Repository navigation
Description
What happens
classifyMutationMarker (src/lib/workflow/mutation-marker.ts:143) resolves a SEQUANT_MUTATION marker's failedTest by taking everything before the first > and matching it against the diff's test-file paths. A marker whose failedTest starts with a describe block or a bare test title classifies test_not_in_diff, and /qa §6i then reports aggregate Failed — the same status a fabricated marker gets — which floors the verdict at AC_NOT_MET.
Nobody tells the author. CLAUDE.md's marker template reads "failedTest":"..."; the exec skill never mentions SEQUANT_MUTATION in any of its three mirrors (.claude/skills/exec/SKILL.md, skills/exec/SKILL.md, templates/skills/exec/SKILL.md — 0 hits each); the only place the <file> > <name> form appears is the module's own doc comment at mutation-marker.ts:12.
Evidence (2026-09-18/19, one runner session)
| PR | Marker as written | Classified | Cost |
|---|---|---|---|
| #1091 (#1075) | "doctor probe timeouts (#1075) — all 3 cases" and "templates > templateDestination > …" |
test_not_in_diff ×2 |
AC_NOT_MET; PR-body fix; full QA re-run (~6 min opus) |
| #1103 (#1099) | "1099: a hanging gh makes checkAuthSync() …" |
test_not_in_diff |
QA flagged it; harmless only because isGateTestEvidence returned false for that AC |
| #1092 (#1071), #1102 (#1100) | "src/commands/init.test.ts > …" |
valid |
— |
Two of four gate-test PRs tripped it, one of them after a context comment on the issue spelled the prefix out. The mutation narratives in both bad cases were genuine; only the field format was wrong. A format defect that is indistinguishable from fabrication in the gate's output is the wrong failure mode.
Fix shape
CLAUDE.mdmarker template:"failedTest":"<test file path> > <describe> > <case>", with one sentence saying the path segment is what the gate resolves.- Exec skill (all three mirrors, kept byte-identical): a short "Recording the mutation result" step that shows the exact form and says to run §6i's
parseMutationMarkerscheck before opening the PR. Not taken (PLAN D-8): parked with a trigger — file it if a marker still classifies/qa§6i status table: distinguish Malformed from Failed.test_not_in_diffon a PR opened after this issue merges (OQ-7). This issue touches neither the qa skill normutation-marker.ts.
Release-graph plan — guard-2026-09 (2026-09-20)
Graph: guard-2026-09 Tier: mechanical Wave: 1
May touch: CLAUDE.md (marker template line), exec SKILL.md ×3 (byte-identical), one gate test in scripts/ (scripts/lint-skill-gates.test.ts or a new scripts/exec-skill-marker.test.ts); not the qa skill, not src/lib/workflow/mutation-marker.ts (#1095 owns it this wave)
The npm run build && npm test AC is verified by the runner from a clean shell after the PR opens (PLAN I-1); the agent runs only the test files its ACs name. Mutation markers use failedTest starting with the test file path (I-4). First in wave 1 because #1093 (wave 2) and #1094 (wave 3) edit the same exec-skill mirrors. Skill edits: I-3 applies.
Acceptance Criteria
- AC-1:
CLAUDE.md's marker template names the file-path prefix — Evidence:grep -c 'failedTest":"<test file path> >' CLAUDE.mdprints 1 - AC-2: the exec skill documents the marker in all three mirrors, byte-identical — Evidence:
grep -c "SEQUANT_MUTATION" .claude/skills/exec/SKILL.md skills/exec/SKILL.md templates/skills/exec/SKILL.md | grep -vc ":0$"prints 3, anddiff .claude/skills/exec/SKILL.md skills/exec/SKILL.md && diff skills/exec/SKILL.md templates/skills/exec/SKILL.md && echo SAMEprints SAME - AC-3: gate test — the exec skill's marker section exists and shows the
<file> >form — Evidence:npx vitest run scripts -t "exec skill documents the SEQUANT_MUTATION failedTest file prefix" 2>&1 | grep -E "Tests +[1-9][0-9]* passed"prints a passed line (scoped to the section between its heading and the next##, per CLAUDE.md's scoping rule) - AC-4:
npm run lint:skill-sync,npm run lint:skill-callsandnpm run lint:skill-gatesstill pass — Evidence: all three exit 0 in the PR test plan (edited 2026-09-20 by the runner: the issue namedlint:skills, a script that does not exist onorigin/main; these are the three real skill lint gates)
AC-3 is a gate test: mutation-verify (delete the section → the test fails) and record the marker — with the file-path prefix.
Out of Scope
Changing classifyMutationMarker's matching rule itself (file === namedFile || file.endsWith("/" + namedFile)); #1095's property tests cover the parser.
Activity
admarble commentedon Sep 20, 2026
Runner context — guard-2026-09 launch, 2026-09-20. Base:
origin/mainatda9ed6e8(2.16.0 plus the plan docs). These rules override the exec skill's defaults for this run:npm testin the worktree. Run only the test files this issue's ACs name. The runner runs the full suite once per PR from a clean shell. Undersequant runthe suite is not hermetic againstSEQUANT_*(bug(test): suite isn't hermetic against the SEQUANT_* env phases inject — exec sees red tests it didn't cause and opens no PR #1086), so a full run shows red files you did not cause.env -u SEQUANT_ORCHESTRATOR -u SEQUANT_WORKTREE -u SEQUANT_PHASE -u SEQUANT_ISSUE -u SEQUANT_RELAY -u SEQUANT_RELAY_FRAME npx vitest run <file>. If it is still red, the PR body names the issue number and the base-vs-head result for that test.<!-- SEQUANT_MUTATION: {"ac":"AC-N","mutation":"<what you deleted>","failedTest":"<test file path> > <describe> > <case>"} -->in the PR body.failedTestMUST start with the test file path, or the qa classifier reports it Failed. Commit before mutating.timeout.git commit -m "...", noCo-Authored-By. Never rebase or force-push after pushing. One AC per line in the PR body, idsAC-Nonly.Issue-specific: Only this issue edits the exec
SKILL.mdmirrors this wave (#1093 and #1094 wait on it). After editing,npm run lint:skill-syncmust stay 44/44 and no SKILL.md may contain the word relay (grep -il relay .claude/skills/*/SKILL.md skills/*/SKILL.md templates/skills/*/SKILL.mdprints nothing). Do not touch the qa skill orsrc/lib/workflow/mutation-marker.ts.admarble commentedon Sep 20, 2026
Complexity: Standard (4 ACs, 3 directories)
AC Quality Check
Every AC carries a runnable
Evidence:command and sits on one line, so the parser reads them intact. One defect:npm run lint:skills, and that script does not exist.package.jsondefineslint:skill-calls,lint:skill-gates,lint:skill-sync,lint:constitution-dodandlint, but nolint:skills. Run literally, it exits non-zero with "missing script". See Open Question 1.Scope Assessment
Non-Goals: The issue's
## Out of Scopesection names no changes toclassifyMutationMarker's matching rule. The "May touch" list also rules out the qa skill andsrc/lib/workflow/mutation-marker.ts(#1095 owns that file this wave). ✅CLAUDE.md, exec skill ×3 mirrors,scripts/)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1:
CLAUDE.md's marker template names the file-path prefixVerification: Integration Test (declared evidence: the
grep -cone-liner)Scenario: Given CLAUDE.md line 17 → When the template changes from
"failedTest":"..."to"failedTest":"<test file path> > <describe> > <case>"→ Thengrep -c 'failedTest":"<test file path> >' CLAUDE.mdprints 1Assumptions: The marker appears once in CLAUDE.md (verified: line 17 only), so the count is exactly 1. The Evidence pattern is a basic-regex
grep, and<,>and"are literals in BRE.AC-2: the exec skill documents the marker in all three mirrors, byte-identical
Verification: Integration Test (declared evidence: grep count +
diff)Scenario: Given the three exec mirrors are currently identical (md5
09c17afe…×3) → When one new section is added to.claude/skills/exec/SKILL.mdand copied withnpx tsx scripts/check-skill-sync.ts --fix→ Then each file has ≥1SEQUANT_MUTATIONhit and bothdiffs print SAMEAssumptions:
.claude/skills/is canonical (check-skill-sync.ts header)..agents/skillsis a symlink and is not a fourth mirror. No SKILL.md may contain the word "relay" (runner rule).AC-3: gate test, the exec skill's marker section exists and shows the
<file> >formVerification: Unit Test (declared evidence:
npx vitest run scripts -t "exec skill documents the SEQUANT_MUTATION failedTest file prefix")Scenario: Given the exec SKILL.md → When the test extracts the region from the "Recording the mutation result" heading to the next heading at the same or a higher level, skipping fenced blocks → Then that region contains
SEQUANT_MUTATIONand"failedTest":"<test file path> >; deleting the section fails exactly this testAssumptions: The test name must contain the exact
-tstring. The file runs in the vitestunitproject (5s timeout is fine for a file read).AC-4:
lint:skill-*gates still passVerification: Integration Test (both commands exit 0)
Scenario: Given the edited mirrors → When
npm run lint:skill-calls,npm run lint:skill-gates,npm run lint:skill-syncrun → Then all exit 0 (sync stays 44/44)Assumptions: See Open Question 1 on the
lint:skillsname.Implementation Plan
Phase 1: Docs (independent edits)
CLAUDE.md:17. Change the template to{"ac":"AC-N","mutation":"...","failedTest":"<test file path> > <describe> > <case>"}. Add one sentence:/qa§6i resolves only the path segment before the first>, and a describe-block name or bare test title classifiestest_not_in_diff, which floors the verdict atAC_NOT_MET..claude/skills/exec/SKILL.md. Add### Recording the mutation result (gate-test ACs)between### 3e2. Simulate QA Before PR(line 687) and### 3f. CHANGELOG Update(line 732). The section is placed before PR creation because the marker goes in the PR body. It contains:failedTestis a real path, e.g.scripts/exec-skill-marker.test.ts > exec skill documents … > <case>.>. A describe title, bare test name, or issue number as the first segment fails the gate. Say this plainly.}insidemutationorfailedTest. The extraction regex{[^}]+}stops at the first}, so a brace silently truncates the JSON. This is a second way to break the marker that is undocumented today.parseMutationMarkers(prBody, diffTestFiles)call from/qa§6i and confirm each marker printsvalid. Point at the qa skill rather than copying the snippet, so exec doesn't drift from qa.npx tsx scripts/check-skill-sync.ts --fix, then confirm the twodiffs.Phase 2: Gate test (depends on Phase 1)
scripts/exec-skill-marker.test.ts, oneit("exec skill documents the SEQUANT_MUTATION failedTest file prefix"). It reads.claude/skills/exec/SKILL.mdand extracts the region from the heading to the next^#{1,3}line, ignoring headings inside fences (the## Summaryin the PR heredoc must not end the region early;lint-skill-gates.ts'sparseSectionsalready handles fences, so reuse or mirror it). It asserts that the region containsSEQUANT_MUTATIONand"failedTest":"<test file path> >. Fail loudly if the heading is absent. Using a new file rather than extendinglint-skill-gates.test.tskeeps this test from being coupled to the qa-verdict fixtures there.<!-- SEQUANT_MUTATION: {"ac":"AC-3","mutation":"deleted the Recording the mutation result section from exec SKILL.md","failedTest":"scripts/exec-skill-marker.test.ts > exec skill documents the SEQUANT_MUTATION failedTest file prefix"} -->in the PR body. ThefailedTeststarts with the file path, and there is no}in the payload. Also try a second mutation that leaves the heading but drops the<file> >form, to prove the assertion is scoped to the region and not the whole file.npx vitest run scripts/exec-skill-marker.test.ts, the threelint:skill-*scripts,grep -il relay …(must print nothing), and the AC-1/AC-2 evidence commands. No fullnpm test(runner does that).Design Review
failedTest(issue Out of Scope, test(parsers): property-based and metamorphic tests with fast-check on ac-parser, parseQaSummary, and the marker parsers #1095 owns the file). Rejected: theMalformedstatus in qa §6i (D-8, parked with a trigger)..claude/skillscanonical,--fixto sync) and the "scope a file-reading assertion to the delimited region" rule in CLAUDE.md.Feature Quality Planning
All standard checks pass. Notable items:
}may appear in the marker payload. Add this to the exec section, since the classifier's failure for it would look like "no marker found".## …inside a code block ends the region early and the test passes or fails for the wrong reason.Open Questions
npm run lint:skillsdoes not exist (AC-4). Recommendation: read it as the three reallint:skill-*scripts (orlint:skill-gatesalone) and note that reading in the PR body. Impact if wrong:/qaruns the literal command, gets "missing script", and marks AC-4 unmet. The alternative is for the owner to edit AC-4's text to the real script names before exec.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Docs plus one gate test, mechanical tier.
testgenis skipped because AC-3's single test is specified above and stubs add nothing. No UI, no security surface.Label Review
Current: bug
Recommended: bug, docs
Reason: The change is documentation plus a gate test.
Quality Loop: Won't auto-enable (SCOPE_OK).
admarble commentedon Sep 20, 2026
Runner edit to AC-4 (2026-09-20). The qa phase found AC-4 unsatisfiable:
npm run lint:skillsis not a script onorigin/main(the real gates arelint:skill-sync,lint:skill-calls,lint:skill-gates). AC-4 now names those three; all three exit 0 on the branch. No code change implied. Recorded as a decision in PLAN §7.admarble commentedon Sep 20, 2026
Runner note for the qa phase (2026-09-20). Do not run the full
npm testin the worktree: under seven concurrent phase agents it exceeds the 30-minute no-progress wall and the phase is killed (this happened to the first qa run of this issue). The runner runs the full suite once per PR from a clean shell and records the result on the PR. Verify each AC by its own command, run only the test files the ACs name, and read the PR body's mutation marker withparseMutationMarkers. The PR is already open; do not push or rebase.admarble commentedon Sep 20, 2026
QA Verdict: READY_FOR_MERGE
AC coverage: 0/4 met
Gaps:
Suggestions:
scripts/exec-skill-marker.test.ts) with placeholder describe/case text. That's deliberate (the spec plan called for a real path so the prefix is concrete), and the sibling"mutation":"deleted the section"reads as a template, so it doesn't teach a false record.test(#1104): gate test also runs the documented example marker throug…
chore(#1104): merge origin/main
docs(#1104): state the SEQUANT_MUTATION failedTest file-path contract…