← Back to Pull requests

feat: store verified source attestation bundles in packages #2977

Open
wolfv opened this pull request with 378 lines diff across 14 files
View on GitHub
wolfv wolfv commented on Nov 29, 2026 09:34 UTC
Author

Builds that verify source attestations (#2947) record which publishers were checked, but not the attestations themselves. Once the upstream attestation disappears, nobody can check that evidence again.

What changes

  • Bundles in the package. For every publisher, the bundle that satisfied it is written as a standard Sigstore bundle to info/attestations/<sha256>.sigstore.json. PyPI provenance gets converted to a bundle. Only bundles that passed verification are stored, not the raw API responses, so the package contents don't depend on what the GitHub attestations API returns on a given day.

  • Linked from the rendered recipe. Each publisher in finalized_sources gets bundle_sha256, so a verifier knows which bundle covers which source and publisher.

  • Source cache. The cache keeps the bundles in src_cache/attestations/ and reuses a cached verification only while its bundle files still exist. Cache entries from 0.81.0 are verified once more.

  • rebuild. Sources are verified against the package's info/attestations instead of downloading the attestations again. Verification is the same as in a normal build: signature, subject digest and publisher checks. Packages without the folder download the attestations as before.

  • Docs: sigstore.md, rebuild.md and package_spec.md.
  • Determinism

    The bundle digests end up in the package, so the bytes have to be stable. In sigstore-types 0.16.0, Bundle::to_json() writes fixed fields in a fixed order, with no maps and no floats. The in-toto statement stays as base64 payload bytes and is never re-encoded. A new test fixes the stored bundle digests for the recorded flask and uv attestations, and checks that a stored bundle reads and writes back to the same bytes.

    Testing

  • Unit tests: rattler_build_source_cache, including the ignored network tests (59 passed), and rattler_build_recipe. clippy is clean.

  • End to end with a recipe that has two sources: flask from PyPI, and uv's source.tar.gz with both the release attestation and the provenance attestation.

  • - The package contains 3 bundles. sigstore-python 4.6.0 verifies the stored flask and uv provenance bundles against the tarballs.
    - A cached rerun makes no attestation downloads and still packages all 3 bundles. After the cached bundles are deleted, the build verifies again.
    - rebuild uses the bundled attestations and is bit-for-bit identical.
    - A tampered DSSE signature fails the rebuild, and so does a removed bundle.
    - A 0.81.0 package rebuilds by downloading, as before.

    Limitations

  • rebuild still fetches the Sigstore trust root through TUF, so it isn't fully offline yet.

  • No bundle is stored when a source lists no publishers.

  • Bundles are written only when the recipe itself is stored in the package.
  • Diff: 378 lines (+337 / -41) across 14 files Reviewer: None requested Review duration: 4468m
    All Vouch review confidence checks passed
    Residual risk 0.39 = Change Risk (0.70) × (1 − Review Confidence (0.44)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.70 · 378 lines diff across 14 files
    0.70
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.355
    Shallow Review Depth shallow_review_depth
    0.344
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #2977"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    wolfv wolfv
    Labels
    risk: medium confidence: 44.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 69.6% (HIGH) · Higher = larger blast radius
    69.6%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.2% · Lower = rushed or shallow review
    44.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 38.8% · Moderate risk
    38.8%