fix(sprintstatus): recognize split-story keys with a letter suffix#147
Conversation
BMAD splits an oversized story into 2-6a/2-6b, but STORY_RE required a digits-only story number, so split stories fell into unknown_keys and were silently dropped: invisible to run/--story/the TUI tree and skipped by advance()'s epic-lift — with the loop walking on to later, possibly dependent, stories. The suffix is a first-class Story/StorySelector field rather than an uncaptured widening (which would have let --story 2-6a dispatch 2-6b and rendered both halves identically in the TUI): 2-6a / 2.6a / --epic 2 --story 6a select exactly that half, while a plain 2-6 matches the whole split family in file order. run/--dry-run now also print a stderr warning when sprint-status keys remain unparseable instead of only journaling them. Fixes #144
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
WalkthroughSplit-story suffixes are now parsed into sprint-status stories and selectors, enabling exact-half or whole-family selection. Run modes warn about unknown keys, TUI labels show suffixes, and tests cover parsing, selection, advancement, warnings, and rendering. ChangesSplit-story sprint-status support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant sprintstatus
participant SprintStatusYAML
CLI->>sprintstatus: Parse story selector
sprintstatus->>SprintStatusYAML: Load sprint-status
SprintStatusYAML-->>sprintstatus: Return parsed stories and unknown keys
sprintstatus-->>CLI: Select actionable story and report unknown keys
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #144.
Problem
BMAD's split-story convention produces keys like
2-6a-example-slug, butSTORY_RE/SHORT_REF_RErequired a digits-only story number. Split stories fell intounknown_keysand were silently dropped: invisible to the backlog count and the TUI sprint tree, unselectable via--story, skipped byrun(which then walked on to later — possibly dependent — stories out of order), and skipped byadvance()'s epic-lift. The only trace was a journal event.Why not the issue's two-line fix
The reporter's minimal fix (an uncaptured
[a-z]?) resolves the invisibility but introduces a mis-selection: with the suffix discarded,--story 2-6aparses tonum=6and matches both halves — the engine's_pick_nextselector filter could dispatch2-6bwhen asked for2-6a, and the TUI would render both halves identically ({num}-{slug}→6-example-slugtwice). The reporter flagged exactly this in their "design decision" caveat, so this PR takes the fuller path they sketched.Change
Story.suffix,StorySelector.suffix); group numbering shifts once insidesprintstatus.py, the only module that parses story keys.numstays anint(it has no arithmetic consumers — selection equality and display only).2-6a/2.6a/--epic 2 --story 6a/ full key select exactly that half. A plain2-6(suffix=None) matches the whole2-6a/2-6bfamily in file order — mirroring how short refs already ignore the slug. Conservative shape: single lowercase letter (2-6ab-x,2-6A-xstay unknown).advance()now works for split keys for free (it silently skipped them before).6a-build-structure/6b-extend-structure.runand--dry-runprintwarning: ignoring unparseable sprint-status keys: …to stderr, matching the notevalidatealready emits; thesprint-status-unknown-keysjournal event stays the durable record.Verification
2-5 done / 2-6a backlog / 2-6b backlog / 2-7 backlog / weird-key):run --dry-run --epic 2→2-6a,2-6b,2-7(previously jumped to2-7) + the warning line--story 2-6a→ exactly2-6a;--story 2-6→ the pair;--story 2.6b→ exactly2-6b--story 2-6c→no story matches '2-6c'Summary by CodeRabbit
2-6aand2-6bare now parsed and selected correctly.runand--dry-runwarn when sprint-status entries cannot be parsed.