11 · The broker contract
Records, routing, delivery — and the same surface over MCP.
Goal
Know which records Scout owns, who writes them, and how an ask flows through routing, endpoint resolution, and delivery.
You need
10 done. Read alongside
agent-integration-contract.md and
scout-comms.md↗.
The idea
The broker is the canonical writer for Scout-owned coordination records: messages, invocations, flights, deliveries, bindings, agent registrations, questions, work items. Everything else — harness transcripts most of all — is observed source material. One writer per record class is what makes multi-surface reads coherent.
An ask's lifecycle, end to end:
- Route — the target resolves to an agent/project/profile. Explicit routing metadata wins; body text is payload.
- Resolve — the endpoint resolver picks (or provisions) the endpoint: exact-session match, wakeable reuse, or a fresh isolated/cardless spawn. Exact-runtime asks are judged on observed values, with the pending-launch trust window covering first execution.
- Dispatch — the invocation reaches the harness through its transport; the flight tracks ack → completion/failure.
- Deliver — the reply lands in the same conversation;
--notifydecides whether the caller waits inline or gets called back.
Walk it
Drive it through MCP
Register it in any MCP-capable host and the tools you used as CLI commands
become callable tools: messages_send, ask, invocations_get,
invocations_wait. The parity rule: ask({ projectPath, harness }) is
capability routing; ask({ targetSessionId }) continues exact context.
Read the grammar
scout ask --help prints the full routing grammar. The structural rules worth
memorizing:
- One target → DM; explicit
--channel→ group;broadcast→ shared opt-in. - Bare reserved names (
Fable,Opus,Kimi,Grok) → fresh profile launch, never existing-target routing. @name.dimension:valuepins harness/model/profile/node on an address.>> project:<path> …is the composer route form for project asks.- Exact session continuation is accepted only when observed runtime matches what you asked — mismatches fail closed, never silently reroute.
Watch a flight's records
The flight view exposes the invocation id, session, conversation, ref, state, and execution resolution — the same fields the broker wrote.
How to tell it worked
- You can name the record class for each handle in an ask receipt.
- You can state the write boundary: who writes messages versus who writes observed session material.
Push further
mcp-api-posture.mdsplits core versus pro MCP tool tiers — read it before exposing Scout to a new host.- Errors are part of the contract:
session_runtime_unobserved,session_identity_mismatch,session_placement_conflicteach name a specific failed guarantee; they should surface, not be retried around. - Route aliases (
scout alias) are durable pointers; asession:alias is live-bound and expires with the session — seeruntime-sessions.md↗.
Next
12 — Adding a harness: the full integration checklist, worked end to end on a real merged PR.