# Terminal reattachment runtime proof

Run the same driver against each checkout with dependencies installed and a fresh data directory.
Start the real server from the checkout, retaining its process for cleanup:

```sh
T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --host 127.0.0.1 --port "$PORT" --base-dir "$DATA" --no-browser
```

In a separate terminal, using Node compatible with the checkout:

```sh
python3 record.py "$CAPTURE" node driver.mjs "$CHECKOUT" "$DATA" "http://127.0.0.1:$PORT" "$SIDE" "$CAPTURE/transcript.txt"
```

`CAPTURE` must be a new directory. The recorder creates it. Requires Pillow and ffmpeg.
The driver authenticates with the server's own CLI, mints a WebSocket ticket and uses the checkout's typed RPC client and contracts. No mocks or test runner are used. It creates synthetic workspace directories and terminal thread IDs directly through terminal RPCs; no database rows are inserted or copied.

Both runs use 128 exited bash terminals with `seq 1 100000; exit` history, opened 150 ms apart, then 64 running bash terminals. Reopening the oldest 64 overlaps the busy shells' exits staggered across 0–4 seconds. After all open calls return, the driver waits 1.5 seconds and resumes each attachment, checking the original PID and its workspace through `/proc`.

Recordings show the driver's live stdout rendered at 2 fps in the same 1600x1000 dark console layout; they are not screenshots of the web client. The full transcripts preserve all 64 terminal results. The PNG files are final frames. Stop the server after each run; use fresh data for subsequent runs.

Recorded base: 58/64 resumed attaches closed, with all 58 original shells alive in their workspace. Recorded head: 64/64 running snapshots, no closed attaches. Both returned 64/64 running PIDs from terminal.open.
