Skip to main content

03.05Framework

The coding pipeline for AI coding agents

How AR Labs takes coding work from a rough idea to reviewed, merged code with AI coding agents, a task graph and scripted checks at every step.

On this page
  1. The vocabulary
  2. How work flows
  3. Three routes
  4. Floors never pass on anyone's say-so
  5. How much a person watches
  6. What exists today
  7. Where it came from

The coding pipeline is the route every code change at AR Labs takes, from a rough intention to code that has been specified, built test-first, reviewed by a second model and merged by a person. AI coding agents (AI agents that write code, such as Claude Code or Codex) do the work at each step. Scripts check the result before the work may move on, and a person approves the plan and merges to main. Coding Planner is the pipeline's tooling. This page is the map: how AR Labs engineers software gives the approach in brief, and the other pages in this section describe each practice in detail.

The pipeline exists because an agent working from memory drops steps without noticing. When the steps live in written command files, and the move from one step to the next runs through a script that checks for proof, a skipped step becomes a refusal instead of a silent gap.

The vocabulary

A few terms recur on every page in this section.

  • Bead: one tracked task in Beads, Steve Yegge's open-source issue tracker for coding agents. Every piece of pipeline work is a bead, and all the beads with their dependencies make up the task graph.
  • Lone task: one coherent piece of work, tracked as a single bead.
  • Campaign: work planned in one PRP and split into a tree of beads. The beads that hold other beads are containers; the beads at the bottom, where code is written, are leaves.
  • Step: one stage of a bead's route, such as writing its spec or reviewing its code.
  • Floor: a machine proof attached to a step. A script inspects git, the filesystem or the code host and answers yes or no.
  • Gate: a point work cannot pass until a condition is met; here, the checkpoint a step must satisfy before it counts as done. A human gate waits for a person; a step with no human gate is settled by its floor.

How work flows

The route map shows both ways in joining at the spec, and the one route every leaf then takes to main. Each circle is a station with a floor. A filled diamond is a decision a person makes at every autonomy level, such as approving the PRP; an open diamond is one an agent may pass when the bead's autonomy level allows it (see how much a person watches).

Transit map: a campaign line through grill, design record, PRP and fan-out joins a lone-task line at spec; every leaf runs implement, review, merge, deliver; campaigns end with integrate. An idea is routed as a lone task or a campaign. The campaign line runs through the grill (a design interview), the design record (design document, decision records and C4 diagrams, approved by a person), the PRP or campaign plan (approved by a person), and fan-out into vertical-slice beads. The lone-task line goes straight to the per-bead spec, where both lines join. Every leaf then follows one route: spec, implement test-first in its own worktree, cross-model review, merge and deliver, where a script confirms the reviewed commit is on the target branch. A failed review gets one automatic fix round; a second failure is parked for a person. The spec and implement gates wait for a person unless the bead's autonomy level lets an agent pass them. Campaigns finish with integration, where every acceptance scenario must have a test and the suite must pass, before a person merges the campaign to main. The pipeline: from idea to merged code TWO WAYS IN, ONE LEAF ROUTE OUT · EVERY STATION HAS A MACHINE CHECK; DIAMONDS ARE WHERE A PERSON DECIDES FIGURE PIPELINE ROUTE MAP DRAWN BY AR LABS SHEET 1 / 1 fails: one automatic fix round fails again: parked for a person Idea Route one piece or many? Grill design interview with a person Design record design doc, decision records, C4 diagrams PRP the campaign plan Fan out vertical slices, each a bead CAMPAIGN a tree of beads LONE TASK one bead, straight to its spec Spec per bead, from the code EVERY LEAF Implement test-first, in its own worktree Review a second model, four axes Merge a person, or the campaign branch Deliver reviewed commit is on the target On main Integrate every scenario has a test; suite passes Merge the campaign, by a person CAMPAIGN when every child has landed KEY Campaign route Lone-task route Leaf route: every bead with code Station with a machine check (a floor) A person decides, at every autonomy level A person decides, unless the autonomy level lets an agent pass
Two ways in, one leaf route out: every station has a machine check, and diamonds mark where a person decides.

1. Route the work. The first decision is whether the work breaks into pieces worth tracking separately. If it does, it is a campaign. If it is one piece, however many files it touches, it is a lone task. When in doubt, the work enters as a lone task: the spec step detects work that turns out to be compound and sends it to fan-out, so the first decision does not have to be right. Work too small for a bead, such as a comment fix, does not enter the pipeline at all.

