# Rebuild the synthetic evidence

All scripts assume scratch root `/tmp/issue-lead-33252-r2/evidence-capture`. Keep runtime logs private. No production database is read or seeded. The two reviewed checkouts are `/home/ubuntu/wt/issue-33252-before` at [c6ca605630](https://git.cafe/pingdotgg/t3code/commit/c6ca6056309904f89b90b6055d797973be0a0939) and `/home/ubuntu/wt/issue-33252` at [21e22d030c](https://git.cafe/pingdotgg/t3code/commit/21e22d030ca430ef680082630274b3b1c073d35c). Install their dependencies with `vp install`.

1. Run `bash seed.sh` once. It creates one synthetic committed project and three real Pi sessions; never publish its JSONL or private logs.
2. Run `bash start-server.sh before` and `bash start-server.sh after`. Each starts its own fresh scratch T3 home with seeding disabled and Claude/Codex homes empty. Read the web port from each private server log. Keep the recorded PID/process group for cleanup.
3. Install agent-browser 0.41.2 and its Chromium. `capture.py` contains the executable path and owned session name used here; update that path if needed. Open the side's origin with this session. Get its CDP URL, then run `node setup-browser.mjs <cdp-url> <scratch>/browser-init.js`. This registers the fixed clock and explicit request gate on all subsequent navigations.
4. Generate a fresh pairing token with `node apps/server/src/bin.ts pair --base-dir <side-run>/home`, from that checkout, saving output privately. Run `python3 capture.py pair before <private-pair-log>` (or after). Pair again when switching sides because localhost cookies share a name. Run `python3 capture.py provider before` once per fresh server to add Pi via the real settings UI.
5. For each side, run `python3 capture.py capture <side> <width> <theme> LP` for 1440/dark, 1440/light, 390/dark, 390/light. It records Agents → cold scan (held until 6 seconds) → true scanner Pi result, then saves a stable P still.
6. Run `bash session-state.sh empty`, then the same capture command with `E` instead of `LP`. A new /welcome page creates a fresh query registry and successful empty scan. Restore with `bash session-state.sh populated` before the next Pi capture.
7. Run `python3 harness-capture.py <side>` for the eleven context rows. The driver loads that side's real WelcomeWizard/CSS/atoms into a visibly labelled in-browser harness. It controls only scan, environment, permission and command completion boundaries. `fixtures.js` defines every scene and action. It emits initial stills, recordings, environment, steps, timelines and completion text. Row W changes the font to 20px system-ui and resizes through 640px.
8. `build-comparisons.py` picks the latest successful fixed-clock capture of each row/viewport/theme. `diff.py` creates full-viewport zero-threshold and >16/255 threshold images, an RGB×32 image, metrics and 2×2 sheets. Review accepted frames, recordings and diffs before running `publish-evidence.py`.
9. `publish-evidence.py` uploads only selected synthetic assets, metadata and source drivers using `ghdrop upload -m`, preserving its Markdown output verbatim. Never add private logs, pairing tokens or session files to this list.
10. Close the owned browser session. Stop each server's recorded process group after verifying port owners and `/proc/<pid>/cwd`, then remove only the before worktree. Keep scratch evidence and raw logs.

AI-assisted; verified with the tests and tools listed above.

The accepted interaction take uses `retake-interactions.py`, which resets native pointer modality through the shared driver before every recording. It sets `EVIDENCE_W_EMPTY=1` so W uses an unclipped successful-empty still and records populated stress afterward. `review-after-when-ready.py` only schedules local extraction after the owned after capture completes. `cleanup.py` stops the recorded process groups and removes only the before checkout.

The long command ended before its last eight sequences completed. Those were resumed with `EVIDENCE_W_EMPTY=1 EVIDENCE_VIEWPORT=390-light python3 harness-capture.py before F C G A D I O W`; the viewport filter uses the same scene and interaction code.
