# SSH ownership desktop proof

The driver runs two real Electron desktop processes with fresh, separate HOME, XDG and T3 state directories. A real local OpenSSH daemon forwards to a real T3 server. No launch or stop implementation is mocked. The SSH wrapper only supplies the isolated identity and known-hosts file; it execs /usr/bin/ssh. The daemon's ForceCommand redirects HOME and selects the installed Node executable, then executes the original SSH command. No existing user data is seeded.

Requirements: Linux, headless-desktop, OpenSSH server/client, ImageMagick, ffmpeg, Python, repository dependencies, and downloaded Electron runtime. The target username in prove-desktop.mjs is `user`; adjust it to the test account on another machine.

1. Put setup-ssh.py and prove-desktop.mjs together in an empty scratch directory. Run `python3 setup-ssh.py`.
2. Start `sudo /usr/sbin/sshd -D -e -f <scratch>/sshd.conf` and retain its process/session.
3. Build each checkout's desktop and real server: `T3CODE_DEV_SEED=0 vp run --filter @t3tools/desktop build:bundle`. Download Electron with `node node_modules/electron/install.js` from apps/desktop.
4. Start each checkout's web development server on a separate free port, retaining the sessions. Do not set VITE_HTTP_URL or VITE_WS_URL.
5. Sequentially run `EVIDENCE_WEB_URL=<that checkout's web URL> headless-desktop node <scratch>/prove-desktop.mjs before <base checkout>` and the same command with `after <head checkout>`.
6. Each timestamped run directory contains original screenshots, a screen recording, and observations.json. The driver adds the same SSH target in A and B, reads the real IPC bootstrap classification without issuing a new pairing token, switches B off through Settings, and observes A and the original server process.
7. A screenshot is retained only after two screenshots 500 ms apart are byte-identical. The recording covers adding B and switching it off. The driver disconnects through A's real IPC and closes both desktops in finally.
8. Stop the retained SSH and web sessions. The renderer and backend for the final base run came from the base checkout, and those for head came from the head checkout.

Expected captured result: base classifies B as managed, overwrites A's launcher, stops the original server and leaves A reconnecting. Head classifies B as external, preserves A's launcher, keeps the original server alive and A connected.

Viewport: 1920×1080 Xvfb display, two 960×1080 desktop windows, light theme, Settings → Environments → List. Evidence images add a caption strip above unmodified stable screenshots; videos add labels and an event caption to the original recording.
