# Windows PATH proof driver

These scripts were used with a disposable Windows Server 2025 VM, Node 26.13.1,
vite-plus 1.4.0, Playwright 1.64.1 and Electron 44.10.1. No provider turn or
provider authentication was required. Codex is the actual npm package, version
0.169.0; the precedence wrappers log their selection and delegate to that package.

Prepare two worktrees under the current user's home, named `evidence-base` and
`evidence-head`, at the base and head commits respectively. The proof used base
[1f698f01d9](https://github.com/pingdotgg/t3code/commit/1f698f01d9fbbc5858963c1fe81d4b3e00783a5d)
and head [e6cba356d7](https://github.com/pingdotgg/t3code/commit/e6cba356d7a661ecc2064b026940b5e1edaecaa0).
Run `vp i` and `node apps/desktop/node_modules/electron/install.js` in each.
Place these driver files in `C:\evidence`. The VM supplied `C:\tools\desk.ps1`
to launch a command in the logged-in desktop session. Run `setup.ps1` before
starting either app. The setup script records the inherited process PATH before
installing Codex and removes the additional vite-plus shims, leaving the CLI only
in `C:\provcli`.

For each side, use `launch.ps1 -Side <base|head> -Case <user|refresh>`. It creates
a separate, fresh T3 home for each run and disables development database seeding.
Wait for the server's well-known environment endpoint to answer, then run the
worktree's `node apps/server/src/bin.ts pair --base-dir <run-home>` with its output
redirected to that run's `pair.txt`. Pairing output is private and is not uploaded.
From that side's worktree, run `node C:\evidence\capture.cjs <side> <case> web`.
Run `runtime.ps1` for the same side/case, retain its output, and stop the tracked
process tree using `stop.ps1` before starting the next run.

The user case adds the CLI directory only to User registry PATH before launch.
The refresh case removes the installed package from its final location before
launch. While Providers is open, the driver deploys the predownloaded real npm
package into `C:\provcli`, adds the User registry PATH entry, waits 11 seconds,
and clicks Refresh provider status. The package deployment and registry write
are external fixture operations performed by the driver while the app stays open;
the video shows the Providers interaction. The driver does not change Binary path.

For the desktop pair, use `launch.ps1 -Side <side> -Case machine -Surface desktop`
and wait for Electron's debugging endpoint. Run
`node C:\evidence\capture.cjs <side> machine desktop` from that side's worktree.
This adds the CLI directory only to Machine registry PATH. Desktop renderer
automation selects the main page rather than DevTools and uses the app's hash
route. The runtime transcript reads the real desktop shell-probe cache, recording
only the synthetic PATH markers, not the rest of the machine's PATH.

After both machine cases, run `precedence-setup.ps1` once. For both commits, run
the desktop `precedence` case, recording runtime output before stopping it. It
sets a process PATH wrapper and a PowerShell profile prepend, with the real CLI
directory still only in registry PATH. Then run the desktop `process` case on
both commits; it clears the synthetic profile prepend. Each launch clears the
selection log. The real app's Codex health checks write `profile` or `process`
through those wrappers; the transcript also records their order in the real
desktop probe's saved PATH.

Every capture run writes a new timestamped directory. Stills require identical
screenshots 500 ms apart. Web videos use Playwright recording, trimmed to one
second before the Providers click so pairing and startup are excluded. Desktop
videos use CDP screencast frames with their original timestamps, followed by a
two-second hold. All captures use a 1440 x 1000 dark renderer. The environment
name selector is covered for privacy in published images and videos; the app's
provider status and Binary path are unaltered. No application source was changed.
