# Evidence

For [#33620](https://git.cafe/pingdotgg/t3code/pull/33620). Before: [bbdc7dca](https://github.com/pingdotgg/t3code/commit/bbdc7dca320ee4fbc7131498aaffef2fa1eb3d41). After: [a103cf6d](https://github.com/pingdotgg/t3code/commit/a103cf6dffc5c06d386282ba3dd794ce43dac0be). Both built from independent detached scratch worktrees; production source unchanged.

Environment: Ubuntu 24.04.5 LTS, Linux x86_64, Electron 44.10.1 / Chromium 152.0.7977.169, headless-desktop with Xvfb 21.1.12 (1920×1080×24), scale factor 1, actual `apps/desktop/dist-electron/main.cjs` entry, actual preload/renderer and bundled server. Fresh isolated T3CODE_HOME and XDG directories per run, T3CODE_DEV_SEED=0, confirmQuit=hold. No live database copied or read. Real wall clock; no clock mocking. Main window 1100×780; no responsive/theme/render-surface fixture applies.

Chronology below is relative to the first native Q down, separately for each run. R2–R5 capture the installed application callback by observing its registration, then call that retained callback directly. They never install a copied listener implementation. R2/R3 inject after real BrowserWindow.destroy(); exit is not paused. Each exception is caught so every case can run; exit code 0 in base does not imply absence of callback exceptions.

| Row / scripted interaction | Before — bbdc7dca | After — a103cf6d | Result |
| --- | --- | --- | --- |
| R1 native Linux smoke: hold Ctrl+Q ~1550 ms, X11 Q/Control up | [native-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1621d2a0f7202df6/native-base.log) | [native-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/addc8cb1c94179e9/native-head.log) | Hold resolved; conceal at +1214/+1229 ms. No Q-up callback delivered by Electron. Watchdog shutdown at +2114/+2130 ms; both exit 0. Native release route remains unverified. |
| R1 release, real-app harness: native hold; at +1537/+1544 ms force missing Q-up into installed listener | [release-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/07b74b34366e4c28/release-base.log) | [release-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5381625e32d2535d/release-head.log) | Base quits/destroys the window then throws Object has been destroyed at +1545 ms. Head quits/destroys and returns at +1558 ms. Harness catches base exception; both exit 0. |
| R1 quiet-period, real-app harness: native hold; stop forwarding repeats while Q remains down; physical Q-up later | [quiet-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/62a3cd6973a34cdd/quiet-base.log) | [quiet-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1b407c92ea11be68/quiet-head.log) | Real watchdog starts shutdown at +2052/+2115 ms, before physical Q-up by 916/928 ms. Both exit 0; no callback exception. |
| R2 harness: destroy main window; force trailing Q-up, Control-up, ordinary X-down | [listeners-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf927a94560f1a5b/listeners-base.log) | [listeners-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0a97dbc3f57d5211/listeners-head.log) | All three throw Object has been destroyed on base. All return on head; no menu API call or IPC after destruction. |
| R3 harness: destroyed main; gestureScrollBegin / gestureScrollEnd / unrelated mouseMove | [listeners-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf927a94560f1a5b/listeners-base.log) | [listeners-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0a97dbc3f57d5211/listeners-head.log) | Begin/end throw on base and return without IPC on head. Unrelated input returns on both. |
| R4 live callback controls: Ctrl+W initial/repeat/up; plain W; Ctrl+X; Alt/Shift-modified Ctrl+W | [listeners-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf927a94560f1a5b/listeners-base.log) | [listeners-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0a97dbc3f57d5211/listeners-head.log) | Seven matching results. Only matching repeat is prevented; menu interception enabled only for matching Ctrl+W. DevTools-focus smoke not captured. |
| R5 live callback controls: gesture begin/end/unrelated input | [listeners-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf927a94560f1a5b/listeners-base.log) | [listeners-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0a97dbc3f57d5211/listeners-head.log) | Three matching results. Begin/end send exactly their matching IPC once; unrelated input sends neither. |
| R6 macOS native Cmd+Q timing | Unverified | Unverified | cannot-verify macos: Linux VM has no native macOS keyboard/window delivery. |

R1 is **partial for native delivery**: its native hold/watchdog smoke is captured, and both release/quiet routes have labelled real-app harness evidence. This does not establish native macOS timing or a naturally delivered Linux trailing keyUp race. R2–R5 are captured; R6 is unverified. Coverage: 4/6 rows fully captured, 1/6 partial, 1/6 unverified; all three Linux affected rows have recordings, with the R1 limitation above.

Diff0 / DiffT: pixel diffs do not apply to these two main-process guards. The exact behavioral result comparison is [behavior-diff0.diff](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2986028351d80c91/behavior-diff0.diff); it removes only timestamps, elapsed times and exception stacks before comparing all input/outcome/menu/IPC fields. No numeric threshold is used. The full what-else-changed inventory is [behavior-comparison.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/503f67517b94ff9c/behavior-comparison.md).

What else changed: R2 keyboard exceptions and R3 gesture exceptions disappear; live R4/R5 outcomes match exactly. The release harness also changes from base exception to head return. Both quiet-period and native smoke runs quit normally. Startup timing, repeat counts/cadence, generated identifiers, display numbers and process IDs vary between real runs; the supplemental videos show startup/onboarding and are not visual parity evidence.

Validation: [validation.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b1cbc47b59eeb485/validation.log) confirms eight final processes exit 0, both native holds reach >=1200 ms, base/head callback differential, matching live controls, and quiet shutdown before physical release. No test is substituted for a runtime capture.

Reproduction and seed/driver scripts: [reproduce.sh](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a8b6fdcd11219086/reproduce.sh), [run-one.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/7e2c5c397082562e/run-one.mjs), [driver.cjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b57f2bdcb8346950/driver.cjs), [native-input.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8b21fa87db1b85b7/native-input.py), [assert-evidence.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6cd3e3e61b33365e/assert-evidence.py), [package-evidence.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1cfe65572dd60be9/package-evidence.py). The runner seeds only {confirmQuit:hold}; no project/thread data is necessary.

Supplemental Xvfb recordings (startup included; terminal logs above are the proof):

- native: Before [native-base.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/edfe18005ee3692d/native-base.mp4) / After [native-head.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8fe2abfcd6dcca66/native-head.mp4)
- release: Before [release-base.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5d4c18bb5cd301ff/release-base.mp4) / After [release-head.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/61c7a71a26960a79/release-head.mp4)
- quiet: Before [quiet-base.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cf1e04e2d71af939/quiet-base.mp4) / After [quiet-head.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/56cdd0a961e7e0f9/quiet-head.mp4)

All attempts, including unsuccessful native-driver experiments: [raw-recordings-and-logs.tar.gz](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/ec612dccd3a0b861/raw-recordings-and-logs.tar.gz). Synthetic state and runtime caches are excluded. SHA-256 manifest: [sha256.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4e5bfd7d3fdb3b4b/sha256.json).

AI-assisted; verified with the tests and tools listed above.

## FRICTION

- tool | xdotool/libXtst and xset were absent | preinstall xdotool and x11-xserver-utils in the evidence VM.
- tool | Electron/Xvfb delivered native Q-down/repeats but no Q-up callback despite XQueryKeymap confirming physical release | a native macOS capture host, or explicitly labelled main-process harness evidence for the missing delivery branch.
- infra | isolated XDG_DATA_HOME made the Vite+ node shim download ~230 MB runtime copies per run and approached the disk floor (lowest observed df output: 5G) | retain runtime-cache configuration while isolating app data. Removed only my own runtime caches to recover space; no evidence logs were removed before upload.
- runbook | concurrent startup could choose the same automatic backend port | final hold captures use explicit distinct side ports 39031/39032.

## Report

R2/R3 reproduce the actual app listener failure on base and verify both guards on head. R4/R5 live controls match. R1 has native Linux hold/watchdog smoke and deterministic labelled release/quiet harness captures; native trailing keyUp delivery remains unverified. R6: cannot-verify macos. Production source and PR unchanged; no commits. All app runs stopped; scratch worktrees and this step's scratch directory are removed after upload. The original lead worktree and lead scratch root are retained.

## ghdrop output (verbatim)

[assert-evidence.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6cd3e3e61b33365e/assert-evidence.py)
[behavior-comparison.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/503f67517b94ff9c/behavior-comparison.md)
[behavior-diff0.diff](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2986028351d80c91/behavior-diff0.diff)
[driver.cjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b57f2bdcb8346950/driver.cjs)
[listeners-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf927a94560f1a5b/listeners-base.log)
[listeners-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0a97dbc3f57d5211/listeners-head.log)
[native-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1621d2a0f7202df6/native-base.log)
[native-base.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/edfe18005ee3692d/native-base.mp4)
[native-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/addc8cb1c94179e9/native-head.log)
[native-head.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8fe2abfcd6dcca66/native-head.mp4)
[native-input.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8b21fa87db1b85b7/native-input.py)
[package-evidence.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1cfe65572dd60be9/package-evidence.py)
[quiet-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/62a3cd6973a34cdd/quiet-base.log)
[quiet-base.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cf1e04e2d71af939/quiet-base.mp4)
[quiet-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1b407c92ea11be68/quiet-head.log)
[quiet-head.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/56cdd0a961e7e0f9/quiet-head.mp4)
[raw-recordings-and-logs.tar.gz](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/ec612dccd3a0b861/raw-recordings-and-logs.tar.gz)
[release-base.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/07b74b34366e4c28/release-base.log)
[release-base.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5d4c18bb5cd301ff/release-base.mp4)
[release-head.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5381625e32d2535d/release-head.log)
[release-head.mp4](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/61c7a71a26960a79/release-head.mp4)
[reproduce.sh](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a8b6fdcd11219086/reproduce.sh)
[run-one.mjs](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/7e2c5c397082562e/run-one.mjs)
[sha256.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4e5bfd7d3fdb3b4b/sha256.json)
[validation.log](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b1cbc47b59eeb485/validation.log)
