An AI agent audited my Raft database and found a critical bug. Then I caught the agent’s own mistake.
I asked an AI agent to audit my own distributed database. It found a critical bug. Then I had to catch the agent's own mistake.
I built Phalanx, a Raft key-value store in Go replicated across 5 regions. I wanted to know if my docs matched my code, so I gave an AI agent strict rules: never invent a number, save raw output for every claim, write a failing test before each fix, and report anything where my docs and my code disagree.
What it found:
- Raft log entries were never written to disk. A restarted node would have lost acknowledged data.
- Seven more gaps between what I'd claimed and what the code did (pre-vote never initiated, no snapshots, gossip bypassing consensus, and more).
- I fixed all eight, test by test. A linearizability checker (Porcupine) now passes 99 of 100 randomized failure runs.
The part I think matters for this community: the agent's first benchmark report looked great, and some of it was wrong. Its cross-region latency numbers were identical before and after my changes, which means they were never measured. I caught it by reading the data, not the summary.…