Skip to content

Autonomous Implementation Pipeline — as-built specification

Split from a single file by #2094 so every part is within the 100,000-byte documentation size budget (docs/README.md “Size budget”).

This is the as-built requirements specification for the implementation pipeline: the numbered requirements the system satisfies, the components that satisfy them, the acceptance checks that prove it, and the reasoning behind them. It describes the system as it exists, and it must keep doing so — any change to the pipeline lands together with the edit that keeps this document accurate (see AGENTS.md, “As-built specifications”). Where this document is silent, follow the conventions of the two target repositories (their AGENTS.md files — or CLAUDE.md, for a repository that has not migrated — are binding on any agent working inside them).

Requirement ids may recur across ### sections — e.g., “requirement 39c (The Refiner)” and “requirement 39c (Finish-then-continue)” name two different requirements — and, for the two legacy ids 17b and 17g, even within the single section that defines both of each pair (“The Co-Ordinator (selection only)”). A citation of an id defined in more than one place is qualified with its owning section unless the surrounding clause already names the owner (e.g., “the Refiner’s (requirement 39)”); a citation of an id defined in exactly one place may be left bare.

A pipeline that, on a configured cadence (schedule.cycle_interval_minutes), picks at most one well-scoped item of pending work from the configured GitHub repositories, implements it on a feature branch in an ephemeral clone, reviews and corrects the result, and leaves a mergeable pull request for approval and landing at the repository’s configured merge_autonomy level (see “## The Landing Gate”). It runs unattended on a containerized node; human involvement narrows to whatever that level still requires.

cron (schedule.cycle_interval_minutes)
└─ agent-cycle.sh ← the Script: lock, stand-down checks, repo ordering
├─ Co-Ordinator (Haiku) ← selects ≤ 1 item, emits a work order; nothing else
├─ Implementer (Sonnet/Haiku)← ephemeral clone, feature branch, draft PR
├─ Reviewer (Sonnet/Opus) ← corrects the branch, flips the PR to ready
│ └─ Human Reviewer ← approves/merges per `merge_autonomy` (D18)
├─ Enabler (Opus, rarely) ← re-examines long-blocked items at the end of a
│ cycle: unblocks, voids, or raises an issue
│ assigned to the Human saying what to do
└─ Refiner (Haiku) ← same end of the cycle: writes the specification
an unscoped item lacks, before it has to be
blocked and wait for the Enabler
  1. The Cronjob — the crontab entry that fires the Script.
  2. The Script (agent-cycle.sh) — a bash script that orchestrates one whole cycle. It launches every agent; agents never launch other agents.
  3. The Co-Ordinator — a headless Claude Code invocation that selects one item of work and emits a work order. It does not implement anything.
  4. The Implementer — a headless Claude Code invocation that carries out the work order and raises a draft pull request.
  5. The Reviewer — a headless Claude Code invocation that checks and corrects the Implementer’s branch, then marks the pull request ready. 5a. The Approver — a headless Claude Code invocation, engaged only where merge_autonomy is above human (D18, “## The Landing Gate”), that independently judges a pull request the Reviewer has already marked ready and returns a verdict. It writes no code and pushes nothing; the Script turns its verdict into a real GitHub review — APPROVE or REQUEST_CHANGES — posted under a non-author GitHub App identity (“Pullwright Approver”), never under this system’s own authoring account.
  6. The Human Reviewer — gives final approval (at human) or an additional one alongside the Approver’s own (above human), through the ordinary GitHub process. Merges the pull request directly at human and agent-approves; at agent-merges-routine and agent-merges-all, the arming step lands an eligible pull request itself (D18, “## The Landing Gate”), and the Human Reviewer’s own role narrows to whatever that classifier did not cover. Not launched by any part of this system.
  7. The Enabler — a headless Claude Code invocation, engaged rarely and at the end of a cycle, that re-examines items recorded as blocked which the pipeline has not cleared by itself. It unblocks, voids, or leaves them blocked with a fresher condition; where an item was never specified well enough to select, it specifies it (requirement 36b); and where an item cannot be moved without escalating, it composes a GitHub issue that the Script files, assigned to a human — directly, or after one bounded pass per escalation_autonomy: an adjudication, for a refinement-disagreement item only (requirement 36b), or, at decide-tactical, a decide pass over any escalation, which may settle it or decide a tactical question on the pipeline’s own authority instead of paging a human at all (requirement 36d). It writes no code and raises no pull request.
  8. The Refiner — a headless Claude Code invocation, engaged from the same end-of-cycle cleanup as the Enabler and immediately after it, that writes the specification an under-specified item lacks before the item has to be blocked and wait for the Enabler to reach it (requirement 39 (The Refiner)). Every item it takes ends refined — the specification posted as a comment on the item’s own issue, or returned as refined_spec where the source has no thread to write into — or needs-refinement, where only a human can supply what is missing (requirements 39c (The Refiner) and 39d). It also bands every open issue whose Priority is unset, a one-way ratchet the Script alone enforces (requirement 39g). Its powers are otherwise deliberately narrower than the Enabler’s: it writes no code, raises no pull request, and can neither escalate nor void.

Two further Actors belong to the sibling pipelines rather than to this one, and are named here because lib/pipeline-marker.sh’s pipeline_actor_label and dashboard/index.html’s ACTOR map carry every Actor token this system has, whichever pipeline runs it (requirement 9d):

  1. The Project Reviewer (token project-reviewer) — the repository-review pipeline’s single agent. Specified at docs/spec/review/README.md, Actors, where that document calls it the Reviewer-Agent.
  2. The Pipeline Monitor (token monitor) — the Monitor pipeline’s single agent: a scheduled reading of this pipeline’s own recorded state, whose mechanical findings are filed as pw::type:tech-debt issues that this pipeline’s own tech-debt work source then selects (requirement 16). Specified at docs/spec/monitor.md, Actors. It never runs as a stage of agent-cycle.sh and writes no label this pipeline’s Co-Ordinator keys on.