Skip to content

bug(provenance): PR bodies carry fabricated exact-head SHAs in gate-verdict trailers #7448

Description

@ll7

Problem

PR bodies written by the autonomous implementation loop routinely carry gate-verdict: accepted @ <sha>
and Exact head: <sha> values that are not objects in this repository. The SHAs are not stale —
they never existed. They share a 8–9 hex-character prefix with the real head and then diverge, which
is the signature of a fabricated suffix rather than a superseded push.

Measured on 2026-08-18 over the 40 most recent open PRs:

Two more (#7102 af658fb5ca1338d…, #7104 7cf5a91d374499d…) were found and corrected in place
during PR resolution on 2026-08-18; #7102 additionally had the same fabricated SHA repeated across
four separate ll7 audit comments claiming exact-head validation against it.

Why it matters

scripts/dev/merge_queue_gate.py treats an exact-head gate-verdict: accepted @ <head> as the
trusted human/reviewer attestation. The gate itself is safe — it fails closed when the trailer SHA
does not equal the live head, so a fabricated SHA cannot admit a PR. The damage is upstream of the
gate:

  1. Reviewers and the maintainer read "validated at exact head X" for an X that does not exist,
    so the recorded validation evidence is unverifiable and, as written, false.
  2. It burns gate cycles: every such PR is pending_gate_verdict and needs a fresh review comment.
  3. It contradicts the repository's hard rules in docs/maintainer_values.md (be honest,
    transparent, reproducible) at exactly the surface those rules exist to protect.

Suggested fix (fix-or-track)

Add a cheap fail-closed check so a bad SHA cannot be written or can be detected immediately:

  • In scripts/dev/gh_pr_body_rest.py, reject any gate-verdict: / base-policy: / Exact head:
    40-hex value in the incoming body that does not resolve via git cat-file -t and does not
    equal the PR's live headRefOid. This is the narrow, high-leverage spot — every body writer goes
    through it.
  • Optionally extend .github/workflows/pr-body-contracts.yml to run the same assertion, so already
    written bodies are caught.
  • Backfill: the six PRs listed above still carry the bad trailer.

Claim boundary

Diagnostic-only tooling/provenance defect. No benchmark, planner, scientific, or paper-facing claim
is involved. Evidence tier: reproducible measurement over live GitHub state at 2026-08-18, script
inlined above (gh pr list --json number,headRefOid,body + git cat-file -t).

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:0P0: correctness, safety, or CI-critical worktype:bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions