# Reproduce the runtime capture

Use clean checkouts at before [37fbefd](https://github.com/pingdotgg/t3code/commit/37fbefd147197fab9d88f9c120560c3f21b52cfc) and after [45c1162](https://github.com/pingdotgg/t3code/commit/45c1162b91872e5e7a7ddd7843b24364caca0f4d). Install each with global `vp install`. No source file is modified. The fixture repository's origin is a GitHub URL; the scripts never push or create a forge PR.

Download the scripts into one scratch directory and use that directory as `EVIDENCE_CAPTURE_DIR` (it defaults to the script's directory). Set `EVIDENCE_BEFORE_CHECKOUT` and `EVIDENCE_AFTER_CHECKOUT` if using other checkout paths. Python requires `websocket-client`. Provider credentials must support OpenCode `anthropic/claude-haiku-5-5`; no credential is part of these artifacts.

For each side, run the same commands, substituting the side and a separate unused port:

```sh
python3 driver.py start before measured 19684
python3 seed-all.py /absolute/run/path/printed/by/start > seed.log 2>&1
python3 run-core.py /absolute/run/path A B-local B-native D E C L > core-progress.log 2>&1
python3 run-extras.py /absolute/run/path > extras-progress.log 2>&1
python3 driver.py stop /absolute/run/path
```

Use `after` and port `19685` for the second side. Each start creates a new timestamped run directory and a fresh isolated home. Every launch sets `T3CODE_DEV_SEED=0`; seeded startup is exercised by restarting the same side's own home. Each server's spawn PID, actual server PID, port, SHA, clean status, home, Node version, and observer hash appear in environment records and restart transcripts. Processes are stopped through their captured process groups.

`seed-all.py` creates genuine app-owned delegates from active OpenCode sessions, native OpenCode task projection, and a public RPC fork of a child. It normalizes branch names while retaining the genuine lineage. `phases.py` drives authenticated public RPC and reports foreground activity only in connected phases. `counter.py <trace>` counts completed `branchPullRequest` service spans under each synchronize through trace/parent ancestry, independently of time overlap. Git counts combine `runGitCommand` and git `processRunner.runProcessCore` executions. F separately records failed wrappers (exit 87) and actual git executions.

`observer.mjs` is an external Node load hook. It adds request, branch, cwd, options, event correlation, subprocess arguments/status, and policy observations. Normal A–E runs only add observations. In F, `EVIDENCE_GIT_WRAPPER` selects `fault-git.py`, which fails only an exact `git remote` invocation in marked fixture directories. Recovery writes an off marker. `replay-selectors.py` explicitly enables a file watcher that calls the real service's selector with labelled internal events, then drains the real worker. This is harness coverage for R12 and never public domain-event fabrication. It does not replace the genuine completed-child capture.

`known-pr.py` creates a separate synthetic project with no remote, completes a real worktree child, then stops the server. It configures the fixture origin, fetches the existing public PR branch, and restarts. It only reads the existing PR. It verifies automatic reference persistence, a subsequent child event, equal-reference behavior, and three settled saved-reference records.

The authoritative side recordings are the clean before run and the `after-final` run. Earlier after pilot records are retained under `excluded-preflight/`, outside all acceptance counts. Those pilots established working provider routing and corrected readiness/trace-correlation handling. No database, credential file, `.env`, dependency tree, or repository checkout is uploaded.

Exact observer revisions used by accepted captures are included as `observer-03e4976f2698.mjs` (before A), `observer-367fb1e4e3e9.mjs` (before shared-local B), and `observer-22e47a30da50.mjs` (all later before phases and all clean after phases). Their SHA-256 values match the restart environment records. They differ only in event correlation labels; the replay and subprocess fault paths stay disabled unless explicitly selected. `observer.mjs` is the final version.
