Merge pull request #3622 from gsd-build/fix/3600-bug-init-new-milestone-counts-prefixed-p

fix(3600): count project-code-prefixed phase dirs in milestone filter
This commit is contained in:
Tom Boucher
2026-05-15 23:04:20 -04:00
committed by GitHub
4 changed files with 206 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
type: Fixed
issue: 3600
---
**`init.new-milestone` now counts project-code-prefixed phase directories** — `getMilestonePhaseFilter` previously skipped `.planning/phases/CK-01-name` against a numeric ROADMAP heading like `### Phase 1:`: the numeric matcher required the directory name to start with a digit and the custom-ID matcher compared the full prefixed name against the bare milestone token. Added a strip-and-retry path that strips the same `^[A-Z]{1,6}-(?=\d)` prefix `normalizePhaseName` already recognises and retries the numeric match. The fix lands in both the CJS runtime (`get-shit-done/bin/lib/core.cjs:isDirInMilestone`) and the SDK twin (`sdk/src/query/state.ts:isDirInMilestone`), and is shared by every caller of `getMilestonePhaseFilter` — including `init.new-milestone`, `phase complete`, `verify-work`, and `validate-health`.