# Runtime proof for PR 41113

Base: fb23f12f1fb1895c1e14441f797a9da6ae61e75e
Head: b59256d90bcfb31ccd7df6f52f519c80a1eb0592

This is real server evidence, not a unit test or a mocked service. Both checkouts ran the repository's `scripts/scenarios/start-app.ts` dev stack with fresh isolated homes and `T3CODE_DEV_SEED=0`. Synthetic projects and three completed Replay turns were created through the real project API and thread CLI; rollback/delete commands used the authenticated typed WebSocket RPC. SQLite was opened read-only solely to observe persisted events, projections and outbox states.

A deleted thread cannot be selected for rollback in the web client, so this uses the second-client RPC reproduction instead of a browser scenario. The app source and database were never patched.

## Queue control

The replay provider runs through `gated-replay.mjs`, a transparent stdin/stdout relay to the checkout's own `dev-replay-agent.ts`. It delays one `session/new` request only when armed. After three completed turns, an earlier conversation-only rollback to checkpoint 2 is started and held at that request. A second rollback to checkpoint 1 is then accepted and waits behind the earlier effect in the server's real per-thread outbox. The driver deletes the thread, reads the target's persisted outbox state (`pending`, `attempt_count: 0`) after the deletion receipt, then releases the relay.

The earlier rollback is already running and remains outside this fix's scope. Its provider update to ordinal 2 and stale checkpoint/run 3 events occur on BOTH sides. It has `restoreFiles: false`, so it cannot account for any file changes. The target queued rollback would produce an additional provider update to ordinal 1 and stale checkpoint/run 2 events. Those appear only on base. Forwarded ACP `session/new` requests after deletion total two on base and one on head: one belongs to the earlier rollback on both; only base starts the target provider rollback.

## Observations

- Isolated worktree, target `restoreFiles: true`: base changes notes.txt v2 -> v0 after deletion; head keeps v2. Both target effects eventually settle successfully, but head adds no target provider request or rollback events.
- Project folder, target `restoreFiles: false`: base executes the queued conversation rollback after deletion; head skips it. Files remain v2 on both, as requested.
- Project-folder `restoreFiles: true` was sent while live and again after deletion: both reject the live command for requiring an isolated worktree; base rejects the deleted command only for that workspace rule, while head rejects it because the thread is deleted.
- New rollback commands sent after deletion: accepted on base, rejected as deleted on head, on both workspace variants.

## Artifacts and reproduction

`transcript.txt` is the driver's actual stdout. `runtime.cast` preserves its emission timestamps. The PNGs and MP4s are terminal renderings of that captured stdout, not screenshots of the web client; the MP4 gives each output change at least 0.7 seconds for readability. `render-capture.py` contains the rendering code. Captures use the same 1920x1440 viewport, font, and dark theme on both sides. No real user data, credentials, or machine paths are in the uploaded artifacts.

Place `driver.mjs` and `gated-replay.mjs` together in a scratch folder. In each installed checkout, start the dev stack on a distinct free port and fresh home:

```sh
T3CODE_DEV_SEED=0 node scripts/scenarios/start-app.ts web "$PWD/.t3/evidence" 127.0.0.1 "$WEB_PORT"
```

In another shell, from the same checkout:

```sh
PROOF_HOME="$PWD/.t3/evidence" PROOF_OUT="$SCRATCH/base-run" node "$SCRATCH/driver.mjs"
```

Use `head-run` for the other side. Each output directory must be new, and must be a direct child of the directory containing `gated-replay.mjs`. The driver needs the same workspace dependencies as the repository's scenarios. No model subscription is used. Stop each start-app process after the driver completes.
