fix(wizard): avoid rerunning completed setup steps #692
Reference in New Issue
Block a user
Delete Branch "fix/wizard-step-dedup"
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 #16
REVIEW-OF-RECORD — APPROVE (#692, head
0113d89ab8). I reviewed the wizard step deduplication fix and found no blockers.Deduplication:
runMenuLoopnow maps menu choices to section keys and skips completed sections before dispatching their stages. Providers, Identity, Skills, Gateway, and Advanced no longer rerun after they are marked[done]; the regression test explicitly re-selects Providers and Skills and verifies each stage executes exactly once, with clear skip logs.Provider/no-key handling:
providerSetupStagealready records an explicit no-key provider setup asproviderType='none'. This PR preserves that state into gateway config instead of defaulting unrun/undefined provider setup tonone.gatewayConfigStagenow treatsproviderType='none'as an explicit completed provider step and skips the secondANTHROPIC_API_KEYprompt while writing no API key env var. If provider setup was never run,providerTyperemains undefined and the gateway prompt path remains available.B1-B3 regression check: Quick Start marks Providers and Skills complete after running them. The B2 finalize/skills-sync path stays intact (full mosaic tests include finalize-skills), and the B3 deferred success-summary ordering remains covered by unified-wizard tests. I did not see unrelated 0.0.50/provider behavior mixed into this diff.
Reviewer verification on head
0113d89a: targetedunified-wizard gateway-configtests pass (28/28); full mosaic test suite pass (629/629); mosaic typecheck pass; mosaic lint pass; repo format:check pass; repo build pass (23/23). PR CI was still running when reviewed, so merge should still wait for terminal-green CI. APPROVE.REVIEW-OF-RECORD — APPROVE
Independent review (reviewer ≠ author). Blocker B4 (greenfield wizard: Providers + Skills menu steps re-ran after
[done]— API key asked twice, skills block shown twice).Fix:
skipCompletedMenuChoice()short-circuits any menu section already in thecompletedset ("…is already complete; skipping") instead of re-running its stage — applied to providers/identity/skills/gateway-config/advanced.menuSectionKey()centralizes the MenuChoice→MenuSection mapping (gateway-config→gateway; null for quick-start/finish).quickStartPathnow recordsproviders+skillsincompletedSectionsafter running them.gateway-confighandlesproviderType === "none"(empty key, skip the gateway key prompt) and all callers now pass the realstate.providerType(no?? "none"coercion) so a "none" selection from provider setup propagates and the gateway stage does not re-ask.Tests: +76 lines unified-wizard integration coverage + new gateway-config.spec (+39) for the providerType="none" / no-reprompt path.
CI: PR-event pipeline 1649 fully green (ci-postgres, typecheck, lint, format, test all success).
Approving for squash-merge to
next. This is the 4th and final 0.0.49 RC blocker.