fix(phase,sync): H2 heading support in _req_count and YAML-mode MD fallback (REQ-358, REQ-359)#191
Merged
Merged
Conversation
…llback
REQ-359: Widen _req_count regex from ^###\s+REQ- to ^#{2,3}\s+REQ- so
H2-style requirement headings (## REQ-BE-001) are counted alongside H3.
REQ-358: In run_sync() YAML-first mode, fall back to parsing
REQUIREMENTS.md when no YAML requirement files exist but the Markdown
file contains >=5 REQ-* references. Also falls back for tests.
Co-Authored-By: Oz <[email protected]>
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
Implements REQ-358 and REQ-359: two targeted fixes for phase readiness checks and sync YAML-mode fallback.
REQ-359: _req_count H2 heading support (phase.py)
Widens the first regex in _req_count from ^###\s+REQ- to ^#{2,3}\s+REQ- so that H2-style requirement headings (## REQ-BE-001: Title) are counted alongside H3 headings.
REQ-358: Markdown fallback in YAML sync mode (sync.py)
In
un_sync() YAML-first mode, when no YAML requirement files exist but REQUIREMENTS.md contains >=5 REQ-* references, the function now falls back to Markdown parsing rather than silently producing an empty state. Same fallback applies to test cases via TESTS.md.
Tests
Added ests/test_req_358_359.py with 5 tests covering H2/H3 heading counting, YAML-mode markdown fallback, and no-fallback when YAML exists.
Conversation: https://app.warp.dev/conversation/b2962fe2-fde9-449b-9e70-d4e97ded5d13
Run: https://oz.warp.dev/runs/019e76b9-669d-7de8-95c8-4a10a9581475
This PR was generated with Oz.