# Delegation OTLP runtime proof

This captures real Linux T3 server behavior. It does not run unit tests. Each revision runs in its own checkout and creates its own fresh database. Only the development replay agent is extended with a deterministic prompt handler; no server, orchestration, projection, or MCP service implementation is modified. The handler makes actual HTTP MCP calls with the provider session's credentials, invokes orchestrator_capabilities and delegate_task, and waits for the child to complete through the real ACP provider adapter.

The server-only failure is not visible in the web chat, so this uses the server/CLI route rather than a screenshot scenario. Images are visualizations of the captured OTLP and CLI output, not screenshots of an app or a tracing product. JSON contains every exported span in each delegation trace, preserving names, span/parent ids, timestamps, and statuses. Resource attributes, SQL attributes, and exception stacks are omitted to keep machine-local details private. Text transcripts include the exact failure ancestry.

## Driver

Prepare two worktrees at base `6ef2c05410b43a06eea6493a0dc66c1c92f5592f` and head `e5425c557696d92309c1b25de30397ff8990c7c5`. Install each with `vp i`.

In a separate terminal start the collector: `python3 collector.py "$OUTPUT_DIRECTORY"`. It listens on loopback port 14318 and records incoming HTTP/JSON OTLP batches. Its private raw file includes machine-local metadata and should not be published.

For each worktree, run `python3 prepare.py "$CHECKOUT"` to install the deterministic replay prompt handler. Start the real app from that worktree:

```sh
T3CODE_DEV_SEED=0 T3CODE_OTLP_TRACES_URL=http://127.0.0.1:14318/v1/traces T3CODE_OTLP_EXPORT_INTERVAL_MS=500 T3CODE_OTEL_SDK_DISABLED=false vp run dev
```

Once listening, in the same checkout:

```sh
node apps/server/src/bin.ts project add . --title 'Trace proof' --base-dir .t3
node apps/server/src/bin.ts thread start . 'PROVE_DELEGATE: delegate one child task' --provider devReplay --model multi-turn --title 'Delegation trace proof' --wait --json --base-dir .t3
```

The CLI authenticates as an MCP client, creates and starts a real parent thread. The parent replay agent initializes its own MCP session, calls capabilities, delegates a task titled `Trace proof child` in wait mode, and emits the MCP result. The child plays the unmodified `multi-turn` recording. Both parent and child completed on both revisions, with the child result `first fixture turn complete`.

Find each `mcp.tool.delegate_task` span in OTLP, then select its entire trace by traceId. On base there are 578 exported spans, including two failed canonical projection reads, each directly under a failed sql.transaction. Both report the not-yet-persisted child thread missing. On head there are 568 exported spans and no error spans. Exact trace ids are in the captures.

An initial setup attempt omitted the MCP initialization handshake and was corrected before either evidence trace was selected; it did not create a delegated child. Neither that attempt nor unrelated parent-thread creation traces are included in the published trace JSON.
