# SSH Node diagnostic reproduction driver

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

This is a manual desktop reproduction, not a unit test or a scenario. The production Electron app calls its normal SSH IPC handler against real OpenSSH, with actual Node binaries in an isolated chroot. No Node diagnostics are mocked.

Environment: Linux x86_64, Electron 44.10.1 under headless-desktop; light theme; 1100x780 content viewport. Separate base and head checkouts were installed with vp i and built with vp run --filter=@t3tools/desktop build:bundle. Each app started with T3CODE_DEV_SEED=0 and a fresh isolated T3 home. Onboarding imports were deselected; no projects, accounts, or threads were imported.

Base: [70833b2f55](https://github.com/pingdotgg/t3code/commit/70833b2f558ee86d7a31d954126e282c8340ac22)
Head: [df62432cbb](https://github.com/pingdotgg/t3code/commit/df62432cbb02ae746c2e85bd5562460747024306)

## Driver files

Set PROOF_SCRATCH to an empty scratch directory, BASE_CHECKOUT and HEAD_CHECKOUT to their respective checkout roots. These are portable copies of the driver files used for capture; local absolute paths have been replaced with these variables.

- setup.py: creates disposable SSH keys/config, loopback sshd configuration (port 22367), and an ssh client wrapper that only adds -F pointing to that config.
- isolate.py: copies the real Node 18.20.8 executable and its dynamic libraries plus normal shell utilities into an isolated remote filesystem. Download the official node-v18.20.8-linux-x64 archive into PROOF_SCRATCH and unpack it first.
- remote.sh.template: final forced-command wrapper. Replace REPLACE_WITH_PROOF_SCRATCH with the scratch directory. It selects actual Node 18, actual Node 24, or no Node, sets a fresh synthetic HOME, and runs the unmodified production launch script received over SSH inside the chroot. The state key is the production hash of the synthetic SSH target.
- copy-runtime.py: stages installed native runtime dependencies for the compatible control.
- start-base.sh / start-head.sh: app launch environments, run using headless-desktop. Start each checkout's web dev server first on ports 14369 and 14367 respectively. Install Electron using node node_modules/electron/install.js from apps/desktop.
- capture-flow.mjs: drives the actual desktop renderer through Electron DevTools (19369 base, 19367 head), captures the interaction with real frame timestamps, and waits for two identical screenshots 500ms apart before saving the still. Requires ffmpeg. Run with `node capture-flow.mjs before incompatible`, then `after incompatible`; repeat with `missing`, then `compatible`.
- runtime-driver.ts: optional supplemental direct production-launcher invocation; copy into packages/ssh/proof-driver.ts in each checkout and run with node. It prints only the remote diagnostic and exit status.

## Fixture preparation details

Use sudo to start a dedicated sshd with the generated config. Create /dev/null and /dev/urandom in the scratch chroot (character devices 1:3 and 1:9, mode 666). The shell utilities env, cmp, tail, nohup, readlink, touch, find, sort, and wc were also copied into the chroot. For the compatible control, install the official Node 24.10.0 binary as /versions/node24 inside the chroot and copy its dynamic dependencies; copy the runtime native modules' ldd dependencies too. Node 18 is /versions/node18. The final remote wrapper selects these using a symlink at /bin/node.

Copy each checkout's apps/server/dist into the scratch chroot as /synthetic/server (base) and /synthetic/server-after (head). Both use the installed runtime dependencies staged under /synthetic/server/node_modules. The remote wrapper points /synthetic/server-entry.mjs to the selected build. Set chroot /etc/machine-info to PRETTY_HOSTNAME="SSH control" for a synthetic public label. Compatible controls use separate synthetic homes, compatible-before and compatible-after.

The incompatible and missing-Node reproductions exit before any server entry is executed. The compatible control starts each side's real server and establishes an authenticated SSH-managed tunnel.

## Steps and observations

Settings > Environments > Add environment > SSH; fill host diagnostic-proof, username user, port 22367; Add environment.

Node 18.20.8: base rejects with both required-range and missing-Node guidance; head rejects with only the required-range diagnostic. Supplemental launcher transcripts show exit status 1 on both.
No Node in the remote filesystem: both reject with installation guidance.
Node 24.10.0: both connect successfully and show SSH control as Connected.

Stop the app processes and the remote servers whose PIDs were recorded in their isolated runtime files; stop the dedicated sshd and web servers; remove only the scratch directories and the two reproduction worktrees.
