chore: INFRA-217 seed post-onboarding state for the e2e-sim safety gate#132
Merged
MP2EZ merged 1 commit intoJun 6, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
EXPO_PUBLIC_E2E_SEED_ONBOARDED, set only inbuild.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 weakencanPerformOperation(...).CleanRootNavigatormounts unconditionally and awaits awhenE2ESeedComplete()gate promise before resolving its route, so the first route is deterministicallyMain(fixes a blank-screen bug where a conditional mount silently failed to commit in the SDK-56 Release build)._seeded-home.yaml; the 4 sim flows (q9/phq9/gad7/crisis-button) repoint to it. Device-onlycrisis-988-dial.yaml+_legal-and-onboarding.yamlleft 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