2. Grill (campaigns only). The agent interviews the person, one question at a time, until every branch of the design is resolved. The technique comes from Matt Pocock's open-source grill-me skill. The output is a design brief in four blocks: resolved decisions, scope boundaries, how the system decomposes, and acceptance criteria written as Gherkin scenarios (plain-language Given/When/Then statements).

3. Design record and PRP. The brief can be formalised into a design document, architecture decision records and C4 diagrams (see architecture documentation). It then becomes a PRP, a product requirement prompt (Rasmus Widing's format, adapted): a plan that keeps a classic requirements document's goal and justification and adds the context, design-level approach and validation an agent needs. A person approves the PRP. This gate holds at every autonomy level, because every later step is delegated against it.

4. Fan out into issues. The PRP is split into vertical slices: thin pieces of function that each cross every layer of the system, with the thinnest end-to-end slice (the tracer bullet) first. Each slice becomes a bead with its own acceptance criteria and blocking edges to the slices it depends on, and is classed as HITL (needs a person in the loop) or AFK (safe for an agent to run unattended).

5. Per-task spec. For each bead, an agent researches the codebase as it stands now and writes an implementation spec: goal, scenarios, a table saying how each criterion will be proved, the files in scope and the commit the spec was grounded against. See spec-driven development.

6. Implement. On its own branch in an isolated checkout (worktree isolation), an agent builds the bead test-first, writes a walkthrough as it goes, and captures evidence for every criterion.

7. Review. A model from a different family, reached through OpenAI's Codex CLI and given only the diff, the spec and the proof manifest, reviews the work on four separate axes. One automatic fix round is allowed after a failed review; anything still failing after a second review goes to a person. See the code review gate.

8. Deliver. The step closes only when the reviewed commit is actually on the target branch. An open pull request does not count.

9. Integrate (campaigns). When every child has landed, the campaign's own acceptance scenarios must each appear in a test file, and the campaign's test suite must pass.

Three routes

Containers and leaves do different work, so the pipeline declares three routes. A bead's route follows from whether it is the campaign root and whether it has been split into children.

Route Steps, in order
Root (the campaign) design, PRP, refine design, fan out, delegate to children, integrate
Compound (a container below the root) spec, fan out, delegate to children, integrate
Leaf (where code is written) spec, implement, review, deliver

All of this lives in one manifest file. The scripts contain no step names of their own; they read the manifest, so changing the process means editing data rather than logic. An excerpt, in the manifest's shape:

"leaf": ["generate-spec", "implement", "review", "deliver"],
"deliver": { "gate": null, "verify": [{ "kind": "landed_on_target" }] }

Floors never pass on anyone's say-so

The founding rule is that a floor answers from evidence or does not answer. When it cannot pass, it says why in one of two ways. Refuse means the work is not done yet, and the pipeline may dispatch an agent to do what is owed. Escalate means the floor cannot answer at all, because the repository is missing or the code host is unreachable, so the bead is parked for a person and the run carries on elsewhere. Keeping the two apart tells a person whether to fix the work or fix the machinery.

The pipeline's whole memory is metadata on the beads, written only by one transition script. A session can crash, or a laptop can close, and nothing is lost: the next session reads where each bead stands.

How much a person watches

Each bead carries an autonomy level that decides which human gates an agent may pass on its own. Every floor runs at every level; the level only removes the person's hand from approving the step.

Level Meaning
hold The work waits for a person at every gate.
hitl The pipeline asks first; if no answer comes within four hours, it advances and records that it advanced on silence. Review fixes are not dispatched unattended.
wave Agents may pass the spec and implement gates and dispatch one round of review fixes. Each task branches from main and lands on main.
deep As wave, plus fan-out, the post-plan design revisit and integration, with every task landing on a campaign branch instead of main, so dependent work stacks up and a person reviews the whole campaign before it reaches main.

Some steps never pass without a person at any level: the design record, the PRP and the merge to main. A step that is waiting for a person does not stop the run; the question and a recommended answer are written on the bead, and the run moves to other work.

What exists today

The pipeline runs our own development. It can be driven from an interactive session, where a person answers gates in conversation, or unattended, where a runner dispatches one headless agent session per step. Work an agent discovers mid-run is filed at once as a new bead linked to the bead that found it, then worked when the current tree is done.

Where it came from

The task-versus-campaign split, vertical slices, HITL/AFK classification, review in a fresh context and the grilling interview follow Matt Pocock's published workflow for AI coding. The tracker is Steve Yegge's Beads. Our own additions are the deterministic floors, the autonomy levels and the rule that state lives on the tracker rather than in any running process.