Repository navigation
feat(ci): hold proof-system candidates behind a single-run stability window and off-main qualification (#3269, #3271) - #4145
Merged
Conversation
…te incidents Adds the repository-level red-main record to the shared coordination ref (red-main.json beside reservation.json, exact --force-with-lease CAS), a deterministic flake estimator, a coordinator workflow on main CI completion (one incident issue per record, triage and bisect probes, cancellation of doomed PR proof, detection of squashes that land while red, clearing on a green run that included the red set), a hosted gate as the first PR step, integrate.ts main-status/declare-fix and merge refusal while red, and main runs that select the open red set and run proof even when metadata fails. Refs #2942 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #2942 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #2942 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d run Refs #2942 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…add an expedited red-main fix merge check:pr writes a machine-readable receipt of every selected check (passed/failed/skipped/timed-out/preempted), with an optional per-check budget and explicit --skip; the PR template carries it. integrate.ts refuses a missing receipt and any skipped, timed-out or preempted check whose hosted category the exact-head proof did not run. confirm/merge --fixes-main-run merges a declared fix (forward fix or targeted revert) on red-base/green-head fix probes plus exact-head fast invariants, under the reservation, records it on the red-main record and as an expedited-fix event; ci-timings reports each PR's merge path. Refs #2940 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and off-main qualification integrate.ts confirm and merge classify the candidate (merge base to head) with classify() from scripts/proof-system.ts. A proof-system candidate is refused unless the last proof-system squash on main has a completed, green main-push run at its own squash and at each of the next two (#2938 ruling, answers 1-2), and unless its PR body has an "Off-main qualification" section linking a run of this repository on the exact head or on an ancestor with no proof-system change after it (answer 3). The refusal names the blocking squash, the runs found and the green runs still required, or the missing evidence. `integrate.ts lane --json` reports the same decision from the same function, reading at most three runs. Product candidates are never held; declared red-main fixes (expedited or ordinary) are exempt. Closes #3269 Closes #3271 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in runs Apply the maintainer's clarification of the stability window (#3269, issuecomment-6575963951): the proof-system squash's own main run must be green, then two consecutive later main runs must be completed and green. A failed or cancelled run restarts the count instead of keeping the lane closed until a rerun or revoke. Queued, in-progress or not-yet-created runs are not green yet. The decision reads at most ten main runs in merge order, stops once decided, and reports `unknown` (refused) past that bound. `lane --json` reports state, ownGreen, streak and required. Refs #3269 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndow to a single run The stack base (feat/2940-recorded-merge-path and #3279) reached main in another form (#3309 and its successors), so every file outside the lane change resolves to main's version, and the lane change (07fd0ec..5224e5f) is reapplied on top of main's integrate.ts (#4110 review gate, #3573 contract wait, #3303 holder tokens). The stability window follows the 2026-11-02 amendment on #2938 (issuecomment-6580707195): the proof-system squash's own run must settle, and the lane is open when the newest settled run from that squash on is green. The own green run opens it without waiting for later runs; after any failure, a failed own run included, the next green main run reopens it. The lane is read again inside the merge, after the candidate's proof. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 17, 2026
schlessera
marked this pull request as ready for review
November 17, 2026 07:48
This was referenced Nov 17, 2026
Closed
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3269
Closes #3271
What changed
bun scripts/integrate.ts confirmandmergenow classify the candidate from its merge base to its exact head withclassifyfromscripts/proof-system.ts, and hold only a proof-system candidate. Such a candidate is refused unless the proof-system lane is open, and unless its PR body has an## Off-main qualificationsection that links a run of this repository. That run must be on the head, or on an ancestor with no proof-system change after it.confirmchecks before it takes the reservation or requests candidate CI. The merge checks again after the candidate's proof, because a main run may fail during that time. A new read-onlybun scripts/integrate.ts lane --jsonprints the sameLaneDecisionand refusal. Product candidates and declared red-main fixes are never held. The PR template gains the qualification section, and the decision record and the CI reference describe the gates.Stability window, single run (the 2026-11-02 amendment and
docs/decisions/ci-utility.md, "Stability window"):unknownand refused.Why this shape
This resumes
feat/3269-3271-lane-enforcement(5224e5f), which was stacked on a pre-merge form of #2940. That stack base reached main in another form (#3309 and later), so the merge oforigin/mainresolves every file outside the lane change to main's version. The lane change (07fd0ec..5224e5f) is reapplied on top of main'sintegrate.ts, which now has the #4110 review gate, the #3573 contract wait and the #3303 holder tokens.The old branch implemented the superseded three-run window: the own run green, then two consecutive green runs. It is reworked to the single-run window. #3269's first acceptance criterion still encoded the old window, so it was corrected on the issue (see the 2026-11-17 comment).
One reading is made explicit: a failed own run also reopens at the next green main run. The decision text is "if a main run fails, the lane reopens at the next green main run". Requiring the own run itself to be green would deadlock the lane whenever the proof-system squash broke main and a product fix repaired it, because a rerun at that squash stays red. The own run must still settle first.
The declared-fix exemption covers
--fixes-main-runfixes, which go through the expedited branch and never reach the lane check. It also covers fixes declared on the open record that are confirmed ordinarily because their failures are category-level. Without it, a proof-system fix for a red window could never land.This branch is not a proof-system change:
bun scripts/proof-system.ts classify --base origin/main --head b5138b208→not a proof-system change. So it needs no off-main qualification, and the lane does not hold it.Proof
bun run check:pr --base origin/main # passed at b5138b208 (after merging main eb9191c4b), receipt below; bun run typecheck clean at 35aa3013fbun run test tests/proof-system-lane.test.ts tests/integration-command.test.ts: 39 pass, 0 fail at 35aa301 and again at b5138b2. The merge of main ateb9191c4bwas clean, and its only change to these files is one line ofintegrate.ts.Failing first: with
scripts/integrate.tsrestored toorigin/main,tests/integration-command.test.tshas 3 failures, each on its named assertion:NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-own-busy(merged)lane --jsonexits 1 with the usage error (expected 0)NO_UNQUALIFIED_PROOF_SYSTEM_MERGE:lane-open-unqualified(merged)Mutations. Each was applied alone, both test files were run, and the source was restored:
isGreencountscancelledas greenNO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-cancelled,OWN_RUN_NOT_GREEN:{…cancelled},CANCELLED_IS_NOT_GREENqualifiesaccepts any run SHANO_UNQUALIFIED_PROOF_SYSTEM_MERGE:lane-open-stale-runand both unit SHA testsNO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-own-busy,OWN_RUN_NOT_SETTLED,NO_LATER_READS_BEFORE_THE_OWN_RUN_SETTLESNO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-recovering,LATER_FAILURE_CLOSES,CANCELLED_IS_NOT_GREENDECLARED_FIX_EXEMPT:red-main-fix-lane-own-red-unqualifiedTRANSIENT_RENEWAL_RETRIED,REAL_CONFIRMATION_HELPER_REACHED_OWNED_HOLD,COMPLETE_SELECTED_BROWSER_INVENTORY, …)confirmNO_CANDIDATE_CI_FOR_A_HELD_CANDIDATE:confirm-lane-own-busyreadLane never reads more than the boundThe
expedite-lane-own-redcase stays green under the exemption mutation, because the expedited path never calls the lane check.Collisions
bun scripts/collisions.ts --json --pr 4145at headb5138b20875df983bf7975402537f16759bb5b5d:closureonly, nopathcollisions. The overlapping PRs are #3054, #3056, #3059, #3069, #3581, #3622, #4002, #4036 and #4146; they share test categories and workspaces, not files.{"version":1,"kind":"brain-check-pr-receipt","head":"b5138b20875df983bf7975402537f16759bb5b5d","base":"origin/main","mode":"focused","startedAt":"2026-11-17T07:28:59.474Z","finishedAt":"2026-11-17T07:32:17.311Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":38370.681782},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":275.1795520000014},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":154.613734999999},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":73.09077100000286},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":158927.76610399998}]}Checklist
🤖 Generated with Claude Code