Complete visual reference for every module, function, type, and data flow in the Champ agent swarm harness. Built for maintainers.
The work packet is the fundamental unit of communication in the swarm. Every task, from a one-line fix to a full feature, travels as a packet.
Think of a work packet as a sealed envelope you hand to an agent. Inside the envelope:
The agent opens the envelope, does the work, and returns a Work Result, a structured response with status, summary, output files, and test results.
wp-{hex8}), phase history with timestamps, and an event log entry. Nothing happens without a record.
id | wp-{hex8}, unique ID generated from crypto.randomUUID() |
agent | Target agent name (e.g. "dev", "qa", "architect") |
invoked_by | Who created it, "human" for CLI, or another agent's name |
priority | P0 P1 P2, urgency level (default P1) |
timeout_minutes | Max execution time (default 60) |
complexity | simple medium complex, drives model selection and fix loop limits |
status | Legacy: pending → accepted → in_progress → done/failed/blocked |
phase | FSM: PENDING → ACCEPTED → EXECUTING → VERIFYING → FIXING → DONE/FAILED/BLOCKED/CANCELLED |
phase_history | Array of {phase, timestamp, reason}, full transition audit |
active | Boolean, false once in a terminal phase |
fix_iteration | Current fix loop count (0-indexed, resets on restart) |
instruction | Free-text task description. This becomes the core of the agent's prompt. |
context |
.files, specific file paths to read.directories, dirs to explore.references, related packet IDs or doc links.notes, free-text extra context
|
expected_output |
.type, one of: files pr report review plan decision.description, what the output should contain
|
success_criteria | String array, each criterion is checked against the result |
test_command | Shell command to verify output (e.g. bun test) |
verificationSpec |
Structured checks array: {type, command, required}Types: test, typecheck, lint, build, runtime, security, performance |
protocol.ts → createPacket()shared/packets.jsonprotocol.ts → createResult()shared/results.jsonfollow_up_packets in their result to spawn new work.
Click any module to explore its exported functions, types, and dependencies.
Directed edges show which modules import from which. Root modules have no harness dependencies.
Every work packet transitions through these phases. Defined in protocol.ts PHASE_TRANSITIONS.
The execute-verify-fix cycle in runner.ts runWithFixLoop(). Bounded by complexity: simple=3, medium=5, complex=10 iterations.
How a work packet becomes a fully enriched prompt sent to Claude. Spans runner.ts, prompt-utils.ts, skill-loader.ts, and prompt-enricher.ts.
The invoke command's size-aware routing decision tree. Defined in cli.ts.
From CLI invocation to completed work result, every module touched and every file written.