← Brakes: coding with AI agents

Brakes: coding with AI agents · Part 8

The fake adapter lied

· by Tony Tang

Every test passed and prod charged $87,604.99 for an $87.60 cart. The tests ran on an in-memory fake returning a number; Postgres returns a bigint column as a string, so 8760 plus 499 became "8760499". Two adapters, one port, and nothing checked they agree. Write the port's contract once and run it against the fake and real Postgres in CI. One contract. Every adapter keeps it.

Comment below: Do your fakes run the same tests as the real thing?

Brakes: a series on the checks that let an AI coding agent go fast without shipping bugs. Every best practice shortens the time between writing a bug and finding it. Brakes are why race cars go fast. All code is real TypeScript on Node 24, typechecked and tested before it went on screen.

More from this series