# Real-app expansion proof

This benchmark drives the actual T3 Code web client, served by each revision's development server. It does not patch the app or substitute a tree component.

- Base: [4dec8cf641](https://github.com/pingdotgg/t3code/commit/4dec8cf64169f6ba7f97b7c34887d9c021db15f7), the merge-base with origin/main.
- Head: [d44e219128](https://github.com/pingdotgg/t3code/commit/d44e219128a9311384109b46438101943b05d88b).
- Windows Server 2025 Datacenter 10.0.26100; Intel Xeon Platinum 8370C, four logical processors. Both sides use the same leased machine.
- Headless Chromium 156.0.8078.4, 1920×1080, dark theme, default CPU speed, no throttling.
- Fresh isolated app data for each checkout, with seeding disabled (`T3CODE_DEV_SEED=0`). No production database or real model is used.

`seed.cjs` creates three synthetic git repositories with 600, 2,000, and 4,000 files. Their paths are `src/groupNNN/folderNNNN/file.ts`, with 50 folders per group. This yields 613, 2,041, and 4,081 directories. It commits `value = 1`, creates a project and a thread through the real CLI with the free devReplay/multi-turn provider, then changes every file to `value = 2`.

`measure.cjs` pairs a browser, opens each thread by its environment/thread route, opens Diff → Changes versus Automatic, and shows the file tree. It waits for the tracked/untracked Git preview and any slow-request toast to finish before timing. It closes unrelated thread details and the main sidebar for clean captures. For each expansion it invokes the real Collapse all folders button, waits 1,500 ms, and invokes the real Expand all folders button with `element.click()` inside the page. It measures `performance.now()` from just before that click until the second `requestAnimationFrame`, separately records synchronous handler time, and uses a PerformanceObserver for long tasks.

The first baseline exploration showed substantial cold JavaScript warm-up variation. Before measuring the head, the driver was fixed to run two recorded warm-ups followed by five measured repetitions at every size, identically on both revisions. Warm-ups remain in each measurement JSON and video; they are excluded only from the reported median and measured spread. `base-cold.json` and `measure-cold.cjs` retain the original five-run baseline exploration.

After every collapse and expansion, the driver reads the existing mounted Pierre tree model without changing it. It verifies every directory, including virtualized rows: zero expanded after collapse, every directory expanded after expansion, expected file and folder counts, and the final button label "Collapse all folders". These checks happen outside the timed interval. The HUD shows measured output; it does not implement the tree. Each final still is retained only after two screenshots 500 ms apart are pixel-identical.

Run each side with its own checkout, home, and free ports, one server at a time. In PowerShell, start long-lived dev servers through Win32_Process.Create so they survive the SSH command, redirect output to a private file, and retain their process IDs for teardown. Once the listeners are ready:

```powershell
node seed.cjs <checkout> <fixture-output>
# Mint a fresh pairing URL into a private log, without publishing it:
node <checkout>/apps/server/src/bin.ts pair --base-dir <checkout>/.t3 > <private-pair-log>
node measure.cjs <playwright-core-module> <checkout> <private-pair-log> <fixture-output>/fixtures.json <new-run-output> before <base-sha>
# Repeat on the head with the same scripts, replacing before with after.
```

The output directory is new for every run. PowerShell's UTF-16 redirected pairing log is decoded by the driver. Captures contain synthetic data only. Published clips trim setup before measurement and preserve the scripted warm-ups and all five expansions at 4,081 folders; playback speed is unchanged.

Windows 11 itself was not available. Windows Server 2025 supplies a real Windows/Chromium measurement, but no Windows 11-specific behavior is claimed.

Work performed by gpt-6.1-sol through the Codex harness.
