# Linux desktop registration proof

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

This is a manual runtime comparison, not a unit test. Each side is its own release-packaged, unpacked Linux x64 build, produced with the repository's build-desktop-artifact script (`--platform linux --target dir --arch x64 --skip-build`) after building desktop/server/web. The app runs under headless-desktop with `--no-sandbox --disable-gpu`. Its inspector confirms `app.isPackaged === true` and only drives window bounds, readiness, and normal `app.quit()`.

Base: [b3fdf2b10f](https://git.cafe/pingdotgg/t3code/commit/b3fdf2b10fb92e5dbc71a83381c602a8a464bbca).
Head: [71630d1660](https://git.cafe/pingdotgg/t3code/commit/71630d1660a82f62230986a4de6bf56d144542ee).

## Run

Place drive.py and inspect.mjs together. Give each side a fresh output directory and distinct inspector port:

```
headless-desktop python3 drive.py /path/to/packaged/t3code before BASE_COMMIT /path/to/new-before-run 19387
headless-desktop python3 drive.py /path/to/packaged/t3code after HEAD_COMMIT /path/to/new-after-run 19388
```

The driver creates isolated HOME, XDG_CONFIG_HOME, XDG_DATA_HOME, and T3CODE_HOME directories. The app PATH is /usr/bin:/bin; provider CLIs and external accounts are absent. It uses generic XDG desktop settings and real /usr/bin helpers, with no wrappers or mocks. It never starts an agent turn. T3CODE_DEV_SEED=0 disables copying any existing user data. Each side has a distinct backend port.

For each side: launch and quit; relaunch unchanged; delete MIME cache and relaunch; backdate MIME cache and relaunch; corrupt desktop entry and relaunch; change the scheme's default handler and relaunch; corrupt the persistent icon and relaunch; relaunch unchanged after all repairs. Every launch waits for registration completion and the real welcome screen. The driver records nanosecond mtimes, SHA-256, sizes, file write opens and successful helper executions. Before each still, two root-window screenshots 500 ms apart must match exactly.

The screen shows the real app and the driver's runtime measurements side by side. A fixed privacy mask covers the environment identity area; it does not cover measurements. No source modification is used. The videos show the actual sequence; they are not a synthetic animation of the report.

The on-screen xdg-mime count includes all invocations, including Electron's unrelated `xdg-mime query default inode/directory`. The registration-trace transcripts retain exact arguments so the relevant `xdg-mime default ... x-scheme-handler/t3code` calls can be distinguished. Reports include exact mtimes and hashes. Published traces contain only registration file write opens and helper calls, with private paths normalized to symbolic XDG and package paths.
