Skip to content

fix(qa): §7 gates must be reachable — lint the skill's own enforcement chain (§2h has been unwired since it shipped) #834

Closed

Description

@admarble

Context

/qa §2h declares a merge gate that has never been able to fire:

.claude/skills/qa/SKILL.md:1689 — CRITICAL: If CLI registration verification = Failed, verdict CANNOT be READY_FOR_MERGE. Missing CLI registrations mean users cannot access the feature via command line.

§2h also carries a Verdict Gating table (Failed → Maximum Verdict: AC_NOT_MET) and a remediation block. But §7's verdict algorithm never evaluates it: there is no cli_registration_status in step 2's gate list and no branch in step 4. Grep the whole of §7 for registration and it returns nothing. The gate §2h exists to enforce is the #305 class — force?: boolean added to RunOptions, checked at runtime, referenced in a user-facing warning, and never registered in bin/cli.ts — a bug that is invisible to TypeScript, build, and unit tests. §2h was written specifically so QA would catch it, and it cannot.

This is a structural seam, not a one-off. /qa has ~15 conditional sections that each self-report a status string, and §7 aggregates them by name. Nothing checks that the set of sections and the set of gates agree, so a section can declare any enforcement it likes in prose and §7 will silently not implement it.

The same defect was just found in freshly-written code. #819's §6f Trust-Boundary Check shipped saying "floor the verdict at AC_NOT_MET" with no step-2 gate and no step-4 branch, so a real prompt injection could reach at most AC_MET_BUT_NOT_A_PLUS; it also routed only through §6d, which Simple Fix mode omits, switching a security check off below the 100-line diff gate. Both were caught by a human second pass and fixed in #830 — the automated /qa pass that reviewed the same commit reported all six ACs met and missed both. Of the five findings that second pass produced, the only one the automated pass had also caught was the missing CHANGELOG entry, which is the only one that was already a wired §7 gate. That is the evidence for doing this as a lint rather than as better review.

This is a known recurrence. #22 ("skill output reliability: validation layers, schemas, structured logging") specified four validation layers. #823's post-mortem documents that only Layer 1 — the "Output Verification / DO NOT respond until verified" checklist — ever shipped, and that Layer 1 did not fire for the failure it was assigned to catch. This issue is Layer 2 for /qa: a deterministic check that the skill's stated enforcement and its actual algorithm agree.

A second, cheaper class surfaced in the same review. #819's AC-4 read "…a corpus check against several real recent issue bodies shows no behavior change" and was marked MET on the reasoning "unchanged by construction" — no corpus check was run. When one was finally run it surfaced a real false-positive surface in the shipped rule. §7 already has exactly the right machinery for this: Manual Test AC Enforcement makes an AC that names a manual verification method un-markable as MET from code review alone, routing it to PENDING → NEEDS_VERIFICATION. It just doesn't recognise evidence-naming ACs that aren't phrased as manual tests.

Proposal

1. scripts/lint-skill-gates.ts — a deterministic check over qa/SKILL.md asserting four invariants, joining check-skill-sync and lint-skill-calls as a CI step:

