Repository navigation
Description
Problem
The 2026-10-25 red-main ruling (answer 8, docs/decisions/ci-utility.md "Proof-system lane") pauses hosted proof whose merge ref contains the bad commit. The controller from #2942 is broader than that. cancelDoomed (scripts/red-main-coordinator.ts:141-155) cancels every queued or in-progress ci.yml pull_request run created after the bad commit's commit time, unless its PR is a declared fix. It never checks whether the run's merge ref contains firstBad.
As a result, a PR whose base does not contain the bad commit loses valid proof. Examples are a PR against a non-default branch that forked before firstBad, or a release branch.
Evidence
Incident #3315 opened for firstBad c14846a66. Two ready-candidate runs whose PRs target integration branches at a62db8f27, which does not contain c14846a66, were cancelled mid-run:
- run 41490484208 (CONTRACT: feat(ui-sdk): relay the Gemini Files video lifecycle for brain video watch in keyless workers #3312, base
epic/1646-cost-limitsata62db8f27) - run 41490023078 (refactor(common): hold the Claude subscription billing guard once (#2493) #3310, base
epic/2539-security-helpersata62db8f27)
Neither merge ref contained the bad commit, and both PRs then had to request confirmation again.
Acceptance criteria
-
cancelDoomedcancels a run only when its tested merge ref containsopen.firstBad. Equivalently, the PR's base SHA at run creation descends fromfirstBad. Runs whose base does not containfirstBadare left alone, and so are declared fixes. - The same ancestry rule governs the refusal side: confirmation and heavy-feedback admission while main is red.
- A unit test covers a run on a base without
firstBad(not cancelled), a run on a base that contains it (cancelled), and a declared fix (not cancelled). A mutation that drops the ancestry check makes the first case fail. -
docs/decisions/ci-utility.mdand the ci: record a red main centrally, stop doomed proof and file one incident issue #2942 controller docs describe the rule as implemented, with citations updated.
Notes
Found while working the 0.45.0 epics via per-epic integration branches. Refs #2942, #3315, epic #2934.
Activity
schlessera commentedon Nov 2, 2026
Claiming this (
claim-3321-e188beca). Branch:fix/3321-red-main-ancestryoffmain(c23a5811c).Collision report: path overlap with open drafts #3309 (
integrate.ts,red-main-coordinator.ts,red-main.ts,tests/red-main.test.ts,ci-utility.md) and #3311 (red-main-coordinator.ts,red-main.ts,ci-utility.md), both under epic #2934; everything else is closure-only. Scope stays to the ancestry rule incancelDoomedandrefuseWhileRed, reusinggateDecision, so I'll keep the edits small to ease the rebase on whichever lands second.schlessera commentedon Nov 2, 2026
Implementation is in draft PR #3325 (head
d03ad04a3). Local preflight, typecheck, and the failing-first and mutation receipts are in the PR. The PR and this issue are both on milestone 0.45.0.Waiting on main: it is red at
c14846a66(#3315), so ordinary confirmation is refused. Once main is green, the next step isbun scripts/integrate.ts confirm 3325 --issues schlessera/brain-kit#3321, run from current origin/main tooling. The assignment stays with this claim (claim-3321-e188beca) until then.fix(ci): cancel and refuse red-main proof only when its merge ref con…
fix(ci): cancel and refuse red-main proof only when its merge ref con…