Skip to content

chore: INFRA-217 seed post-onboarding state for the e2e-sim safety gate#132

Merged
MP2EZ merged 1 commit into
developmentfrom
chore/infra-217-maestro-safety-e2e-seed-onboarded
Jun 6, 2026
Merged

chore: INFRA-217 seed post-onboarding state for the e2e-sim safety gate#132
MP2EZ merged 1 commit into
developmentfrom
chore/infra-217-maestro-safety-e2e-seed-onboarded

Conversation

@MP2EZ
Copy link
Copy Markdown
Owner

@MP2EZ MP2EZ commented Jun 6, 2026

Closes INFRA-217

Seeds post-onboarding state (legal consents + age verification + onboarding-complete) at launch on the no-dev-client e2e-sim build so the Maestro safety flows start at the home screen instead of traversing the timing-fragile 16-question onboarding preamble. Turns the gate from ~0–1/5 flaky into a reliable ≥5/5 signal.

  • Gated solely by EXPO_PUBLIC_E2E_SEED_ONBOARDED, set only in build.e2e-sim.env (absent from production/preview/production-emergency/development; defaults false). Compliance boundary pinned by __tests__/safety/e2eSeedGate.config.test.ts; seed does not weaken canPerformOperation(...).
  • CleanRootNavigator mounts unconditionally and awaits a whenE2ESeedComplete() gate promise before resolving its route, so the first route is deterministically Main (fixes a blank-screen bug where a conditional mount silently failed to commit in the SDK-56 Release build).
  • New _seeded-home.yaml; the 4 sim flows (q9/phq9/gad7/crisis-button) repoint to it. Device-only crisis-988-dial.yaml + _legal-and-onboarding.yaml left untouched.

Validated on the e2e-sim build: q9/phq9/gad7/crisis-button each 5/5 consecutive (20/20); b-close Phase 2.5 full suite 4/4 on a clean sim.

🤖 Generated with Claude Code

The Maestro safety-e2e gate runs against the no-dev-client e2e-sim Release
build (INFRA-216). That build boots/transitions slowly and the 16-question
LegalGate + onboarding preamble flaked at 0-1/5. Seed post-onboarding state at
launch so CleanRootNavigator routes straight to Main and the sim flows start at
the surface they test.

- env.ts: register EXPO_PUBLIC_E2E_SEED_ONBOARDED (booleanString.default('false'),
  no production superRefine — the e2e-sim profile resolves ENV=production, so a
  guard would refuse to boot the gate's own build).
- e2eSeed.ts: maybeSeedE2EOnboardedState() — no-op unless the flag is 'true';
  seeds onboarding-complete + legal consents + age verification (>=18) + full
  consent record via the real store APIs. Does NOT weaken canPerformOperation.
  Exposes whenE2ESeedComplete(): a module-level "seed gate" promise resolved when
  the seed lands (15s safety timeout), resolved immediately in real builds.
- App.tsx: call maybeSeedE2EOnboardedState() after EncryptionService.initialize().
  CleanRootNavigator mounts unconditionally (as in every real build).
- CleanRootNavigator: checkInitialRoute awaits whenE2ESeedComplete() before
  reading state, so the FIRST resolved route is already Main (initialRouteName
  only applies on first navigator mount; a later flip would not navigate).
- eas.json: set EXPO_PUBLIC_E2E_SEED_ONBOARDED=true ONLY in build.e2e-sim.env.
- Maestro: new _seeded-home.yaml (wait for home-screen); repoint the 4 sim flows
  (q9/phq9/gad7/crisis-button) to it. crisis-988-dial.yaml + _legal-and-onboarding.yaml
  left untouched for the non-seeded device flow.
- Tests (test-first): eas.json profile-scoping compliance pin, seed-gate unit
  tests (both branches + non-blocking), env schema default cases.

Validated on the e2e-sim build: q9/phq9/gad7/crisis-button each route straight to
home and pass. Compliance boundary reviewed by the compliance agent; the seed is
impossible in any shipping build (var absent from all non-e2e profiles, defaults
false), pinned in CI by e2eSeedGate.config.test.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MP2EZ MP2EZ merged commit 7e80621 into development Jun 6, 2026
22 checks passed
@MP2EZ MP2EZ deleted the chore/infra-217-maestro-safety-e2e-seed-onboarded branch June 6, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant