# PR watch completion after an early failure

This driver runs the real T3 Code server, watch reactor, MCP watch command, replay agent, and Chromium web client. Only GitHub's external responses are synthetic. No GitHub writes or application source changes are involved.

Environment: Linux, Chromium, 1280 × 800, light theme. Each side starts on fresh isolated state, with automatic seeding disabled. The synthetic PR has no required checks and an unchanged head commit and conversation throughout.

Sequence:

1. Create the demo project and a replay-agent thread through T3's CLI.
2. Call `watch_pull_request` through the running server's MCP endpoint.
3. Wait for the reactor to commit its baseline: Lint, Build, and Integration are all running.
4. Change Lint to failure while Build and Integration remain running.
5. Let the failure wake run and complete. Open the checks popover and capture the waiting thread beside the failure activity summary.
6. Change Build and Integration to success. Leave Lint failing; add no comments or commits.
7. Wait through the normal two-minute reactor sweep. Capture the completion notification on the fix, or the still-waiting thread on the base.

The driver opens the checks popover and waits for successful terminal run events. Its database access is read-only synchronization against synthetic state; all state is created through the server's CLI/MCP commands. Still captures are accepted only after identical screenshots 500 milliseconds apart. The browser recordings omit the first 20 seconds of initial sign-in setup and retain the real polling waits.

## Running

Place `pr-watch-after-early-failure.e2e.ts` under `scripts/scenarios/` in each checkout. Use the repository's scenario configuration with only the web target enabled, a 600000 ms test timeout, and the app command's `inheritEnv` set to `['GH_CONFIG_DIR', 'GH_TOKEN', 'T3CODE_DEV_SEED']`.

Start the supplied `forge-fixture.mjs` with `CI_WATCH_SCRATCH` pointing to an empty scratch directory. It listens on `forge.sock` in that directory and a loopback control port, 18942. In an isolated GitHub CLI configuration, set `http_unix_socket` to that socket. Set `GH_CONFIG_DIR` to that isolated configuration and `GH_TOKEN` to a synthetic fixture-only value. Run one side at a time:

```sh
T3CODE_DEV_SEED=0 vp run scenarios scenarios/pr-watch-after-early-failure.e2e.ts --target web
```

The base is [b1c1e07ded](https://github.com/pingdotgg/t3code/commit/b1c1e07ded4524dfb8dd054dc4dd3504ec2f86d7); the fix is [9c0ae214c7](https://github.com/pingdotgg/t3code/commit/9c0ae214c7c11ef6f6f8cec55ff4969fea9f7077).

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