Multi-Agent Coordination

Agents do not coordinate by talking to each other. They coordinate through shared state, task ownership, and structured handoffs.

The problem

One agent working alone is manageable — it reads a contract, validates, acts, reports. Multiple agents working on the same system is where things break. Without coordination, two agents claim the same task, modify the same file, or make conflicting decisions. The result is not collaboration — it is interference. Without coordination, multiple agents do not collaborate — they corrupt each other's work.

Most multi-agent systems solve this with messaging: agents send each other messages, negotiate, and agree. That is complex, fragile, and requires agents to understand each other's intent. ANCC solves it differently: agents never talk to each other. They coordinate through a shared ledger with ownership semantics.

The coordination stack

Three primitives. No messaging, no negotiation, no consensus protocols.

1. Shared work orders

All agents read from and write to the same work order ledger. A work order is a structured task contract — repo, title, description, acceptance criteria, scope, files, verification, priority, handover. Every agent sees the same queue. No private task lists. Any ledger with task ownership and context storage works at this layer — one implementation is Hiveram (shared WOs, claim/release leases, context-put/pull, agent memory).

# Agent sees open work
workledger list --status open

# Agent sees what's claimed by others
workledger list --status claimed

2. Claim/release with leases

An agent claims a work order before starting. The claim has a TTL (time-to-live). While claimed, no other agent can take it. If the agent dies or stalls, the lease expires and the work order returns to the open pool.

# Agent A claims WO-53
workledger claim --project ancc --id 53
# → lease granted, TTL 30m

# Agent A is working... renews lease
workledger renew --project ancc --id 53

# Agent A finishes
workledger release --project ancc --id 53
workledger update --project ancc --id 53 --status done

# If Agent A dies, lease expires → WO-53 returns to open pool
# Agent B picks it up
workledger claim --project ancc --id 53

Ownership is exclusive. Work is never shared. This prevents the two hardest coordination failures: duplicate work (two agents on the same task) and zombie tasks (agent dies, task stuck forever).

3. Context handoffs

When an agent finishes, it saves its working context — what it learned, what it changed, what state the system is in. The next agent pulls that context before starting. No tribal knowledge, no "check with the previous agent."

# Agent A finishes, saves context
workledger context-put --project chainwatch

# Agent B starts, pulls context
workledger context-pull --project chainwatch
# → receives Agent A's findings, file changes, observations

Context handoff is the link between agents. Agent A's handover becomes Agent B's starting state. If handover is vague or missing, Agent B starts from zero — wasting everything Agent A discovered.

The coordination loop

Agent starts
  → context-pull (what did the previous agent learn?)
  → list --status open (what work is available?)
  → find-unclaimed (what hasn't been taken?)
  → claim (I'm working on this — lease with TTL)
  → work (read SKILL.md, validate, execute, verify)
  → add-note (progress updates visible to all agents)
  → release + update status (done, or back to open if blocked)
  → context-put (save what I learned for the next agent)
  → next task or stop

What this is NOT

Failure modes

Agent dies mid-task

Lease expires. Work order returns to open pool. Next agent claims it, pulls context from the dead agent's last context-put (if any), and continues. No coordinator intervention needed.

Two agents race for the same task

First claim wins. Second agent gets a rejection, moves to the next unclaimed work order. No conflict, no merge, no negotiation.

Agent produces bad work

The verification command in the work order fails. Agent marks the task as blocked with a note explaining why. Next agent (or human) picks it up with full context of what was attempted and what failed.

Context drift

Agent B's context-pull returns stale data from Agent A's session. Mitigation: context includes timestamps. Agent B runs validation and doctor checks before trusting inherited context. If context cannot be trusted, discard it and start fresh.

Scaling patterns

Pipeline

Agent A observes → creates WO. Agent B claims → diagnoses → updates WO with findings. Agent C claims → implements fix → creates PR. Each agent is specialized. Handoff through work orders + context.

Fan-out

One observation creates multiple WOs (one per affected system). Multiple agents claim different WOs simultaneously. No coordination needed — each WO is independent, each agent works in isolation.

Enrichment

A cheap agent creates a rough WO. A smarter agent claims it, enriches the observations, sharpens the scope, improves the acceptance criteria. The WO gets better before an execution agent touches it. Resource governance determines whether the enrichment is worth the spend.

How this connects to ANCC

Multi-agent coordination is not a separate system. It is the same ANCC principles applied to the space between agents: remove ambiguity, enforce ownership, make handoffs explicit, and never let an agent guess what another agent did.