# Real-app reproduction

Surface: built web app served by its real Node server, Chrome 151, 1280 x 900, light theme. Each commit used its own fresh database. No mocked relay responses, fixture credentials, database edits, or unit tests. The machine heading was hidden in captures for privacy.

Account A is the second staging test account; B is the first. Their roles were swapped because the first account had no managed-tunnel capacity.

## Per-commit setup and flow

1. Install dependencies and build `apps/web` with the supplied T3 Connect staging environment variables. Use `T3CODE_DEV_SEED=0` throughout.
2. Authorize the CLI as A with `connect login --headless` in this checkout's own data directory. Install the relay client with `connect link --headless`, then set CLI startup intent with `connect link --headless --publish-only`.
3. Start `node apps/server/src/bin.ts serve --base-dir <isolated-home> --host 127.0.0.1 --port 7308`. Pair the browser with its printed URL, open `/settings/access`, and sign in as A. Wait for initial CLI reconciliation to finish.
4. Run `relay-driver.mjs managed-link`: this performs the actual challenge, server-signed proof, relay link, and server relay-config HTTP requests used by the app, enabling a managed tunnel as A. The CLI A token and startup intent remain in place.
5. Run `relay-driver.mjs revoke`, issuing the account's real DELETE for this environment. The staging relay returned HTTP 500 `RelayInternalError/upstream_unavailable`, but removed the account registration. Run `relay-driver.mjs register-saved` to cause the server's next relay-registration request using its saved A configuration. It returns 503 after the relay rejects authorization, and the real link-state endpoint now reports `linkRevoked: true`. This is the prerequisite for the reported bug, not a manually seeded revoked flag.
6. Run `relay-driver.mjs publishing-off` to turn off publishing without unlinking. Run `relay-driver.mjs signout`, then sign in as B. `login.mjs 1` drives Clerk's real email/password/code UI; it reads credentials from environment variables.
7. Open `/settings/access`. Run `capture-relink.mjs base <output-directory>` on base or `capture-relink.mjs head <output-directory>` on head. Both execute exactly the same click on “Publish agent activity to mobile clients”, which explicitly links the revoked environment as the currently signed-in account. The script records the click and its result and reads real server link state before/after. Two screenshots 500 ms apart are byte-identical on each side.
8. Stop and restart the server against the same isolated home. Read `relay-driver.mjs state`. Head retains B with publishing enabled and revocation cleared. The old A CLI token is still present, but the CLI desired-link intent is removed. Base stays/reconciles as A and retains CLI link intent.

Set `AGENT_BROWSER_BIN` to the installed agent-browser executable for the scripts. All commands target the isolated `proof34194` browser session. `relay-driver.mjs` reads `T3CODE_RELAY_URL` and `VITE_CLERK_JWT_TEMPLATE`; `login.mjs` reads the supplied `FACTORY_USER_*` variables. No credentials are embedded in these files.

The videos record the final explicit relink interaction. Runtime evidence records the actual prerequisite state and persistence check. This proves the publish-only web link path; a new managed tunnel under B, desktop-shell behavior, and active-link/unattended mismatch rejection were not exercised.
