fix(#3701): resolve next_phase from the roadmap, selecting the numerically lowest successor (#3852)

* test(#3701): failing-first coverage for roadmap-order next_phase resolution

* fix(#3701): resolve next_phase from roadmap order, keeping the disk scan for spelling and fallback

* fix(#3701): select the numerically lowest successor in both scans, not the first row encountered

* chore(#3701): backfill changeset PR number

---------

Co-authored-by: sim <sim@local>
This commit is contained in:
Tom Boucher
2026-08-25 08:58:10 -04:00
committed by GitHub
parent 308c17505c
commit aa6c332b5a
4 changed files with 428 additions and 11 deletions

View File

@@ -790,6 +790,16 @@ Interactive command center for managing multiple phases from one terminal.
**Phase completion is disk-strict (ADR-3180 §7.4, issue #3186).** A phase's status here — and in `roadmap analyze`, `roadmap update-plan-progress`, and `phase complete` — is decided by one rule: a passing `*-VERIFICATION.md` on disk, checked unconditionally (plan count is never a precondition, so a zero-plan phase with a passing verification reports complete). A ticked `- [x]` checkbox in `ROADMAP.md` is a human annotation only; it carries no machine authority and is never consulted for these commands' completion verdicts. `roadmap update-plan-progress` additionally withholds writing the checkbox/completion date while any plan in the phase has no matching `*-SUMMARY.md`, mirroring `phase complete`'s own coverage gate.
**Which phase comes *next* is a different question, and the roadmap answers it.** Disk-strictness
governs whether a phase is *complete*; it does not decide the successor. `phase complete` resolves
`next_phase` as the **lowest-numbered phase above the completed one that `ROADMAP.md` declares** for the
current milestone, regardless of which phase directories happen to exist. Phase *numbers* decide the
sequence — the order rows happen to appear in the file does not — a phase that has not been planned yet has no directory, and must still
be selected ahead of a later phase that does. When the roadmap and the directories agree, the
directory supplies the spelling (the zero-padded token and its on-disk slug). The directory scan is
the fallback only when no readable roadmap phase list exists (#3701; the same rule #3581 established
for `init.progress`).
**Checkpoint Heartbeats (#2410):**
Background `execute-phase` runs emit `[checkpoint]` markers at every wave and plan