Repository navigation
Description
Why
#1286 committed a tree from an old worktree on top of a fresh main and silently reverted 78 files: most of epic #1253, plus #1279's duplicates Parquet export. Restored by #1300 (#1299).
No gate could see it:
- the squash was
CLEAN; - the old code is self-consistent, so every test passed;
pull request contractreads the body, not the tree.
Proposal
Add a check, in pr-contract.yml or its own workflow. For each file the PR changes, compare its blob in the PR head with the blobs that path has held on main. If the PR's version equals a version main held before a later commit changed it, flag the file, naming the commits whose change it undoes.
That is exactly the test that found this one. 75 of 75 blobs matched dc45fd16. A short script over git log --format=%h -- <path> and git rev-parse <c>:<path> did it, in seconds.
- Start as a warning. Post a PR comment listing the files and the PRs they undo.
- Promote it to failing only after it has been seen catching the case and passing everything else. Deliberate reverts are exempt, as
pull request contractexempts them: aRevert "…"title or arevertlabel.
Done when
- Replaying
d245d4adon top of8b5b25adflags all 75 files and names the PRs they undo. - A normal feature PR is not flagged.
Product context (2026-11-26)
Why this matters for the API product: Merge-gate trust. #1286 was itself an API PR (#518, the record allowance), and the same stale-tree mistake could just as easily revert API contract or entity changes with every gate green.
Current state:
- Nothing is in flight. No PR or remote branch references CI: flag a pull request whose files revert to an older main version (the #1286 stale-tree class) #1307, the issue has no assignee, and the only cross-references are fix: restore the 78 files #1286's stale tree reverted — the cinematic epic and #1279's duplicates Parquet export (#1299) #1300 (the restore, merged) and feat(marketing): home 06 — an interactive audit film: decide the gray zone, unmerge, the rule holds (#1297) #1298 (marketing, unrelated).
- The replay commits named in the body exist: d245d4a (the E3 — API usage, entitlements and commercial metering #518/feat(api): connected-record usage and an enforced record allowance (#518) #1286 head), 8b5b25a (test(marketing): the /pricing figure test waits for the whole end state (#1284) #1285) and dc45fd1 (E8 — Review UI and tags #516). The done-when replay is reproducible.
- The revert exemption to reuse is already in
scripts/ci/pr-contract.sh:57-62, which matches titles starting withRevert/revert. Any new shell must go inscripts/ci/, per the workflow-shell budget. pr-contract.ymlchecks outgithub.event.pull_request.head.sha(:59). A blob-history check also needs full history oforigin/main(fetch-depth: 0, or a targeted deepen).
Definition of done:
- Both criteria in the body.
- A self-test in
scripts/ci/that is seen to fail on the replay fixture before the check is trusted. - A run on a deliberate
Revert "…"PR that is exempt. - Promotion to a required context only after an observed catch, following the order
ci-and-supply-chainrecords forpull request contract.
Dependencies / sequencing: None.
Size: ~0.5 engineer-weeks for the warning tier. Promotion comes later.
Activity
athvin commentedon Nov 27, 2026
Claimed — working in #1315 (draft). Closing that PR releases the claim. The owner asked to keep every static-site change, and this class of revert has hit twice on 2026-11-27: #1286 merged one, and #1310 was caught before it merged.
wip: claim #1307 — flag a pull request whose files revert to an older…
feat(ci): flag a pull request whose files return to an older main ver…