Skip to content

feat(ci): hold proof-system candidates behind a single-run stability window and off-main qualification (#3269, #3271) - #4145

Merged
schlessera merged 9 commits into
mainfrom
feat/3269-3271-lane-enforcement
Nov 17, 2026
Merged

schlessera merged 9 commits into
mainfrom
feat/3269-3271-lane-enforcement

Conversation

@schlessera

@schlessera schlessera commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #3269
Closes #3271

What changed

bun scripts/integrate.ts confirm and merge now classify the candidate from its merge base to its exact head with classify from scripts/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 qualification section 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. confirm checks 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-only bun scripts/integrate.ts lane --json prints the same LaneDecision and 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"):

  • The last proof-system squash's own main-push run must settle first, that is, complete. A squash with no run settles once a later squash exists.
  • The lane is then open when the newest settled run from that squash on is green.
  • So the own green run opens the lane without waiting for later runs. After a failure, the next green main run reopens it.
  • Missing, queued, in-progress, cancelled and failed runs are not green.
  • The check reads the own run, then later squashes newest first, and stops at the first settled run: at most ten reads. If no later run within that bound has settled, the lane is unknown and 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 of origin/main resolves every file outside the lane change to main's version. The lane change (07fd0ec..5224e5f) is reapplied on top of main's integrate.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-run fixes, 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 35aa3013f
  • bun 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 at eb9191c4b was clean, and its only change to these files is one line of integrate.ts.

  • Failing first: with scripts/integrate.ts restored to origin/main, tests/integration-command.test.ts has 3 failures, each on its named assertion:

    • NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-own-busy (merged)
    • lane --json exits 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:

    Mutation Named failures
    isGreen counts cancelled as green NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-cancelled, OWN_RUN_NOT_GREEN:{…cancelled}, CANCELLED_IS_NOT_GREEN
    qualifies accepts any run SHA NO_UNQUALIFIED_PROOF_SYSTEM_MERGE:lane-open-stale-run and both unit SHA tests
    own run need not settle NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-own-busy, OWN_RUN_NOT_SETTLED, NO_LATER_READS_BEFORE_THE_OWN_RUN_SETTLES
    a later failure does not close the lane NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-recovering, LATER_FAILURE_CLOSES, CANCELLED_IS_NOT_GREEN
    declared-fix exemption dropped DECLARED_FIX_EXEMPT:red-main-fix-lane-own-red-unqualified
    every candidate treated as proof-system the existing product merge/confirm tests (TRANSIENT_RENEWAL_RETRIED, REAL_CONFIRMATION_HELPER_REACHED_OWNED_HOLD, COMPLETE_SELECTED_BROWSER_INVENTORY, …)
    no lane check before acquiring in confirm NO_CANDIDATE_CI_FOR_A_HELD_CANDIDATE:confirm-lane-own-busy
    unbounded read history readLane never reads more than the bound

    The expedite-lane-own-red case stays green under the exemption mutation, because the expedited path never calls the lane check.

Collisions

bun scripts/collisions.ts --json --pr 4145 at head b5138b20875df983bf7975402537f16759bb5b5d: closure only, no path collisions. 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

  • Focused local preflight and behavioral receipts passed; exact-head hosted proof runs at confirmation.
  • No contract change (repository script output only), no package change and so no changeset.

🤖 Generated with Claude Code

schlessera and others added 8 commits November 2, 2026 10:21
…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>
@schlessera schlessera added this to the 0.45.0 milestone Nov 17, 2026
@schlessera schlessera added type: chore Tooling, CI, release plumbing, dependencies. area: ci CI workflows, the gates they run, release scripts, packaging. labels Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, the gates they run, release scripts, packaging. type: chore Tooling, CI, release plumbing, dependencies.

Projects

None yet

1 participant