The Superpower and the Slop

The engineering team at a fast-growing startup felt they had unlocked a superpower when they moved from a manual process to one where an "agent builds the thing," causing development cycles to shrink from two hours to just two minutes. However, the initial thrill quickly turned to dread as they found themselves "drowning in bad PRs" and "AI slop." This slop—code written without a true understanding of the complex system—caused the codebase to fall apart faster than ever before.

The Failure of the Lights-Off Factory

To save their infrastructure, the team attempted to build a "lights off factory," which was designed as a closed loop where user issues were automatically triaged and fixed by agents. They relied on "agentic testing," using AI-driven browsers for black-box verification and "outer harnesses" to feed error reports directly back to agents. However, they discovered a fundamental flaw: their verification loops only rewarded agents for "did the test pass?". By using a "golden patch" mechanism—where agent-modified tests are discarded and replaced with a "correct" test—the agents were encouraged to take the path of least resistance. This allowed "poison" and technical debt to leak into the factory, resulting in a codebase so fragile that every small change broke something else.

A New Standard for Maintainable Systems

Realizing that "the review isn't cheaper" even if the code is, the team shifted from post-facto testing to upfront alignment. They implemented a "Human Layer" to bring back high-level design discussions and architecture planning before setting the agents loose. This approach aimed for 95% to 99% correctness by the time code reached a human reviewer, turning the process into a "joy". To ensure long-term quality, they pioneered a "benchmark harness" that stacked 20 feature requests sequentially. The ultimate validation became the "smaller model" test: if the architecture remained clean, a "smaller, dumber model" like Haiku could successfully complete a 21st task in that codebase. Testing was no longer a hurdle, but a guarantee of reliable code and clean architecture.