Files
Jarvis/App/Wizard
james.maes 1fc613bcfa fix(01-WR-09): document refresh-before-view-build invariant in wizard open
Phase 1 REVIEW.md WR-09: `OnboardingWizardController.open` called
`state.refresh()` immediately before building the hosting view. The
refresh is synchronous and @MainActor-safe, so the potential race
(refresh publish arriving after SwiftUI subscribes) doesn't occur in
practice — but the sequencing was an implicit invariant worth
codifying.

App/Wizard/OnboardingWizardController.swift
- Add docstring noting why refresh must complete before view
  construction (keychain-lock contention latency + publish ordering).
- Add runtime assertion `Thread.isMainThread` after refresh — makes
  the invariant explicit and fails loudly if a future refactor moves
  refresh off-main.

Notes for future work:
- A truly async-off-main refresh would make the UX WORSE (user sees
  a flash of empty wizard for the async duration). Current posture
  of "run refresh synchronously, short-lived main-thread block" is
  correct for this scope; revisit only if the Keychain contention
  stalls become user-visible in practice.
2026-04-23 16:27:25 -05:00
..