# Delegated background completion proof

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

## Environment

Run the exact base and head commits in separate checkouts with fresh, unseeded T3 homes. Both captures use the real web client at 1280 x 800, light theme. Android captures use a Pixel 9 emulator, Android 16, 1080 x 2424, light theme, with each checkout serving its own Metro bundle and server.

The scripts are deterministic ACP recordings, not a live language model. They use the real provider adapter, MCP delegation, child thread, Node background subprocess, completion event, and parent notification. No database rows, timestamps, or UI text are injected. The names scenario, child, and steer are synthetic fixture modes.

## Setup and normal run

Place seed.mjs, completion-agent.mjs, and scenario-replay.mjs together. Preserve the steer version separately, then copy completion-agent.mjs over scenario-replay.mjs for the normal run. Run vp i in each checkout.

1. From each checkout, start `T3CODE_DEV_SEED=0 node scripts/scenarios/start-app.ts web "$PROOF_HOME" 127.0.0.1 "$WEB_PORT"`. This creates a fresh isolated home and disables real providers. Never reuse a live home.
2. Run `node seed.mjs "$CHECKOUT" "$PROOF_HOME"`. Wait for the settings watcher. Pair the browser using the generated private pairing-path file; never publish it.
3. From the checkout run `node apps/server/src/bin.ts thread start "$PROOF_HOME/workspaces/async-check" 'Delegate an asynchronous background check. Finish your answer while it runs.' --title 'Delegate resumes after answer' --provider scenarioReplay --model scenario --json --base-dir "$PROOF_HOME"`.
4. Open that parent thread. The child starts a Node process waiting for `.git/release-v5` and ends its initial prompt. The parent acknowledges the initial child result and finishes its answer. Note Worked for. Start recording the web client, with the original fold collapsed.
5. Leave the thread idle, then `touch "$PROOF_HOME/workspaces/async-check/.git/release-v5"`. The background process exits; the adapter creates a later child continuation. Watch the live task card, then the settled task and separate Finished notification. Wait for the parent notification response.
6. Capture the result. Open the same parent thread on the Android app connected to that checkout and capture the duration.

Observed normal run: base web Worked for grew from 3.5s to 1m 20s; base Android showed 1m 21s. Head web and Android kept 3.9s. The head settled child card folded into the earlier turn; the separate Finished notification remained visible. Small web/mobile rounding differences are left intact.

## Steer run

Restore the uploaded steer version as scenario-replay.mjs. Add steer to the customModels in the isolated settings if needed. Use a new parent thread and `--model steer`, with prompt 'Delegate an asynchronous background check and wait for my steer.'

1. Wait until the parent says it is ready for a steer while the child background command waits.
2. Start recording. Type 'Keep the answer short' in the composer and click Steer message during the original parent turn.
3. Let the parent finish. Both sides show Continued for 2.7s. Record the original Worked for, too.
4. Leave the parent idle, then touch `.git/release-steer` in its project. Wait for the resumed child and parent Finished notification response.
5. Capture the settled view with folds collapsed.

Observed steer run: base Continued for changed from 2.7s to 2m 46s and Worked for from 1m 28s to 4m 10s. Head Continued for stayed 2.7s and Worked for stayed 1m 32s. Both steer recordings retain the same first 200 seconds at original speed; only the trailing idle footage is omitted.

Every uploaded still was checked against an identical second screenshot at least 500 ms later. All uploaded captures were visually inspected. No test results are used as evidence.
