replaceInCurrentMilestone() locates content by finding the last </details> in the ROADMAP and only operates on text after that boundary. When the current (in-progress) milestone section is itself wrapped in a <details> block (the standard /gsd-new-project layout), the phase section's **Plans:** counter lives INSIDE that block. The replacement target ends up in the empty space after the block's closing </details>, so the regex never matches and the plan count stays at 0/N permanently. Fix: switch the plan count update to use direct .replace() on the full roadmapContent, consistent with the checkbox and progress table updates that already use this pattern. The phase-scoped heading regex (### Phase N: ...) is specific enough to avoid matching archived phases. Adds two regression tests covering: (1) plan count updates inside a <details>-wrapped current milestone, and (2) phase 2 plan count is not corrupted when completing phase 1.
5.4 KiB
5.4 KiB