-
Notifications
You must be signed in to change notification settings - Fork 0
fix(actions): retire stale Noema token-lifetime quality runs #1726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
seonghobae
merged 7 commits into
main
from
fix/noema-token-lifetime-stale-run-contract-20260902
Sep 2, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
181889f
test(actions): reproduce stale Noema token-lifetime quality runs
seonghobae abb7b99
fix(actions): retire superseded Noema token-lifetime quality runs
seonghobae 3751cd3
docs(actions): record Noema token-lifetime stale-run RCA
seonghobae a360529
docs(actions): bind stale-run proof to repair PR evidence
seonghobae 3dfe006
docs(actions): explain PR-stable Noema quality concurrency
seonghobae c129a5f
fix(actions): execute stale-run contract in Noema quality gate
seonghobae b4632b0
merge(main): reconcile Noema token-lifetime stale-run repair
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
docs/doctoring/noema-token-lifetime-stale-run-retirement.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Noema token-lifetime quality stale-run retirement | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed on the repair branch pending exact-current-head protected review and Checks. This document is evidence/doctoring, not merge authority. | ||
|
|
||
| ## Incident and root cause | ||
|
|
||
| On 2026-09-02, pushing `ContextualWisdomLab/.github#1717` from predecessor head `5b8badc3b9088a5845abc447ed75bf2d9a99031d` to current-main reconciliation head `aeae0c681b66c2e6e9b98d13e47d684eb350b0a8` correctly retired the predecessor runs for Security Scan, OSV-Scanner PR, Semgrep, CodeQL, Strix Changed Path Quality CI, contextual-orchestrator review-repair quality, Python Security, organization commercial readiness, Secret Scan, Scorecard, SBOM, OpenCode Rust coverage, and exact-artifact SBOM quality. The predecessor `Noema Reviewer Token Lifetime CI` run `33621482031`, however, remained queued while the new-head run `33622618082` was also queued. | ||
|
|
||
| The owner workflow `.github/workflows/noema-token-lifetime-quality-ci.yml` had no `concurrency` contract at all. A PR synchronize therefore created a new expensive validation without retiring the obsolete queued/in-progress run for the same repository + PR lineage. This directly violated the control-plane stale-Actions contract and consumed scarce shared Actions capacity. | ||
|
|
||
| ## RED → repair contract | ||
|
|
||
| A regression was committed first at `181889f260d3c0f5a048a52f58e470bfb9090b64`. It requires this pull-request workflow to use a repository + PR stable concurrency group, deliberately excludes both `github.event.pull_request.head.sha` and `github.sha`, and requires `cancel-in-progress: true`. The unmodified protected-main workflow fails immediately because it contains no `concurrency:` block. | ||
|
|
||
| The production repair adds only the missing PR-stable concurrency boundary: | ||
|
|
||
| - repository identity: `github.event.pull_request.base.repo.full_name`; | ||
| - PR identity: `github.event.pull_request.number`; | ||
| - no head SHA in the group; | ||
| - `cancel-in-progress: true`. | ||
|
|
||
| This quality gate executes deterministic token-lifetime tests rather than a long semantic reviewer, so preserving superseded in-progress work has no safety benefit. Native GitHub concurrency cancellation is the least-privilege mechanism: it needs no `actions: write`, privileged cancellation token, untrusted-head execution, or custom stale-run API code. | ||
|
|
||
| ## Invariants preserved | ||
|
|
||
| The workflow remains `pull_request`-scoped with the same path filter, `contents: read`, `ubuntu-24.04`, exact source checkout, hash-locked CI dependency installation, token-lifetime/two-phase/App-identity pytest targets, compile verification, and `git diff --check`. This change does not alter Noema verdict semantics, contextual-orchestrator routing, provider/model selection, protected branch requirements, or review authority. | ||
|
|
||
| ## Live repair-PR evidence | ||
|
|
||
| `ContextualWisdomLab/.github#1726` was opened from repair head `3751cd3b82e48f0131689ab18fbea16ff741f37d`. GitHub admitted `Noema Reviewer Token Lifetime CI` run `33622880158` for that head. This doctoring update intentionally advances the same PR once more so the repaired native concurrency contract can be observed retiring that predecessor run rather than merely asserted from YAML. | ||
|
|
||
| ## Verification required before merge | ||
|
|
||
| 1. Re-read the exact PR head and workflow text. | ||
| 2. Prove the regression is GREEN on that exact head. | ||
| 3. Confirm this synchronize retires predecessor `Noema Reviewer Token Lifetime CI` run `33622880158` and leaves only the current-head authoritative lineage. | ||
| 4. Re-fetch reviews, unresolved threads, and required/security Checks; merge only through ordinary protection unless the strict independently verified `QUEUE_SATURATION_CHICKEN_EGG` boundary is freshly satisfied. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| """Regression contract for Noema token-lifetime PR run retirement.""" | ||
|
|
||
| from pathlib import Path | ||
|
|
||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[1] | ||
| WORKFLOW_PATH = REPO_ROOT / ".github" / "workflows" / "noema-token-lifetime-quality-ci.yml" | ||
|
|
||
|
|
||
| def test_noema_token_lifetime_quality_ci_retires_superseded_pr_runs() -> None: | ||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
| """Keep one authoritative PR/head lineage for the token-lifetime quality gate.""" | ||
| workflow = WORKFLOW_PATH.read_text(encoding="utf-8") | ||
|
|
||
| assert "concurrency:" in workflow | ||
| concurrency_contract = workflow.split("concurrency:", 1)[1].split( | ||
| "permissions:", 1 | ||
| )[0] | ||
| assert "github.event.pull_request.base.repo.full_name" in concurrency_contract | ||
| assert "github.event.pull_request.number" in concurrency_contract | ||
| assert "github.event.pull_request.head.sha" not in concurrency_contract | ||
| assert "github.sha" not in concurrency_contract | ||
| assert "cancel-in-progress: true" in concurrency_contract | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.