$ cd ../blog

A ticket goes in, a reviewed merge comes out

There is a small computer at my home. Every hour it checks the issue tracker of a client project I work on. If it finds a ticket assigned to me with the label agent-ready, it takes that ticket from an empty branch to a reviewed merge on the staging branch, without me.

Between August 17 and November 3, 2026, it merged 134 tickets into staging.

This post is about how that pipeline works, and more importantly about the bugs in the pipeline itself. Those were harder to find than any bug in the code it wrote, because none of them showed up in the output.

What it is, and what it isn’t

It’s a mini PC running Ubuntu, a systemd timer, a runner written as a shell script, and Claude Code called from the command line. The tracker is Linear, the code is on GitHub, and pull requests also get an automated review from Codex.

What it isn’t: a way around the team. It merges only into staging. Moving changes to production is a separate pull request that I propose and the team reviews; only the team merges to production and deploys. It also doesn’t pick its own work. A ticket gets agent-ready only after I’ve written it and checked it against the code, which I wrote about in Writing for an agent that starts from zero.

The pipeline

Before it touches anything, the runner checks its preconditions: the working copy is clean, staging pulls without conflicts, and no test processes are left over from a previous run. If something isn’t clean, it stops and writes why. It does not clean up and continue.

Then:

ticket (agent-ready, assigned to me, no open blockers)
  -> new git worktree from a fresh origin/staging
  -> implementer     one session per ticket, resumed for every fix
  -> completeness    fresh agent, sees the ticket and the diff: COMPLETE or MISSING
  -> migrations      run down and up again, if the diff has any
  -> schema check    every change to schema.rb must be explained by a migration
  -> G1              full test suite
  -> reviewer        up to 6 rounds
  -> verifier        fresh agent: Rails runner + headless browser, if app code changed
  -> G2              full suite, only if something changed after G1
  -> pull request to staging -> Codex review, up to 10 rounds
  -> G3              full suite, always, last gate before merge
  -> merge, close the ticket, journal entry with the exact revert command

Three ideas carry most of the weight.

Separate roles. The implementer remembers why it wrote something, so every fix goes back to the same session. The reviewer must be fresh, because the author defends its own code. The verifier checks behavior in the running app, not the tests, because tests only check what someone thought to test.

Gates only at the boundaries. The full suite takes about five minutes. Running it after every review round and every one of up to ten Codex rounds would cost an hour or more of CPU per ticket. Between rounds the agent runs the targeted tests itself. The hard guarantee is G3: nothing reaches staging without a green full suite on the final commit.

A journal, not a dashboard. Every step writes a line to a dated journal file that syncs to my laptop. Every merge entry includes the command to revert it. Next to the journal there’s a one-screen file I read in the morning: what’s done, what’s in progress, and what’s waiting on me. It gets rewritten, not appended.

Review rounds that diverged

The first version of the review step was the obvious one: every round, a fresh reviewer reads the whole diff, until a reviewer finds nothing.

On an unattended pipeline that doesn’t converge. Every fresh reviewer found new things instead of judging whether the previous findings were fixed. On one ticket, six rounds of full-diff review grew the change from 12 files to 24 before the run gave up.

Now the first round reviews the full diff. Later rounds judge the previous findings and look only at what changed since. The limit started at three rounds and went up to six, because on large changes all three rounds kept finding real problems and the work was converging when the limit cut it off. Codex gets a similar rule: after three rounds with findings, every new Codex finding first goes to a fresh agent that also sees the ticket and decides whether it’s real. Agents don’t have to obey Codex blindly, and once one of them was right not to. Codex claimed an out-of-range ID would crash an endpoint, and the agent showed, against the running app, that Rails returns an empty result instead.

When I review interactively, I still loop until a reviewer finds nothing, because I’m there to stop it from wandering. Unattended, the loop needs a shape.

The bugs in the pipeline

This is the part I’d want to read if I were building one of these.

The agents didn’t have the project rules

Every ticket runs in its own git worktree. A worktree contains what’s tracked in git. The project’s CLAUDE.md and my working notes are gitignored, local to my machine, so the worktree didn’t have them.

For the first days, every agent worked without the project rules, without the architecture guides, without the testing conventions. The tickets got merged anyway. Now the runner links both into each worktree as symlinks, not copies, so when an agent corrects a document it corrects the real one.

The memory was never loaded

Claude Code keeps memory per working directory. The runner works in ~/worktrees/<ticket>, a different path every time, so the 120 memory files I had built up on that project were never loaded in a single run. Nothing complained. The fix is another symlink, created on every entry into a worktree, and if it fails the run stops.

Sixteen tickets on the wrong model

The runner called claude -p without a model flag, so every call used the account’s default model. From August 16 to August 23, all 16 tickets were implemented, reviewed and verified by a smaller model than the one I intended.

I found it by reading the modelUsage field in the saved responses. Now every call passes the model and the effort level explicitly, and after every call the runner reads which model actually answered and writes any mismatch into the journal. Sub-agents are chosen by name from definitions that pin their model and effort, because the tool that starts them accepts only a model alias.

The preflight check that lied

A preflight script checks that no runner is active before I change anything on the server. It used systemctl is-active. A oneshot systemd service stays in the activating state for the whole run, so the check reported “idle” while a run was in progress. It now reads ActiveState. The preflight has since grown to 47 checks.

Tests that could eat the CPU all night

This one I knew about before the runner existed. A test that hangs, usually a redirect loop in an authentication gate, pins every core. If the parent process dies, the parallel test workers are orphaned and keep running for hours. It had already happened at least three times on my laptop, and the test suite got a 60-second watchdog per test because of it. On an unattended machine at night, the same hang would waste the whole night, so the runner cleans up orphaned workers on every exit, and the precondition check refuses to start if any are left.

A lost night from a chain of tickets

I once labeled a chain of nine dependent tickets agent-ready at the same time, with correct “blocked by” links. The runner took them from the highest number down, one per hour from midnight to seven, and each one correctly stopped as blocked. It reached the first ticket in the chain at eight in the morning. The agent-blocked label doesn’t remove itself, so after that it had nothing to do.

Now only a ticket whose blockers are done gets agent-ready. The rest wait with agent-queued and get promoted automatically when the blocker merges. Since November 3 the runner also skips any ticket with an open blocker.

What all of these have in common

Not one of these bugs was visible in the result. Tickets were merged. Tests were green. Pull requests looked fine. The agents wrote reasonable code without the project rules, on the wrong model, without their memory.

The lesson of running agents unattended: you have to verify the environment, not only the output. Which model answered. Which instructions were loaded. Which tests actually ran, and on which commit. If you only look at the result, a degraded pipeline and a healthy one look the same.

What I still do by hand

  • Write each ticket and check it against the code before it gets the label.
  • Answer the team and the client. The runner has no access to chat.
  • Read the journal every morning and decide what I propose for production.
  • Remove agent-blocked when an agent stops with a question, after I’ve answered it.

The runner does the part that used to take most of my day. The parts that need judgment, or that someone else depends on, are still mine.