# Find after a failed history load

Base: e0064f86030320d3f370da4e4160919eef5f3a2f
Head: 812b0b2d5ed6a8e289c72101bf5462c9d636d347

Environment: real web dev apps from separate checkouts, fresh isolated homes, Chrome 158 on Linux, light theme, CSS viewport 1280 x 800, DPR 2. PNG captures are 2560 x 1600. No live database was used. Each side has the same 185 synthetic prompts, "Needle 01 turn" through "Needle 185 turn", with the repository's existing todo-list Replay recording. The seed uses the real CLI/API and provider adapter, not inserted database rows.

This recording produces a skipped-history seam after turn 50, rather than after turn 39 in the original fixture. Both sides use the same 50 -> 51 boundary. This is the same failure condition: a different Find match lies in history that has not been loaded after an earlier history request failed.

## Rebuild

Install dependencies with `vp i` in both checkouts. Put manual-find-seed.ts in scripts/ (its imports refer to the repository's scenario helpers). Run each app from its own checkout and a fresh home. Keep each command in its own terminal session:

```sh
T3CODE_DEV_SEED=0 node scripts/scenarios/start-app.ts web "$proof_home" 127.0.0.1 13887
node scripts/manual-find-seed.ts "$proof_home" http://127.0.0.1:13887 "$thread_output"
node history-fault-proxy.mjs 14887 13887
```

For head, use ports 13888 and 14888 and a different fresh home. The seed takes several minutes. If running the seed helper from a different checkout, set T3_SCENARIO_APP_DIR to the checkout running that side's app. The output JSON contains threadId; environment-id is in the isolated home's userdata directory. Pair the preview browser with that isolated app, then open `/<environment-id>/<threadId>` through the proxy port. Do not capture pairing credentials.

The proxy forwards all real HTTP and WebSocket traffic. Only while explicitly armed, it answers `/history` requests with HTTP 503. It supplies no invented history or provider responses. `/__proof/status` reports actual history requests and WebSocket connection counts. Browser fetch is never patched. Total connection counts include setup attempts; the relevant count stays constant throughout each recorded failure/recovery sequence.

## Recorded interaction (both sides)

1. Set a 1280 x 800 viewport and light theme. Open the completed thread, wait for the composer, press Ctrl+F and type Needle.
2. Evaluate browser-driver.js in the page. Start recording. Run `await findProof.goTo(1)`, then `goTo(39)`, `goTo(49)`, and `goTo(50)`. The initial jump sends history request 1. Turn 50 is directly above Load skipped turns.
3. Run `await findProof.armFailure()`, then click the real Load skipped turns button. Request 2 receives HTTP 503, while the WebSocket stays connected.
4. The app renders its native history error at the top of the timeline, above the current viewport. Save `.messages-timeline-scroll.scrollTop`, scroll that container to zero, and capture the native error. This is a view-only scroll, not an app-state change. Clear input focus before stills to avoid a blinking caret.
5. Restore the saved scroll position. Run `await findProof.restore()` and `await findProof.next()`. Wait at least ten seconds and capture the result.
6. Base: Find says 51/185 but the viewport remains on Needle 50 and the skipped-history seam. No request 3 occurs; the native error remains (shown again by scrolling to the top).
7. Head: request count changes 2 -> 3, Needle 51 loads and is visibly highlighted at 51/185, and the history error disappears. The WebSocket does not reconnect during recovery.

The videos contain holds while the native error and results are inspected. Base shows the error around 1:10 and recovery around 1:28; head shows the error around 0:20 and recovery around 0:43. Stills were retained only after two screenshots at least 500 ms apart matched pixel-for-pixel.

The initial scenario attempt used the minimal multi-turn replay, which did not create enough timeline rows for detached history. Its missing seam was a setup failure, not evidence about the fix. The final evidence above is a manual two-checkout real-app run.
