# Reproduce the middle-truncation comparison

Commits: base [01c8e59f14](https://github.com/pingdotgg/t3code/commit/01c8e59f1489a1c89848541ec3ed9ccfefa30a25); head [f18f883260](https://github.com/pingdotgg/t3code/commit/f18f8832605b7b2800b096e08c43c66045b6d2f7).

Use two fresh checkouts, install each with `vp i`, and start each with `T3CODE_DEV_SEED=0 vp run dev`. Run the commands below from the corresponding checkout. Use the Vite origin printed by its dev runner, with `localhost` on this setup. Do not set VITE_HTTP_URL or VITE_WS_URL.

Create a synthetic git repository for PROOF_WORKSPACE (an initial empty commit is enough). Both sides use the same synthetic files. No database is copied. The driver calls projects.mutate and orchestration.dispatchCommand to create 150 sidebar threads, two workload threads, and 322 linked PRs in each workload thread. The intentionally invalid forge host prevents external requests; all displayed PR snapshots are synthetic.

```sh
PROOF_WORKSPACE="$WORKSPACE" node driver.mjs seed "$ORIGIN" "$OUT/seed"
python3 history.py
node driver.mjs measure "$ORIGIN" "$OUT/base-long-final"
VARIANT=short node driver.mjs measure "$ORIGIN" "$OUT/base-short-final"
```

On the head checkout use `head-long-final` and `head-short-final` as output folder names. Finish all replay histories before measuring. Run one measurement process at a time, without video encoding or builds in parallel.

The browser is the repository's playwright-core Chromium, headless, 1440 by 900, dark theme, without CPU throttling. The PR badge inside the workload's sidebar row opens its linked PR panel. Each round trip clicks the nearby Work item 151 row, waits for that panel to unmount and settles for 1.5 seconds, then clicks the workload row, waits for its panel to remount and settles for another 1.5 seconds. One warm-up precedes five measured runs of six round trips each.

Performance.getMetrics deltas give LayoutCount, LayoutDuration, ScriptDuration, and TaskDuration. A 100 microsecond V8 CPU profile estimates inclusive time in fitHead on the base and fitPendingHeads on the head. PerformanceObserver records long tasks. Profile sampling adds overhead on both commits; the sampled fit time is an estimate, not precise instrumentation. Busy and worst-task results cover the whole dev app.

The driver retains every run, captures a still only after two screenshots 500 milliseconds apart are byte-identical, and saves overflowing label text, widths, clipping, and tail translations. export.py trims the initial pairing/setup from each recording and transcodes the measured interactions. The video includes all five measured runs. Only the environment name in the other thread’s details card is masked for privacy; the PR labels are untouched. Relative timestamps differ between captures; label text, widths, clipping, and tail translations are compared separately. report.py summarizes all raw measurements and generates the comparison chart.

```sh
python3 report.py "$OUT"
python3 export.py "$OUT" base-long-final
python3 export.py "$OUT" head-long-final
python3 export.py "$OUT" base-short-final
python3 export.py "$OUT" head-short-final
```

Only the browser surface is measured. No packaged desktop, Safari/WebKit, or 25-open-PR-tab workload is covered.
