Track 02: Collaboration Contract
Stable broker-owned contract every harness must obey.
On This Page
Purpose
Define the collaboration semantics that every OpenScout harness must obey.
This track is about the contract between the broker, adapters, and agents:
- how identity is represented
- how work is delegated
- when an agent is woken
- how conversation differs from durable work
- how
@mentionsmap to routing - how a harness receives the same collaboration rules regardless of runtime
The goal is not a prettier chat layer. The goal is a stable broker-owned contract that lets Claude, Codex, tmux-based agents, and future runtimes participate in the same system without per-harness semantic forks.
Non-Goals
- Do not redesign the native shell UI.
- Do not replace the broker protocol with a prompt-only system.
- Do not make routing fully LLM-dependent.
- Do not collapse questions, work items, and chat into one generic message stream.
- Do not require every harness to share the same transport or API surface.
Canonical Concepts
OpenScout should treat these as distinct records:
identity: who the agent is in the broker modelconversation: the human-readable thread or channelmessage: a conversational turn inside a conversationwork_item: durable execution with ownership, progress, and completioninvocation: an explicit request to do workdelivery: routing intent from the broker to a target agentflight: the lifecycle of a work request or deliverybinding: a durable link from an external surface or harness into the same broker model
This aligns with the current broker-first direction in OpenScout Architecture and the question / work_item split in Collaboration Workflows V1.
Identity Model
Use a two-level identity model:
logicalAgentId: stable human-facing name used in@mentionsand routingendpointId: the concrete harness instance or process currently attached to that identity
Recommended broker fields:
{
"logicalAgentId": "codex-luna",
"endpointId": "endpoint-01HXYZ",
"harnessType": "codex",
"workspaceId": "workspace-abc123",
"projectPath": "/Users/me/dev/openscout",
"status": "online"
}Rules:
logicalAgentIdis stable across restarts when possible.endpointIdchanges when the harness process, machine, or session changes.- routing should prefer
logicalAgentIdunless the user explicitly targets a specific endpoint. - the broker owns the mapping from logical identity to active endpoints.
Delegation Semantics
OpenScout should support three delegation forms:
- direct mention:
@codex-luna - explicit assignment:
ownerId=codex-luna - durable next-move assignment:
nextMoveOwnerId=codex-luna
Semantics:
- a leading mention in a message is a hard routing signal
- mentions inside a message are soft routing hints unless the broker chooses to treat them as hard
- a
work_itemmust always have a current owner and a current next-move owner - a
questionmay be answered without creating work - if the answer reveals durable execution, the broker should spawn a
work_itemlinked to the question
The current workflow guidance in Collaboration Workflows V1 should be treated as the semantic baseline:
questionfor information-seeking interactionswork_itemfor durable execution and coordination
Waking Rules
The broker should wake the minimum set of targets needed to preserve responsibility.
Default waking order:
- explicit
@mention nextMoveOwnerIdownerId- conversation master or channel owner
- no wake, if the message is final, informational, or terminal
Rules:
- wake only the current responsibility holder, not everyone in the conversation
- do not wake the sender for their own message unless the message explicitly requests a follow-up
- do not use broadcast wakeups for ordinary delegation
- treat
waitingas a real state, not a failure state - if a work item is waiting on a dependency, wake the dependency owner, not the entire work group
Durable Work vs Conversation
Conversation is ephemeral enough to be read like chat. Work is durable enough to survive restarts and handoffs.
OpenScout should keep these separate in storage and UI behavior:
- conversation records answer: "what was said?"
- work records answer: "what is owned, blocked, waiting, and done?"
Implementation guidance:
- messages may create or reference work, but they should not become the work record
- work items may summarize chat, but the summary is not the canonical thread
- progress, waiting, review, and completion belong to work items
- routing history must be reconstructable from durable records, not terminal scrollback
Protocol Shapes
Use append-only broker events with explicit targets.
Core shape:
{
"id": "evt-123",
"type": "collab.message.posted",
"source": "openagents:codex-luna",
"target": "conversation:thread-9",
"payload": {
"text": "Please review this change",
"kind": "chat"
},
"metadata": {
"mentions": ["claude-river"],
"targetAgents": ["claude-river"],
"inReplyTo": "evt-122"
}
}Recommended event families:
collab.message.postedcollab.question.createdcollab.question.answeredcollab.work_item.createdcollab.work_item.updatedcollab.delivery.requestedcollab.delivery.wokencollab.agent.heartbeatcollab.agent.onlinecollab.agent.offline
Recommended broker invariants:
- every routed event has a single canonical source and target
- every non-terminal work record has
ownerIdandnextMoveOwnerId - every wake decision is explainable from stored metadata
- a delivery should be derivable from a message, work item, or explicit invocation
Routing Behavior
Routing should be deterministic first, adaptive second.
Suggested order:
- parse explicit mentions
- resolve the target logical agent
- check whether the target is active
- if not active, resolve the next available endpoint for that logical agent
- if multiple candidates exist, choose the current workspace/project-local endpoint first
- only then consider any model-assisted fallback
Rules:
- the broker is the only component that decides canonical delivery
- adapters may help form a prompt or submit a delivery, but they do not own routing truth
- message routing should preserve the original message even when the wake target changes
- ambiguous multi-agent threads may use an LLM router, but only as a fallback behind explicit broker rules
Harness Adapter Responsibilities
Every adapter should do four things and only four things:
- present the broker with the harness identity and capabilities
- inject the collaboration contract into the harness prompt or session context
- emit heartbeats and lifecycle changes for the attached endpoint
- wake or resume the harness when the broker assigns work
Adapter requirements:
- include the current logical agent identity in every prompt contract
- include the current conversation/work context in the prompt
- include the allowed collaboration verbs: delegate, answer, wait, review, complete
- suppress accidental broad wakeups
- translate harness-specific events back into broker events without losing semantics
Adapters should not:
- invent new collaboration nouns per harness
- reinterpret
@mentions - rewrite work state transitions
- turn a wake request into an unbounded restart loop
Prompt Contract Guidance
Every harness prompt should contain the same collaboration contract sections:
- identity
- current workspace or project context
- current conversation or work item
- delegation rules
- mention rules
- stop/wait/review semantics
- allowed tools and resources
Prompt rules:
@mentiononly when delegating real work- do not mention an agent to say thanks or acknowledge receipt
- if the task is complete, answer the human without waking other agents
- if more work is required, create or update the work item and set the next owner
- if the harness cannot act safely, mark the work as waiting instead of guessing
The prompt contract should be identical in meaning across harnesses even if the exact syntax differs.
Rollout Phases
Phase 1: Contract Freeze
- write the canonical collaboration nouns and state transitions
- define the event payload shapes
- decide the identity split between logical agent and endpoint
Phase 2: Broker Enforcement
- validate mention parsing and target resolution in the broker
- persist work and delivery records before waking any harness
- make wake decisions explainable from stored metadata
Phase 3: Adapter Standardization
- update each harness adapter to inject the same collaboration contract
- standardize heartbeat and resume behavior
- normalize harness-specific lifecycle events into broker events
Phase 4: Recovery and Sweeping
- add stale-work sweeps for
waiting,review, and unanswered delegation - wake only the current next-move owner
- make restart recovery deterministic from durable state
Phase 5: Surface Consistency
- expose identity, ownership, and routing state consistently in UI surfaces
- show when an agent is online, waiting, or requires attention
- keep the same semantics across native shell, CLI, and web surfaces
Testing And Verification
This track needs tests that prove the semantics, not just the syntax.
Required coverage:
- mention parsing routes to the intended target
- leading mention vs soft mention behavior
questionstays non-durable unless it spawns workwork_itemalways has a next-move owner- broker wakeups target only one responsibility holder
- adapter prompt snapshots include the collaboration contract sections
- restart recovery reconstructs routing from durable records
Useful test forms:
- pure unit tests for mention parsing and routing selection
- broker integration tests for work item state transitions
- adapter snapshot tests for prompt contract generation
- harness-mock tests that verify no accidental broadcast wakeups occur
Risks
- If mention semantics drift across adapters, routing will become inconsistent and users will not trust delegation.
- If the broker does not own the canonical target decision, the same message can wake different agents on different harnesses.
- If work and conversation stay conflated, recovery and retry logic will remain fragile.
- If the prompt contract is left ad hoc per adapter, the system will accumulate hidden behavioral forks.
- If wakeups are too broad, the collaboration layer will become noisy and expensive.
Open Questions
- Should
@mentionsresolve to bare logical agent names only, or should they also support fully qualified endpoint addresses? - When both
ownerIdandnextMoveOwnerIdexist, should the broker ever wake the owner instead of the next-move owner? - Should model-assisted routing be enabled only for multi-agent channels, or also for single-agent fallback recovery?
- Do we want a first-class
agent.mentionevent, or is metadata onmessage.postedenough? - How much of the collaboration contract should live in shared docs versus generated adapter prompt templates?
Practical Next Step
Implement the broker-side routing and identity rules first, then make every adapter consume that contract unchanged. That keeps the root cause in one place and prevents each harness from becoming its own policy engine.