Repository navigation
fix(ac-parser): fenced code-block AC examples get parsed as real ACs (#947) - #951
Merged
admarble merged 4 commits intoAug 20, 2026
Merged
Conversation
3 tasks
) Extracts fence-tracking into shared src/lib/markdown-fence.ts, used by both ac-parser.ts and scope/analyzer.ts's parseNonGoals, which had the same fence-blindness bug flagged as a follow-up during #947's QA.
admarble
deleted the
feature/947-fix-ac-parser-fenced-code-block-ac-examples-ge
branch
August 20, 2026 05:01
7 tasks
5 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
parseAcceptanceCriterianow tracks fenced-code-block state (computeFenceMask) and excludes fenced lines from both the main AC scan and theexplicitIdspre-scan — an AC-authoring example shown inside a fence (```or~~~) is no longer parsed as a real AC.Evidence:-clause example that shadowed its real AC-1 under the parser's first-occurrence dedupe.#-prefixed line inside a fenced shell block no longer closes the AC section early (fixed alongside the primary bug — same fence-boundary root cause).scope/analyzer.ts'sparseNonGoalshad the identical fence-blindness bug — a fenced example under## Non-Goalswas read as a real non-goal item. Fence-tracking is now extracted into sharedsrc/lib/markdown-fence.ts(computeFenceMask/stripFencedLines) and used by bothac-parser.tsandparseNonGoals, so the two scanners can't independently drift on fence-boundary rules.Pre-PR AC Verification
src/lib/ac-parser.tscomputeFenceMask+ 6 new tests inac-parser.test.ts;npm test -- ac-parser→ 83 passednpm test -- ac-parser→ 83 passed, no fixture-expectation changessrc/lib/__fixtures__/ac-parser/issue-938.md(verbatim) + regression test assertingcriteria[0].descriptionstarts with`parseACLine`parseNonGoalsexcludes fenced example lines, same as AC-1src/lib/markdown-fence.test.ts(6 tests) + 2 new tests inscope/scope.test.ts;npx vitest run src/lib/scope/scope.test.ts→ 42 passedMutation Verification
Mutation-verified: AC-1 —
computeFenceMaskstubbed to unconditionally returnfalse(fence tracking disabled); exactly the 6 new fenced-code-block tests failed (nothing else), including the AC-1 synthetic-fence tests and the AC-3 #938 regression test; restored and re-confirmed 83/83 passing.Mutation-verified: AC-4 —
parseNonGoals'sstripFencedLines(issueBody)call replaced with the rawissueBody(fence-stripping disabled); exactly the 2 new fenced-Non-Goals tests failed (nothing else); restored and re-confirmed 42/42 passing inscope.test.ts.Test plan
npm test -- ac-parser— 83/83 passednpx vitest run src/lib/scope/scope.test.ts src/lib/markdown-fence.test.ts src/lib/ac-parser.test.ts— 131/131 passednpm test— 267 test files, 5491 passed, 1 expected fail, 2 skipped (zero regressions)npm run build— passesnpm run lint— passes (0 errors)Closes #947