* fix(#2204): phase-completion writes 'All phases complete' per ADR-2207 completePhaseCore was writing the overloaded bare 'Milestone complete' on the last phase — the same string space the milestone-close verb owns for terminal state. Per ADR-2207, phase-completion now writes the existing intermediate value 'All phases complete' (already used in gsd2-import.cts). Milestone termination ('<version> milestone complete' / 'Awaiting next milestone') remains solely with milestoneCompleteCore. Status lifecycle: Ready to plan → All phases complete → <version> milestone complete → Awaiting next milestone. Changes: - src/state-transition.cts: completePhaseCore status value - src/phase.cts: #2028 guard comment - tests/state-transition.test.cjs: assertion + test name - tests/phase.test.cjs: 8 assertion updates (positive + negative) - tests/state.test.cjs: normalizeStateStatus test case + reset regex - tests/workstream.test.cjs: fixture status to terminal value - gsd-core/workflows/progress.md: Route D label - gsd-core/workflows/transition.md: Route B label - CONTEXT.md: Status lifecycle glossary entry (ADR-2207) - .changeset/brave-geese-jump.md * test(#2204): regenerate golden-install-parity fixtures + workflow-size baseline Workflow file edits (progress.md, transition.md) changed install payload hashes and pushed past the committed workflow-size baseline. Regenerated all 17 golden-install-parity fixtures + claude-local via the standalone gen script (which now also covers the local-scope claude layout). Updated workflow-size-baseline.json and agent-size-baseline.json via size:baseline. * fix(#2204): correct claude-local golden hashes + document gen-script limitation The gen-script's claude-local generation produces macOS-specific hashes incompatible with Linux CI (local-scope install embeds platform-varying node-runner paths). Reverted to manual update using Linux FAILURES.md +actual hashes for the 2 changed workflow files. Added explanatory comment in the gen script. * test(#2204): add isCompletedInventory coverage + clarify CONTEXT.md glossary Addresses orthogonal code-review findings (Medium #1 + #2): - Add isCompletedInventory test cases for ADR-2207 status lifecycle (terminal 'milestone complete' → true; intermediate 'All phases complete' → false; archived → true; active statuses → false) - Clarify CONTEXT.md glossary: note that isCompletedInventory intentionally excludes the intermediate value * docs: backfill changeset PR number (#2259) * docs(#2204): add Status lifecycle table to state-md reference (ADR-2207)
This commit is contained in:
@@ -2090,7 +2090,7 @@ function cmdPhaseComplete(cwd: string, phaseNum: string, raw: boolean): void {
|
||||
}
|
||||
}
|
||||
|
||||
// #2028: don't stamp "Milestone complete" when a LOWER-numbered phase is
|
||||
// #2028: don't stamp "All phases complete" when a LOWER-numbered phase is
|
||||
// still outstanding. The two blocks above only clear isLastPhase when a
|
||||
// HIGHER-numbered phase exists, so completing the numerically-highest phase
|
||||
// out of order (e.g. Phase 10 before Phase 9) wrongly read as milestone-end.
|
||||
|
||||
@@ -816,8 +816,8 @@ function advancePlanCore(content: string, deps: StateTransitionDeps): StateTrans
|
||||
* Migrates the inline STATE.md transform that lived inside `cmdPhaseComplete`
|
||||
* (phase.cts) onto the substrate. Owns the field-classification-governed body
|
||||
* mutations: Current Phase (preserving the `of total` shape and phase name),
|
||||
* Current Phase Name, Status (`Milestone complete` on the last phase, else
|
||||
* `Ready to plan`), Current Plan (`Not started`), Last Activity + Description,
|
||||
* Current Phase Name, Status (`All phases complete` on the last phase, else
|
||||
* `Ready to plan` per ADR-2207), Current Plan (`Not started`), Last Activity + Description,
|
||||
* and the Completed/Total Phases + Progress percent block (re-derived from the
|
||||
* roadmap via the injected `roadmapProvider`).
|
||||
*
|
||||
@@ -917,8 +917,10 @@ function completePhaseCore(
|
||||
}
|
||||
}
|
||||
|
||||
// Status — `Milestone complete` on the final phase, otherwise `Ready to plan`.
|
||||
const statusValue = intent.isLastPhase ? 'Milestone complete' : 'Ready to plan';
|
||||
// Status — `All phases complete` on the final phase (ADR-2207), otherwise
|
||||
// `Ready to plan`. Milestone termination (`<version> milestone complete`) is
|
||||
// owned solely by the milestone-close verb (milestoneCompleteCore).
|
||||
const statusValue = intent.isLastPhase ? 'All phases complete' : 'Ready to plan';
|
||||
const statusAfter = stateReplaceFieldWithFallback(body, 'Status', null, statusValue);
|
||||
if (statusAfter !== body) {
|
||||
body = statusAfter;
|
||||
|
||||
Reference in New Issue
Block a user