## Summary
- defer the wizard success summary / "Mosaic is ready" until gateway config health and admin bootstrap have completed
- preserve non-deferred finalizeStage behavior for direct callers while returning an idempotent showSummary callback for wizard paths
- update Pi runtime install hint to the requested curl installer string
## Verification
- pnpm --filter @mosaicstack/mosaic test -- unified-wizard finalize-skills
- pnpm format:check
- pnpm typecheck
- pnpm lint
- pnpm build
- pnpm test
- Codex code review: approve
- Codex security review: one low finding on requested Pi curl|sh hint; no wizard-ordering security finding
Fixes #15
REVIEW-OF-RECORD — APPROVE (#691, head e495d8845f). I reviewed the wizard gateway-health ordering change and found no blockers.
Ordering: finalizeStage now separates mutation work from terminal success messaging by returning an idempotent showSummary() callback and supporting deferSummary. Wizard/quick-start paths call finalize with deferSummary: true, then call showSummary() only after gateway config reports ready and admin bootstrap completes. If gateway health/config reports not ready, the wizard returns/aborts without printing Installation Summary or Mosaic is ready.; the new unified-wizard tests cover both success-after-health and no-summary-on-health-failure.
Compatibility: direct/non-deferred finalizeStage callers still get the old immediate summary behavior, and skipGateway wizard paths explicitly call showSummary() after finalize. The B2 skills-sync/finalize helper path logic remains intact: frameworkScriptPath() still resolves tools/_scripts first with legacy bin fallback, 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: targeted unified-wizard finalize-skills tests 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 (#691, head e495d8845fa5512f3d9b89b8ccdfc729b3ae3d37). I reviewed the wizard gateway-health ordering change and found no blockers.
Ordering: `finalizeStage` now separates mutation work from terminal success messaging by returning an idempotent `showSummary()` callback and supporting `deferSummary`. Wizard/quick-start paths call finalize with `deferSummary: true`, then call `showSummary()` only after gateway config reports ready and admin bootstrap completes. If gateway health/config reports not ready, the wizard returns/aborts without printing `Installation Summary` or `Mosaic is ready.`; the new unified-wizard tests cover both success-after-health and no-summary-on-health-failure.
Compatibility: direct/non-deferred `finalizeStage` callers still get the old immediate summary behavior, and `skipGateway` wizard paths explicitly call `showSummary()` after finalize. The B2 skills-sync/finalize helper path logic remains intact: `frameworkScriptPath()` still resolves `tools/_scripts` first with legacy `bin` fallback, 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: targeted `unified-wizard finalize-skills` tests 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.
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:finalizeStage no longer emits the success summary inline — it gains deferSummary and returns a showSummary() callback (idempotent via summaryShown guard). Both quickStartPath and the main wizard.ts path call finalize with deferSummary: true, run gateway config + gatewayBootstrapStage (health gate), and invoke showSummary() 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 installHint for Pi updated deprecated npm 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.
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:** `finalizeStage` no longer emits the success summary inline — it gains `deferSummary` and returns a `showSummary()` callback (idempotent via `summaryShown` guard). Both `quickStartPath` and the main `wizard.ts` path call finalize with `deferSummary: true`, run gateway config + `gatewayBootstrapStage` (health gate), and invoke `showSummary()` 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 `installHint` for Pi updated deprecated `npm 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`.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.