Files
msd-core/.changeset/3815-phase-insert-bullet-roadmap.md
Tom Boucher 4a19d4db2b fix(3815): phase.insert handles checked-bullet ROADMAP format (#79)
* fix(3815): phase.insert parser handles checked-bullet ROADMAP format

phaseInsert (TS) and cmdPhaseInsert (CJS) previously used a heading-only
regex (#{2,4}\s*Phase\s+N:) to locate the target phase.  On projects whose
ROADMAP uses the checked-bullet format (- [ ] **Phase N: name** or
- [ ] Phase N: name), the lookup always failed with "Phase N not found".

Extend the locator to also accept the bullet form — mirroring the patterns
already used by phaseRemove and phaseComplete.  When bullet-style is
detected, insert a new bullet entry after the matched line (preserving
bold/plain style to match surrounding entries).  The heading-style code
path is unchanged.

Also fix a pre-existing test timeout: the first registry-integration test in
phase-lifecycle.test.ts was failing with STACK_TRACE_ERROR (masked timeout)
because the cold import of index.js takes >5 s.  Added { timeout: 30_000 }.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(3815): refine hybrid-ROADMAP detection, preserve #3098 parity

Tighten the bullet-style branch guard: only treat a ROADMAP as
bullet-style (and apply the bullet-insert path) when it contains
ZERO heading-style phase entries (anyHeadingPattern test).  A
mixed (hybrid) ROADMAP — headings for some phases, bullet summaries
for others — is the #3098 case where the detail section is absent;
that path must still error with "missing a detail section".

Adds a regression test (#3098 preserved) in both TS and CJS to
confirm that a heading-style ROADMAP with a bullet-only entry for
the target phase still fires the "missing a detail section" error,
not the bullet-insert path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: add changeset for #3815 phase.insert bullet-roadmap fix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 11:39:45 -04:00

721 B

type, pr
type pr
Fixed 3815

phase.insert now handles checked-bullet ROADMAP format — gsd-sdk query phase.insert (and gsd-tools phase insert) previously threw "Phase N not found" on ROADMAPs that use the - [ ] **Phase N: name** checklist format instead of ### Phase N: name headings. The parser now detects purely bullet-style ROADMAPs and inserts the new decimal phase entry between the target bullet and the next phase bullet (preserving bold vs plain formatting). Hybrid ROADMAPs that mix heading-style phases with bullet summaries continue to produce the "missing a detail section" error from #3098, since a bullet-only entry in that context means the ### Phase N: detail section is absent. (#3815)