# Diagnostics CPU-time reproduction setup

Use the uploaded scenario file in `scripts/scenarios/` in a checkout of current `origin/main`.

- Install with `vp i`.
- Build the native monitor with `vp run build:resource-monitor`.
- Set the global `timeout` in `scripts/e2e.config.ts` to `1_800_000`, since six workers need about ten minutes to accumulate one CPU hour.
- Supply the resulting native binary to both app runs through `T3CODE_RESOURCE_MONITOR_PATH`. The monitor source is identical on the base, head and runner checkout used for this proof.
- Use fresh scenario data; never seed from an installed T3 database.

```sh
T3CODE_DEV_SEED=0 \
T3CODE_RESOURCE_MONITOR_PATH="$PWD/native/resource-monitor/target/release/t3-resource-monitor" \
T3_SCENARIO_INHERIT_ENV=SHELL,T3CODE_DEV_SEED,T3CODE_RESOURCE_MONITOR_PATH \
vp run scenarios:prove scripts/scenarios/diagnostics-cpu-rollover.e2e.ts \
  --base 12102c74a323c67bcbec189ae23dc50c62740895 \
  --head 37381ebd32be756e789d29826c03568e24dd8747 \
  --upload-command "ghdrop upload"
```

The scenario creates one synthetic project and replay thread. Its terminal runs `sleep infinity | node burn.mjs 59.97 1 &` and `sleep infinity | node burn.mjs 3599.7 6 &`. Each Node process measures total process CPU usage, idles at the target, and records its PID and measurement. It then opens Settings → Diagnostics and captures the real native monitor's Live process tree. The only behavioral assertion checks that those PIDs' CPU TIME cells read `1m` and `1h`.

Environment: Linux x64, headless Chromium 156, 1280×800 viewport, default light theme. Short recordings contain the final Diagnostics view; the full run includes synthetic terminal prompts and is retained privately rather than publishing internal paths.
