Build / Handoff and communication contracts

B02 / Build

Handoff and communication contracts

The Guild handoff bus: specialists write typed receipts under .guild/runs/, and leads, review, verification, and replay consume files.
First move
Follow typed handoffs across roles
Expected receipt
guild.handoff_receipt.v1
Last verified
Jul 17, 2026

Page evidence and guidance

Read as StartReceipts, status, and why the durable file matters more than chat. SteerAssignments, receipts, bus events, liveness, issues, and review packets. ExtendEnvelope schemas, validators, event streams, fallback substrates, and reaping.

Guild Stack communication is a file-first handoff bus:

agent -> handoff receipt -> lead -> review -> verification

A specialist can use host chat to say a receipt is ready, but the chat message is not the handoff. The contract is the receipt file under .guild/runs/<run-id>/handoffs/, plus the run-state, bus, review, and trace files that surround it.

Operational mapAssignments go out. Typed receipts come back.
Lead
  1. lane assignment
  2. review packet
  3. gate decision
Specialist
  1. focused context
  2. bounded work
  3. handoff receipt
.guild/runs/
  1. task
  2. handoff
  3. review result

Files carry authority, evidence, and recovery state. Chat is not the durable bus.

The handoff bus is file-first: agents write receipts, the lead reads receipts, and review/verification consume the same artifacts.
Diagram notes and sources

Reduced motion: Shows receipt write, validation, and consume states at once with numbered markers.

  • docs/v2/dispatch-execution.md
  • docs/v2/architecture/modules/communication.md

Handoff Contract

A dispatched lane is expected to receive an assignment and focused context, but the production assignment path is not yet the authoritative per-attempt contract described in the design. The durable completion boundary is shipped today: when a lane finishes, it writes one receipt:

.guild/runs/<run-id>/handoffs/<specialist>-<task-id>.md

That receipt wraps a compact guild.handoff.v2 envelope inside a guild.handoff_receipt.v1 Markdown record. The envelope carries task id, tier, status, summary, artifacts, issues, optional escalation reason, notes, and learning candidates. Learning entries are candidates only; they do not promote themselves into .guild/wiki/**.

The receipt gives three audiences the same truth at different depths:

AudienceWhat they inspect
Beginner UsersThe final receipt that explains what the specialist did.
Power UsersReceipt status, artifacts, issues, review packets, and verification results.
Harness Developersguild.handoff.v2, guild.handoff_receipt.v1, task assignments, agent-bus events, and validation paths.

Assignment path: shipped and target

Do not treat the current pane assignment file as proof that every task was delivered and acknowledged.

StateWhat is true
ShippedThe tmux launcher writes one guild.task_assignment.v1 file per specialist pane and exports its path. Production workers do not yet read and acknowledge that file as a required startup step. When a specialist owns several planned tasks, the pane assignment represents the first task rather than a complete per-task queue.
TargetEvery dispatch attempt gets an authoritative assignment keyed by task_run_id and attempt. The worker must read and acknowledge it before work begins, and every planned task remains individually traceable.

The handoff receipt remains the shipped completion boundary. Assignment acknowledgements are a target contract and must not be inferred from pane creation or environment export.

Schema And File Map

Use this map before reading implementation detail:

ConcernContractPath
Pane assignment (shipped launcher file; no required worker acknowledgement)guild.task_assignment.v1.guild/runs/<run-id>/tasks/<specialist>.json
Dispatch attemptguild.task_run.v1.guild/runs/<run-id>/task-runs/<task-id>.yaml
Context bundlecontext bundle Markdown.guild/context/<run-id>/<specialist>-<task-id>.md
Completion receiptguild.handoff_receipt.v1 wrapping guild.handoff.v2.guild/runs/<run-id>/handoffs/<specialist>-<task-id>.md
Lifecycle streamguild.agent_bus_event.v1.guild/runs/<run-id>/agent-bus/events.ndjson
General artifact busguild.bus_event.v1, CAS metadata, subscribers.guild/runs/<run-id>/bus/
Lane livenessstructured heartbeat.guild/runs/<run-id>/in-progress/<specialist>.json
Review outputreview packet/result/trail files.guild/runs/<run-id>/review/<gate>/
Canonical tracetrace JSONL.guild/runs/<run-id>/logs/v1.4-events.jsonl

Two bus names matter:

BusShipped role
Agent busThe shipped lifecycle stream for task-created, task-completed, and idle events.
Artifact busA generalized publish/consume substrate with CAS and subscribers. It exists as code, but review paths still write co-located review files in v2.0.

Do not conflate them. They have different schemas, logs, and runtime roles.

Validation Points

Receipt validation is split by execution path:

PathValidation behavior
Claude-hooked writescomms-format-lint checks written receipts; blocking is opt-in with GUILD_COMMS_FORMAT_ENFORCE=1.
Agent-team completiontask-completed validates the envelope before accepting lane completion.
Non-Claude panesThe orchestrator or reaping path validates when it consumes the receipt.
Idle lane with no receiptteammate-idle nudges; repeated failure routes to lane failure/dead-letter handling.

The canonical validator lives in plugin/hooks/lib/handoff-v2.ts. The communication module keeps a lint mirror in plugin/src/modules/communication/workflows/comms-format-lint.ts, and reaping keeps another local mirror. A schema change must update the validator and mirrors together.

Module Ownership

The communication boundary is implemented across a small set of modules:

ModuleOwns
communicationHandoff-envelope linting, artifact bus, agent-team communication hooks, and protected communication-surface guards.
dispatchguild.task_assignment.v1, backend launch, and pane/channel setup.
lifecycleguild.task_run.v1, run lifecycle records, and task-run writers.
reviewReview packets, review results, trails, and gate outcomes.
telemetryCanonical trace and additive structured trace events.

Implementation source paths:

NeedSource
Communication module referencedocs/v2/architecture/modules/communication.md
Dispatch module referencedocs/v2/architecture/modules/dispatch.md
Handoff validatorplugin/hooks/lib/handoff-v2.ts
Task assignment writerplugin/src/modules/dispatch/workflows/task-assignment.ts
Completion hookplugin/hooks/agent-team/task-completed.ts
Artifact busplugin/src/modules/communication/resources/scripts/lib/artifact-bus.ts

Host Boundary

The file bus is what makes host adaptation possible. A Claude pane, a Codex pane, an app surface, or a connector path can all lose host-specific chat features while preserving the receipt contract.

What may degrade:

Degraded surfaceWhat remains stable
Host chat / SendMessageReceipt files under .guild/runs/<run-id>/handoffs/.
ParallelismTopological task execution and receipts.
Native approval UIFile-backed approval request and recorded decision.
Model-tier availabilityTier key plus recorded collapse/unavailable path.

What must not degrade silently:

ContractReason
Handoff receiptReview and verification need a durable lane result.
Context pointerThe lane must be reconstructable.
Trace eventDegradation and run history must be explainable later.
Review/verification fileA chat transcript cannot substitute for a gate result.

What This Is Not

  • Not a chat protocol.
  • Not proof of host parity.
  • Not a real-time message broker requirement.
  • Not an auto-promotion path for knowledge or skills.
  • Not a replacement for review and verification gates.

The durable answer is the receipt. Other channels point to it, validate it, or summarize it.