Skip to content

ci: land proof-system changes one at a time behind a single-run stability window #3269

Closed

Description

@schlessera

Part of #2934 (Phase A). Implements questions 1 and 2 of the #2938 ruling.

Blocked by #3268

Context

About a quarter of main squashes since 2026-10-14 changed the proof system (see #2938). The maintainer ruled that proof-system and global-tooling changes land one at a time under the existing reservation, and that product changes do not wait on them. After such a change merges, the next may merge once that change's own main run is green (amended 2026-11-02; it previously also required the next 2 main runs). After a failed main run, the lane reopens at the next green main run. Related proof-system changes may land as one squash, which counts once. The ordinary merge path is bun scripts/integrate.ts merge (docs/decisions/ci-utility.md, "Exact-candidate integration reservation"). It checks candidate proof (verifyIntegrationProof, scripts/integration-proof.ts:69) but knows nothing about proof-system changes.

Scope

Out of scope

Acceptance criteria

  • With fixture main history where the last proof-system squash's own run has not settled (queued or in progress), or a later main run failed with no green run after it, a proof-system candidate is refused with "1 more green main run required". A product candidate is accepted. Each is proven by a test that fails before the change. (Corrected 2026-11-17 to the single-run window; the earlier wording encoded the superseded three-run window.)
  • With the squash's own run green, the proof-system candidate is accepted, without waiting for later runs.
  • After a later failed main run, a single later green run reopens the lane.
  • A missing, in-progress, cancelled or failed run in the window counts as not green.
  • lane --json reports the same decision as the refusal, from the same function.
  • Restored mutation receipt: counting a cancelled run as green makes the named test fail.

Verification

bun run test tests/integration-command.test.ts plus the new lane tests and mutation receipt.

Contract impact

None: repository script output.

Activity

  1. added
    type: chore
    area: ci
    priority: p1
    agent-ready
    blocked
    on Nov 2, 2026
  2. removed
    blocked
    on Nov 2, 2026
  3. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    2026-11-02: blocker #3268 is delivered (PR #3276, squash b228b1f21c4758ee712e922d12ebbe77cf4b3512 on main), so blocked is removed. The Blocked by #3268 line stays as history.

    Use import { classify } from "./proof-system": classify(base, head, { cwd?, pathSet? }) returns { schemaVersion, base, head, proofSystem, reasons } and throws when the diff cannot be computed, so an error never reads as false. matchProofSystemPath(path) gives a path-only check. The CLI is bun scripts/proof-system.ts classify --base <sha> --head <sha> [--json]. The timeout check flags changed timeouts in rewritten existing test lines and file-wide setDefaultTimeout changes, not new tests that set their own timeout (see the PR for the reasoning).

  4. self-assigned this
    on Nov 2, 2026
  5. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claimed while working epic #2934 end to end (claim token wi-20261102-fd2d2f21). Intended branch: feat/3269-3271-lane-enforcement, built on #2940's branch because both change scripts/integrate.ts.

  6. added this to the 0.45.0 milestone on Nov 2, 2026
  7. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Implementation pushed, PR held for its stack base. #3269 and #3271 are implemented together on feat/3269-3271-lane-enforcement at 5224e5ff75e4c66570b563509de706d21c03884b (updated for the window clarification), stacked on feat/2940-recorded-merge-path (07fd0ecc7, no PR yet). That branch is in turn on #3279 (feat/2942-red-main-controller). The change uses #2940's --fixes-main-run mode for the red-main fix exemption, so its PR opens only after #2940 has merged to main.

    What it does

    • New scripts/proof-system-lane.ts holds the decision functions; it lists no globs and reuses classify from scripts/proof-system.ts.
    • integrate.ts confirm (before acquiring) and merge (after the lease check) classify the candidate from merge base to head and hold only proof-system candidates.
    • Window (ci: land proof-system changes one at a time behind a single-run stability window #3269, as clarified):
      • The last proof-system squash's own main-push ci.yml run must be completed and green. After it, two consecutive later main runs must be completed and green.
      • A failed or cancelled run restarts the count. A squash with no run restarts it once a later squash exists.
      • A queued or in-progress run, or no run yet at the newest squash, is not green yet, and nothing after it counts.
      • Each decision reads at most 10 main runs in merge order and stops once decided. Past that bound it is unknown and refused.
      • The refusal says N more green main run(s) required. integrate.ts lane --json prints the same LaneDecision (state, ownGreen, streak, required, window) and laneRefusal.
    • Qualification (ci: refuse proof-system optimizations without off-main qualification evidence on the PR #3271): the PR body needs an Off-main qualification section linking a run in this repository. The run's head SHA must be the candidate head, or an ancestor whose diff to the head is not a proof-system change. At most 5 runs are read. The PR template gains the section.
    • Exempt: --fixes-main-run fixes, and fixes declared on the open record that go through ordinary confirmation because their failures are category-level. Otherwise a proof-system fix for a red window could never land.
    • Outside the path set: bun scripts/proof-system.ts classify --base origin/feat/2940-recorded-merge-path --head 5224e5ff7 → not a proof-system change.

    Receipts

    • bun run test tests/integration-command.test.ts tests/proof-system-lane.test.ts tests/red-main-expedite.test.ts tests/red-main.test.ts tests/proof-system.test.ts: 62 pass, 0 fail at c445ed57f. At 5224e5ff7, tests/integration-command.test.ts tests/proof-system-lane.test.ts: 27 pass, 0 fail.
    • Failing first: with scripts/integrate.ts restored to 07fd0ecc7, three tests fail on their named assertions:
      • window: NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-short (merged)
      • lane --json: usage error, exit 1
      • qualification: NO_UNQUALIFIED_PROOF_SYSTEM_MERGE:lane-open-unqualified (merged)
    • Mutation, ci: land proof-system changes one at a time behind a single-run stability window #3269 (count cancelled as green in isGreen): NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-cancelled, OWN_RUN_NOT_GREEN:{…"cancelled"} and CANCELLED_IS_NOT_GREEN fail. Restored, green.
    • Mutation, clarification (no reset after a failure): GREEN_BEFORE_THE_FAILURE_DOES_NOT_COUNT, CANCELLED_IS_NOT_GREEN and the lane-cancelled scenario fail. Restored, green.
    • Mutation, own run (own run not required): NO_PROOF_SYSTEM_MERGE_INSIDE_THE_WINDOW:lane-own-red, OWN_RUN_NOT_GREEN and NO_LATER_READS_AFTER_A_RED_OWN_RUN fail. Restored, green.
    • Mutation, read bound (unbounded history): readLane never reads more than the bound fails against a 12-squash alternating history. Restored, green.
    • Mutation, ci: refuse proof-system optimizations without off-main qualification evidence on the PR #3271 (accept any run SHA in qualifies): NO_UNQUALIFIED_PROOF_SYSTEM_MERGE:lane-open-stale-run and both unit SHA tests fail. Restored, green.
    • Mutation, product never held: treating every candidate as proof-system makes the existing product merge/confirm tests fail.
    • Mutation, exemption: dropping it makes DECLARED_FIX_EXEMPT:expedite-lane-short fail.
    • bun run typecheck is clean. bun run check:pr --base origin/feat/2940-recorded-merge-path passed, all checks passed, receipt head 5224e5ff7.

    Resume steps

    1. Wait until ci: restore one recorded merge path and refuse merges with uncovered local skips #2940's PR has merged to main (and feat(ci): record a red main centrally, stop doomed proof and file one incident issue #3279 before it). If either base branch moves first, run git rebase --onto <new head> 07fd0ecc7 feat/3269-3271-lane-enforcement.
    2. git fetch origin && git rebase --onto origin/main 07fd0ecc7 feat/3269-3271-lane-enforcement. Resolve scripts/integrate.ts against the squashed ci: restore one recorded merge path and refuse merges with uncovered local skips #2940, keeping the lane gate after refuseWhileRed and the lane command. Then bun run test tests/integration-command.test.ts tests/proof-system-lane.test.ts and bun scripts/proof-system.ts classify --base origin/main --head HEAD (it must say not a proof-system change).
    3. bun run check:pr --base origin/main, then git push --force-with-lease. Open a draft PR with Closes #3269 and Closes #3271, milestone 0.45.0, the receipt block in the body and the receipts above.
    4. Report collisions, then bun scripts/integrate.ts confirm <pr> --issues schlessera/brain-kit#3269,schlessera/brain-kit#3271. If the process dies, run release on its lease.
  8. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-02, given in the working session and recorded here by the agent): this clarifies how the stability window reopens after a failure. The proof-system change's own main run must be green. If any later main run in the window fails, the lane reopens once the next two consecutive main runs after the failure are completed and green. A missing, in-progress or cancelled run counts as not green. Waiting for a rerun of the failed squash, or for a maintainer revoke, is not required, so the lane cannot deadlock on a red main that was later fixed.

  9. changed the title [-]ci: land proof-system changes one at a time behind a two-green-main stability window[/-] [+]ci: land proof-system changes one at a time behind a single-run stability window[/+] on Nov 2, 2026
  10. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    2026-11-02: the window is now a single green main run, following the maintainer amendment on #2938 (#2938 (comment)). Updated the title, background and acceptance criteria to match. The open branch is reworked to this before it is proposed.

  11. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Source/specification finding from the full 133-issue triage pass: the Context correctly consumes the November 2 single-run amendment, but the first acceptance criterion still refuses a proof-system candidate when the preceding change’s own run and one later run are green, demanding “1 more green main run required”. That criterion encodes the superseded three-run window and contradicts both Context and the current decision record (docs/decisions/ci-utility.md, “Stability window”, inspected main 35217d283b849b5ef81700d5d4c2ec7486405d12).

    Before implementation/proof, reconcile that existing criterion with the recorded single-run policy: admit after the preceding proof-system change’s own green main run, and after a failure reopen on the next green main run. Keep product candidates independent of this lane and retain the exact-candidate reservation. This records a brief inconsistency on the existing owning issue; no additional policy choice, code change, new issue or readiness change is made here.

  12. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Ownership reconciliation (0.45.0 orchestration, 2026-11-17): the claim on this issue and #3271 has had no activity since 2026-11-05. Its implementation waits on feat/3269-3271-lane-enforcement at 5224e5f for #2940, which closed on 2026-11-03, and no PR was opened. Releasing the stale claim so a new worker can resume from that branch, merging main forward and keeping the existing commits.

  13. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-7d37050e. Branch: feat/3269-3271-lane-enforcement.

    Resuming feat/3269-3271-lane-enforcement (5224e5f) with main merged forward; reworking the window to the single-run amendment. Collisions: closure-only with draft PRs 3054, 3056, 3059, 3069, 3581, 3622, 4002, 4036 (3056, 3059, 3622, 4002 also touch tests/integration-command.test.ts).

  14. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    2026-11-17: the first acceptance criterion is corrected to the single-run window recorded in docs/decisions/ci-utility.md ("Stability window") and the 2026-11-02 amendment, as the 2026-11-05 triage comment asked. The old wording ("own run green and only 1 later green run" refused) encoded the three-run window. The other criteria already match.

    One reading made explicit in the implementation: a failed own run also reopens at the next green main run. The decision says "if a main run fails, the lane reopens at the next green main run", and requiring a green own run would deadlock the lane whenever the proof-system squash itself broke main and a product fix repaired it, because a rerun at that squash stays red. The own run must still complete first.

  15. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Merged in #4145 as 564a1d57f through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

  16. schlessera commented on Nov 17, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-17): confirmed the reading delivered in #4145. The proof-system lane reopens at the next green main run after a proof-system change, even when that change's own main run failed. A rerun at a broken commit stays red, so requiring the change's own run to pass would block every later proof-system PR after a product PR fixed main.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: cipriority: p1type: chore

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions