Owning software · 6 min
Does your team make the same mistake twice?
Most teams fix a bug and move on. We turn each lesson into an automatic check where we can, and a written rule where we can't. Here's where that falls short.
Short answer: A fix repairs one bug. It doesn't stop the same mistake next month. In GarageHub, our own app, every hard lesson becomes an automatic check where that's possible, and a written rule where it isn't. There are 151 rules today. The checks are the ones we trust.
The fix isn't the lesson
Something breaks. Your developers fix it, and everyone moves on. Six months later it breaks again in a slightly different place, and someone says "didn't we fix this?"
You did. You fixed that one bug. What nobody kept was the reason it happened.
In most teams that reason lives in one person's head. When they're busy, on holiday or gone, it's gone too.
Why we had to write it down
GarageHub is our car maintenance app. About nine in ten changes to its code list an AI agent as co-author, as of November 2026.
An agent is fast and it reads everything you give it. It also starts every session knowing nothing about last month. If a lesson isn't written where the agent will see it, the agent will make the mistake again, and it will be very confident about it.
So we wrote the lessons down. It turned out people needed them just as much.
What a rule looks like
A rule is a file. It says what went wrong, when, and what to do instead. Each one is attached to a part of the code and appears only when someone works there. Nobody is asked to remember all of them. Only three load every time. They're about how we merge work.
The oldest, written in March 2026, is about a bug from that February. Photos weren't showing in the app, because the server sent half an address and the app needed the whole one. The rule loads whenever an agent works on photos.
A rule is the second choice
A written rule works only if someone reads it and does what it says. So our first rule is about rules: a lesson becomes an automatic check if it can, and a written rule only if it can't.
Here's why. In July 2026 a TestFlight build, not yet in the App Store, showed an empty garage. The server had started sending one number with decimals, and the app expected a whole number. The version in the App Store was fine. We wrote the rule: never break an app that's already on someone's phone.
Not counting July's, the same kind of mistake has reached users three times, and for too long that rule was only a document. Since August a check compares the answers the server declares with what the apps expect. It catches most of this kind of change before it ships, and it lists what it can't see.
The rule is still there. The check is what we rely on.
The day an agent published a release early
On 14 October 2026 an agent was testing a change to our release script. To test it, it ran the script. That published a real version tag and 24 changelog entries, two days early.
We could have written "don't do that" in a file. But the agent hadn't broken any rule it knew about. So the same day we added a guard: any agent command that looks like a release, a deploy or a push to the live branch now stops and asks a person first.
We have four guards like that. One refuses to skip the checks that run before code is committed. Another refuses any merge that doesn't go through our gate.
It doesn't always work
Three places it falls short.
A check can be too narrow. In August we planted bugs in our own code to find out, and the check written after the July incident missed a bug one field over. We wrote about that in Green tests, 15 missed bugs.
Some rules never became checks. The photo rule was still only a file that August. When we planted that exact bug, no check caught it.
And rules pile up. We stopped adding new ones for two weeks and merged the overlapping ones. A new file now needs a reason.
What to ask your developers
- When something breaks twice, where is the lesson written down?
- Who would know it if the developer who fixed it left?
- Which of our past incidents has an automatic check now, and which has only a promise?
- If you use AI to write code, what does it read before it starts?
If the lessons live only in people's heads, you're paying for some of them more than once. Reading what a team has written down, and what it hasn't, is part of a codebase audit.
For your CTO
- Count: 151 rule files and an index (152 files in all), as of 22 November 2026. The folder grew from 49 files to 152 between 1 September and 10 October 2026, and the count hasn't moved since. 148 of the rules are scoped by path and load only when a matching file is read. Three load in every session.
- Order of preference: a check first, an edit to an existing rule second, a new rule file last. A check must run in the pull request pipeline or it doesn't count, and another check verifies that every guard script is wired in.
- Released clients: the contract check finds every route that returns a decimal or fractional column and requires a declaration. It compares the iOS and Android model types against the database types for 23 declared contracts, and fails strict enums a response can reach. Server-computed fields are a short hand-kept list, and the script documents its own blind spots.
- Class, not instance: a guard written backwards from one incident guards that incident. Each new guard has to answer: is it a property or an instance, how many sites does it cover, does it fail on an empty input set, and which job runs it. Findings fail or are baselined. They never warn.
- Agent guards: four pre-execution hooks. They deny skipping git hooks, ask before a release, tag, deploy or push to the main branch, deny merges outside the merge script, and deny tracker issues without a project and milestone. Each has its own tests.
- Upkeep: a two-week freeze on new rule files, consolidation commits, nine stubs that point to merged rules, and a weekly audit of always-loaded size. Lessons that aren't specific to this product are tagged, and promoted to a shared set when we choose to.
- Still a written rule only: the ban on stashing with parallel working copies, and the judgement of whether a branch is already merged.