BUG-049
ID:BUG-049Status:confirmed

A work item's criteria count is a regex over its whole text, so stray checkbox markers skew milestone progress

Recorded by SPEC-142 D6 and carried here when that spec was superseded. Confirmed by reading the code.

The page-walk register loop counts a work or bug item's progress like this:

Severity:minorSource:SPEC-142

Criteria completion

Criteria completion: 1 of 2 (50%) checked; tracking started on Nov 9, no incremental history yet0%25%50%75%100%Nov 9Nov 22

Tracking started Nov 9 — check back for trends.

Branches 3
History 2
  1. d0bf152
    Created (confirmed)by bjornolofandersson
  2. dd1f2fa
    Content editedby Claude
    plan: supersede SPEC-142; file BUG-049 from its D6

Steps to Reproduce

  1. Create a work item with two criteria, one checked:

    ## Acceptance Criteria
    
    - [x] First criterion
    - [ ] Second criterion
    
    ## Notes
    
    The syntax for a done criterion is `- [x] text`.
    
  2. Build a plan site that renders it, and read the item's checkedCount / totalCount (or the milestone progress bar).

Expected

1 of 2: only the Acceptance Criteria section counts, and it agrees with the count entity.criteria gives.

Actual

2 of 3: the [x] in the Notes counts as a checked criterion.

Approach

  • Count from the structured criteria, not from text: the page-walk path should read the same list the scan path does, or both should read the Acceptance Criteria section through a content model.
  • SPEC-142 D6 pointed at the long-term form: a per-section content model on work's Acceptance Criteria (knownSections.<name>.model, resolver.ts:518) that resolves it as a checklist. When the plan runes move to definitions (SPEC-152), that model belongs in work's frontmatter.
  • Decide whether [-] (skipped) counts toward the total, and whether [>] (active) counts as unchecked, and apply the same rule on both paths.
  • Add a test with a stray marker outside the criteria section, and one comparing the two paths.

References

  • SPEC-142 D6: where this was first noted.
  • SPEC-152: the plan runes as compositions.