From 00b7e622e1d596582f4efb134c78390717ca59d4 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Tue, 8 Sep 2026 10:19:16 -0400 Subject: [PATCH] test(#4457): cover init.new-milestone's project_exists/project_path under an active workstream (#4547) #4457 reports init.progress and init.new-milestone reporting project_exists:false (and a workstream-scoped project_path) for a root-shared PROJECT.md after a normal migration. Direct read of current src/init.cts shows this is already fixed on next by PR #4543 (#4455's self-discovered follow-up): withProjectRoot, buildInitCompletenessFields, cmdInitProgress's project_exists, and cmdInitNewMilestone's project_exists/project_path all already resolve PROJECT.md via the root-aware planningDir(cwd, null). PR #4543 added parametrized regression coverage for ingest-docs/resume/progress/ new-project (plus a dedicated milestone-op test), but its own comment explicitly deferred new-milestone's coverage to "#4456's own new-milestone.md workstream-forwarding work" (PR #4543). PR #4545 (#4456) never added it -- its test additions only exercised the *workflow's* --ws argv forwarding through a stubbed gsd_run, never cmdInitNewMilestone's real output. That gap is exactly what #4457's own acceptance ask requests ("Add a migration-to-init regression test with a root PROJECT.md and no workstream-local copy"). Folds 'new-milestone' into the existing SUBCOMMANDS loop in tests/init-manager.test.cjs (it has no manager-style readiness precondition, and exposes both project_exists and project_path, so it fits the loop's existing assertion shape without a dedicated test). No production code change. Co-authored-by: sim Co-authored-by: Claude Sonnet 5 --- tests/init-manager.test.cjs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/init-manager.test.cjs b/tests/init-manager.test.cjs index 4d6fab9bd..bf23627e1 100644 --- a/tests/init-manager.test.cjs +++ b/tests/init-manager.test.cjs @@ -1172,13 +1172,17 @@ describe('init subcommands sharing the project_exists/project_path PROJECT.md pa // and withProjectRoot) repeated verbatim, via grep, in six more cmdInit* // functions. Each is exercised here through its real CLI subcommand rather // than re-asserting src/init.cts internals directly, so a regression in the - // router wiring would also be caught. `init manager` and `init new-milestone` - // are deliberately excluded: `manager` has its own STATE.md/ROADMAP.md - // readiness guard (covered separately above via `init complete-milestone`, - // which shares withProjectRoot); `new-milestone`'s project_path fix is - // real (see src/init.cts) but its dedicated coverage belongs with #4456's - // own new-milestone.md workstream-forwarding work, not duplicated here. - const SUBCOMMANDS = ['ingest-docs', 'resume', 'progress', 'new-project']; + // router wiring would also be caught. `init manager` is deliberately + // excluded: it has its own STATE.md/ROADMAP.md readiness guard (covered + // separately above via `init complete-milestone`, which shares + // withProjectRoot). `new-milestone` was originally deferred to #4456's own + // new-milestone.md workstream-forwarding work (see PR #4543), but that PR + // only exercised the *workflow's* `--ws` argv forwarding through a stubbed + // gsd_run, never cmdInitNewMilestone's real project_exists/project_path + // output — #4457 closes that gap by folding it into this loop; it has no + // manager-style readiness precondition, so it fits the shared assertion + // shape below without a dedicated test. + const SUBCOMMANDS = ['ingest-docs', 'resume', 'progress', 'new-project', 'new-milestone']; let tmpDir;