Skip to content

🐛 Fix _has_acceptance_criteria false-negative on ### sub-headings (closes #83) - #85

Merged
monkut merged 2 commits into
mainfrom
feature/83-fix-acceptance-criteria-subheadings
Apr 25, 2026
Merged

🐛 Fix _has_acceptance_criteria false-negative on ### sub-headings (closes #83)#85
monkut merged 2 commits into
mainfrom
feature/83-fix-acceptance-criteria-subheadings

Conversation

@monkut

@monkut monkut commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fixes bug: _has_acceptance_criteria false-negative when AC section contains ### sub-headings #83: _has_acceptance_criteria returned False for valid AC sections that contain ### sub-headings (a structure encouraged by PREPARE_SYSTEM_PROMPT.md).
  • The next-heading regex \n#{2,}\s+ matched any heading at level 2 or deeper, so a ### sub-heading inside an ## Acceptance Criteria section truncated the search range before any - [ ] items.
  • Made the next-heading regex level-aware: detect the AC heading's level (##, ###, ...) and stop only at headings of the same level or higher. The simpler fix proposed in the issue (r"\n#{1,2}\s+") would have broken the existing ### Acceptance Criteria case where a sibling ### Other should terminate the section.
  • Bumped version 0.2.6 → 0.2.7.

Test plan

  • Added 4 tests to TestHasAcceptanceCriteria covering the bug and the level-aware termination behaviour
  • Confirmed the new tests fail before the fix and pass after
  • uv run pytest — 182 passed
  • uv run poe check — ruff clean
  • uv run poe typecheck — pyright clean

monkut added 2 commits April 25, 2026 19:04
…oses #83)

The next-heading regex `\n#{2,}\s+` matched any heading at level 2 or
deeper, so a `###` sub-heading inside an `## Acceptance Criteria` section
truncated the search range before any `- [ ]` items, returning False.

Detect the AC heading level from the match and stop only at headings of
the same level or higher (fewer #s). This handles both `## Acceptance
Criteria` with `###` sub-headings and `### Acceptance Criteria` with
`####` sub-headings, while still terminating at sibling sections.

Bump version 0.2.6 -> 0.2.7.
The previous commit bumped pyproject.toml but did not regenerate the
lock file, leaving it at 0.2.6.
@monkut
monkut merged commit 7248a59 into main Apr 25, 2026
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.

bug: _has_acceptance_criteria false-negative when AC section contains ### sub-headings

1 participant