1.7 KiB
1.7 KiB
B3 — Wizard completion ordering
Problem
The wizard printed the success summary / Mosaic is ready. during finalizeStage, before the gateway configuration stage had completed its daemon health check. If the gateway health gate later failed, the user could see a success claim followed by a gateway failure.
Diagnosis
finalizeStage handled both mutation work and terminal success messaging. Wizard paths then ran gatewayConfigStage and gatewayBootstrapStage afterward:
- finalize writes config, links runtime assets, syncs skills, runs doctor;
- finalize prints
Installation Summary+Mosaic is ready.; - gateway config starts/waits for daemon health;
- gateway bootstrap runs.
The summary needed to be deferred until after the gateway readiness gates.
Fix
finalizeStagenow returns ashowSummary()callback and supportsdeferSummary.- Wizard/quick-start paths call finalize with
deferSummary: true. showSummary()is called only after gateway config reports ready and bootstrap completes, or immediately when the caller explicitly skips gateway setup.- If gateway health/config reports not ready, the wizard returns/aborts without printing the success summary.
- Folded in adjacent runtime install hint fix for Pi:
curl -fsSL https://pi.dev/install.sh | sh.
Verification
- Added unified-wizard coverage for summary-after-health and no-summary-on-health-failure.
- Targeted:
pnpm --filter @mosaicstack/mosaic test -- unified-wizard finalize-skills pnpm format:checkpnpm typecheckpnpm lintpnpm buildpnpm test- Codex code review: approve.
- Codex security review: one low finding on the requested Pi
curl | shinstall hint; no security finding in the wizard completion-ordering change.