chore(mobile): simulator verification skill, stand-in host, and host-state flows

Merged
KI
2mo ago
+337-11

What & why

Stacked on the never-connected host PR (mobile-host-never-connected-setup). That work was first reported as tested after one main-path pass on the simulator. The edge pass that followed found three bugs, two of them older than the branch. This makes that pass repeatable and writes down what it taught.

  • .agents/skills/mobile-sim-verification: the mobile counterpart to cdp-verification. What counts as evidence on a phone (the real screen, real services, an edge pass before "tested", never painting pending or failed as a negative, recordings for flashes), and how to run the local API, relay and Metro, sign in, and capture locales and text sizes. It includes the traps: wrangler dev dying when a client aborts, CI=1 Metro not watching files, the first bundle timing out the dev client, and the worktree's Neon branch being deleted by the daily cleanup.
  • apps/mobile/scripts/e2e/stand-in-host.ts: registers a host through host.ensure, holds the relay control socket open to make it online, reads presence, and deletes it through host.delete. No second machine, no SQL. It refuses a non-local API.
  • Maestro flows: sign-in.yml asserted a home-screen testID that exists nowhere and used launchApp, which stops at the dev launcher, so it could not pass. It now opens the bundle by link and waits for the sign-in button to go away. host-states/ plus scripts/e2e/host-states.sh walk never connected, online, offline and Try again.
  • apps/mobile/AGENTS.md: Hermes ships a partial Intl and no screen has an error boundary; pending and failed are not answers.

How I tested it

Ran sign-in.yml from a reset keychain and then scripts/e2e/host-states.sh on an iPhone 17 Pro simulator (iOS 26.5) against the local API and relay: all four stages pass, and the host is deleted through the API at the end. The flows failed three times on the way, each for a real reason that is now handled or documented: the host list is not polled, a fresh install opens on the Cloud scope, and "Cloud" shows briefly while the list loads.

bun run lint in apps/mobile passes. No product code changes.

Checklist

  • PR title follows conventional commits (type(scope): subject)
  • bun run lint passes; typecheck left to CI

Summary by cubic

Adds a mobile simulator verification skill, a stand-in host, and host-state Maestro flows so host connectivity states can be tested on the simulator without a second machine, and fixes the sign-in flow that could never pass. No product code changes.

New Features

  • Adds .agents/skills/mobile-sim-verification/SKILL.md, the mobile counterpart to cdp-verification, covering evidence rules and how to run the local API, relay, Metro, sign-in, and recordings.
  • Adds apps/mobile/scripts/e2e/stand-in-host.ts, which registers, brings online, checks presence, and deletes a host through the API; it refuses non-local APIs.
  • Adds host-states.sh and Maestro flows that walk a host through never connected, online, offline, and Try again.

Bug Fixes

  • Fixes sign-in.yml, which previously used launchApp and asserted a nonexistent home-screen testID; it now opens the dev bundle by link and waits for the sign-in button to disappear.
  • Adds apps/mobile/AGENTS.md notes that Hermes ships a partial Intl and that pending or failed query states are not answers.