ES
Writing Field notes

A rule enforced by process is not enforced

Enzo Snyman
  • AI-directed engineering
  • AI coding agents
  • Process design
  • Systems thinking

In late October we started building a data product from an empty repo. About four weeks later it had more than 300 pull requests behind it. Most of the code was written by AI coding agents, each with a job: one built features, one reviewed and ran operations on the server, one handled bulk extraction early on, and cloud agents built parts of the app. I made the decisions only a person should make, and approved anything that touched live data.

That speed only works with rules. What I didn’t appreciate at the start is that a rule written in a document and a rule checked by a machine are different kinds of thing.

The rules we started with

The written rules were sensible:

  • Code merges only after an independent review and passing tests.
  • Changes to the live database need a typed yes from a person, naming the change.
  • Anything that spends money gets a free dry run first.
  • Paid extraction runs only on the server, never on a laptop.

The plan we were on didn’t support branch protection, so for a while those rules lived in an instructions file and in everyone’s good intentions, human and agent.

How each one got broken

Not dramatically. Quietly, and usually by something trying to be helpful.

  • A database migration was merged before the typed yes and before a backup. Merging deployed it, so it ran on the live database. Nothing had been deleted yet, and the clean-up job it scheduled was paused before its first run. A near miss.
  • A pull request on hold was merged early by the automatic reviewer. Another merged within a minute of opening, with a review comment but no real review.
  • An agent ran a paid extraction on a laptop after being told not to. The spend was small and it was stopped.

Each time, the rule was clear and written down. Each time, nothing actually stopped the action.

What actually held

The rules that never broke were the ones a machine checked:

  1. A merge gate. A hook blocks the merge command unless the checks are green.
  2. A label, not a feeling. Code merges only with a “reviewed-ok” label, added after an independent review says confirmed. Pull requests on hold never auto-merge.
  3. A guard that can’t edit itself. Files that run with full rights on the server count as live changes. A CI check guards them, and it reads its rules from the main branch, so a pull request can’t change the guard to let itself through.
  4. Migrations count as live changes. They carry a hold label by default and need the typed yes before merging, because merging is deploying.

Tests on every pull request, plus independent review, caught real bugs from the first week. One day of reviews caught five. But the review only counted once a machine made it count.

What I’d do from day one

Put the important rules in code before writing the first feature, not after the first near miss. Decide what “live” means: if merging deploys, merging is live. And plan for the budget limits too. We ran out of CI minutes for the month, and had to make CI run only for the parts of the repo that changed.

That was the systems thinking lesson for me. In operations at this speed, you build the controls into the system, not into the team’s memory.

Agents are fast and mostly careful. People are too. Neither is a control. If a rule matters, something other than good intentions should enforce it.