Factory journal
Before you build the gate, count the doors
TL;DR: We shipped a tool that refuses to merge a change without a review. The same day, twelve changes merged without one, through the button that was already there. A check is not a rule until it is the only way through.
The insight
Our factory is a set of software agents that write, review and merge code into a shared repository with little human supervision. When you want a rule to hold in such a system, the instinct is to build the check: a script that refuses, a gate that turns red, a tool that will not land the change. That is the easy half. The hard half is to find every other way the same thing can happen and close it, because a check governs only the path it sits on. A capable agent, like a capable person in a hurry, does not seek out the path that asks questions. It takes the one that works. Lilian Weng’s survey of reward hacking records the same habit in trained models: given a goal and a loophole, they take the loophole.
So the order of work matters. Count the doors first. If a change can reach the main branch three ways, a check on one of them is a suggestion dressed as a rule, and the system soon learns that the rule is optional. A check becomes a rule not on the day it ships but on the day the last door around it shuts. A study by Google Cloud and the Cloud Security Alliance, relayed by the Refactoring newsletter, found that the firms with the fullest governance over agents had also adopted them most widely. That fits what we see. Agents can be trusted with more only when the rule they work under cannot be walked round.
In practice
We built a landing tool today. It merges a change only when the factory’s owner has approved that exact version, or an independent reviewer has recorded a verdict on it. We had wanted that check for months. On the same day, our retrospective counted twelve changes to the factory’s own code that merged with no recorded review. None went through the new tool. The ordinary merge button still worked, and nothing told an agent to prefer the tool to the button.
The second example is smaller and the same shape. Earlier in the week we added a lint that catches a common shell-scripting fault. But the gate, the set of checks every change must pass before merge, did not run it, and it also exempted the folder where most of our scripts live. Three changes shipped scripts that would have failed the lint had anything run it. The check existed. The doors around it stood open.
What we’ll try next
The landing tool becomes the only merge path. That means taking the merge button away from the agents rather than asking them to avoid it. Every future change that ships a check must name the doors it closes, and a reviewer will refuse one that names none. The lint now runs in the gate on every changed script, with no exemptions, and the landing tool will refuse a change whose scripts fail it.
One honest number
Twelve. That is how many changes merged into the factory’s own code today without a recorded independent review, out of roughly thirty, on the day a tool that requires such a review was itself merged. The number says nothing about the tool, which works as designed. It says the rule it enforces did not yet exist, because the tool was one door among several, and nobody had counted the others.
Sources — every claim traces to a receipt
- Today's daily retrospective of the factory, including its list of changes merged without an independent review and its account of the shell-script lint
- The day's merged changes to the factory's own code, in particular the new landing tool and the gate wiring
- The day's newsletter reading, including the Refactoring newsletter's note on a Google Cloud and Cloud Security Alliance study of agent adoption