Woodcut illustration: a lantern hanging from a pine bough over a dark wood, its one lit pane throwing rings of light into the trees.

Factory journal

Size the change for the reviewer, not the author

TL;DR: An AI that writes code can produce a thousand lines as easily as ten. The person who must check those lines cannot. So the size of a change should be set by whoever has to trust it, and set before the work begins.

The insight

Writing code now costs almost nothing. Trusting it costs what it always did. A reader can check a ten-line change and believe it in a minute. A thousand-line change gets skimmed, and the reader ends up believing the machine’s account of what it did rather than the code itself. Kent Beck gave this a shape in a recent essay, Trust Is the Binding Constraint. He argues that the trustworthiness of a change falls with the square of its size, so doubling a change roughly quarters how far you should trust it. He also notes that AI tools favour big batches while trust favours small, verified steps. We have adopted his rule as our own.

That is awkward for anyone running a software factory, by which we mean a set of AI loops that write, test and merge code with little human help. The machines prefer big batches, because one long run is cheaper and tidier than ten short ones. Trust prefers small ones. When the two pull apart, the factory should side with trust. That means the limit on size must be set in the brief that hands out the work, not discovered when the review arrives. A reviewer handed too much will either wave it through or stall it. Both are failures of sizing, not of review.

In practice

Our smallest changes were our smoothest today. Cuesheet, the app we are building for indoor cycling instructors, merged a handful of changes, and each did one thing. One added a check that an analytics event carries exactly the fields it should and no others. Another made a test script fail with a plain message when the tools it needs are missing. Each was small enough for its review to be real, and each went through without a person.

The factory’s own work shows the opposite shape when a change is large. Every improvement to the factory passes through a chain of steps. Someone designs it, a hostile reviewer attacks the design, a builder builds it, a second reviewer checks the build, a verifier confirms it works, and only then is it merged. Each step is recorded as its own task. The chain exists because no single reader could hold the whole change in their head at once. It makes the work traceable. It also tells us something we did not want to hear. When a change needs six checkpoints before anyone will trust it, the change was too big to begin with.

What we’ll try next

We will put a size cap into the brief an agent receives before it starts. The cap will say how large a change may grow. An agent that needs more will have to split the work and come back for a second brief. We will also count how often the cap is hit. A cap that is never reached is doing nothing, and a cap that is reached every time has been set in the wrong place.

One honest number

Of roughly one hundred tasks the factory closed today in its own repository, about eighty-five were steps in those review chains rather than changes to anything. That ratio shows the small-steps discipline is real, which is good. It also shows that a count of closed tasks says almost nothing about how much shipped. Most of our effort now goes into earning trust for changes we could have made smaller.

Sources — every claim traces to a receipt

  • Today's retrospective of the factory's work, in particular the Cuesheet merges and the review-chain counts
  • The day's intake learnings, which flagged Kent Beck's essay on trust and change size
  • Kent Beck, 'Trust Is the Binding Constraint', from his newsletter