Skip to content
Multi-Agent Systems / Coordination & Handoff

Orchestrate agent workflows as gated phases with a durable ledger

  • BP-0048
  • v1.0.0
  • draft
  • pattern
  • role: orchestrator
  • role: planner
  • stage: plan
  • stage: build
  • stage: verify
  • updated 2026-11-24
  • reviewed 2026-11-24
  • next review 2027-05-24
  1. MUST run non-trivial work as named phases, each with an exit gate the orchestrator checks before moving on:

    Phase Produces Exit gate
    Clarify Goal, why, constraints, done-criteria Human (or principal) agrees the intent; open questions answered or recorded as assumptions
    Plan Units of work with interfaces and tests (BP-0008) Every requirement maps to a unit; every unit has a check
    Execute Artefacts, one unit at a time or in parallel Each unit’s own check passes (BP-0002)
    Verify Independent review of the whole result Critical and important findings fixed, each with a test
    Integrate Merge, release or hand-over Human approves irreversible steps
  2. MUST choose the topology before the phases (BP-0042); a workflow does not need many agents. One agent running these phases is often enough.

  3. SHOULD scale the ceremony to the stakes: a one-file fix may collapse Clarify and Plan into one line; a multi-day change gets a written spec and plan.

  1. MUST keep the plan and a progress ledger in files (or workflow memory, BP-0013), with one line per completed unit: what was done, the commit or artefact, the check that passed. Context is compacted or lost; the ledger and version control are the record.
  2. MUST make the workflow resumable: on restart, the orchestrator reads the ledger and git log, and continues at the first unit without a completion line. It never redoes completed units from memory.
  3. MUST record every deviation from the plan as a ruling in the ledger: what was decided, why, and the cost if wrong.
  1. MUST dispatch each unit with a self-contained brief and require a structured result (BP-0003). Set the model and effort for each role (BP-0049).
  2. MUST run units in parallel only when they are independent and touch disjoint files; isolate parallel writers (BP-0035).
  3. SHOULD have workers return conclusions, artefact locations and evidence, not transcripts, so the orchestrator’s context stays small.
  1. MUST cap retries per unit (for example two) and then escalate, in this order: more context in the brief → a higher effort level → a more capable model → a human. Do not loop on the same failing brief.
  2. MUST define stop conditions before starting: budget, wall-clock time, and the actions that always need a human (irreversible, destructive, security-sensitive, external side effects) (BP-0041).
  3. MUST end with a review by a fresh context that did not produce the work, on the most capable model available, against the spec (BP-0036). Fix what it finds with tests; do not re-review indefinitely.

Any task with more than a few steps, more than one artefact, or work that may outlast one context window or one session.

Ledger (.work/feature-x/progress.md):

docs/plans/2026-11-24-feature-x.md
Unit 1: complete (a1b2c3d..d4e5f6a, tests: bun test → 41 pass)
Unit 2: Ruling: plan used `fetchAll()`; spec requires paging → used `fetchPage()` — cost if wrong: one extra refactor
Unit 2: complete (d4e5f6a..0a1b2c3, tests: bun test → 44 pass)
Final review: 1 important fixed (test: rejects-empty-page RED→GREEN), 2 minors deferred

Software change, single orchestrator: Clarify with the user → write spec → plan into five units → implement each test-first in the main session → one independent reviewer subagent on the full diff → human merges.

Research: orchestrator plans angles → parallel researcher workers (small model, low effort) each return findings with citations → orchestrator synthesises → fresh reviewer checks claims against sources.

  • The plan lives only in the orchestrator’s context and is gone after compaction.
  • Redoing finished units because the orchestrator “doesn’t remember” them.
  • Retrying the same brief on the same model until it passes.
  • The author reviewing its own work as the only verification.
  • Checking in with the human after every unit when nothing needs a decision.
  • Phases and exit gates named
  • Plan and ledger in files; workflow resumable
  • Briefs self-contained; model and effort set per role
  • Parallel units independent and isolated
  • Retry cap, escalation path and stop conditions defined
  • Independent final review; findings fixed with tests