Repository navigation
fix(#834): §7 gates must be reachable — lint /qa's own enforcement chain (§2h has been unwired since it shipped) - #841
Merged
admarble merged 9 commits intoJul 29, 2026
Conversation
§2h declared `verdict CANNOT be READY_FOR_MERGE` plus a Maximum Verdict table, but §7's algorithm never evaluated it: no `cli_registration_status` in step 2, no branch in step 4. The gate had been prose-only since the day it shipped, and the #305 bug class it exists to catch is invisible to TypeScript, build, and unit tests. - Wire §2h: `cli_registration_status` in §7 step 2, an `ELSE IF ... == "Failed" → AC_NOT_MET` branch in step 4, and §2h's prose pointing at that branch the way §6f's does. Behavior change: a verdict that would previously have reached READY_FOR_MERGE despite a failed CLI-registration check is now AC_NOT_MET. - Add `scripts/lint-skill-gates.ts` (+ `lint:skill-gates`, CI step) asserting I1 declared floors are reachable from §7 · I2 no orphan gates · I3 every `(REQUIRED` section has an explicit place in both mode checklists · I4 checklists and templates agree both directions. I1 asks §7 which section a token is attributed to rather than deriving names from titles — a `[a-z_]+_status` heuristic would false-positive on §6a's `skill_verification`. Every parser fails loud: a present-but-unparseable region is a violation, never "no findings". - Fix the five further gaps the lint found on main: §6e and §10a were `(REQUIRED` with Simple Fix mode silent about them (added to the required list, not the omitted one — both defect classes are plausibly sub-threshold diffs, so omitting would recreate #819 F2); the Standard checklist never demanded the Precheck Findings or CLI Registration Verification sections its template renders, and demanded a CHANGELOG Verification section the template had no place for. - Extend §7's Manual Test AC Enforcement to evidence-naming ACs (corpus check, against several real …, N samples, sampled) → PENDING → NEEDS_VERIFICATION when the artifact is absent. #819's AC-4 named a corpus check and was marked MET on "unchanged by construction"; when the check was finally run it surfaced a real false-positive surface. Gate tests use the real shipped qa/SKILL.md as the passing fixture and that same content minus one specific piece of wiring as the failing fixture, so fixtures are mutation-derived from the actual §2h / #819 F1 / #819 F2 defects rather than synthesized. Layer 2 of #22's four validation layers (only Layer 1 ever shipped, per #823's post-mortem). Refs #305, #819, #830, #608, #515. Fixes #834
…e test
The tautology detector flagged 9 of 34 blocks (26.5%) in the new test file:
the AC-6 tests compiled §7's evidence-naming detection pattern with a
test-local extractor, so nothing validated the extraction itself and no block
called production code. That is a real finding, not a detector artifact.
- Export `parseEvidenceAcPattern()` from lint-skill-gates.ts as the single
owner of that parse, scoped to the `manual_test_acs=` assignment.
- Use it in `lintSkillContent`: when §7 declares step-3a manual-test
enforcement but the pattern will not compile, emit a PARSE violation.
Deleting the shipped pattern is now a build failure rather than a silent
downgrade — the same prose-only condition I1 catches, one level down.
- Tests call the parser inline per block and assert with toMatch, which also
stops `RegExp.prototype.test(...)` reading as a test declaration.
Tautology detector: 9 blocks (26.5%) → 0 ("All tests call production code").
29 tests pass.
Found by mutation testing, not review. §7 detects evidence-naming ACs with a `grep -iE` pattern, then attributes matches to AC IDs with a second `awk` pattern carrying the same terms. The AC-6 tests extracted only the grep line, so stripping the four terms from `awk` alone left all 29 tests green while AC-ID attribution silently stopped working — a half-wired feature with a green suite, which is the failure mode this issue exists to eliminate. Adds an assertion scoped to the `manual_ac_ids=` block so the grep line cannot satisfy it. Mutation-verified: stripping the awk terms fails exactly this test (1 failed | 29 passed) and stripping the grep terms still fails only the two pattern-match tests.
Follow-up to the previous commit's awk gate, which asserted literal text and so tested the pattern's spelling rather than its behavior. - Add `parseEvidenceAcIdPattern()`, symmetric with `parseEvidenceAcPattern()`, compiling the `awk` program's AC-ID attribution pattern. - `lintSkillContent` now requires BOTH halves to compile and names which one failed. Previously only the grep half was checked, so the awk half could be removed outright with the lint still green — the same failsafe-off hole one level down. - The awk gate now asserts behavior (#819's AC-4 matches, a control does not) instead of literal term presence. Mutation-verified: stripping the terms from awk alone fails exactly the behavioral awk test (1 failed | 30 passed); removing the awk match block outright fails exactly the fail-loud test and reports only the AC-ID attribution half. 31 tests pass; tautology detector reports 0 blocks.
…was silent Found by running §7's actual shell pipeline against this issue's own spec comment during QA: `grep` matched the evidence-naming line, then `awk` attributed it to NO AC. AC-6 requires evidence-naming ACs to "route to PENDING"; routing needs an AC ID, so the recognition half worked and the routing half could not fire. Cause: the awk anchor was `/^(#+ AC-[0-9]+|\*\*AC-[0-9]+)/` — heading forms only. Measured across a corpus of 18 recent issues (#533–#822): - [ ] **AC-N** 102 #+ AC-N 70 - [ ] AC-N 32 **AC-N 24 The checkbox forms it missed (134) outnumber the heading forms it matched (94), so attribution was silent for ~59% of real AC declarations while detection kept reporting matches. Same class as the #547 awk-anchor bugs §6c documents, and exactly the failure mode #834 exists to eliminate: a half-wired gate that reports success. - Anchor now also matches `- [ ] AC-N` and `- [ ] **AC-N**`. - `parseAcHeaderPattern()` exposes the anchor so it is gate-tested against all five real declaration forms, plus two negatives (prose, indented non-AC checklist item) so a loosened anchor cannot misattribute every later match. End-to-end verified on the real #819 spec-comment AC-4 line ("…corpus check on several recent real issue bodies"): attributes to AC-4 after the fix, to nothing before it. Mutation-verified: reverting the anchor to the heading-only form fails exactly this one test (1 failed | 31 passed). Known residual, fail-safe: the nearest-preceding-declaration heuristic attributes trailing prose to the last AC seen, so an implementation note mentioning "corpus check" after the AC list can produce a spurious PENDING. That errs toward NEEDS_VERIFICATION, never toward a false READY_FOR_MERGE, and the imprecision is pre-existing to the manual-test terms. Left unchanged — tightening it would alter pre-existing detection semantics beyond this issue.
…effect gap Two QA follow-ups on the previous commit. 1. `parseAcHeaderPattern` was exported and behaviorally tested but never wired into the fail-loud check, so removing the anchor outright (as opposed to weakening it) still left the lint green. It is now the third checked pattern alongside detection and AC-ID attribution, with its own regression test. Verified: gutting the anchor yields "its AC-declaration anchor half has no compilable pattern". 2. A comment on the RegExp-compile fallback claimed an uncompilable ERE was "worth surfacing, not something to swallow into a silent null" while the code returned null — describing the intent, not the effect, and inviting a future reader to conclude the error was dropped. Reworded to state the actual mechanism: lintSkillContent converts null from any of these parsers into a PARSE violation, which is what makes it fail the build. Claim #1 above is what makes the reworded comment true for all three parsers. 33 tests pass; build, eslint, lint:skill-gates, lint:skill-sync (44/44), tautology detector all clean.
7 tasks
Closes the two gaps QA left open. Both were measured against a corpus of 18 real issues (#533–#822) rather than reasoned about. Gap 1 — attribution scope. QA documented trailing-prose misattribution as an acceptable fail-safe. Measuring it showed that was too generous: of 9 attributions the old program produced across the corpus, 5 were WRONG — including a `| AC-7 | … |` coverage row credited to AC-8 and a `| AC-4 | … |` row credited to AC-6. Misattributing a PENDING to the wrong AC is not fail-safe; it points the reader at the wrong requirement. A non-AC heading now clears the current AC. Verified: all 4 true positives survive (including #819's AC-4, the motivating case, and #795's two real Manual Test markers) and all 5 false positives disappear. Gap 2 — `BEGIN{IGNORECASE=1}` is a gawk extension and a silent no-op on macOS's awk, so matching was case-sensitive there. `Manual test` and `Corpus check` both occur in the corpus and were being missed. Replaced with `tolower($0) ~ /…/`, which is POSIX-portable; all awk literals are now lowercase. Both properties are gated, not just fixed: - `parseAcScopeResetClause()` — the lint fails if the scope-reset clause is removed, since its absence is otherwise silent. - `findUppercaseInAwkPattern()` — an uppercase literal in a pattern matched against `tolower($0)` can never fire, so reintroducing `Manual Test` is now a build failure rather than a dead term. Mutation-verified: removing the scope-reset clause and reintroducing an uppercase literal each produce their own named violation. 37 tests pass; full suite 168 files / 3847 passed; tautology detector clean.
…gates-must-be-reachable-lint-the-skil # Conflicts: # CHANGELOG.md
…missed it Asking "what would make this A+" turned up the answer the issue itself predicted: "this is a structural seam, not a one-off." I1's phrase list started as the three strings named in the issue, plus a fourth added on noticing §6e's wording. That was hand-picking — the exact mistake §6c exists to prevent and the one #547 made three times — and it was never run against its own corpus. Enumerating every line in qa/SKILL.md that pairs a constraining verb with a verdict constant found §11 Script/CLI Execution Verification saying "Do NOT give `READY_FOR_MERGE` verdict until verification is complete" with no §7 gate. A second §2h, in the same file, shipped straight past the lint built to catch §2h. - Phrase list is now DERIVED from that enumeration, with the method recorded so the next edit re-runs it instead of guessing. - §11 wired: `script_verification_status` in §7 step 2, an `ELSE IF … == "Not Verified" → AC_MET_BUT_NOT_A_PLUS` branch in step 4, explicit status outcomes, and prose pointing at the branch. BEHAVIOR CHANGE: `scripts/` changes with no /verify evidence and no approved §11a override can no longer reach READY_FOR_MERGE. - I1 now recognises the second legitimate wiring mechanism. §1 constrains the verdict with no gate token because its outcome is an AC status, which §7 step 1 counts — step 3a blesses this explicitly. Flagging §1 would have been a false positive (AC-5). It qualifies only by NAMING `pending_count`; an unstated mechanism is indistinguishable from none. - I2 rejects a gate attributed to a duplicated section number. qa/SKILL.md has two `### 1.` sections, so "status from Section 1" would have no single answer. Fires only when a token actually points at one, so no renumbering is forced. - Forward-looking test: the lint's value is stopping the NEXT §2h, and every prior I1 test mutated existing wiring. Now simulates a contributor adding §6g in each of the four shipped declaration styles. - CONTRIBUTING.md documents both wiring mechanisms; `check-skill-sync` was documented and this was not. Mutation-verified: narrowing the phrase list back to the original four fails the forward-looking and AC-routing tests (2 failed | 37 passed); pointing an existing gate at the duplicated §1 produces the I2 violation. 39 tests; full suite 213 files / 4430 passed; build, eslint, all four skill lints, tautology detector clean.
admarble
deleted the
feature/834-fix-qa-7-gates-must-be-reachable-lint-the-skil
branch
July 29, 2026 01:41
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
§2h declared
**CRITICAL:** If CLI registration verification = **Failed**, verdict CANNOT be READY_FOR_MERGEplus aMaximum Verdictgating table. §7's algorithm never evaluated it — nocli_registration_statusin step 2, no branch in step 4. The gate had been prose-only since the day it shipped.cli_registration_status = status from Section 2hin §7 step 2, anELSE IF cli_registration_status == "Failed" → AC_NOT_METbranch in step 4, and §2h's prose pointing at that branch the way §6f's does.scripts/lint-skill-gates.ts(AC-1) —lint:skill-gates, wired as its own CI step afterLint skill calls. Asserts I1–I4 over the skill's own enforcement chain.corpus check,against several real …,N samples,sampled→PENDING → NEEDS_VERIFICATIONwhen the named artifact is absent. Reuses the existing path; no new verdict branch.READY_FOR_MERGEdespite a failed CLI-registration check is nowAC_NOT_MET. That is the intent.The invariants
(REQUIREDsection that declares an output section is in the Standard checklist and in either the Simple Fix checklist or its explicit omitted listI1 asks §7, not the section. It looks a token up by the section it is attributed to in step 2, never by name-shape. A
[a-z_]+_statusheuristic would have false-positived on §6a, whose real token isskill_verification. Rejected alternatives: deriving token names from section titles (fuzzy, needs an allowlist); a separate gate-registry file (a second source of truth that drifts).Every parser fails loud. A region that is present but yields no entries is a
PARSEviolation, never "no findings" — a silently-empty parser would make this lint the same tautology it exists to stop.What the lint found on
mainI1 flagged §2h as predicted. It also found five gaps I had not:
(REQUIRED …)in neither Simple Fix list, and no template section(REQUIRED)absent from both Simple Fix listsPrecheck FindingsandCLI Registration Verification; the Standard checklist demanded neitherCHANGELOG Verification; the Standard template had no such section§6e and §10a went on the Simple Fix required list rather than the omitted list. Both routes satisfy I3, but a #533-class stale-rule survival and a one-line user-facing fix are both plausibly sub-threshold diffs, so omitting them would have recreated #819 F2 — a real gate switched off exactly below the size where the defect is most likely.
Why a lint and not better review
#819's §6f shipped with this same defect in freshly-written code. A human second pass caught it (#830); the automated
/qapass over the same commit reported all six ACs met and missed it. Of that second pass's five findings, the only one automation also caught was the missing CHANGELOG entry — the one finding that was already a wired §7 gate. This is Layer 2 of #22's four validation layers, of which #823's post-mortem records that only Layer 1 ever shipped.Test plan
npm run lint:skill-gates— 19 files scanned, 18 skipped (no verdict algorithm), 0 violations (AC-4, AC-5)npm run build,npm run lint,lint:skill-calls,lint:skill-sync(44/44 synced) — all clean (AC-7)Fixtures are the real file. Every invariant's passing fixture is the shipped
qa/SKILL.md; its failing fixture is that same content with one specific piece of wiring deleted — the historical defect restored. Nothing is synthesized, so a fixture cannot drift into agreeing with a bug the real file no longer has, and each pair doubles as a live gate.Mutation verification (recorded per the convention #835 adopts)
cli_registration_statusbranchmutate()target assertionsgreplineawkline onlyawkmatch block outrightCLI Registration VerificationStandard checklist entryTwo findings came out of that mutation pass, not review — both fixed here:
parseEvidenceAcPattern()in the script, whichlintSkillContentnow uses as a fail-loud check.awkhalf alone left all 29 tests green while AC-ID attribution silently stopped working — detection would find the line and then report no AC for it. A half-wired feature with a green suite is exactly the failure mode this issue exists to eliminate. Fixed withparseEvidenceAcIdPattern(); the lint now requires both halves to compile and names which one failed.Corpus check (AC-6's named evidence — actually run)
AC-6's own wording names its evidence, so reasoning "unchanged by construction" would have repeated #819 AC-4's mistake verbatim. Corpus: 220 real AC-declaration lines from the bodies and comments of 18 recent issues (#761–#822, #533, #552, #683).
MET.— sampled, not gated,~1/12 sampled) are QA-comment prose, and the detection runs on the spec plan comment only.Risk assessment
/qa's own prose, so a large reformat of §7 or the Output Verification region could change a parse shape. Mitigated by the fail-loud rule — an unreadable-but-present region is a violation naming the parser to fix, not a silent pass. The failure mode is a noisy build, not a blind gate.FailedCLI-registration status actually producesAC_NOT_METat runtime — that is LLM prompt behavior, not code. The lint gates the wiring's presence; the verdict is the model following §7. Same limitation as every other §7 gate.SECTION_ALIASESmap, where checklist labels and template headers legitimately differ in wording (Code Review Findings/Code Review). Each entry is justified inline. If it grows past a handful the right fix is renaming the headers, not growing the map./qais the only skill with a verdict algorithm (verified by grep across all 19SKILL.mdfiles); the other 18 are reported as skipped. Extending to other skills' output contracts is explicitly out of scope per the issue.AC coverage
scripts/lint-skill-gates.ts; exits 1 naming section + missing wiring (see M6 output above)mainwith zero suppressions locally; the "own CI step" half needs this PR's CI runlint:skill-calls+lint:skill-synccleanAC-4 is
PENDING, notMET— deliberately, since it names CI as its evidence and I cannot produce that artifact locally. ExpectNEEDS_VERIFICATIONuntil the CI run is green.Closes #834
🤖 Generated with Claude Code
Update — QA gaps closed
The QA pass left three gaps open. All three are now fixed, and both behavioral ones were measured against a corpus of 18 real issues (#533–#822) rather than reasoned about.
1. Attribution scope — QA's own framing was too generous
QA called trailing-prose misattribution "fail-safe, acceptable." Measuring it said otherwise: of the 9 attributions the old awk produced across the corpus, 5 were wrong.
Crediting a
PENDINGto the wrong AC is not fail-safe — it points the reader at the wrong requirement. A non-AC heading now clears the current AC. Verified: all 4 true positives survive (including #819's AC-4, the motivating case, and #795's two realManual Testmarkers) and all 5 false positives disappear.2.
IGNORECASEis gawk-onlyBEGIN{IGNORECASE=1}is a gawk extension and a silent no-op on macOS's awk, so matching was case-sensitive there.Manual testandCorpus checkboth occur in the corpus and were being missed — the same silent-routing class as the original bug. Replaced with POSIX-portabletolower($0) ~ /…/; all awk literals are now lowercase.3.
/verifyexecution evidenceRecorded on the issue rather than claiming a §11a override (a new script isn't an approved override category). Both paths exercised — a lint that only ever prints "no violations" proves nothing:
01§2hatfile:line+ the exact step-2 token and step-4 branch to addBoth new properties are gated, not merely fixed
Neither would fail loudly on its own, so each got a lint check:
parseAcScopeResetClause()— removing the scope-reset clause is now a build failure.findUppercaseInAwkPattern()— an uppercase literal matched againsttolower($0)can never fire, so reintroducingManual Testis a build failure rather than a dead term.Mutation-verified: each produces its own named violation. 37 tests (was 33).
Merge + suite status
origin/main(#837) merged in; oneCHANGELOG.md[Unreleased]conflict, resolved keeping both entries.Full suite on the merged branch: 213/213 files, 4428 passed, exit 0.
Two earlier full-suite runs showed 3–6 intermittent failures, always in subprocess- or lock-heavy files (
precheckCLI,semgrep,tui/load,lock-manager,scrollback-harness,tautology-detector-cli), never the same set twice, and all passing in isolation (78/78). None touch anything this PR changes. This PR's test file is 55ms of in-memory string parsing with no subprocesses or timers, so it is not a plausible contention source; the flakiness looks pre-existing and load-dependent. Flagging it rather than burying it — CI is the arbiter.