Repository navigation
feat(#939): mutation-verification becomes a parseable /qa §6i gate - #949
Merged
admarble merged 6 commits intoAug 15, 2026
Merged
Conversation
- parseMutationMarkers/classifyMutationMarker parse SEQUANT_MUTATION PR-body markers (flat-JSON idiom, mirrors SEQUANT_SPEC/SEQUANT_PHASE) - isGateTestEvidence classifies which ACs are gate-test ACs per the CLAUDE.md definition - /qa §6i wires mutation_verification_status into the §7 verdict algorithm: Missing caps AC_MET_BUT_NOT_A_PLUS, Failed floors AC_NOT_MET - scripts/lint-skill-gates.ts reports zero I1-I4 violations against the wired skill (structural coverage, no code changes needed)
"floors the verdict at" didn't match the VERDICT_FLOOR_PHRASES list
("floor the verdict at"), so I1 silently never evaluated §6i.
Mutation-verified: AC-4 — deleted §7's mutation_verification_status
step-2 token and both step-4 branches (Failed, Missing); confirmed
`npx tsx scripts/lint-skill-gates.ts` reports an I1 violation naming
§6i, and mutation-verification-skill.test.ts's dedicated wiring
assertions fail (3 of 10 tests); restored both, suite green again.
…estore The prior wording-fix commit only updated skills/ and templates/skills/ qa/SKILL.md — canonical .claude/skills/qa/SKILL.md still had the stale "floors the verdict at" wording, because an earlier `git checkout --` used to restore a dogfood mutation reverted the canonical copy to HEAD before the wording fix was committed, silently discarding it there while the already-synced mirrors kept the fix. Caught by __tests__/integration/skill-sync.integration.test.ts. npx tsx scripts/check-skill-sync.ts now reports 44 synced, 0 diverged.
- scripts/qa/backtest-mutation-gate.ts backtests the gate-test-AC population against merged PRs' Pre-PR AC Verification tables, modeled on scripts/spec/measure-corpus.ts's harvest() pattern - CLAUDE.md's testing rule now names the Mutation-verified: / SEQUANT_MUTATION marker format as the required record form - CHANGELOG [Unreleased] entry for the feature Real run against the last 20 merged PRs (only 3 carry a Pre-PR AC Verification table): 7 in-scope gate-test ACs, 100% Missing (expected — none predate this feature). Sizes the authoring burden for the scope-widening decision the issue leaves to a human.
Closed
6 tasks
…utation-verification-becomes-a-parsea # Conflicts: # CHANGELOG.md
- isGateTestEvidence: add a manual-review negative-signal guard so evidence like "reviewed manually, fixture exists in the demo env" no longer false-positives as a gate-test AC just because it mentions a gate-test keyword. Named QA finding, now regression-tested. - parseMutationMarkers: add an overload — given a second diffTestFiles argument, the same function now both parses AND rejects (attaches a "valid"/"test_not_in_diff" classification per marker), making it literally the rejecting entry point AC-3 describes, without losing the one-argument parser-only form's independence from a git-diff dependency. classifyMutationMarker stays exported for standalone use. - Updated /qa §6i's "How to perform" step 2 to demonstrate the single-call form across all 3 skill mirrors; re-synced, lint-skill- gates.ts still reports zero violations.
admarble
deleted the
feature/939-feat-qa-mutation-verification-becomes-a-parsea
branch
August 15, 2026 04:55
6 tasks
2 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
<!-- SEQUANT_MUTATION: {"ac":"AC-N","mutation":"...","failedTest":"..."} -->PR-body marker.src/lib/workflow/mutation-marker.ts—parseMutationMarkers/classifyMutationMarker/latestMutationMarkerPerAc, flat-JSON idiom mirroringSEQUANT_SPEC/SEQUANT_PHASE.src/lib/ac-parser.ts—isGateTestEvidenceclassifies which ACs are gate-test ACs per the CLAUDE.md definition (fixture/section/flag/mutation-verified language)./qagains §6i "Mutation Verification": for any gate-test AC,Missingcaps the verdict atAC_MET_BUT_NOT_A_PLUSandFailed(a marker naming a test absent from the diff) floors it atAC_NOT_MET. Wired into §7's verdict algorithm, required in both Simple Fix and Standard QA modes, across all 3 skill-mirror dirs.scripts/qa/backtest-mutation-gate.ts— AC-5's backtest against the last 20 merged PRs.Pre-PR AC Verification
/qa§7 collectsmutation_verification_statusfromSEQUANT_MUTATIONmarkers, statuses Verified/Missing/Failed/Not-Applicablesrc/lib/__tests__/mutation-verification-skill.test.ts(10 tests: section presence, §7 step-2 token, both step-4 branches, ordering, both-mode checklist/template membership,lintSkillGateszero-violations)Missingcaps atAC_MET_BUT_NOT_A_PLUS,Failedfloors toAC_NOT_METFailedsits among the hard floors, before the soft-fail chainparseMutationMarkers(prBody)exists, rejects markers naming absent testssrc/lib/workflow/mutation-marker.test.ts(15 tests). Updated per QA:parseMutationMarkersnow takes an optional seconddiffTestFilesargument — given it, the same function both parses AND rejects (attaches a"valid"/"test_not_in_diff"classification to each marker), so the function named in the AC literally does the rejecting, not a separately-named siblingscripts/lint-skill-gatescovers the new gate so it cannot regress to unreachableCLAUDE.md's testing section points at the marker formatCLAUDE.mddiff — testing bullet now names theMutation-verified:/SEQUANT_MUTATIONmarker formatisGateTestEvidenceheuristic has unit tests covering true-positive and true-negative real evidence textsrc/lib/ac-parser.test.ts— true positives use this issue's own AC-1/AC-4 evidence text verbatim; true negatives use AC-3/AC-5's prose evidence text verbatim. Updated per QA: added a manual-review negative-signal guard (mutation-verified below) so evidence like "reviewed manually, fixture exists in the demo env" no longer false-positivesMutation-verified: AC-4
Deleted §7's
mutation_verification_statusstep-2 token declaration and both step-4 branches (Failed,Missing) from.claude/skills/qa/SKILL.md. Confirmed two independent things broke:npx tsx scripts/lint-skill-gates.tsreported an I1 violation naming §6i ("declares a verdict floor... but no §7 step-2 status token is attributed to Section 6i... The gate can never fire").mutation-verification-skill.test.ts's dedicated wiring assertions failed (3 of 10 tests).Restored both;
npx tsx scripts/lint-skill-gates.tsreports zero violations again, full suite green.The same mutation and restore also validates AC-1 (the §7 step-2 token declaration) and AC-2 (both step-4 branches) — one mutation, three ACs' wiring, since all three assert on the same
mutation_verification_statusplumbing. Recorded as separate markers per this issue's own one-line-per-AC format:Mutation-verified: AC-1 — removed §7's
mutation_verification_status = status from Section 6istep-2 declaration;mutation-verification-skill.test.ts > §7 step 2 declares mutation_verification_status attributed to Section 6ifailed; restored.Mutation-verified: AC-2 — removed §7's
mutation_verification_status == "Failed"and== "Missing"step-4 branches;mutation-verification-skill.test.ts > §7 step 4 floors 'Failed' at AC_NOT_METand> §7 step 4 caps 'Missing' at AC_MET_BUT_NOT_A_PLUSboth failed; restored.Note on a real gap this dogfooding caught: the first wiring pass used "floors the verdict at" in §6i's prose, which does not match
lint-skill-gates.ts'sVERDICT_FLOOR_PHRASESlist ("floor the verdict at", no trailings) — so the generic I1 structural check silently never evaluated §6i at all, regardless of whether it was wired correctly. Caught only by actually running the dogfood mutation and seeing "No violations" when a violation was expected. Fixed the wording to match exactly; re-ran the mutation, which now correctly fails. A second issue surfaced during that fix: an interruptedgit checkout --restore reverted the canonical.claude/skills/qa/SKILL.mdcopy to the pre-fix wording while the already-syncedskills//templates/skills/mirrors kept the fix, producing a real 3-way divergence — caught by__tests__/integration/skill-sync.integration.test.tson the next full suite run, not by manual inspection. Both are fixed and verified in the commit history.QA Follow-up: both flagged gaps fixed
The initial
AC_MET_BUT_NOT_A_PLUSQA review named two non-blocking gaps. Both are fixed:Gap 1 — AC-3's literal wording vs. the shipped two-function split.
parseMutationMarkers(prBody)now has an overload: given a seconddiffTestFilesargument, it returns each marker with aclassificationfield ("valid"or"test_not_in_diff") computed inline — the same function AC-3 names now does the rejecting itself, not a separately-namedclassifyMutationMarker. The one-argument form is unchanged (still parser-only, no git-diff dependency, existing tests untouched);classifyMutationMarkerstays exported for callers that already have a diff-test-file list and want to classify a single marker (e.g. the backtest script)./qa§6i's "How to perform" step 2 now demonstrates the single-call form.Gap 2 —
isGateTestEvidence's false-positive surface. AddedMANUAL_REVIEW_NEGATIVE_SIGNALS— a short list ("reviewed manually","manual review","human review","manually verified","manually confirmed") checked first and short-circuiting tofalsebefore the positive keyword match runs. QA's exact named scenario,"reviewed manually, fixture exists in the demo env", is now correctly classifiedfalse.Mutation-verified: AC-7 (the negative-signal guard) — removed the
MANUAL_REVIEW_NEGATIVE_SIGNALSshort-circuit block fromisGateTestEvidence;ac-parser.test.ts > isGateTestEvidence > should return false for a manual-review attestation that mentions a gate-test keywordand the sibling'human review'test both failed (2/66); restored.Full suite re-verified green after both fixes: 266 test files, 5466 passed (7 more than the initial pass — the new regression tests), build/lint/
lint-skill-gates.ts/check-skill-sync.tsall clean.Backtest (AC-5)
npx tsx scripts/qa/backtest-mutation-gate.ts --limit 20— fetched the last 20 merged PRs, extracted each PR's## Pre-PR AC Verificationtable, appliedisGateTestEvidenceto the Evidence column, checked for aSEQUANT_MUTATIONmarker.100% Missing is the expected finding — none of these PRs predate this feature. The honest finding worth flagging: only 3 of 20 merged PRs actually carry the
## Pre-PR AC Verificationtable format at all — most historical PRs use free-form summaries instead, so the backtest's population is smaller than "20 PRs" suggests. The authoring-burden signal is 7 gate-test ACs across 20 PRs — a light load, supporting the spec plan's recommendation to ship gate-test-only scope for v1 rather than widening to all declared-evidence ACs immediately.Scope decision (issue's own "Human decisions required")
Shipped gate-tests-only scope (
isGateTestEvidence), not all declared-test-Evidence ACs, per the spec plan's recommendation — confirmed reasonable by the backtest's low volume (7 ACs). Widening to all declared-evidence ACs is a follow-up if the authoring burden argument changes.Test plan
npm run build— cleannpm run lint— cleannpm test— 266 test files, 5466 passed, 1 expected fail (pre-existing), 2 skippednpx tsx scripts/lint-skill-gates.ts— zero violationsnpx tsx scripts/check-skill-sync.ts— 44 synced, 0 divergedghdata (see above)Pre-PR Confidence Check
isGateTestEvidenceis still a static keyword list (now with a negative-signal override, not a semantic classifier) — it can still under-fire on gate-test phrasing that uses none of its trigger words, or in principle over-fire on unanticipated phrasings the negative-signal list doesn't cover. The QA-named false-positive scenario is now fixed and regression-tested; this is a residual, narrower version of the same class, not a new gap.classifyMutationMarker's diff-test-file matching is a simple filename/suffix match (file === namedFile || file.endsWith('/'+namedFile)) — it doesn't validate that the named test file was actually modified in a way relevant to the claimed mutation, only that it exists in the diff's test-file list. Accepted: catching an outright-fabricated marker (a nonexistent file) is the feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939 scope; validating the semantic connection between mutation and test would need actually running the mutation, which is explicitly a Non-Goal in the issue ("no automated mutation-testing framework").Closes #939
🤖 Generated with Claude Code