# Desktop folder-drop proof

Run the same `driver.mjs` on each checkout, one side at a time. Requires Linux, Xvfb via `headless-desktop`, Node, vite-plus, ffmpeg, and the checkout's installed dependencies. No provider turn is sent.

Base: `f3b168b9f661eb464ad47d986dc16813c622f8e2`
Head: `aa90d0bd29fcd3d1509678e8f2ef56a52f62957d`

1. In each checkout, run `vp i` and `node apps/desktop/node_modules/electron/install.js`.
2. Choose a fresh scratch directory for each side. In the commands below, `$runHome` is that side's absolute scratch home. Create `$runHome/userdata/desktop-settings.json` containing `{"localEnvironmentEnabled":false}`. Do not reuse an existing T3 home or database.
3. From that side's checkout, keep this server running in its own terminal:

```sh
T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --base-dir "$runHome" --port 3973 --host 127.0.0.1 --no-browser > "$runHome-server.log" 2>&1
```

4. From the same checkout, keep the desktop dev app running in another terminal:

```sh
T3CODE_DEV_SEED=0 XDG_CONFIG_HOME="$runHome/config" T3CODE_DESKTOP_REMOTE_DEBUGGING_PORT=9333 headless-desktop vp run dev:desktop --home-dir "$runHome" > "$runHome-desktop.log" 2>&1
```

5. Wait for the app to show “This computer is off” and for port 9333 to be available, then run:

```sh
node driver.mjs "$checkout" "$runHome" "$newOutputDirectory"
```

The driver pairs through Settings > Environments > Add environment > Remote link using the code in the local server log. It captures the connected server and disabled bundled backend, confirms `desktopBridge.getHostEnvironmentId()` matches the server's well-known descriptor, returns home, and records two real directory drops separated by more than ten seconds. It then runs `node apps/server/src/bin.ts app <activation-demo> --base-dir <scratch-home>` through the real desktop control socket. This is the supported `t3 app <dir>` activation command on these revisions; bare `t3 <dir>` is rejected by their CLI argument parser.

The synthetic directories are created by the driver. No copied database, provider credentials, model calls, mocked bridge, or patched app code is used. Both sides use a 1100×780 light-theme Electron renderer. Stills require byte-identical screenshots at least 500 ms apart. The video samples the renderer every 500 ms and preserves actual capture timestamps. Each side's recording contains the first drop, retry, and CLI activation without cuts.

Only visible machine-label elements are masked, using the same locator rule on both sides; no mask is drawn when that label is absent. The opening home frames have no redaction rectangle. `observations.json` and application logs are local diagnostics and may contain local paths; do not upload them unsanitized.

Expected observations:

- Base: both drops show the disconnected-server toast; no project is added. CLI activation exits 1 with DesktopAppUnreachableError (desktop control socket absent).
- Head: first drop opens the drop-demo composer without an error toast; retry keeps that composer without a toast. CLI activation exits 0 and opens activation-demo without an error toast.

Stop the desktop and server processes from their terminals before running the other side. Use a new output directory and a fresh home to repeat a run.
