Repository navigation
fix(#820): classify runner-never-started CI (billing lockout) as infra-blocked, not NOT_MET - #828
Merged
admarble merged 4 commits intoJul 27, 2026
Conversation
…_MET A repo that hits its Actions spending limit fails every check in seconds because no runner is ever allocated. `gh pr checks` shows plain failures, so /qa Phase 1's `FAILURE -> NOT_MET` mapping marked CI-dependent ACs unmet for a condition no code change can fix -- and fed those findings to /loop. Phase 1 now queries the head commit's check-run annotations, but only when every check is in the `fail` bucket. On a message matching /job was not started/i it classifies CI as infra-blocked: CI-dependent ACs map to NEEDS_VERIFICATION, the report carries the annotation verbatim, and the finding is marked `<!-- qa:ci-infra-blocked -->` so the loop skill's new Excluded Finding Classes rule drops it before counting actionable issues. Detection lives in src/lib/qa/infra-blocked-ci.ts as pure predicates, mirroring the markdown-only-ci.ts split, unit-tested against the live incident fixture captured in the issue (perishable -- now committed here). Notes on two deliberate choices: - Matching is on the annotation message only. The fixture carries annotation_level "failure", but gating on it adds an unstated condition that would silently miss a warning-level variant. - No `output.annotations_count` pre-filter: the field exists in live API output but not in the captured fixture, so a zero could skip detection. The /loop filter uses an exclusive-range awk rather than `sed '/marker/,/^### /d'`, which was verified against a real QA comment to also delete the following `### Required Fixes` header and orphan a genuinely actionable finding. Also adds `Bash(gh api:*)` to the qa skill's allowed-tools -- the new procedure needs it and it was not previously granted. Closes #820
…filter in the data path Two defects found by the adversarial re-read, both of which would have shipped inert or actively wrong. 1. `NEEDS_VERIFICATION` is a VERDICT value, not an AC status. Section 7 counts only MET / PARTIALLY_MET / PENDING / NOT_MET, so an AC stamped NEEDS_VERIFICATION lands in no bucket, increments no counter, and lets the algorithm fall through to READY_FOR_MERGE on a fully-red board -- strictly worse than the misclassification this change exists to fix. The AC status is now PENDING, which routes through the existing `pending_count > 0 -> NEEDS_VERIFICATION` branch and produces the outcome AC-2 asks for. All four sites updated consistently, with the reasoning recorded inline so it does not get "corrected" back. Note on AC-2's wording: it says CI-dependent ACs "map to NEEDS_VERIFICATION". That names the verdict; PENDING is how this skill's vocabulary produces that verdict. Requirement implemented, prescription adjusted. 2. The loop exclusion assigned `actionable` and nothing ever read it -- and the extraction it was meant to filter (`verdict`, `not_met_acs`, `recommendations`) runs EARLIER in the document, so even a careful reader would have filtered after the fact. The filter now rebinds `qa_comment` itself, so every existing downstream consumer picks it up with no other change, `qa_comment_raw` preserves the original for verbatim cause reporting, and the Step 1 parsing block carries an explicit "run the filter first" precondition. Filter logic itself is unchanged and re-verified: 20/20 correct exclusion across real past /qa comments, 40/40 byte-identical pass-through when the marker is absent.
6 tasks
…on API errors
Adversarial gap analysis over the committed state found five real gaps.
A. The procedure's core step was a comment, not code. Steps 3 and 4 said
"collect annotations" and "classify" in prose; `annotations_json` was
fetched and then never consumed. An agent following it literally would
fetch data and have nothing to do with it -- the same assigned-but-never-
read defect already fixed on the loop side, sitting in the qa skill.
Steps 3-5 are now real shell: fetch per-check annotations, assemble one
array, classify, and destructure the result into the variables the
classification table and report actually reference.
B. `$ci_buckets` was read but never defined. Now assigned from
`gh pr checks --json bucket`.
C. `detectInfraBlockedCi` threw a TypeError on a non-array `annotations`.
Callers feed it raw `gh api` output, and a 404 / rate limit / revoked
token returns `{"message":"Not Found"}` where an array is expected.
Crashing the QA phase is the worst possible response for a detector
whose entire purpose is handling broken CI gracefully. Now guarded with
Array.isArray at both levels; malformed input degrades to
{blocked:false}. 5 new tests; removing the guard fails 2 of them.
D. CHANGELOG still described the pre-fix `NEEDS_VERIFICATION`-as-AC-status
behavior. Updated, including why PENDING is the correct status.
E. Every failure path in the shell now degrades to {"blocked":false} rather
than aborting: an API error must never be reported as infra-blocked, and
must never crash the run.
Verified by executing the committed procedure, not by reading it:
- healthy CI (8 pass) -> all_failing=false, no annotation query (AC-4)
- forced branch on real API -> 8 checks assembled with annotations
- incident fixture through the real step-4/5 shell -> blocked=true,
message verbatim including the 'Billing & plans' apostrophes
- 404 annotations URL -> degrades to []
- {"message":"Bad credentials"} into step 4 -> {"blocked":false}, no throw
Full suite: 206 files, 4283 passed.
…assify-runner-never-started-ci-billin # Conflicts: # CHANGELOG.md
admarble
deleted the
feature/820-fix-qa-classify-runner-never-started-ci-billin
branch
July 27, 2026 15:15
7 tasks
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.
Summary
A repository that hits its GitHub Actions spending limit fails every check within seconds — no runner is ever allocated, so no step executes.
gh pr checksandgh run viewboth report these as ordinary failures, so/qaPhase 1'sFAILURE → NOT_MET → blocks mergemapping marked CI-dependent ACs unmet for a condition no code change can fix, and fed those findings to/loop.failbucket — and on a message matching/job was not started/iclassifies CI as infra-blocked: CI-dependent ACs are markedPENDING(which routes to aNEEDS_VERIFICATIONverdict — see below), the report carries the annotation verbatim, and the finding is marked<!-- qa:ci-infra-blocked -->./loopgains an Excluded Finding Classes rule that rebindsqa_commentbefore the verdict/findings extraction, so marked findings never reach the fix pass.src/lib/qa/infra-blocked-ci.tsas pure predicates, mirroring the existingmarkdown-only-ci.tssplit (detection in TypeScript,gh apiplumbing in the skill prompt).AC Verification
allChecksFailing(infra-blocked-ci.ts:40); step 1 of the Phase 1 procedure, with the fetch inside theif. 7 unit tests.NOT_STARTED_SIGNATURE+detectInfraBlockedCi; AC statusPENDING→ verdictNEEDS_VERIFICATION, neverNOT_MET. Message verified verbatim against the issue body's own bytes./loop, documented in both skill docsqa/SKILL.md§ "Loop Exclusion";loop/SKILL.md§ "Excluded Finding Classes" + Step 3 exit condition./loopfilter byte-identical on 40 real QA comments; confirmed live on this PR (8 passing checks → no annotation query).gh apicommands verified against real output per §6acheck-skill-sync.ts: 42 synced, 0 diverged.Command verification — executed, not read
The procedure in
qa/SKILL.mdwas run verbatim:all_failing=false→ no annotation query fires (AC-4)blocked=true, message verbatim incl. the'Billing & plans'apostrophes[], scan continues{"message":"Bad credentials"}into step 4{"blocked":false}, no throwField checks:
gh pr checks --json name,state,bucket✅,gh pr view --json headRefOid✅,gh api .../check-runswith.output.annotations_url✅ (live).Three deliberate choices worth reviewing
PENDING, notNEEDS_VERIFICATION. AC-2's text says "map toNEEDS_VERIFICATION" — but that is a verdict value, and §7 counts onlyMET/PARTIALLY_MET/PENDING/NOT_MET. An AC stampedNEEDS_VERIFICATIONlands in no counter and lets a fully-red board fall through toREADY_FOR_MERGE— worse than the bug being fixed.PENDINGroutes through the existingpending_count > 0 → NEEDS_VERIFICATIONbranch and produces the intended outcome. Requirement implemented, prescription adjusted; reasoning recorded inline in the skill.messageonly. The fixture also carriesannotation_level: "failure", but gating on it adds a condition the AC never states, and awarning-level variant would then be silently missed. A test pins that the variant still matches.output.annotations_countpre-filter. The field exists in live API output but is absent from the captured fixture, so a zero there could skip detection entirely.Bugs caught before merge
sed '/marker/,/^### /d'silently ate the next section header. Dogfooded against a real QA comment: it deleted### Required Fixesand orphaned a genuinely actionable finding (sedranges are end-inclusive). Replaced with an exclusive-rangeawk, verified on 20 real/qacomments.NEEDS_VERIFICATIONused as an AC status — see choice 1 above./loopfilter was inert — assignedactionable, nothing read it, and it sat after the extraction it was meant to filter. Now rebindsqa_commentin the data path.$ci_bucketswas read but never defined. Steps 3–5 are now real, executed shell.detectInfraBlockedCithrew on a non-arrayannotations— a 404/rate-limit returns an object, and iterating it crashed the QA phase for exactly the broken-CI case this detector exists to handle gracefully. Now guarded; 5 new tests, and removing the guard fails 2 of them.Also adds
Bash(gh api:*)to the qa skill'sallowed-tools— the new procedure needs it and it was not previously granted.Test plan
npm run build— passesnpm run lint— passes (--max-warnings 0)npm test— 206 files, 4283 passed, 1 expected fail, 2 skippednpm run validate:skills/lint:skill-calls/lint:skill-sync— all pass, 42 synced 0 divergedevery→somefails 3 tests; loosening the regex to/started/ifails 1; removing theArray.isArrayguard fails 2Risk
NOT_METbehavior. Safe direction to fail (nothing gets waved through), but invisible.Closes #820