# SSH update ownership reproduction

This is a real CLI/server reproduction, not a unit test or a mock service. Both sides use the released Linux x64 0.1.8 service launcher (`t3 __service-launcher`), supervising the server built from the commit under comparison. The launcher is invoked directly rather than installed into systemd. The SSH shell script is generated unchanged from each commit's `packages/ssh/src/tunnel.ts`; it is executed locally against a disposable HOME, which is the command that an SSH connection executes remotely. No fake clock, artificial update delay, or fake readiness responder is used.

The two source builds on each side use APP_VERSION=0.1.8 (active) and APP_VERSION=0.1.9 (candidate). This allows the real preflight, launcher IPC, database backup, ownership lock, trial, and commit/failure code to run against matching database schemas. The source on each side is otherwise unchanged. The published 0.1.8 client assets supply the HTTP readiness page; no browser UI is used as evidence.

1. Install dependencies with `vp i` in each checkout. Build each version using `APP_VERSION=<version> vp run build:bundle` in apps/server. Preserve each dist directory as `base-8`, `base-9`, `head-8`, or `head-9` beside the driver. Link that directory's node_modules to the installed server dependencies.
2. Download and extract the published `v0.1.8/t3-0.1.8-linux-x64.tar.gz` beside the driver. Link its `client` directory into each dist directory.
3. Create `base-home/.t3/runtime/versions/0.1.8` and `0.1.9` (likewise head-home). Each has a `t3` executable shell wrapper that execs the appropriate built bin.mjs with Node, and `.install-complete` containing its version. Write `runtime/service-state.json` as `{"protocol":3,"activeVersion":"0.1.8"}` and `runtime/service.env` with T3CODE_HOST=127.0.0.1, T3CODE_PORT=41689, T3CODE_NO_BROWSER=1. Put the real Node binary first on PATH in each disposable home's bin directory.
4. Generate `base-launch.sh` / `head-launch.sh` by exporting and calling the existing private `buildRemoteLaunchScript({nodeScriptPath: <active-built-bin.mjs>})` function. The only scratch source edit is adding `export` to this function in a sibling module; no generated shell behavior is changed.
5. Run `node drive.mjs base`, then `node drive.mjs head`. Each launcher starts its own fresh database. Add the same synthetic padding table on each side: 1,000 rows of zeroblob(6291456), commit, then PRAGMA wal_checkpoint(truncate). The base database was padded before the recorded driver began; the head driver includes its padding step. Both database sizes are recorded.
6. The driver adopts the service as external, pairs using the app auth API and a CLI-minted pairing credential, sends the real `server.updateServer` WebSocket RPC targeting 0.1.9, waits for the active PID to exit, and immediately invokes the same SSH launch script. It records the returned serverKind, runtime ownership, and final service update state.

`before.mp4` and `after.mp4` replay the captured command-output events with their original timestamps. The initial database-padding wait is omitted from the after video's playback, retaining event timestamps. PNGs show the final captured transcript. Sanitized logs include the actual shell trace, RPC result, service log, and update state. Paths and startup pairing credentials are redacted. No real user data is present.
