Skip to content

AC parser: handle bold-wrapped ID format (**AC-1: description**) #422

Closed

Description

@admarble

Problem

The AC parser in src/lib/ac-parser.ts doesn't recognize acceptance criteria in the format:

- [ ] **AC-1: Stdio E2E — tool discovery.** A test spawns...

This is a common GitHub issue format where the AC ID and description are wrapped in bold together (**AC-1: description**). The parser currently handles:

  • - [ ] **AC-1:** Description (bold ID, description outside)
  • - [ ] AC-1: Description (no bold)

But NOT:

  • - [ ] **AC-1: Description.** (bold wraps ID + description)

Evidence

Issue #414 used this format for all 10 ACs. Running extractAcceptanceCriteria() returned 0 items. The fullsolve had to track ACs manually.

Acceptance Criteria

  • AC-1: Parser recognizes **AC-N: description** format (bold wrapping ID + colon + description)
  • AC-2: Existing formats continue to work (no regression)
  • AC-3: Add test cases for the new format

Files in Scope

  • src/lib/ac-parser.ts
  • src/lib/ac-parser.test.ts (or wherever parser tests live)

Activity

  1. added
    bug
    cli
    on Mar 24, 2026
  2. added a commit that references this issue on Mar 25, 2026
  3. admarble commented on Mar 25, 2026

    @admarble
    ContributorAuthor

    Exec Phase — Progress Update

    AC Coverage

    AC Description Status Evidence
    AC-1 Parser recognizes **AC-N: description** format ✅ Implemented src/lib/ac-parser.ts:49 — new Pattern 3 regex
    AC-2 Existing formats continue to work (no regression) ✅ Implemented All 17 pre-existing tests pass
    AC-3 Add test cases for the new format ✅ Implemented 3 new tests covering: bold-wrapped with trailing text, bold-wrapped only, 10-AC reproduction from #414

    Key Files Changed

    • src/lib/ac-parser.ts — Added Pattern 3 regex, updated parseACLine to combine capture groups
    • src/lib/ac-parser.test.ts — 3 new test cases (20 total, all passing)
    • CHANGELOG.md — Added entry under [Unreleased]

    Quality Gates

    Check Status
    npm run build ✅ Passed
    npm run lint ✅ Passed
    npm test (ac-parser) ✅ 20/20 passed
    npm test (full suite) ✅ 1899/1903 passed (4 pre-existing failures unrelated)

    Self-Evaluation

    • Worked as expected: Yes — pattern matched all test cases on first try
    • Test coverage confidence: High — tests cover bold-wrapped with trailing text, without trailing text, and the real-world 10-AC format from MCP server: add true E2E tests with real protocol client #414
    • Weakest part: Pattern ordering matters — Pattern 3 must come before Pattern 4 (no-bold) to avoid false matches. This is inherently correct since bold patterns are more specific.
    • Honest assessment: Clean fix, minimal scope, no concerns

    PR: #425

    Quality Plan Alignment: N/A — No quality plan in issue

    CHANGELOG: Updated (### Fixed)

  4. admarble commented on Mar 25, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #422

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Parser recognizes **AC-N: description** format MET Pattern 3 regex at ac-parser.ts:51 correctly matches bold-wrapped ID+description. Verified with 3 test cases including the 10-AC reproduction from #414.
    AC-2 Original Existing formats continue to work (no regression) MET All 17 pre-existing tests pass. Pattern ordering prevents overlap — Pattern 3 cannot match Patterns 1/2 format because (.+?) non-greedy + \*\* terminator fails on :** syntax.
    AC-3 Original Add test cases for the new format MET 3 new tests: bold-wrapped with trailing text, bold-wrapped only, 10-AC #414 reproduction. Total: 20 tests, all passing.

    Coverage: 3/3 AC items fully met


    Quality Plan Verification

    N/A — No quality plan found in issue comments


    CI Status

    Check State Impact
    build (20.x) pass ✅ MET
    build (22.x) pass ✅ MET
    typecheck pass ✅ MET
    validate-plugin pass ✅ MET
    validate-skills pass ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 3 OK
    Lines added +72 -
    Lines deleted -3 -

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/lib/ac-parser.ts Standard ✅ Yes src/lib/ac-parser.test.ts
    CHANGELOG.md Optional N/A -

    Coverage: 1/1 changed source files have corresponding tests


    Code Review

    Strengths:

    • Clean, minimal change — only 3 files modified for a well-scoped bug fix
    • Pattern 3 regex is well-designed: (.+?) non-greedy prevents over-matching, (.*) optional trailing group handles both with/without post-bold text
    • Description combination logic correctly handles falsy match[3] (undefined for Patterns 1/2/4, empty string for Pattern 3 with no trailing text)
    • Pattern ordering is correct — more specific bold patterns before less specific no-bold Pattern 4
    • Test coverage includes the real-world reproduction case from MCP server: add true E2E tests with real protocol client #414

    Issues:

    • None

    Suggestions:

    • None — implementation is appropriately scoped

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Tests assert on parsed output (id, description), not regex internals
    Coverage Depth ✅ OK Covers: trailing text, no trailing text, 10-AC stress test
    Mock Hygiene ✅ OK Pure function tests, no mocks needed
    Test Reliability ✅ OK Deterministic string parsing, no timing dependencies

    Anti-Pattern Detection

    No anti-patterns detected. No dependency changes.


    Call-Site Review

    N/A — No new exported functions

    Execution Evidence

    N/A — No executable script changes

    Skill Command Verification

    N/A — No skill files changed

    CLI Registration Verification

    N/A — No option interface changes

    Smoke Test

    Not Required — No workflow-affecting changes


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix: commit)
    [Unreleased] entry ✅ Present
    Entry format ✅ Valid (includes #422)

    Self-Evaluation

    • Verified working: Yes — ran all 20 tests, all pass. Reviewed regex logic for correctness including non-overlap with existing patterns.
    • Test efficacy: High — tests directly exercise the parsing function with the exact format that was broken.
    • Likely failure mode: A markdown format not yet encountered (e.g., ***AC-1:*** triple-bold). Extremely unlikely in practice.
    • Verdict confidence: High — small, focused change with comprehensive tests and clear regex logic.

    Verdict: READY_FOR_MERGE

    All 3 ACs are met. Clean implementation with well-designed regex, correct pattern ordering, and thorough test coverage including the real-world reproduction case from #414. CI passes on all checks. No regressions detected.

    Documentation

    • N/A — Bug fix, no new features or flags. CHANGELOG entry added.

    Next Steps

    1. Merge PR fix(#422): handle bold-wrapped AC ID format #425
    2. Close issue AC parser: handle bold-wrapped ID format (**AC-1: description**) #422

    QA completed — A+ implementation

  5. added
    ready-for-review
    on Mar 25, 2026
  6. admarble commented on Mar 25, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #422

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original Parser recognizes **AC-N: description** format MET Pattern 3 regex at ac-parser.ts:51 correctly matches bold-wrapped ID+description. Verified with 3 test cases including the 10-AC reproduction from #414.
    AC-2 Original Existing formats continue to work (no regression) MET All 17 pre-existing tests pass. Pattern ordering prevents overlap — Pattern 3 cannot match Patterns 1/2 because .+? non-greedy + \*\* terminator fails on :** syntax.
    AC-3 Original Add test cases for the new format MET 3 new tests: bold-wrapped with trailing text (line 67), bold-wrapped only (line 88), 10-AC #414 reproduction (line 103). Total: 20 tests, all passing.

    Coverage: 3/3 AC items fully met


    Quality Plan Verification

    N/A — No quality plan found in issue comments


    CI Status

    Check State Bucket Impact
    build (20.x) SUCCESS pass ✅ MET
    build (22.x) SUCCESS pass ✅ MET
    typecheck SUCCESS pass ✅ MET
    validate-plugin SUCCESS pass ✅ MET
    validate-skills SUCCESS pass ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 3 OK
    Lines added +77 -
    Lines deleted -2 -

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/lib/ac-parser.ts Standard ✅ Yes src/lib/ac-parser.test.ts
    src/lib/ac-parser.test.ts Optional N/A (is test) -
    CHANGELOG.md Optional N/A -

    Coverage: 1/1 changed source files have corresponding tests
    Critical paths without tests: None


    Code Review

    Strengths:

    • Minimal, focused change — 3 files for a well-scoped bug fix
    • Pattern 3 regex is well-designed: .+? non-greedy prevents over-matching, (.*) optional trailing group handles both with/without post-bold text
    • Description combination logic (match[3] check) correctly handles all patterns: undefined for Patterns 1/2/4, empty string for Pattern 3 without trailing text
    • Pattern ordering is correct — more specific bold patterns before less specific no-bold Pattern 4
    • Comprehensive test coverage including real-world reproduction from MCP server: add true E2E tests with real protocol client #414

    Issues:

    • None

    Suggestions:

    • None — implementation is appropriately scoped

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Tests assert on parsed output (id, description), not regex internals
    Coverage Depth ✅ OK Covers: trailing text, no trailing text, 10-AC stress test
    Mock Hygiene ✅ OK Pure function tests, no mocks needed
    Test Reliability ✅ OK Deterministic string parsing, no timing dependencies

    Anti-Pattern Detection

    No anti-patterns detected. No dependency changes.


    Call-Site Review

    N/A — No new exported functions

    Execution Evidence

    N/A — No executable script changes

    Skill Command Verification

    N/A — No skill files changed

    CLI Registration Verification

    N/A — No option interface changes

    Smoke Test

    Not Required — No workflow-affecting changes


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix commit)
    [Unreleased] entry ✅ Present
    Entry format ✅ Valid — "Fix AC parser not recognizing bold-wrapped ID format **AC-1: description** (#422)"

    Result: CHANGELOG requirements met


    Self-Evaluation

    • Verified working: Yes — ran all 20 tests, all pass. Traced regex logic for all 4 patterns to confirm no overlap and correct match[3] handling across all patterns.
    • Test efficacy: High — tests directly exercise the parsing function with the exact format that was broken, including the real-world 10-AC case from MCP server: add true E2E tests with real protocol client #414.
    • Likely failure mode: A markdown format not yet encountered (e.g., ***AC-1:*** triple-bold or nested bold). Extremely unlikely in practice.
    • Verdict confidence: High — small, focused change with comprehensive tests and clear regex logic. No ambiguity.

    Verdict: READY_FOR_MERGE

    All 3 ACs are met. Clean implementation: single new regex pattern, correct ordering, safe match[3] handling for all existing patterns, and thorough test coverage including the real-world reproduction case from #414. CI passes all 5 checks. No regressions.

    Documentation

    • N/A — Bug fix, no new features or flags. CHANGELOG entry added.

    Next Steps

    1. Merge PR fix(#422): handle bold-wrapped AC ID format #425
    2. Close issue AC parser: handle bold-wrapped ID format (**AC-1: description**) #422

    QA completed — A+ implementation

  7. admarble commented on Mar 25, 2026

    @admarble
    ContributorAuthor

    Documentation Review Complete

    This issue is a bug fix to an internal parser (src/lib/ac-parser.ts). No user-facing documentation required.

    What changed:

    • Added Pattern 3 regex to recognize **AC-N: description** bold-wrapped format
    • Updated JSDoc in parseAcceptanceCriteria to list all supported formats

    Documentation coverage:

    • CHANGELOG.md — ✅ Entry added under [Unreleased] > Fixed
    • JSDoc — ✅ Updated in source file
    • External docs — N/A (internal parser, no user-facing surface)

    Ready to merge!

  8. added a commit that references this issue on Mar 25, 2026
  9. added 2 commits that reference this issue on Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcliready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions