fix(wizard): report gateway failures before success summary #691
Reference in New Issue
Block a user
Delete Branch "fix/wizard-gateway-health-order"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Verification
Fixes #15
REVIEW-OF-RECORD — APPROVE (#691, head
e495d8845f). I reviewed the wizard gateway-health ordering change and found no blockers.Ordering:
finalizeStagenow separates mutation work from terminal success messaging by returning an idempotentshowSummary()callback and supportingdeferSummary. Wizard/quick-start paths call finalize withdeferSummary: true, then callshowSummary()only after gateway config reports ready and admin bootstrap completes. If gateway health/config reports not ready, the wizard returns/aborts without printingInstallation SummaryorMosaic is ready.; the new unified-wizard tests cover both success-after-health and no-summary-on-health-failure.Compatibility: direct/non-deferred
finalizeStagecallers still get the old immediate summary behavior, andskipGatewaywizard paths explicitly callshowSummary()after finalize. The B2 skills-sync/finalize helper path logic remains intact:frameworkScriptPath()still resolvestools/_scriptsfirst with legacybinfallback, and the finalize-skills regression suite still passes.Pi hint: the Pi runtime install string change is limited to the runtime detector install hint (
curl -fsSL https://pi.dev/install.sh | sh). That is adjacent wizard/runtime-instruction copy, not a broader installer/runtime behavior change. Codex's low note on curl|sh is acknowledged, but this matches the requested install hint and is not a blocker for the B3 ordering fix.Reviewer verification on head
e495d884: targetedunified-wizard finalize-skillstests pass (10/10); full mosaic test suite pass (627/627); mosaic typecheck pass; mosaic lint pass; repo format:check pass; repo build pass (23/23). APPROVE.REVIEW-OF-RECORD — APPROVE
Independent review (reviewer ≠ author). Blocker B3 (greenfield wizard printed "Mosaic is ready" + Next Steps, THEN ran gateway install which failed health → false success claim).
Fix:
finalizeStageno longer emits the success summary inline — it gainsdeferSummaryand returns ashowSummary()callback (idempotent viasummaryShownguard). BothquickStartPathand the mainwizard.tspath call finalize withdeferSummary: true, run gateway config +gatewayBootstrapStage(health gate), and invokeshowSummary()ONLY after those succeed — or immediately when gateway setup is explicitly skipped. On config/bootstrap failure the wizard aborts (process.exit(1)) WITHOUT the success summary. Correct ordering: real readiness now precedes the "ready" claim.Fold-in: runtime detector
installHintfor Pi updated deprecatednpm install -g @mariozechner/pi-coding-agent→curl -fsSL https://pi.dev/install.sh | sh(verified live; installs @earendil-works/pi-coding-agent).Tests: new unified-wizard coverage — "prints the success summary only after gateway health succeeds" + "does not claim success when gateway health reports not ready".
CI: PR-event pipeline 1645 fully green (ci-postgres, typecheck, lint, format, test all success).
Approving for squash-merge to
next.