# Desktop restart proof

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

Use Linux with Xvfb, headless-desktop, ffmpeg, git, passwordless sudo, polkit, dpkg, and the checkout's Playwright dependency. No provider turn is needed. Keep the two checkouts and all evidence in isolated directories. The base is [88bf393b30](https://github.com/pingdotgg/t3code/commit/88bf393b30d031ad998651eb66f4df804442399c); the head is [aff41a0648](https://github.com/pingdotgg/t3code/commit/aff41a0648896c08bc033d80ebec4df7f985cc5a).

Run `bash build-evidence.sh <checkout> <evidence-directory> <base|head>` for each checkout. This performs the full production build, then packages version 0.1.9 as an AppImage and Debian package. It reuses that exact code to package a 0.1.10 Debian update, changing only version metadata and configuring the local feed. The dist exclusion prevents repackaging previous artifacts into the update.

The two JavaScript driver files belong next to each other. A run uses fresh T3 home, config and cache directories; it deselects all history imports and adds only a synthetic Sudo-demo git repository. It never opens the live T3 database. A neutral shell prompt avoids exposing local account and directory names.

For ordinary relaunches, install the side's 0.1.9 Debian package with `sudo dpkg -i`, then run:

```
headless-desktop node run-proof.cjs <checkout> <evidence-directory> <before|after> deb-relaunch '/opt/T3 Code (Beta)/t3code' <unused-debug-port>
```

For the AppImage branch, use the side's `.AppImage` as the executable and `appimage` as the kind. The driver starts the actual image runtime, rather than supplying synthetic APPIMAGE/APPDIR values. The transcript records whether the executable was mounted and hashes each mount path, so fresh mounts can be distinguished without publishing local paths. On the tested base image, the first relaunch did not return a replacement window; the matched sudo comparison therefore uses Debian packages.

For update installs, start `python3 -m http.server 19390 --bind 127.0.0.1 --directory <side-update-directory>`. Install the same side's 0.1.9 Debian package. Configure its `resources/package-type` as `deb` and `resources/app-update.yml` with a generic feed at `http://127.0.0.1:19390` and cache name `t3code-updater`. These fixture files are needed because the unsigned local 0.1.9 build has no production release feed. Use `deb-update` as the driver kind and a new debug port.

The local updater runs the real pkexec/dpkg installer. For unattended capture, authorize only this user's `/bin/bash -c 'dpkg -i <isolated-cache>/...deb'` with a temporary polkit rule, and include the neutral `<evidence-directory>/demo-shell` in `/etc/shells` (pkexec rejects unlisted SHELL values). Remove the rule and that one shells entry afterward. No updater method or install operation is mocked. Check that `dpkg-query -W t3code` reports 0.1.10.

Each driver records the initial PID and kernel flag, invokes the real `desktopBridge.setServerExposureMode` IPC for network-accessible and then local-only (or check/download/install IPC for the update), waits for a different Electron PID, and runs the same inspect.sh inside the integrated terminal. The command reads real /proc status, runs `sudo -n id -u`, and reports its exit status. Update runs also display the installed Debian version. Screenshots require two identical captures 500 ms apart. Videos show the window disappearing and returning, and new PIDs.

The Xvfb screen is 1920x1080 and the app is 1100x780 centered at 410,150. The unused composer is concealed for privacy. Apply `node redact-video.cjs <run/restart.mp4> <public.mp4>` before sharing: this additionally covers the model selector during transient startup frames, preserving frames that display the Name diagnostic. Review the output, including its final frame, before upload. The original terminal output and sudo results are unmodified.

Stop the app, feed server and Xvfb sessions; uninstall the test package; remove the two temporary authorization fixtures; then remove the isolated data and checkouts.
