Skip to content

ci: the red-main controller cancels PR proof whose merge ref does not contain the bad commit #3321

Closed

Description

@schlessera

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:

Neither merge ref contained the bad commit, and both PRs then had to request confirmation again.

Acceptance criteria

  • cancelDoomed cancels a run only when its tested merge ref contains open.firstBad. Equivalently, the PR's base SHA at run creation descends from firstBad. Runs whose base does not contain firstBad are 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.md and 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

  1. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ciCI workflows, the gates they run, release scripts, packaging.
    priority: p1Scheduled into the current or next milestone.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Nov 2, 2026
  2. self-assigned this
    on Nov 2, 2026
  3. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claiming this (claim-3321-e188beca). Branch: fix/3321-red-main-ancestry off main (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 in cancelDoomed and refuseWhileRed, reusing gateDecision, so I'll keep the edits small to ease the rebase on whichever lands second.

  4. added this to the 0.45.0 milestone on Nov 2, 2026
  5. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    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 is bun 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ciCI workflows, the gates they run, release scripts, packaging.priority: p1Scheduled into the current or next milestone.type: fixSomething is broken and must behave the way it is documented.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions