# Reproduce the real-server comparison

Use Linux, Node v26.13.1, and two checkouts with dependencies installed. Base is 0667e88b047a546ec605a3e7b997292d546b8821; head is 041b45b734421c4996518232a317b150fe5cc30d.

For each checkout, create a fresh HOME_DIR with userdata/settings.json containing {"workflowsEnabled":true}. Put the supplied bigresult.ts and poke.ts in HOME_DIR/workflows. HOME_DIR is an isolated test data folder, not the OS home. Never use a live database.

From each checkout start the actual server in a foreground terminal:

```sh
T3CODE_DEV_SEED=0 node apps/server/src/bin.ts serve --base-dir "$HOME_DIR" --port "$PORT" --host 127.0.0.1
```

Ports used for this capture: base 4732; head 4731. Servers ran concurrently, drivers ran sequentially (head then base); no other benchmark ran alongside either driver.

Copy seed.ts to apps/server/proof-seed.ts in each checkout, then run from that checkout:

```sh
PROOF_HOME="$HOME_DIR" node apps/server/proof-seed.ts
```

This starts 500 bigresult workflows through the real MCP service, eight at a time, and starts poke. The server executes and persists every step and result. No database rows are inserted by the driver.

Run the identical driver once per side (fresh poke starts at next-0). Arguments: checkout root, isolated data folder, server origin, side label, new output directory.

```sh
node measure.mjs "$CHECKOUT_ROOT" "$HOME_DIR" "http://127.0.0.1:$PORT" "$SIDE" "$OUTPUT_DIR"
```

It measures three batches per action, each with two warmups and twelve measured samples. Snapshot is subscribe-to-first-frame over an already-connected authenticated WebSocket. Refresh is answer-to-changed-frame carrying Poked i, less the fixed 100 ms debounce. Each batch uses the same answer indices on both commits. The driver checks 500 listed runs (499 completed large runs and poke), exact preview objects, full two-line summary, full 65,000-character log, and completed build step. The identical preview digests compare synthetic title/result pairs, excluding generated run IDs and timestamps.

summarize.py takes the parent folder containing base/ and head/ server data directories and run-1/base.json plus run-1/head.json. It reads each SQLite database read-only and extracts the last 60 WorkflowStore.runs spans from the server's built-in trace logs. No server code is modified. measurement.txt is its captured output; comparison.json preserves raw timing samples and derived values.

The list cap is 500, so the newer poke displaces the oldest completed result. Total completed-result storage is 32,525,890 bytes, and steady-state selected result JSON totals are 32,460,840 bytes on base and 14,862 bytes on head. The servers retain full result storage on both sides.

No browser was needed: the reported performance cost and this capture concern real server WebSocket list reads. These are client-observed timings, not the PR's server-only snapshot timings. Engine replay adds increasing work to refresh timings; built-in WorkflowStore.runs spans isolate the repeated list read.
