# Desktop unload proof driver

These are the executed driver sources with private local paths replaced by placeholders. No application source was modified. Install each checkout with `vp i`, install its Electron runtime, then build it with `vp run build:desktop`. Put these scripts in `/tmp/unload-proof`, create a synthetic git repository at `/tmp/unload-proof/probe-project`, and replace `/path/to/head-checkout` and `/path/to/chrome-headless-shell`.

Run one side per Xvfb display, using `headless-desktop node driver.cjs <checkout> <base|head> <server-port> <probe-port>`. The recorded run used server/probe ports 9452/4790 for base and 9451/4789 for head, and a 1440 × 900 light desktop UI. Both sides use fresh isolated state.

`driver.cjs` creates a project and a replay thread through the real CLI, opens native server previews, pairs a separate web client, exercises closes, then opens 32 hidden tabs through four active replay sessions and waits 30 real minutes before a fifth owner opens a replacement. The probe emits lifecycle beacons.

`recapture.cjs` produced the final focused captures in those same running apps while the hidden capacity tabs aged. It uses the app's CDP and the main-process inspector; the ephemeral inspector ports at the top must be adjusted for another run. It filters the probe monitor to the current case and records the separately paired web client as well. Only the synthetic probe monitor is filtered; the app is unchanged.

For setup-close, the main-process driver temporarily holds `Emulation.setEmulatedMedia` for the matching real webview during server setup, requests manager close while setup is held, and releases the command 300 ms later. This makes the pending setup boundary deterministic without changing close logic. The concurrent case sends two manager close RPCs together.

The custom replay source holds its prompt after emitting its normal transcript so each capacity owner remains a real active agent session. Its private MCP session file contains credentials and must never be uploaded. It uses the repository replay fixtures; no paid provider runs.

The final screenshots are real app screenshots, including native webview rendering. The monitor shown inside the app is supporting probe data. Videos record the Xvfb app window; the web-client recording shows the streamed server tab and the web client's Close button.

Private state, credentials, raw Electron logs, and failed draft captures are excluded from this bundle.

`capacity.cjs` is the final standalone capacity capture driver. It repeats the same fresh CLI seed, opens 32 hidden native tabs through four replay owners, emits a heartbeat every 30 seconds during the real 30-minute idle interval, then records eviction and navigates to the fifth owner to show its admitted replacement in the app. Run it under a PTY; the earlier non-PTY long-running harnesses returned SIGTERM before reaching the idle threshold.

`grace.cjs` is a separate bound control in the original running apps: it installs a 12-second synchronous stall in beforeunload. On head, beforeunload runs and close completes at the existing five-second grace bound. Pagehide cannot run during that intentional stall; its absence in this control is expected. The normal close captures show both beforeunload and pagehide.

The final capacity harnesses exited 1 after the optional `replacement-admitted.png` stability check: the active replay turn timer kept changing. Their eviction-before/after screenshots had already passed the two-screenshot stability check, and their continuous videos show the admitted replacement page. No replacement still is supplied. `capacity-observations.json` reports this explicitly; it is an observation summary, not a test result.
