Exponential
Engineering
Turn every AI mistake into an automatic check, not AI marking its own homework, so that kind of mistake never comes back and quality snowballs.
- + no bare except
- + zero warnings
- + http needs a timeout
how to make every mistake
the last of its kind
by Ben O'Mahony and Fabian Nonnenmacher
the whole idea in fifteen seconds
Nobody reviewed that. The lint rule did.
the big idea
When you find a mistake, don't fix it.
Fix every future version of it.
"What deterministic rule would have caught this automatically?"
Write it as a lint rule, not a line in RULES.md. Five minutes. One rule. Never the same lap twice.
why exponential?
A fix touches one line. A deterministic rule touches every line, by every agent, forever.
Your agents get better without getting smarter.
it cuts both ways
Agents copy what they see. Every pattern in your repo is a template for the next thousand lines.
No rules isn't standing still.
It's compounding the other way.
harden the codebase, not the agent
Agents come and go. Claude Code today, Codex tomorrow, something new next quarter.
The repo is the shared context. Harden it and every agent gets better, including ones that don't exist yet.
the swiss cheese model
Every check is a slice with holes in it, and no slice catches everything. Stack slices whose holes sit in different places and a bug that slips through one hits cheese in the next.
Three bugs from the agent's payments change: a swallowed error, a rounding bug that loses a penny, and a retry that double charges when the network drops a reply. Types miss all three. Lint catches the swallowed error, property tests catch the lost penny and deterministic simulation testing (DST) catches the double charge. No single slice had to be perfect.
One slice leaks. The stack doesn't.
don't let agents drill holes
Stuck on a red build, an agent reaches for the escape hatch.
noqa, a loosened config, a skipped test, a deleted assertionSo add a rule that stops the rules getting weaker.
zanity's relaxed-check rule catches continue-on-error: true, || true, --exit-zero and friends.
everything on. zero warnings.
NASA's Power of 10, rule 10: every warning on at the most pedantic setting, static analysers every day, and ship with zero warnings.
A warning you tolerate is a rule you taught the agent to ignore.
More: The Power of 10 by Gerard Holzmann, TigerStyle, and zanity to enforce it across Python, Zig, Go, TypeScript, Rust and Java.
actionable errors are just in time prompts
Don't front load the context.
Deliver it the moment it's needed.
A lint rule that never fires costs zero tokens. One that fires is the most relevant prompt the agent will see all day.
The error message is the prompt:
error: forbidden call
😐 the agent guesses
error: datetime.now() reads the wall clock.
Use clock.now() so tests can
freeze time.
See docs/time.md
😎 the agent knows
- says what is wrong
- says what to do instead
- points where to read more
- is deterministic: same input, same answer
real rules, real cheap
Point agents at the right API with ruff:
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"datetime.datetime.now".msg = "Use clock.now() so tests can freeze time."
Ban a pattern with ast-grep:
id: no-print-in-lib
language: python
rule:
pattern: print($$$ARGS)
message: Use the logger from app.log, not print().
severity: error
Most mistakes are already a rule someone wrote. Turn it on before you write your own.
your first five rules
The mistakes agents make most, and a rule that already catches each one. Turn them on today.
| the mistake | the rule |
|---|---|
| a silenced exception | ruff BLE001, S110, zanity swallowed-error |
an httpx call with no timeout | ruff S113 |
a naive datetime.now() | ruff DTZ005 |
print instead of the logger | ruff T201 |
| a skipped test | zanity skipped-test |
Each is one line of config. None of them is a line in RULES.md.
quality ratchets
Pick a number. Commit it. CI fails if it gets worse and tightens when it gets better.
lint violations
mon 412
tue 398 ✓ ratchet tightened
wed 401 ✗ CI fails: 401 > 398
thu 371 ✓ ratchet tightened
No big bang cleanup. Turn the rule on today, freeze the old violations, block every new one.
Quality Ratchets are from Building AI Agent Platforms by Ben O'Mahony and Fabian Nonnenmacher (O'Reilly). See also every failure becomes a ratchet.
no backlog
Allen Holub: "Backlogs are a symptom, not a tool." A backlog is work stockpiled in front of development, going stale while it waits.
Agents made building fast. The queue is the delay.
Toss the backlog. If it's important, it will come back.
More: #NoBacklog by Allen Holub.
zero technical debt
TigerBeetle's TigerStyle: do it right the first time, because you may never come back.
Debt compounds too. Pay it while it's small.
More: TigerStyle by TigerBeetle.
certain and instant
Every check sits on two axes: how sure it is, and how fast the agent hears about it. Aim for the top left.
Agent hooks tie you to one agent. LSPs and watch mode daemons live with the codebase and work for all of them, humans included.
overwatch
The fastest loop is the one nobody has to start. Run your tests and linters in watch mode, right beside the agent.
- full suite runs first, so you start green
- every save reruns what changed
- failures go straight back to the agent, before it moves on
- runs zanity beside your tests
- the turn can't end while the build is red
/plugin install overwatch --marketplace benomahony/overwatch
Works with Claude Code, Codex and Neovim. github.com/benomahony/overwatch
no software factory
The pitch: write a spec, start a fleet of long running agents, come back to a finished product. We don't buy it.
Either way the answer is short loops.
A long running agent is a long lived feature branch with extra steps.
thin slices, straight to trunk
Small enough to review in a minute. Small enough to revert in a second. On main many times a day.
Most harness engineering is a workaround for slices that are too thick.
We once had a feature branch live for 45 minutes. We now call that long lived.
tapas teams
Two pizza teams were sized for humans typing. With agents, the plates got smaller.
The only number that matters:
time to first customer feedback
Not lines of code. Not PRs merged. How fast does a real person tell you whether it's any good?
careful now
- noisy rules are bugs. A false positive teaches agents (and humans) to add
noqaeverywhere. - prune. Hundreds of prose rules make agents follow fewer of them. Lint rules only speak when broken, so they scale. Prose doesn't.
- escape hatches need reasons.
# noqa: BLE001 retry loop logs it - don't make an LLM your linter. Pass or fail, every time, for free.
try it monday
- turn every linter and type checker to its strictest setting
- keep a "that again?!" list for one week
- for each entry, find an existing lint rule
- no rule exists? write one with ast-grep or semgrep
- run tests and lint in watch mode with overwatch
- make CI fail on it, and ratchet the count down
- delete the matching line from AGENTS.md 🎉
we practice what we preach
Every change runs zanity strict, axe, the W3C Nu validator, stylelint, actionlint, zizmor pedantic, typos and lychee with zero findings. Then these rules, each one a correction we got along the way:
- axe finds nothing, light and dark, desktop and phone
- no em or en dashes in the copy
- no naming and shaming libraries
- no banning language
- no JavaScript
- stylesheets versioned by their content, so phones never keep stale CSS
- the agent pages link the current stylesheet too
- a 1200x630 social card behind every share
- every in page link lands
- every external link is https
- never scrolls sideways, from 320 to 1440px
- nothing stays invisible after its animation
- no console errors
- highlighted text reads on its band and on the paper
- highlights never cover a neighbouring line
- reduced motion means a still cover
- every card grows to fit its content
- this list matches the test suite
See them run: .github/workflows/lint.yml
wait, isn't this just continuous improvement?
...yes. 🤫
| Toyota, 1950s | us, now |
|---|---|
| kaizen | exponential engineering |
| poka yoke | a lint rule |
| andon cord | overwatch going red |
| jidoka: stop the line | the turn can't end while red |
| five whys | five whys, but the agent answers instantly and confidently |
| the new hire | the new hire, typing 400 words a second, with no memory of yesterday |
The ideas aren't new. The speed is. When your juniors write a thousand lines an hour, a missing rule doesn't cost you a bug. It costs you a pattern.
Please don't tell W. Edwards Deming we put a GPU in it.