#!/usr/bin/env bash
# Independent A1 execution record. Selectors below were obtained from fresh snapshots.
# Start backend and Metro in retained PTYs; stop those owned process sessions at teardown.
# vp run dev:server --home-dir /tmp/t3-issue-24901-home --no-seed --host 0.0.0.0
# (cd apps/mobile && vp run dev:client --port 8081 --clear)
set -euo pipefail
s=issue24901-independent-a1
agent-device connect proxy --daemon-base-url "$SIMLOCK_AGENT_DEVICE_URL" --session "$s"
agent-device open --platform android --device 'Pixel 9' --session "$s"
vp run mobile:install android --session "$s" --metro http://fs-18.tail131df4.ts.net:8081
.agents/skills/test-t3-mobile/scripts/pair-client.sh 13773 /tmp/t3-issue-24901-home http://fs-18.tail131df4.ts.net:13773 agent-device --session "$s"
# Recovery actually used: cancel first pending cached install, reconnect proxy --force,
# retry open, then retry cached install (132s success). Cold bundle took 53.4s.
agent-device open com.t3tools.t3code.dev 't3code-dev://expo-development-client/?url=http%3A%2F%2Ffs-18.tail131df4.ts.net%3A8081&disableAutoLaunch=1&disableFab=1' --relaunch --session "$s"
# Dismiss shared-content storage dialog; rerun pairing helper after UI loaded.
# Open existing target Home card; wait for its three historical turns to load.
agent-device fill @e40 'Run sleep 30 in shell then reply Done. Do not edit files.' --settle --session "$s"
agent-device record start /tmp/issue24901-rebuild-audit/A1-independent-raw.mp4 --hide-touches --session "$s"
agent-device press @e41~s621169 --settle --session "$s"
agent-device press 'label="Navigate up"' --settle --session "$s"
agent-device press @e19~s621178 --settle --session "$s"
agent-device screenshot /tmp/issue24901-rebuild-audit/A1-running.png --session "$s"
agent-device wait absent 'text="Working"' --session "$s"
# Read-only persisted run transcript confirms ordinal4 completion; no UI interaction.
agent-device screenshot /tmp/issue24901-rebuild-audit/A1-after-grace.png --session "$s"
agent-device snapshot -i --session "$s"
agent-device record stop --session "$s"
agent-device close --session "$s"
# Stop retained owned backend/Metro PTYs by Ctrl-C (58894, 78130).
# Confirm ss ports8081/13773 empty and git status clean, HEAD unchanged.
