fix(#4023): preserve decimal phase ids in init progress ordering and smart-entry output (#4110)

* test(#4023): reproduce decimal phase-id coercions

* fix(#4023): preserve decimal phase ids in progress signals

* test(#4023): align phase token contract expectations

* chore(#4023): point the changeset at PR #4110

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Tom Boucher <trekkie@nomorestars.com>
This commit is contained in:
BeeHiggs
2026-09-01 11:58:20 -06:00
committed by GitHub
parent 80d2236ca5
commit 41466e8e88
6 changed files with 95 additions and 17 deletions

View File

@@ -92,7 +92,7 @@ const {
extractCurrentMilestone,
} = roadmapParser;
const { pathExistsInternal, generateSlugInternal, toPosixPath } = coreUtils;
const { normalizePhaseName, matchPhaseDirs, stripProjectCodePrefix, PHASE_NUMBER_TOKEN_SOURCE, isForeignPrefixedPhaseQuery, isSentinelPhaseId, extractPhaseToken, scopeToPhase } = phaseId;
const { comparePhaseNum, normalizePhaseName, matchPhaseDirs, stripProjectCodePrefix, PHASE_NUMBER_TOKEN_SOURCE, isForeignPrefixedPhaseQuery, isSentinelPhaseId, extractPhaseToken, scopeToPhase } = phaseId;
const { pruneOrphanedWorktrees } = worktreeSafety;
const {
@@ -3175,9 +3175,7 @@ function cmdInitProgress(cwd: string, raw: boolean, options: Record<string, unkn
}
}
phases.sort(
(a, b) => parseInt(a['number'] as string, 10) - parseInt(b['number'] as string, 10),
);
phases.sort((a, b) => comparePhaseNum(a['number'], b['number']));
// #3581: the frontier is ROADMAP ORDER, not artifact presence. The disk loop
// above could claim nextPhase from a stray out-of-order artifact directory