fix(ci): cancel superseded Windows supervision - #308
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Hosted supersession/replacement evidence and broader condition coverage remain unresolved.
Pull request overview
This PR updates Windows CI so superseded pull-request runs honor cancellation while preserving existing eligibility, cleanup, timeout, and conformance requirements.
Changes:
- Replaces job-level
always()with!cancelled(). - Adds workflow-condition coverage and updates conformance bindings.
- Documents the CI behavior and outstanding hosted validation.
File summaries
| File | Summary |
|---|---|
src/specification-guards.test.ts |
Adds workflow guard and cleanup assertions. |
src/phase1-conformance-lock.test.ts |
Updates authority expectations. |
phase1-conformance.lock.json |
Updates locked revision and workflow hashes. |
docs/phase1-conformance.md |
Documents the CI policy and validation status. |
.github/workflows/ci.yml |
Uses a cancellation-aware Windows supervision guard. |
Review details
Suppressed comments (4)
.github/workflows/ci.yml:683
- The new guard is the behavior under review, but the added specification test only string-matches the YAML and cannot establish that GitHub cancels an already-running superseded job or that the replacement reaches success. Superseded run 35126136809 has cancelled its Windows job, but replacement run 35126136902 is still in progress, so the required hosted replacement evidence is incomplete; please record a successful replacement run before approving this change.
!cancelled() && needs.rust.result == 'success'
docs/phase1-conformance.md:2894
- This section correctly acknowledges that hosted supersession/replacement validation is still missing, but that is an explicit #306 acceptance requirement: local tests cannot prove that cancellation releases the concurrency slot or that the replacement validates the current head. Please obtain and record that hosted evidence before treating this binding as complete.
must pass all required checks. Issue #306 tracks this change and the remaining
hosted supersession/replacement validation. The motivating old-head run
`35117564510` was cancelled while its Windows job continued to completion; the
replacement run `35118809575` subsequently passed all eleven jobs. That history
does not validate the new cancellation guard.
src/specification-guards.test.ts:1246
- This regression test only matches the workflow text; it cannot exercise GitHub's cancellation scheduler, which is the failure mode changed here. Issue #306 requires hosted evidence that a superseded PR run terminates and a fresh replacement completes successfully, so the cancellation behavior remains unverified until that run is captured.
it('cancels superseded Windows supervision without dropping its eligibility gates', () => {
const workflow = readText('.github/workflows/ci.yml');
const job = workflow.split('\n windows-supervisor-behavior:\n')[1];
expect(job).toBeDefined();
const condition = job?.match(/\n {4}if: >-\n([\s\S]*?)\n {4}timeout-minutes:/)?.[1];
src/specification-guards.test.ts:1250
- This guard only compares the workflow text; it never evaluates the condition for successful versus skipped/failed Rust, a cancelled pull-request run, or a protected
mainpush. A regression in the expression's behavior could therefore still pass this test, while issue #306 explicitly calls for those focused cases. Add table-driven condition coverage (or an equivalent workflow-level test) for those scenarios.
const condition = job?.match(/\n {4}if: >-\n([\s\S]*?)\n {4}timeout-minutes:/)?.[1];
expect(condition?.trim()).toBe(
"!cancelled() && needs.rust.result == 'success'\n" +
" && needs.changes.outputs.docs_only != 'true'\n" +
" && ((github.event_name == 'push' && github.ref == 'refs/heads/main')\n" +
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 16, 2026
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.
Superseded pull-request runs retained a Windows runner because
Windows supervisor behaviorusedalways()at job level. Use!cancelled()while preserving Rust success, docs-only, main-push andci:fulleligibility. Keep the job name, 20-minute ceiling, main concurrency policy, native containment and independent cleanup conditions unchanged.The regression failed on the old
always()guard and passes with the new condition. All 64 specification tests, TypeScript and lint passed; independent review found no blockers. Full serial verification passed 2,127 tests with 98 skips (1,218 normal and 909 heavy), TypeScript, lint and diff checks. The exact signed executable source isffa954c2678bd933d7057d526b5fc4ed67a16f32; its final binding covers all 25 governed files, ten production deltas and eleven explicit expectations. Frozen candidate/counterpart identities remain unchanged.This change is separate from protected run35125287541, which uses Chat #305 / SDK #291. It does not change that run's producer or establish conformance acceptance. Cancelled jobs are not cleanup evidence. Hosted validation must show a superseded run stops and a fresh replacement completes successfully; that remains outstanding.
Use a normal merge after exact-head verification and recheck integration-tree equality. The signed source ancestry must remain reachable; do not squash this authority binding.
Refs #306. Do not close the issue until hosted supersession and replacement behavior are verified.
Review follow-up: 11 table-driven cases evaluate the extracted condition for Rust success/failure/skipped/cancelled, cancelled runs, docs-only and label gates, main and feature pushes. Both cancelled-run cases fail with the original guard. This evaluates the bounded boolean/string condition, not the GitHub scheduler. Signed head
a28cf3cf0d77966667378ec812e872c5e33b5addwas pushed while old Windows job104898926515 was confirmed running. Replacement CI35127584766 is now pending; actual old-job cancellation and complete replacement success remain required.