Skip to content
Nelson D’SouzaEmail me

Agent delivery CLI

Bob the Builder

A Go CLI I use to hand coding tasks to agents. Every task runs the same delivery loop and reaches done through checks outside the agent’s reach (four of five proxy gaps closed; the memory-ack fix is designed but not yet in).

what it does

  • An agent cannot mark its own work done

    Quality gates, a review held to the changed lines and a test-change gate come first.

  • The reviewer can’t edit what it judges

    Review can be confined to the diff in a sandbox, away from repository settings and plugins.

  • Stalls end in a decision

    Bounded repair, then a senior agent, then quarantine with a recorded reason.

  • Every step is on the record

    Schema-checked state beside the code, an append-only journal, traces and a cost ledger.

a review that cannot point at the diff

  1. runningreview_chunk_started

    chunk 1 of 2 · internal/state/transition.go
  2. warningreview_chunk_retry_requested

    ungrounded review findings: F-002 location internal/state/store.go:41 is outside changed files
  3. errorthe loop stops

    verification failure: ungrounded review findings: F-002 location internal/state/transition.go:212 is outside changed hunks

one retry, then the review fails

Redrawn from the review loop’s events and the grounding check; the ids and paths are examples
Engraving of two Jacquard loom mechanisms side by side; the one on the right carries a long hanging chain of punched pattern cards
Its ancestor: Jacquard loom mechanisms with punched-card chain, 19th-century engraving. Études sur l’Exposition (Eugène Lacroix, Paris), Wellcome Collection, CC BY 4.0

The problem

Coding agents are good at saying they are finished. Most agent loops are hard to audit. You see the result without the steps that produced it, and nothing stops a task from being marked done on faith. Handing real work to agents needs a predictable cycle, a record of every step, and checks that sit outside the agent’s reach.

How it fits together

One task through the delivery loopArchitecture diagram with 8 nodes, 7 connections. Each step is listed as text below.Workspace schedulerTask state in therepoAgent in its own gitworktreeQuality gatesReviewer, held tothe diffDoneSenior agentEscalated, with astop reasonnext taskcommitall greenfindings closedbounded repair spentstill stuck
  1. Workspace scheduler to Task state in the repo: “next task”
  2. Task state in the repo to Agent in its own git worktree
  3. Agent in its own git worktree to Quality gates: “commit”
  4. Quality gates to Reviewer, held to the diff: “all green”
  5. Reviewer, held to the diff to Done: “findings closed”
  6. Quality gates to Senior agent: “bounded repair spent”
  7. Senior agent to Escalated, with a stop reason: “still stuck”
One task through the delivery loop A failing gate gets a bounded number of repairs. Then a senior agent gives direction, and a task still stuck stops with a recorded reason.

What I built

Every task moves through the same states, from pending through in_review to done, and the transition table rejects any move it does not list. I keep that state as files in the target repository, validated against JSON schemas, and every transition is appended to a journal. State beside the code can be inspected with git and exported for replay. The price is a schema check on every write.

Each task gets its own git worktree. Before review, the work must pass go test, the race detector, go vet, staticcheck, govulncheck and a determinism check. The reviewer can be confined to the diff inside a bwrap sandbox, and builder and reviewer models are isolated from repository settings and plugins, so a change under review cannot alter its own review criteria. Every finding has to point at a line inside a changed hunk. The reviewer gets one retry to ground a finding that does not, and then the review fails. An approval of a stale head is rejected, and a missing test change needs an explicit waiver.

When work stalls, a bounded repair loop runs first, then a senior agent gives direction, and a task still stuck is quarantined with a structured stop reason and the evidence attached, for me to decide.

Agents sit behind a provider-neutral layer: Codex and Claude CLI sessions, or the OpenAI and Anthropic APIs. Runs export OTLP spans, metrics and logs, keep a cost ledger, and a workspace scheduler can drive several repositories from one queue.

How it turned out

In use on my own projects, starting with itself: Bob’s own changes go through its review loop. I test its gates by breaking the work on purpose, and that turned up five gates that passed while the work they guarded was wrong, because each one read a proxy for the work. Four are fixed. The memory-ack gate is not: a missing principles file hashes the same as the seeded default, and the review loop writes the ack itself, so the gate passes when nothing has been distilled. Longitudinal bug-escape and human-triage rates after the fixes have not been measured yet.

Written about it

Built with

  • Go
  • Git
  • bubblewrap
  • OTLP
  • JSON Schema