# Packaged desktop remote update retry proof

Base: aadf2c577c4c08482d7f771df96872469ba414f5
Head: f8e9cd554859a6e1570c653cb6dd0adb3e5814f8

Each host was built from its own unchanged checkout with:

```sh
T3CODE_DEV_SEED=0 vp run dist:desktop:artifact --platform linux --target AppImage --arch x64 --build-version 1.2.3 --mock-updates --mock-update-server-port 43877
```

The 1.2.4 and 1.2.5 releases were actual complete AppImages built from head with that same command and the corresponding build version. The repository's scripts/mock-update-server.ts served the real artifacts and generated manifests from an active-feed directory. The mock-updates build option selects that local static feed; no updater or download responses were mocked.

Run host-control.mjs from the applicable checkout under headless-desktop. Set HOST_APPIMAGE to that build, EVIDENCE_DIR to a new per-run directory, and T3CODE_ENVIRONMENT_LABEL='Update host'. It sets isolated T3CODE_HOME, XDG config/cache/data and port 43880. The helper drives Electron's actual preload bridge via CDP; /check calls the same IPC as About > Check for Updates.

The remote client used T3CODE_DEV_SEED=0 T3CODE_ENVIRONMENT_LABEL='Remote client' APP_VERSION=1.2.5 vp run dev. Pair its printed URL, then add the desktop host in Settings > Environments with a freshly minted host pairing code. No production state was copied. Both runs used light theme, Chromium at 1280x800 CSS pixels (DPR 2); hosts used Linux x64, Electron 44.10.1 under Xvfb 1920x1080.

1. Offer 1.2.4 in the static feed; host check reports it available. Host runs 1.2.3.
2. In the remote client's Environments list, click Update > Confirm. The browser-driver.js observer unloads the app when Downloading appears. With this local feed, that is near the start of the download rather than the reporter's roughly 20% point.
3. Wait for the real host to download and prepare 1.2.4. Keep the remote client unloaded. The RPC trace shows the client request interrupted after about 56 ms while the detached preparation completes later.
4. Copy the real 1.2.5 AppImage and manifest into the active feed. Invoke the host check IPC. Both real responses report status=available, availableVersion=1.2.5, downloadedVersion=null.
5. Reopen the remote client, choose List, Update > Confirm, within five minutes. Do not unload this retry.
6. Base: retry at 08:45:23 UTC, about 27 seconds after preparation, immediately fails with the stale-preparation error. The update RPC fails in 2.64 ms; no second host download/request is logged.
7. Head: retry at 08:42:18 UTC, about 36 seconds after preparation, downloads and prepares 1.2.5, then separately installs/relaunches. Client reports 'Desktop app relaunched on 1.2.5.'

before.mp4 and after.mp4 record the same first confirmation/unload/reopen/retry interaction. The interval while the app is unloaded appears blank. before.png is the stable base error; after-result.png is a frame from the after recording showing successful relaunch. after-settled.png is the stable head result once the success toast disappears. Two screenshots 500 ms apart were identical for both stable stills (search focus was blurred on base to remove its caret blink).

runtime-evidence.json contains selected real desktop log events, actual IPC responses, and update RPC span results. Unrelated startup events, stack paths, machine identifiers, and credentials were omitted. No tests were used as proof.
