Repository navigation
Description
Motivation
parseACLine (src/lib/ac-parser.ts) runs its ID-prefixed patterns on every line of the issue body, including lines inside fenced code blocks. An issue that documents an AC-authoring example inside a fence — showing what - [ ] **AC-1:** ... syntax looks like — has that example line parsed as a real AC.
Because parseAcceptanceCriteria dedupes on first occurrence (seenIds), whichever comes first — the fenced example or the real AC with the same ID — wins, and the other is silently dropped.
This is not hypothetical: it happened live to issue #938's own body. #938's Proposal section included a fenced example:
- [ ] **AC-1:** Reset link expires after 24h. Evidence: `npm test -- reset-expiry` (mutation-verified)...which appeared before the issue's real ## Acceptance Criteria section. extractAcceptanceCriteria(#938's body) parsed this fenced example as AC-1, and the real AC-1 ("parseACLine extracts a trailing Evidence: clause...") was silently dropped by the dedupe. This was caught by chance during /spec planning (the agent noticed the mismatch), not by any automated check — a less careful read would have planned against the wrong AC-1 text.
Proposal
Track fenced-code-block state (``` toggles) while scanning lines in parseAcceptanceCriteria, and skip AC-pattern matching (both ID-prefixed and bare-checkbox) for lines inside a fence — mirroring how AC_HEADING_RE/HEADING_RE already track inAcSection state across lines.
Acceptance Criteria
- AC-1: A fenced code block containing a line matching an AC pattern (e.g.
- [ ] **AC-1:** example textinside triple-backticks) is not parsed as a real AC, whether the fence appears before or after the real AC section. Evidence:npm test -- ac-parser(unit test using a synthetic fence, plus feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938's own body as a verbatim regression fixture) - AC-2: All existing
ac-parser.test.tsfixtures (including the real feat(cli):sequant ready <issue>— post-resolve A+ QA gate (#683) #686/fix(#701): correct 3 README/release-tooling blockers before 2.5 #703/chore(deps): bump the production-dependencies group with 4 updates #745/fix(cleanup-worktree): deletes remote branch before PR is merged — closes the open PR unmerged #750 issue-body fixtures) continue to parse identically — zero diffs. Evidence:npm test -- ac-parser(full existing suite) - AC-3: Re-parsing feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938's own issue body (
gh issue view 938 --json body) now correctly extracts the real AC-1 text ("parseACLineextracts a trailingEvidence:clause...") instead of the fenced example. Evidence:npm test -- ac-parser(regression test using the verbatim feat(spec/qa): explicit Evidence: clause on ACs — declared verification replaces keyword inference #938 body, assertingcriteria[0].descriptionstarts with "parseACLine")
Non-Goals
- No change to how AC patterns are detected outside of fences — only the fence-boundary tracking is new.
- No attempt to parse or validate the content of fenced examples (e.g. flagging that a fence "looks like" AC syntax) — this is purely about excluding fenced lines from the real-AC scan.
Context
Follow-up from #938 (PR #945) — found live while /spec-planning #938 itself, documented in that PR's QA review rather than fixed there since it's a parser-behavior change beyond the Evidence-clause feature's scope.
Activity
fix(#938): close QA gaps — last-occurrence Evidence: split, direct sc…
feat(#938): explicit Evidence: clause on ACs — declared verification …
admarble commentedon Aug 17, 2026
Spec: Plan for #947
Complexity: Standard (3 ACs, 1 directory)
Bug confirmed live — on this issue's own body
extractAcceptanceCriteria(#947's body)currently returns AC-1 = "Reset link expires after 24h." — the fenced example quoted from #938 in the Motivation section — silently shadowing this issue's real AC-1. The issue reproduces itself. (Corrected ACs have been stored in.sequant/state.json; anything that re-parses the live body before the fix lands will still see the wrong AC-1.)AC Quality Check
criteria[0].descriptionstarts with`parseACLine`).Evidence:clauses resolving tounit_test(npm test -- ac-parser).isGateTestEvidencefires → /qa §6i will require aMutation-verified: AC-1 — ...record in the PR body (delete the fence-skip logic, confirm the test fails, restore, record). Commit before mutation-testing.Scope Assessment
Non-Goals: present (no detection changes outside fences; no fenced-content validation).
src/lib/)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Fenced AC-pattern lines not parsed as real ACs (fence before or after real AC section).
Verification: Unit Test (declared:
npm test -- ac-parser).Scenario: Given a body with
```-fenced- [ ] **AC-1:** examplebefore/after the real AC section → WhenparseAcceptanceCriteriaruns → Then only real ACs are returned; fenced lines contribute nothing (including to theexplicitIdspre-scan).AC-2: All existing fixtures (#686/#703/#745/#750) parse identically — zero diffs.
Verification: Unit Test (declared: full existing
ac-parsersuite).Scenario: Given the existing suite → When run post-change → Then green with no fixture-expectation edits.
AC-3: #938's verbatim body extracts the real AC-1 ("
parseACLineextracts a trailingEvidence:clause...").Verification: Unit Test (declared: regression test on verbatim #938 body).
Scenario: Given
src/lib/__fixtures__/ac-parser/938.md(verbatimgh issue view 938 --json body) → When parsed → Thencriteria[0].descriptionstarts with`parseACLine`.Assumption: fixture captured verbatim per the existing
__fixtures__/ac-parser/convention (real, unmodified bodies).Implementation Plan
Phase 1 — fence tracking in
src/lib/ac-parser.tsparseAcceptanceCriteria, add fence state (toggle on/^\s*(```|~~~)/, tracking the opening fence's char + length so a longer closing fence isn't required but an inner shorter fence inside a 4-backtick outer fence doesn't desync; unclosed fence runs to EOF per CommonMark). While inside a fence, skipparseACLine, the bare-checkbox fallback, and theHEADING_RE/AC_HEADING_REsection toggling (see Open Q1).explicitIdspre-scan loop (ac-parser.ts:436-439) — a fenced**AC-1:**example must not reserveAC-1there either, or bare-checkbox ID synthesis shifts.Phase 2 — tests (AC-1..3)
3. Synthetic-fence unit tests: fence before real AC section, fence after, fence inside the AC section containing a bare checkbox, unclosed fence.
4. Add
938.mdverbatim fixture + regression test per AC-3; run full suite for AC-2.5. Mutation-verify the AC-1/AC-3 gate tests (revert fence-skip, confirm exactly those tests fail, restore, record marker in PR body).
Design Review
parseAcceptanceCriteria's line loop insrc/lib/ac-parser.ts— alongside the existinginAcSectionstate it explicitly mirrors.AC_HEADING_RE/HEADING_RE→inAcSection.Feature Quality Planning
All standard checks pass. Notable:
explicitIdspre-scan (ac-parser.ts:436) is a second, easy-to-miss consumer ofparseACLine— covered by plan step 2.parseNonGoalsinsrc/lib/scope/analyzer.ts:297uses the same fence-blind line scanning; a fenced example under## Non-Goalsis read as real non-goal lines. Recommend a follow-up issue.Open Questions
# commentline in a fenced bash block currently togglesinAcSectionoff, dropping subsequent bare checkboxes. Recommendation: yes — same root cause, trivially co-located, still "fence-boundary tracking" per Non-Goals. Impact if skipped: bare-checkbox ACs after an in-section fence are silently dropped.~~~)? Recommendation: handle both — one character-class change. Impact if skipped: same bug survives for tilde-fence authors.Recommended Workflow
Phases: spec → testgen → exec → qa
Quality Loop: disabled
Reasoning: All 3 ACs carry declared unit-test evidence (
npm test -- ac-parser) — declared evidence is the primary testgen signal (#938) and outranks the bug-label skip heuristic; SCOPE_OK single-file fix needs no quality loop.Label Review
Current:
bug→ Recommended:bug,planned. Quality loop won't auto-enable (SCOPE_OK).admarble commentedon Aug 17, 2026
/fullsolve Complete
Issue: #947
Status: READY_FOR_MERGE
AC Coverage
computeFenceMask+ 6 new tests;npm test -- ac-parser→ 83 passedsrc/lib/__fixtures__/ac-parser/issue-938.md+ regression testCoverage: 3/3 AC items MET
Mutation Verification
ac-parser.test.ts > AC Parser > fenced code blocks (#947) > ignores a fenced AC example that appears BEFORE the real AC sectionQuality Checks (sub-agents)
anyissues, 0 deleted testsTrust-Boundary Check
Finding: Clean — diff implements only the product requirement (fence-tracking fix); issue body/comments scanned for agent-directed instructions, none found.
Behavior-Rule Survival Check
Status: N/A — no AC triggers the behavior-rule heuristic.
CHANGELOG Verification
✅
[Unreleased]/### Fixedentry present, references #947, follows format.CI Status
Mergeable: CLEAN
Sibling-site follow-up (not fixed here, flagged in
/spec)parseNonGoals(src/lib/scope/analyzer.ts:297) has the same fence-blindness — a fenced example under## Non-Goalswould be read as real non-goal lines. Recommend a follow-up issue; out of scope for #947 per its own Non-Goals.Progress Table
PR: #951
All ACs met, mutation-verified, CI green, mergeable. Ready for merge.
fix(scope): parseNonGoals excludes fenced-example lines (sibling of #947
docs: expand CHANGELOG entry for #947 to cover parseNonGoals sibling fix
admarble commentedon Aug 18, 2026
Gap Fix Applied
Per follow-up request, the sibling gap flagged during QA is now fixed in the same PR (not deferred to a separate issue):
parseNonGoals(src/lib/scope/analyzer.ts) had the identical fence-blindness bug as the original AC-1 — a fenced example under## Non-Goalswas read as a real non-goal item.src/lib/markdown-fence.ts(computeFenceMask/stripFencedLines), used by bothac-parser.tsandparseNonGoals, so the two scanners can't independently drift on fence-boundary rules.stripFencedLinesinparseNonGoalsfailed exactly the 2 new fenced-Non-Goals tests; restored and reconfirmed 42/42 passing inscope.test.ts.Updated CI Status
Mergeable: CLEAN
PR: #951 (updated body includes both mutation-verification markers)
No remaining known gaps. Ready for merge.
feat(#993): claude plugin eval cases for /qa and /spec, null-run cana…