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 <sim@local>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-09-08 10:19:16 -04:00
committed by GitHub
parent 147c89a9b8
commit 00b7e622e1

View File

@@ -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* // and withProjectRoot) repeated verbatim, via grep, in six more cmdInit*
// functions. Each is exercised here through its real CLI subcommand rather // functions. Each is exercised here through its real CLI subcommand rather
// than re-asserting src/init.cts internals directly, so a regression in the // 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` // router wiring would also be caught. `init manager` is deliberately
// are deliberately excluded: `manager` has its own STATE.md/ROADMAP.md // excluded: it has its own STATE.md/ROADMAP.md readiness guard (covered
// readiness guard (covered separately above via `init complete-milestone`, // separately above via `init complete-milestone`, which shares
// which shares withProjectRoot); `new-milestone`'s project_path fix is // withProjectRoot). `new-milestone` was originally deferred to #4456's own
// real (see src/init.cts) but its dedicated coverage belongs with #4456's // new-milestone.md workstream-forwarding work (see PR #4543), but that PR
// own new-milestone.md workstream-forwarding work, not duplicated here. // only exercised the *workflow's* `--ws` argv forwarding through a stubbed
const SUBCOMMANDS = ['ingest-docs', 'resume', 'progress', 'new-project']; // 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; let tmpDir;