Environment: Real web app, Chromium 156.0.8078.4 on Linux, 1280×800, dark theme. Fresh isolated databases and identical synthetic project/probe files on both commits, seeded with t3.project and t3.thread using Replay (dev). Two independently connected web app viewers (top document and same-origin iframe) share one terminal. Keyboard input and clipboard pastes go through the real UI; transport gates delay selected outgoing writes and withhold first-viewer terminal/metadata stream events. PTYs are real server processes.

Steps on both commits:

1. Viewer 1 opens the drawer and runs a raw Node cursor-position probe; First reply received is visible. Viewer 2 opens the same terminal and sends s, verified at the PTY. Hold viewer 1’s x write before dispatch, close its drawer, wait until hidden plus 1.5 seconds, and trigger the second query. Observe for 15 seconds, release x, then observe for 10 additional seconds.

2. Paste 100,000 P characters through the clipboard with Control+Shift+V. Allow chunk 1, hold chunk 2, and withhold first-viewer terminal/metadata events. Replace the PTY through the real terminal.open RPC on a separate connection by changing its launch environment; start the byte receiver in viewer 2, then release chunk 2.

3. Repeat with 150,000 characters (three chunks), closing viewer 1’s drawer while chunk 2 is held. Replace the PTY and start its receiver in viewer 2 before releasing chunk 2; observe the interrupted writer’s separate closing recovery marker. Read real receiver byte logs and capture rendered outcomes.

Observed: base never received the second cursor reply, including ten seconds after releasing x; its replacement PTYs received 34,476 bytes and 65,542 bytes respectively (the latter includes a separate six-byte recovery marker). Head answered the query and both replacement receivers stayed at zero bytes; stale chunk and recovery-marker requests carried the original PID and were rejected.

### Scenario: A second viewer answers terminal queries after the first viewer closes during a pending write

**Proven: the scenario fails on base [67918f51cc](https://github.com/pingdotgg/t3code/commit/67918f51ccf79e8873349f3dc35c839689dba884) and passes on head [9afbce98fa](https://github.com/pingdotgg/t3code/commit/9afbce98faa21710b7829817e964c626e400a4fa).**

|  | Base [67918f51cc](https://github.com/pingdotgg/t3code/commit/67918f51ccf79e8873349f3dc35c839689dba884) | Head [9afbce98fa](https://github.com/pingdotgg/t3code/commit/9afbce98faa21710b7829817e964c626e400a4fa) |
| --- | --- | --- |
| Result | ❌ failed<br>ASSERTION_FAILED: expected {"ownerAnswered":false,"ownerAfterRelease":false,"pasteResults":[{"name":"split-chunk","receivedBytes":34476},{"name":"recovery-marker","receivedBytes":65542}]} to equal {"ownerAnswered":true,"ownerAfterRelease":true,"pasteResults":[{"name":"split-chunk","receivedBytes":0},{"name":"recovery-marker","receivedBytes":0}]} | ✅ passed |
| 01 first reply | ![Base 67918f51cc: 01 first reply](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/43910fa20fb8f767/001-01-first-reply.png) | ![Head 9afbce98fa: 01 first reply](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5cf53ecf5bc55229/001-01-first-reply.png) |
| 02 held keystroke | ![Base 67918f51cc: 02 held keystroke](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/97cd0ad846fb5fd9/002-02-held-keystroke.png) | ![Head 9afbce98fa: 02 held keystroke](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d0999ba2b03f5553/002-02-held-keystroke.png) |
| 03 closed drawer | ![Base 67918f51cc: 03 closed drawer](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4e1b0cde936203d2/003-03-closed-drawer.png) | ![Head 9afbce98fa: 03 closed drawer](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/e62bd32da68ca183/003-03-closed-drawer.png) |
| 04 query after close | ![Base 67918f51cc: 04 query after close](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/340ce3d79576aa86/004-04-query-after-close.png) | ![Head 9afbce98fa: 04 query after close](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2f1f00ab945c5813/004-04-query-after-close.png) |
| 05 ten seconds after release | ![Base 67918f51cc: 05 ten seconds after release](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/43cd51c05015984a/005-05-ten-seconds-after-release.png) | ![Head 9afbce98fa: 05 ten seconds after release](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/01df259a5a56b716/005-05-ten-seconds-after-release.png) |
| split chunk 01 paste pending | ![Base 67918f51cc: split chunk 01 paste pending](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/28b0b9fb33c9a2e7/006-split-chunk-01-paste-pending.png) | ![Head 9afbce98fa: split chunk 01 paste pending](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/c154da179738eae8/006-split-chunk-01-paste-pending.png) |
| split chunk 02 replacement ready | ![Base 67918f51cc: split chunk 02 replacement ready](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/f48e7fd37a9fff63/007-split-chunk-02-replacement-ready.png) | ![Head 9afbce98fa: split chunk 02 replacement ready](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2fd681c597695f5f/007-split-chunk-02-replacement-ready.png) |
| split chunk 03 result | ![Base 67918f51cc: split chunk 03 result](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/381ac8c8f8838db9/008-split-chunk-03-result.png) | ![Head 9afbce98fa: split chunk 03 result](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/74745cd19b67ab7f/008-split-chunk-03-result.png) |
| recovery marker 01 paste pending | ![Base 67918f51cc: recovery marker 01 paste pending](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b681e513d5fb4c74/009-recovery-marker-01-paste-pending.png) | ![Head 9afbce98fa: recovery marker 01 paste pending](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a8166a40682189ec/009-recovery-marker-01-paste-pending.png) |
| recovery marker 02 replacement ready | ![Base 67918f51cc: recovery marker 02 replacement ready](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8b950b066ebbf31d/010-recovery-marker-02-replacement-ready.png) | ![Head 9afbce98fa: recovery marker 02 replacement ready](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b618db14e5e80ee5/010-recovery-marker-02-replacement-ready.png) |
| recovery marker 03 result | ![Base 67918f51cc: recovery marker 03 result](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b9b555cb100437e2/011-recovery-marker-03-result.png) | ![Head 9afbce98fa: recovery marker 03 result](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bc638b09d55af321/011-recovery-marker-03-result.png) |
| failure | ![Base 67918f51cc: failure](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/da86a1d96832e358/012-failure.png) |  |

| Recording | Before | After |
| --- | --- | --- |
| Complete interaction | [Before video](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/3b10a93eef42afb1/base.mp4) | [After video](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/804d3b78aaeff73f/head.mp4) |

Recordings omit initial loading, redact private shell prompts during PTY setup, preserve the timed waits, and hold the final result still for two seconds.

[Scenario and synthetic probe sources](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/ca2a4bec94e8fc6b/terminal-release-and-paste-proof.e2e.ts) · [Transport observations and byte counts](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/dca12c90b48314dd/transport-observations.json)
