Skip to content

fix(#808): parse bold AC markers that have no colon - #809

Merged
admarble merged 1 commit into
mainfrom
feature/808-fix-ac-parser-ac-1-desc-bold-id-no-colon-silen
Jul 25, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/808-fix-ac-parser-ac-1-desc-bold-id-no-colon-silen

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

All four patterns in src/lib/ac-parser.ts required a colon attached to the AC identifier, so - [ ] **AC-1** Description — bold identifier, no colon — matched nothing and extractAcceptanceCriteria() returned an empty set.

It failed silently. No warning, no error, no "0 ACs parsed". Downstream: zero acceptance criteria in .sequant/state.json, an empty AC coverage table in /qa, and nothing for the /spec AC linter to lint. A run could complete having verified nothing.

Found while running /fullsolve 803 — that issue's five ACs were authored exactly this way and parsed as zero. It was caught only because /spec happens to print the parsed count; the body was normalized by hand to unblock state tracking.

Adds a fifth pattern:

/^-\s*\[[x\s]\]\s*\*\*([A-Za-z]+-?\d+)\*\*:?\s*(.+)$/gim

AC Verification

AC Description Status Evidence
AC-1 - [ ] **AC-1** Description extracts with id AC-1 and correct description ✅ Implemented ac-parser.ts:55-71; test "should parse bold AC markers with no colon"
AC-2 Same for **B2** and for checked boxes - [x] **AC-1** ✅ Implemented Tests "should parse the no-colon letter-number form" and "should parse a checked box with a no-colon bold marker". [A-Za-z]+-?\d+ covers the no-hyphen form without a second pattern
AC-3 All four existing colon-bearing formats parse unchanged ✅ Implemented All 20 pre-existing ac-parser.test.ts cases pass untouched; the new pattern cannot steal them (it requires ** immediately after the digits, which a **AC-1:** line does not have)
AC-4 A bold token that is not an identifier is still not extracted ✅ Implemented Test "should not treat a non-identifier bold label as an AC" covers **Note**, **Verify**, **TODO**. The \d+ requirement is what excludes them
AC-5 Unit tests cover each new format plus #803's body verbatim ✅ Implemented 6 new cases, including "should parse issue #803's body verbatim (regression fixture)" with the body copied unmodified as originally authored

Bonus beyond the ACs: the trailing :? also absorbs a colon placed outside the bold (- [ ] **AC-1**: Description), which would otherwise land in the description as a leading ": ". Covered by its own test.

Scope note

Deliberately limited to the bold form. A bare - [ ] AC1 something is genuinely ambiguous against ordinary checklist prose, and matching it would trade a silent miss for silent false positives — a worse failure mode than the one being fixed. Stated in a code comment at the pattern.

Sibling-site scan

ac-parser.ts is the only checkbox-based AC extractor in the codebase. The other AC-\d+ matchers were checked and none share this defect:

Site Pattern Verdict
phase-executor.ts:221 /^\s*|\s*\*?\*?AC-\d+/ Markdown table rows, not checkboxes — different corpus
qa/SKILL.md:2330 awk '/^(#+ AC-[0-9]+|\*\*AC-[0-9]+)/' Already colon-agnostic
scripts/qa/precheck.ts:207 /AC-\d+/g Bare ID extraction, colon-agnostic
exec/SKILL.md:355, qa/SKILL.md:635 grep -E '|[^|]+|\s*AC-[0-9]+:' Reads the derived ACs table that /spec itself generates with a colon — not user-authored text

Test plan

  • npm run build — passes
  • npm run lint — passes (0 warnings)
  • npx vitest run src/lib/ac-parser.test.ts — 26 passed (20 pre-existing + 6 new)
  • AC-adjacent suites (ac-linter, scope) — 129 passed
  • Full npm test — 191 files, 4048 passed, 1 expected fail, 2 skipped, 0 failures
  • Regression value verified: with the new pattern removed, 5 of the 6 new tests fail. The sixth is the over-match guard, which correctly passes both ways.

Closes #808

🤖 Generated with Claude Code

All four AC_PATTERNS required a colon attached to the identifier, so
`- [ ] **AC-1** Description` — a very common authoring style — matched
nothing and extractAcceptanceCriteria() returned an empty set.

It failed silently: no warning, no error, just zero ACs in state.json, an
empty AC coverage table in /qa, and nothing for the /spec AC linter to lint.
A run could complete having verified nothing. Hit on #803, whose five ACs
were written exactly this way; caught only because /spec printed the count.

Adds a fifth pattern covering the bold-no-colon form. It also handles the
no-hyphen identifier (**B2**), checked boxes, and — via a trailing optional
colon — `**AC-1**: Description` where the colon sits outside the bold.

Scope is deliberately limited to the bold form. A bare `- [ ] AC1 something`
is ambiguous against ordinary checklist prose, so matching it would trade a
silent miss for silent false positives. The `\d+` on the identifier keeps
`**Note**` / `**Verify**` / `**TODO**` out, guarded by its own test.

Tests: 6 new cases including #803's body verbatim as a regression fixture.
5 of the 6 fail without the new pattern; the sixth is the over-match guard,
which must pass both ways. All 20 pre-existing cases unchanged.
@admarble
admarble merged commit b0e71b7 into main Jul 25, 2026
5 checks passed
@admarble
admarble deleted the feature/808-fix-ac-parser-ac-1-desc-bold-id-no-colon-silen branch July 25, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ac-parser): - [ ] **AC-1** Desc (bold ID, no colon) silently parses as zero ACs

1 participant