# Invariant Catches
I1 A section declaring a verdict floor (floor the verdict at, verdict CANNOT be, Maximum Verdict) has a status token in §7 step 2 and a branch on it in step 4 §2h, #819 F1
I2 Every status token in §7 step 2 is produced by some section that defines its outcomes orphan gates
I3 Every section headed (REQUIRED appears in the Standard required-sections checklist, and in either the Simple Fix checklist or Simple Fix's explicit omitted list #819 F2
I4 Output-template sections and required-sections checklist entries agree in both directions #819 F1's missing template section

2. Wire §2h. Add cli_registration_status to §7 step 2 and an ELSE IF … == "Failed" → AC_NOT_MET branch in step 4, mirroring §6e/§6f. Required in the same change — I1 fails against main until it lands. Note this is a real behavior change: verdicts that would previously have been READY_FOR_MERGE despite a failed CLI-registration check will now be AC_NOT_MET, which is the intent.

3. Extend evidence-naming AC detection. Add corpus/sample phrasings (corpus check, against several real, N samples, sampled) to §7's existing Manual Test AC Enforcement patterns, so an AC that names its evidence method cannot be marked MET without the artifact. Reuses the existing PENDING → NEEDS_VERIFICATION path; no new verdict branch, no new configuration.

Deliberately script-side, not prompt-side. #608's signal-to-noise study found /qa sections producing visibility without action, and #515 is actively compressing these prompts. The only prompt growth here is §2h's two gate lines and item 3's pattern list — everything else is a script that fails the build.

Acceptance Criteria

  • AC-1: scripts/lint-skill-gates.ts implements invariants I1–I4 above, exits non-zero on violation naming the offending section and the missing wiring, and exits zero otherwise.
  • AC-2: Each of I1–I4 has a unit test with one fixture that must fail and one that must pass; the failing fixtures are mutation-derived from the real §2h and feat(skills): shared trust-model block — issue/PR text is data, not agent instructions (prompt-injection hardening, portable to all users) #819 F1/F2 defects rather than synthesized.
  • AC-3: §2h CLI Registration Verification is wired — cli_registration_status declared in §7 step 2 and branched in step 4 flooring at AC_NOT_MET — and §2h's prose points at that branch the way §6f now does.
  • AC-4: The lint runs as its own CI step and passes against main once AC-3 lands, with zero suppressions or allowlist entries beyond any that are individually justified in the script.
  • AC-5: The lint produces zero false positives across every other skill's SKILL.md and does not error on skills that have no verdict algorithm.
  • AC-6: §7's Manual Test AC Enforcement recognises evidence-naming ACs (corpus check, sample counts) and routes them to PENDING when the named artifact is absent, verified against feat(skills): shared trust-model block — issue/PR text is data, not agent instructions (prompt-injection hardening, portable to all users) #819's AC-4 text as a fixture.
  • AC-7: All three mirrored skill directories are byte-identical for the changed files, and lint:skill-calls plus lint:skill-sync pass.

Out of scope

The prose-gate mutation harness (auto-mutating file-reading gate tests) — the convention that gate tests ship with a recorded mutation result is being adopted as a CLAUDE.md line instead, and a harness should wait for a third such test. Extending the lint to other skills' output contracts — /qa is the only skill with a verdict algorithm, and #823 already fixed /assess's rendering by moving it to a tool call. Any change to /qa's section content beyond items 2 and 3.

References

Activity

  1. added
    enhancement
    qa
    on Jul 28, 2026
  2. admarble commented on Jul 28, 2026

    @admarble
    ContributorAuthor

    Plan (/spec)

    Complexity: Standard (7 ACs, 4 directories) · Scope: ⚠️ SCOPE_WARNING → quality loop enabled

    Splitting isn't available for items 1+2: I1 fails against main until §2h is wired, so the lint and the wiring must land in one commit.

    AC Checklist

    • AC-1 scripts/lint-skill-gates.ts implements I1–I4, exits non-zero naming section + missing wiring — Unit + Integration Test
    • AC-2 Each invariant has a mutation-derived failing fixture and a passing fixture — Unit Test
    • AC-3 §2h wired: cli_registration_status in §7 step 2, branched in step 4, prose points at the branch — Unit Test (gate test, mutation-verified)
    • AC-4 Own CI step, passes against main, zero suppressions — Integration Test + CI evidence
    • AC-5 Zero false positives across other skills; no error without a verdict algorithm — Unit Test
    • AC-6 §7 recognises evidence-naming ACs, verified against feat(skills): shared trust-model block — issue/PR text is data, not agent instructions (prompt-injection hardening, portable to all users) #819's AC-4 text — Unit Test
    • AC-7 Three mirrors byte-identical; lint:skill-calls + lint:skill-sync pass — Integration Test
    • AC-8 (derived) Every gate test in this change is mutation-verified, result recorded in the PR body — High

    AC quality: AC-5's "every other skill" flagged open-ended; bounded concretely as the 21 SKILL.md files under .claude/skills/ — only qa/SKILL.md has a verdict algorithm (verified by grep).

    Implementation Plan

    Phase 1 — the lint script (AC-1, AC-5). scripts/lint-skill-gates.ts, following lint-skill-calls.ts exactly (exported pure parsers, lintSkillGates(projectRoot), printReport, isDirectRun guard). Five parsers: check sections; §7's verdict-algorithm block → step2Tokens: Map<token, sectionRef> + step4Tokens: Set<token>; each section's declared output-section name; the two Output Verification checklists + the Simple Fix omitted list; the two output templates' section headers.

    Fail-loud rule (critical): a region that is present but yields zero parsed entries emits ALGORITHM_UNPARSEABLE / CHECKLIST_UNPARSEABLE — never a silent empty result. A silent-empty parser would turn this lint into exactly the tautology the issue exists to stop.

    Invariants:

    • I1 — a section declaring a floor (floor the verdict at / verdict CANNOT be / Maximum Verdict), §7 itself excluded, must have some step-2 token attributing back to it and that token branched in step 4.
    • I2 — every step-2 token's Section/Phase reference resolves to a real section heading.
    • I3 — a section headed (REQUIRED that declares an output section must appear in the Standard checklist and in either the Simple Fix checklist or its omitted list. Sections with no output section (§4, §6) are exempt by construction, not by allowlist.
    • I4 — checklist ≡ template headers, both directions, for both modes; via a 4-entry alias map, each entry justified inline.

    Phase 2 — wire §2h and the violations the lint surfaces (AC-3). Enumerated up front so nothing is found late:

    Inv Finding on main Fix
    I1 §2h declares verdict CANNOT be READY_FOR_MERGE + a Maximum Verdict table; no §7 token attributes to it cli_registration_status = status from Section 2h (Passed/Failed/N/A) in step 2; ELSE IF cli_registration_status == "Failed" → AC_NOT_MET in step 4; §2h's **CRITICAL:** line rewritten as a §6f-style pointer at that branch
    I4 Standard template has Precheck Findings and CLI Registration Verification; the Standard checklist has neither 2 checklist entries
    I3 §6e Behavior-Rule Survival Check (REQUIRED …) is in neither checklist nor the omitted list, and has no template section Standard checklist + Standard template + Simple Fix checklist + Simple Fix template
    I3 §10a CHANGELOG Quality Gate (REQUIRED) is in the Standard checklist but absent from both Simple Fix lists Simple Fix checklist + Simple Fix template

    §6e and §10a go on the Simple Fix required list, not the omitted list. Both routes satisfy I3, but omitting would recreate #819 F2: a #533-class stale-rule survival is very plausibly a sub-100-line diff, and the CHANGELOG gate is the one gate the automated pass in #830 actually caught.

    Phase 3 — evidence-naming ACs (AC-6). Extend §7's Manual Test AC Enforcement patterns with corpus check|against several real|[0-9]+ samples?|sampled, plus one enforcement-table row and one Key Rule clause. Reuses the existing PENDING → NEEDS_VERIFICATION path — no new verdict branch. The test extracts the grep -iE pattern from SKILL.md and runs it against #819's AC-4 text, so SKILL.md stays the single source of truth and the test is mutation-verifiable.

    Phase 4 — wiring, mirrors, docs (AC-4, AC-7). lint:skill-gates in package.json; a CI step after Lint skill calls (ci.yml:122); lint:skill-sync --fix for both mirrors; CHANGELOG [Unreleased].

    Key Decisions

    I1 asks §7, not the section. It does not require a section to name its own token — it asks whether any step-2 token attributes back to the section. A name-shape heuristic ([a-z_]+_status) would have false-positived on §6a, whose token is skill_verification with no _status suffix, and on §6c/§6d. 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 gate test ships mutation-verified — delete the wiring, confirm exactly that test fails, restore, record in the PR body (the convention #835 adopts). Assertions that read files are scoped to their delimited region; the tautology detector is run by hand since that gate never fires in CI.

    Open Questions

    1. §6e / §10a in Simple Fix: required or explicitly omitted? Recommendation required. Wrong → two short template blocks of prose growth in the cheap mode. The alternative being wrong → a real gate switched off below the size gate (feat(skills): shared trust-model block — issue/PR text is data, not agent instructions (prompt-injection hardening, portable to all users) #819 F2). Asymmetric, so taking the safe side without blocking.
    2. Do 4 checklist lines + 2 template blocks exceed "no /qa section-content changes beyond items 2 and 3"? Recommendation: proceed — AC-4 requires main to pass with zero suppressions, so every violation found must be fixed, and these are wiring entries rather than new checks. Flagging because it's a real reading difference and your call to narrow.

    Conflict Risk

    feature/833-* overlaps on CHANGELOG.md only (low — [Unreleased] text; re-fetch origin/main before push). feature/838-* has no commits. PR #835 touches only CLAUDE.md, which #834 does not — complementary, not conflicting.

    Recommended Workflow

    spec → exec → qa, quality loop enabled. No /test (no UI surface). testgen skipped despite Unit/Integration ACs — the tests are fixture-driven and written directly in exec, and stub generation leaves untracked files to clean up (documented override of the auto-detection table). /verify worth a pass: scripts/ gains an executable, so §6/§11 will want execution evidence at QA.

    Note on AC-4: the "own CI step" half can't be proven locally — it needs this PR's CI run, so expect PENDING → NEEDS_VERIFICATION at QA until CI is green.

  3. added
    planned
    no-browser-test
    on Jul 28, 2026
  4. added 2 commits that reference this issue on Jul 28, 2026
  5. admarble commented on Jul 28, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #834

    Commit: 687ee7e3 · PR: #841 · Standard QA (SMALL_DIFF=false, 1674 insertions)

    This pass surfaced three real defects, all fixed in-PR — see Adversarial Re-Read. The most consequential was found by running §7's actual shell pipeline instead of reading it: AC-6's routing half was silent.

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Lint implements I1–I4, exits non-zero naming section + missing wiring MET scripts/lint-skill-gates.ts. Exit-1 path exercised by mutation M4: names the section and the exact checklist line to add
    AC-2 Original Each invariant has a mutation-derived failing + passing fixture MET Passing fixture = the shipped qa/SKILL.md; failing = same minus one wiring line. mutate() asserts its target exists, so a reworded file fails loudly instead of no-op'ing
    AC-3 Original §2h wired: cli_registration_status in step 2, branched in step 4, prose points at it MET Gate-tested via parseVerdictAlgorithm, scoped to §7's block so a mention elsewhere can't satisfy it. M1/M2 mutation-verified
    AC-4 Original Own CI step, passes against main, zero suppressions MET Lint skill gates → success on 687ee7e3 (run 30337005814, job validate-skills). 0 violations, 0 suppressions; only I4's 3-entry alias map, each justified inline
    AC-5 Original Zero false positives on other skills; no error without a verdict algorithm MET 19 scanned, 18 skipped cleanly. qa is the only skill with a verdict algorithm (grep-verified)
    AC-6 Original §7 recognises evidence-naming ACs and routes them to PENDING MET (after fix) Initially PARTIALLY_MET — see Finding 1. Now verified end-to-end on the real #819 spec-comment AC-4 line: attributes to AC-4 after the fix, to nothing before
    AC-7 Original Three mirrors byte-identical; lint:skill-calls + lint:skill-sync pass MET 44/44 synced, 0 diverged; both lints clean
    AC-8 Derived (Test integrity) Every gate test mutation-verified, result recorded MET 6 file mutations + 3 parser mutations, table below

    Coverage: 8/8 met (7 original + 1 derived) · 0 NOT_MET, 0 PARTIALLY_MET, 0 PENDING


    Detection Pattern Verification

    Precondition TRUE — the diff adds grep -iE terms and rewrites an awk anchor in skill markdown.

    Pattern Corpus Samples Expected Actual Status
    grep -iE '…corpus check|against several real|[0-9]+ samples?|sampled' AC-declaration lines from 18 real issues (#533–#822) 220 lines match evidence-naming ACs, no false positives 2 newly matched — both #819's AC-4 (body + spec restatement). 0 false positives ✅ Passed
    awk AC-declaration anchor same corpus 228 declarations attribute every real declaration form 4 forms + 2 negatives verified ✅ Passed (after Finding 1 fix)

    Motivating-example fixture (verbatim, from the issue body): `.claude/skills/qa/SKILL.md:1689` — **CRITICAL:** If CLI registration verification = **Failed**, verdict CANNOT be `READY_FOR_MERGE`… — extracted by Phase 0c precheck and run against the implementation: with the wiring removed (mutation M1) the lint reports §2h; with it present, silent. The fixture is the defect, and the lint detects it.

    Verification Status: Passed


    Adversarial Re-Read

    Findings — three real defects, all fixed in this PR:

    1. AC-6's routing half was silent (the significant one). Instead of reading §7's pipeline I ran it against this issue's own spec comment. grep matched the evidence-naming line; awk then attributed it to no AC at all. AC-6 requires routing to PENDING, and routing needs an AC ID — so recognition worked and routing could not fire. Cause: the anchor was /^(#+ AC-[0-9]+|\*\*AC-[0-9]+)/, heading forms only. Measured across the 18-issue corpus:

    Form Count Anchor matched?
    - [ ] **AC-N** 102 ❌
    - [ ] AC-N 32 ❌
    #+ AC-N 70 ✅
    **AC-N 24 ✅

    The forms it missed (134) outnumber those it matched (94) — attribution was silent for ~59% of real declarations while detection kept reporting matches. Same class as the #547 awk-anchor bugs §6c documents, and precisely the half-wired-gate-reporting-success failure mode this issue exists to eliminate. Fixed; parseAcHeaderPattern now gate-tests all five forms plus two negatives.

    2. Tautological AC-6 tests (9/34 blocks, 26.5%). The detector flagged them and it was right: the tests compiled §7's pattern with a test-local extractor, so nothing validated the extraction and no block called production code. Moved to parseEvidenceAcPattern() in the script, which lintSkillContent now consumes as a fail-loud check. Detector: 26.5% → 0.

    3. Only one of three detection patterns was gated. Stripping the terms from the awk half alone left all 29 tests green while attribution silently broke. parseEvidenceAcIdPattern() + parseAcHeaderPattern() added; the lint now requires all three to compile and names which failed.

    Process state: HEAD 687ee7e3 == origin, 0 uncommitted, 0 behind origin/main, no stashes from this work.
    Non-Goals honored: no mutation harness added (0 files), no non-qa skill touched (0 files), lint not extended to other skills.
    Sibling sites: qa is the only skill with a verdict algorithm across all 19 SKILL.md files — the other 18 are reported skipped, not passed.
    Evidence audit: every claim here was re-executed this pass, not carried over from the exec comment.

    Residual known limitation (non-blocking, 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. Observed once, on this issue's own spec comment (attributed to AC-8). It errs toward NEEDS_VERIFICATION, never toward a false READY_FOR_MERGE, and the imprecision predates the new terms. Left unchanged deliberately — tightening it would alter pre-existing manual-test detection semantics beyond this issue's scope.

    Status: Gaps Found


    Mutation Verification (AC-8)

    # Mutation Result
    M1 Delete §7 step-4 cli_registration_status branch 6 failed / 23 passed — I1 pass-test, AC-3 wiring test, project scan, both mutate() guards
    M2 Delete §2h's prose pointer only exactly 1 — the prose test. §6f's identically-shaped sentence untouched
    M3 Strip 4 evidence terms from grep exactly 2 — both AC-6 pattern tests
    M4 Delete CLI Registration Verification from Standard checklist 4 failed; lint reports the I4 violation with the exact remediation line
    M5 Strip 4 terms from awk only exactly 1 — the behavioral awk test
    M6 Revert anchor to heading-only exactly 1 — the new anchor gate
    P1 Remove awk match block outright exactly 1 — fail-loud, reporting only the AC-ID attribution half
    P2 Gut the AC-declaration anchor PARSE: "its AC-declaration anchor half has no compilable pattern"

    Two mutations initially failed to apply (shell escaping). Both were re-run correctly rather than counted as passes — a no-op mutation proves nothing, and one of them (git checkout on an uncommitted edit) also cost the anchor fix, which had to be re-applied.


    CI Status

    Check State Impact
    validate-skills (incl. Lint skill gates) SUCCESS ✅ AC-4
    typecheck, build (22.x), node-floor-guard SUCCESS ✅
    validate-plugin, Plugin Structure Validation, Hooks Validation, Setup Directory Creation SUCCESS ✅

    CI Summary: 8 passed, 0 pending, 0 failed on 687ee7e3.

    Quality Metrics

    Metric Value Status
    Type issues (any / as any) added 0 OK
    Deleted tests 0 OK
    Files changed 8 OK
    Lines added / deleted +1674 / −24 OK (3 of 8 files are byte-identical mirrors)
    Full suite 168 files, 3843 passed, 1 expected fail, 2 skipped OK
    Tautology detector 0 blocks — "All tests call production code" OK

    Other gates

    Quality Plan Verification: Complete — all spec-noted items addressed; derived AC-8 addressed. The spec's two Open Questions were both resolved as recommended (§6e/§10a → Simple Fix required, not omitted; the extra checklist entries proceeded, as AC-4 requires main to pass with zero suppressions).
    Execution Evidence: Complete — npx tsx scripts/lint-skill-gates.ts and npm run lint:skill-gates both executed locally with captured output; the CI step ran green.
    Skill Command Verification: Passed — the two changed commands (grep -iE, awk) were executed against real corpus input, plus one end-to-end run of §7's full two-pass pipeline.
    Smoke Test: Complete — happy path (0 violations), edge case (18 skills skipped without error), error handling (each mutation produces a violation with an actionable message).
    CLI Registration Verification: N/A — no option-interface files in the diff (bin/cli.ts, batch-executor.ts, run.ts untouched).
    Behavior-Rule Survival Check: N/A — no AC triggers the behavior-rule heuristic.
    Trust-Boundary Check: Clean — no HTML comments beyond phase markers; no execute/fetch/exfiltrate/override patterns in the body or comments. The issue's process guidance ("update all three mirrored dirs", "land the wiring with the lint") is benign maintainer instruction and was followed as such. Status: Clean
    CHANGELOG Verification: ✅ [Unreleased] entry present under ### Fixed, includes (#834).
    Script Verification Override: not claimed. scripts/ changed and /verify was not run; execution evidence above is direct rather than /verify-mediated. Contributes to the verdict below.

    Risk Assessment

    • Likely failure mode: the lint parses /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 — a present-but-unreadable region is a violation naming the parser to fix. The failure mode is a noisy build, not a blind gate.
    • Not tested: that a Failed CLI-registration status actually yields AC_NOT_MET at runtime — that is LLM prompt-following, not code. The lint gates the wiring's presence; the same limitation applies to every other §7 gate.
    • Sibling sites considered: qa is the only skill with a verdict algorithm (all 19 SKILL.md files checked). Extending to other skills' output contracts is explicitly out of scope per the issue.
    • Sibling-line audit: all four Maximum Verdict / verdict CANNOT be sites in qa/SKILL.md (§2h, §6a, §6c, §6d) were checked by I1 — §2h was the only unwired one; the other three pass.
    • Noted, not filed: §7's awk uses BEGIN{IGNORECASE=1}, a gawk extension. On macOS's BSD/onetrue awk it is a no-op, so case-insensitive matching silently does not apply locally. Pre-existing and out of scope; worth a follow-up issue.

    Verdict: AC_MET_BUT_NOT_A_PLUS

    All 8 ACs met, CI fully green, tautology-clean, mutation-verified. Not READY_FOR_MERGE because §6d is Gaps Found: this pass surfaced three real defects (routing silent, tautological tests, one-of-three patterns gated) — all fixed here, but a review that has to fix three things is not an A+ first pass. The documented fail-safe imprecision in prose attribution and the absent /verify evidence also point the same way.

    Per feedback_qa_break_vs_loop, AC_MET_BUT_NOT_A_PLUS breaks to PR — do not run /loop on this. Ready for human review and merge.

    Next Steps

    1. Human review + merge PR fix(#834): §7 gates must be reachable — lint /qa's own enforcement chain (§2h has been unwired since it shipped) #841.
    2. Optional follow-up: IGNORECASE is gawk-only, so §7's awk is case-sensitive on macOS.
    3. Optional follow-up: tighten AC attribution to declaration lines only, removing the trailing-prose imprecision.
  6. added
    needs-improvement
    and removed
    planned
    on Jul 28, 2026
  7. admarble commented on Jul 28, 2026

    @admarble
    ContributorAuthor

    Execution Verification

    Command: npx tsx scripts/lint-skill-gates.ts
    Result: Verified by human review

    Both paths were exercised — a lint that only ever prints "no violations" proves nothing, so the failure path was run by restoring the real §2h defect.

    Run 1 — happy path (clean tree) · exit 0 · 1s
    Linting verdict-enforcement chains in .claude/skills/**/SKILL.md
    Files scanned: 19 (18 skipped — no verdict algorithm)
    
    No violations. Every declared verdict floor is reachable from §7.
    
    Run 2 — failure path (§2h unwired, as it shipped) · exit 1 · 4s
    Linting verdict-enforcement chains in .claude/skills/**/SKILL.md
    Files scanned: 19 (18 skipped — no verdict algorithm)
    
    .claude/skills/qa/SKILL.md:1595: [I1] §2h
      §2h (CLI Registration Verification (When Option Interfaces Modified)) declares a
      verdict floor ("verdict cannot be") but no §7 step-2 status token is attributed to
      Section 2h. The gate can never fire. Add a token to §7 step 2 ("… = status from
      Section 2h (…)") and branch on it in step 4, mirroring §6f/trust_boundary_status.
    
    Found 1 violation(s). A gate that no §7 branch reads cannot fire. See #834.
    

    Mutation applied: removed cli_registration_status from §7 step 2 and its step-4 branch. Working tree restored afterwards — git status --porcelain reported 0 modified files.

    Check Result
    Exit code, clean tree 0
    Exit code, defect present 1 (AC-1: "exits non-zero on violation")
    Message names the offending section ✅ §2h with file:line
    Message names the missing wiring ✅ step-2 token and step-4 branch, with the §6f precedent to copy
    Skills without a verdict algorithm 18/19 skipped, no error (AC-5)
    Duration 1s clean / 4s with a violation

    Human Confirmation:

    Yes, looks correct.

    This satisfies §11's execution-verification requirement for scripts/ changes; no Script Verification Override is claimed.


    Verified by /verify command

  8. added a commit that references this issue on Jul 28, 2026
  9. admarble commented on Jul 29, 2026

    @admarble
    ContributorAuthor

    QA Re-review for Issue #834 — gaps closed

    Commit: e7df3d5d (merge of origin/main #837) · follow-up to the prior QA

    All three gaps the prior pass left open are fixed. Both behavioral ones were measured, not reasoned about — and the measurement overturned one of my own conclusions.

    Correction to the prior QA

    I recorded trailing-prose misattribution as "fail-safe, acceptable — errs toward NEEDS_VERIFICATION, never toward a false READY_FOR_MERGE." Measuring it showed that was wrong on the facts: of 9 attributions across an 18-issue corpus, 5 were misattributions, including a | AC-7 | … | coverage row credited to AC-8 and a | AC-4 | … | row credited to AC-6. Crediting a PENDING to the wrong AC is not fail-safe — it sends the reader to the wrong requirement. Old precision was 4/9. Fixed: all 4 true positives survive (including #819's AC-4 and #795's two real Manual Test markers), all 5 false positives gone.

    AC Coverage (re-verified)

    AC Status Change since prior QA
    AC-1 MET unchanged — /verify now records both exit paths
    AC-2 MET unchanged
    AC-3 MET unchanged
    AC-4 MET unchanged — Lint skill gates → success
    AC-5 MET unchanged
    AC-6 MET strengthened — attribution now correct, not merely non-empty
    AC-7 MET re-verified post-merge: 44/44 synced
    AC-8 MET 2 further mutations recorded

    Coverage: 8/8 · 0 NOT_MET, 0 PARTIALLY_MET, 0 PENDING

    Gate status

    Gate Prior Now
    Execution Evidence (§6/§11) Complete, but no /verify Complete — /verify evidence posted, no §11a override claimed
    Detection Pattern (§6c) Passed Passed — corpus re-run after the scope + portability fixes
    Adversarial Re-Read (§6d) Gaps Found Clean — the three gaps are closed and each is now gated by a lint check, not just fixed
    Trust-Boundary (§6f) Clean Clean
    CHANGELOG (§10a) Present Present — merge conflict resolved keeping both #837 and #834 entries

    Why §6d is now Clean

    Each fix would otherwise have been silent if later undone, so both new properties got their own lint gate rather than a comment:

    • parseAcScopeResetClause() — removing the scope-reset clause fails the build.
    • findUppercaseInAwkPattern() — an uppercase literal matched against tolower($0) can never fire; reintroducing Manual Test fails the build instead of silently dying.

    Mutation-verified: each produces its own named violation. 37 tests (was 33).

    Suite status — flagged, not buried

    Full suite on the merged branch: 213/213 files, 4428 passed, exit 0.

    Two earlier full runs showed 3–6 intermittent failures — precheck CLI, semgrep, tui/load, lock-manager, scrollback-harness, tautology-detector-cli. Never the same set twice; all pass in isolation (78/78); main at f6aa25ca ran fully green in one sample. All are subprocess- or lock-heavy. 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. I did not attempt to fix pre-existing flakiness — out of scope, and widening tolerances is the wrong move per feedback_flaky_test_fixes. Worth a follow-up issue if it recurs on CI.

    Risk Assessment

    • Likely failure mode: unchanged — the lint parses /qa's own prose; a large reformat changes a parse shape. Fail-loud converts that into a noisy build, not a blind gate.
    • Not tested: that a Failed status actually yields AC_NOT_MET at runtime — LLM prompt-following, not code; same limit as every §7 gate.
    • New surface: the awk program grew from 1 clause to 4. Mitigated by three lint gates over it (both patterns + the scope clause) and 5 behavioral tests over the declaration forms.
    • Sibling sites: qa remains the only skill with a verdict algorithm (19 SKILL.md files checked).

    Verdict: READY_FOR_MERGE

    All 8 ACs met and independently re-verified, all three prior gaps closed and each gated against silent regression, /verify evidence recorded, CHANGELOG merged cleanly, suite green.

    The prior AC_MET_BUT_NOT_A_PLUS was justified by §6d Gaps Found. Those gaps are closed, so the floor lifts.

  10. added
    ready-for-review
    and removed
    needs-improvement
    on Jul 29, 2026
  11. admarble commented on Jul 29, 2026

    @admarble
    ContributorAuthor

    Same defect class found in TypeScript code, not just skill prose (#837)

    While closing out #837 I hit this issue's exact failure mode outside SKILL.md, which suggests the framing here is narrower than the problem.

    What happened

    #837 moved the "is this issue already done" predicate into a shared isCompletedIssueStatus (src/lib/workflow/completed-status.ts) and pointed the non-chain pre-flight guard in run-orchestrator.ts at it. completed-status.test.ts pins the predicate's behavior in both directions.

    Mutation-testing the change: reverting the orchestrator's call site back to its pre-#837 inline status === "ready_for_merge" || status === "merged" pair compiled clean and failed nothing in the entire suite.

    That is §2h's shape exactly — enforcement that exists and is correct, consulted by nobody, with no signal when the wiring is cut. The only difference is the medium. §2h declares a gate in prose that §7 never evaluates; here a predicate is declared in TypeScript that the orchestrator could stop calling. Both are invisible to types, build, and tests.

    It also matches this issue's stated lineage: #305 (force?: boolean runtime-checked but never CLI-registered), #795 (--qa-gate parsed but inert), #810 (reuseWorktrees declared with a behavior-promising doc comment and no consumer). Those are all TypeScript, not prose. The recurring defect is "declared enforcement with no consumer," and SKILL.md is one of its media, not the root. Worth deciding explicitly whether AC-1's lint stays qa/SKILL.md-scoped or whether the invariant is stated once and applied to both media — I'd lean toward keeping this issue's scope as-is and noting the generalization, since the two need different detection mechanisms.

    I closed my instance the way this issue's References suggest: a source-text guard (src/lib/workflow/non-chain-skip-guard.test.ts) following the run-options-dead-surface.test.ts pattern, scoped to the guard region rather than the whole 1,700-line file, with @tautology-skip justified by the recorded mutation.

    Two corrections to this issue's Out-of-scope block

    The prose-gate mutation harness … the convention that gate tests ship with a recorded mutation result is being adopted as a CLAUDE.md line instead, and a harness should wait for a third such test.

    Both halves of that deferral need updating:

    1. The "third such test" trigger is now at 2 of 3. The source-text gate tests carrying a recorded mutation result are:

    # Test Issue
    1 src/lib/workflow/run-options-dead-surface.test.ts #810
    2 src/lib/workflow/non-chain-skip-guard.test.ts #837

    Flagging a miscount so nobody repeats it: run-renderer-624.test.ts and run-renderer-672.test.ts also carry @tautology-skip, which makes a naive grep -l @tautology-skip return four. They are not members of this set — their pragma is for helper-indirection in ordinary behavior tests (makeTTY/makeNonTTY construct real renderers the detector's imported-name scan doesn't follow), not for asserting on source text. Counting by pragma over-reports; the discriminator is whether the file readFileSyncs a .ts source and asserts on its text.

    2. The CLAUDE.md line has not landed. grep -i "mutation\|gate test" CLAUDE.md returns nothing on f6aa25c. So the harness is currently deferred to a convention that does not yet exist, which means neither mechanism is in force. If the intent stands, the CLAUDE.md line is a one-liner and worth landing independently of this issue — otherwise the third such test will ship with no rule to follow and the deferral quietly becomes a drop.

    Suggested addition

    No change to this issue's existing ACs. Optionally:

    • Land the CLAUDE.md convention line the Out-of-scope block defers to, so the deferral rests on something real.
    • Note in the Out-of-scope block that the trigger is at 2/3 with the two members named, so the count survives a grep that over-reports.

    Refs: #837 / PR #839 (f6aa25c) — the mutation result and the guard test.

  12. added a commit that references this issue on Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementno-browser-testqaready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions