On October 17 I started a bug-hunt loop on rpgstack.com, my tabletop RPG character app. One agent reads the code and lists bugs, another fixes them, repeat. By the evening of October 19 it had done 40 rounds and fixed about 180 bugs.
The app was not getting better. Round 19 had the commit message "one rule per fact across creation paths". Rounds 21-30 were "one rule set per system across every create path". So the agent was fixing the same thing again with slightly different words, and the commit log looked great.
That evening I asked an agent to stop fixing and sort all 180 bugs by where they came from instead of what they broke. Half of them came from three things:
So every round fixed the bugs it found and left the other copies of the same rule in place. The agent's own write-up said it better than I would: "every fix adds a correct path without deleting the old ones."
Forty rounds of that. Very productive indeed!
A review reads the code and makes a list. The agent fixes the list. Every round ends with green tests and a nice commit message, and honestly it feels like progress, for the agent and for me.
Nobody in that loop asks "how many places in this app calculate a character's health?" That's the question that finds the problem. On rpgstack the answer was way too many.
The tests didn't help either. rpgstack had 7,895 passing tests. They tested characters created by today's code, so obviously they matched today's code.
On October 21 the agent pulled 291 real characters from production and checked what users actually see.
All of that was live, with 7,895 green tests. Turns out green tests mostly prove that the tests agree with the code.
The next day the agent deleted 64 copies of rule code and replaced them with one place that owns the rules. One function for all 37 dice roll paths instead of 37 slightly different ones. Since October 22 there hasn't been a single character or rules bug-hunt round on rpgstack.
It's in the rulebook every coding agent in my repos reads. Before fixing a bug:
Plus two stop signs. If one file has been touched in three rounds, there's no fourth round. And if more than 20% of a round is fixing the previous round, stop.
On November 1 I built contentimage.io in about two hours. The first review found 22 bugs, and the agent started fixing them one by one, so exactly what my own rule says not to do. Prompted: "I'm sick of these constant bugs, go into root of these issues."
25 minutes later the app had five owners instead of 22 fixes. One of the tests found 12 different places that were writing the same data directly. 489 tests, zero server errors on 75 pages after that.
The other example is vilho.app, which got 26 rounds on October 10 and 11, before the rule existed. Six of those rounds fixed things an earlier round had broken. One billing file was touched in 18 of them. It's still on my list.
Next time your agent wants to start round 4, give it this instead:
Stop fixing bugs one by one. Take the bugs from the last rounds and group them
by cause, not by symptom. For the biggest group: list every file that reads or
writes that data, pick one file to own it, and write a test that fails on the
current code because other files touch it directly. Show me the failing test
before you fix anything. Then check the fix against real production rows, not
test fixtures.
My bug-fix commits across the fleet didn't go down, because I keep starting new apps and every new app gets its first rounds. What changed is that once an app has an owner for something, that kind of bug doesn't come back.
New essays like this one, by email. No schedule, no slop.