fix(state): skip ghost check for queued milestones in registry build

The ghost milestone check (#3645) was eliminating queued shell
milestones before the deferred-shell logic (#3470) could handle them,
causing queued milestones to vanish from the registry entirely.
This commit is contained in:
Jeremy 2026-04-07 07:41:10 -05:00
parent b658eb9a24
commit a30e837d9e

View file

@ -468,9 +468,10 @@ export async function deriveStateFromDb(basePath: string): Promise<GSDState> {
continue;
}
// Ghost milestone check: no slices in DB AND no substantive files on disk
// Ghost milestone check: no slices in DB AND no substantive files on disk.
// Skip queued milestones — they are handled by the deferred-shell logic below (#3470).
const slices = getMilestoneSlices(m.id);
if (slices.length === 0 && !isStatusDone(m.status)) {
if (slices.length === 0 && !isStatusDone(m.status) && m.status !== 'queued') {
// Check disk for ghost detection
if (isGhostMilestone(basePath, m.id)) continue;
}