# Delegated child failure proof

Run the scenario from a checkout of current main with dependencies installed. Put `inject.mjs` in a local scratch directory and the scenario under `scripts/scenarios/`.

```sh
T3CODE_DEV_SEED=0 \
T3_SCENARIO_INHERIT_ENV='NODE_OPTIONS,T3CODE_DEV_SEED' \
NODE_OPTIONS="--import=$(pwd)/inject.mjs" \
vp run scenarios:prove scripts/scenarios/delegated-child-start-failure.e2e.ts \
  --base 0b489dada1f00db39c99074239c09c006f223aee \
  --head 8af66d018045fa1e31112962a0476a48fead3df6 \
  --upload-command 'ghdrop upload'
```

Adjust the absolute import path to where you saved the loader. The loader applies identical fault injection to both app commits. It changes no retry or task-completion logic:

- The real replay provider calls the real `orchestrator_capabilities` and asynchronous `delegate_task` MCP endpoints. Async delegation sets `completionWake: always` in the server. The first parent turn remains active for eight seconds, then ends.
- The delegated child's ACP adapter `ensureThread` fails with a nested `No space left on device` error. Normal startup attempts exhaust before the child run fails.
- The first filtered lookup of the parent's child-task row fails with `ProjectionStoreReadError`. Every later lookup uses the real SQLite projection store normally.
- A second parent replay prompt emits the acknowledgment shown in the capture. No second user message is sent: the server must wake the parent to produce it.

The web client, server, SQLite event store, MCP delegation, effects, retry loop and automatic parent wake are real. Only the model and two failure conditions are synthetic. This does not exhaust the host filesystem and does not establish the exact production storage error, which was not captured in the report.

`read-state.py` samples only the synthetic scenario database through a read-only connection:

```sh
python3 read-state.py .t3/scenarios/userdata/statev2.sqlite
```

The paired state snapshots supplement the browser recordings: the base has a failed child run but a running task with no result; the head has a failed task, a consumed result transfer, a delegated-completion message and a completed second parent run.
