# Desktop catalog key-loss reproduction

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

Environment: real Electron 44.10.1 on Linux under headless-desktop (Xvfb + D-Bus + GNOME keyring), 1280x900, light theme. Both app builds come from their own checkout. The scenario runner cannot exercise desktop safeStorage or IPC.

Base: [3a8c250cb0](https://github.com/pingdotgg/t3code/commit/3a8c250cb0c8056f2f563091fd412fe5db809fa1)
Head: [02f10ee561](https://github.com/pingdotgg/t3code/commit/02f10ee561ac532abd4a981968d39f110959de85)

Build each checkout after vp i: vp pack in apps/desktop, then vp pack in apps/server. Fetch Electron using node node_modules/electron/install.js in apps/desktop. Run each checkout's web Vite server on a separate loopback port with T3CODE_DEV_SEED=0.

1. Run seed-catalog.cjs with the head checkout and disposable RUN_HOME, XDG_CONFIG_HOME, and original XDG_DATA_HOME. It saves one synthetic connection through the real desktopBridge.setConnectionCatalog IPC; Electron encrypts it using gnome_libsecret.
2. Retain the resulting connection-catalog.json. Copy exactly those bytes into each side's disposable T3 home under userdata. Use separate fresh XDG_CONFIG_HOME and XDG_DATA_HOME for recovery, so neither side has the original keyring key. All databases are generated fresh by each app. Finish onboarding without importing projects before recording. The head's final repeated recovery used the same source catalog and its already-completed onboarding preference.
3. Run proof-driver.cjs <checkout> recovery under headless-desktop for each side. Set RUN_HOME, OUT (new directory per run), WEB_PORT, API_PORT and SOURCE_CATALOG. The driver launches the full desktop main bundle, reads the catalog three times over real IPC, opens Settings / Connections / Environments, and captures the settled app.
4. Base cannot open settings and stays at Still connecting; pressing Reload returns to the same error. Head displays No saved remote environments and a working Add environment dialog.
5. For head, start a disposable second server on 127.0.0.1:17600 with synthetic-host.cjs as a Node preload. That changes only the server's displayed hostname to Evidence environment. Mint a pairing token with the real CLI pair command into PAIR_FILE. The driver pairs it using the Add Environment UI. The pairing code input is changed to password type solely to hide the secret in the recording.
6. Quit and launch proof-driver.cjs <head-checkout> restart with the same recovery keyring and T3 home. Evidence environment reconnects. Real safeStorage decrypts the fresh catalog with the new key. The original ciphertext still matches the single .undecryptable backup.

The Windows-specific Local State deletion procedure was not run: Linux stores this key in the OS keyring, so a fresh isolated keyring exercises genuine key replacement instead. No mocked safeStorage, synthetic ciphertext, paid agent turns, copied live databases, or application implementation changes were used.
