b8c.io All articles
Engineering Strategy

The Autocomplete That Hasn't Read Your Runbooks

b8c.io
The Autocomplete That Hasn't Read Your Runbooks

Photo: Sylvain Kalache from San Francisco, USA, CC BY 2.0, via Wikimedia Commons

AI pair programmers have a confidence problem that is not really their fault. They have never been on call. They have never watched a dashboard turn red at 2:14 a.m. because a retry loop hit a queue with no depth limit. They do not know that the billing service has a hard dependency on a legacy cron job that only one person understands. What they do know is the shape of code that usually compiles. That is useful. It is not the same as knowing your production constraints.

The result is a new kind of review burden. A generated function can look clean, pass a quick read, and still miss the things that matter: ownership, failure modes, load assumptions, and the operational cost of the abstraction it introduces. The speed gain is real. So is the maintenance bill. The goal is not to ban AI-generated code. It is to make its provenance and intent visible enough that your team can review it like engineering work instead of accepting it like autocomplete.

Plausible Is Not Production-Ready

AI assistants are trained to produce plausible code, not code that respects your architecture decisions. A generated service class may be perfectly idiomatic and still bypass the shared auth middleware your team standardized on. A generated test may assert the happy path while ignoring the idempotency key your payment provider requires. None of this shows up in a syntax check.

The practical risk is not that the code is obviously wrong. It is that the code is close enough to right that a tired reviewer waves it through. That is where hidden debt enters the codebase: a new helper with no owner, a retry policy that ignores your jitter conventions, a database call inside a loop that works in staging and falls over during a US peak-traffic window.

The Review Tax Nobody Budgeted

Every generated block shifts work from writing to reviewing. That can be a good trade. It becomes a bad trade when the reviewer has less context than the generator assumes. A reviewer needs to know which service owns the behavior, what happens when the dependency is slow, and whether the new code path is covered by an existing runbook.

A useful habit is to ask for the operational story before asking for style fixes. Who gets paged if this fails? What metric will show the failure? Is there a rollback or feature flag? If the answer is nobody knows, the code is not ready, regardless of how neat the diff looks.

Provenance Is an Engineering Control

Provenance does not have to mean a bureaucratic paper trail. It can be lightweight: mark AI-assisted commits in the message, note the prompt or source context in the pull request, and require the author to state what they verified. This is less about policing tools and more about giving future maintainers a clue.

When a generated block causes an incident six months later, the first question is usually why the code exists. If the pull request says generated from a support ticket and reviewed against the billing runbook, that is useful context. If it says update service, that is archaeology.

Tests Should Prove Intent, Not Just Syntax

AI-generated tests often mirror the implementation instead of the requirement. They prove that the code does what the code does. That is not enough. Push for tests that encode the failure modes you care about: timeout behavior, duplicate submissions, partial failures, permission boundaries, and the unhappy path that support keeps hearing about.

A good guardrail is to require at least one test that would fail if the production constraint were violated. If the code is supposed to be idempotent, test the duplicate. If it is supposed to degrade gracefully, simulate the dependency being down. If it is supposed to respect tenant isolation, try to cross the boundary. That is how you turn generated speed into reviewed confidence.

Accountability Needs a Name

AI tools do not own code. People do. Every accepted change should have a human owner who can explain why it exists, how it fails, and what to do about it. That sounds obvious, but it is easy to lose when a pull request is mostly generated and lightly edited.

Make the owner explicit in the review. Assign a service owner for anything that touches production behavior. Add a short note in the pull request about the blast radius. If the change touches a shared library, name the downstream teams. If it touches data, name the migration plan. Accountability is not blame. It is the difference between a codebase and a pile of plausible snippets.

A Practical Guardrail Set

Start small. Label AI-assisted pull requests. Require a human owner for every production change. Add a failure-mode checklist to the review template. Ask for at least one test that encodes a production constraint. Keep generated code out of critical paths until it has been exercised against realistic load and failure conditions.

None of this slows a team down as much as a 3 a.m. incident caused by code nobody understands. The point of AI assistance is to build faster and ship smarter, not to outsource judgment. Your runbooks, your pager, and your incident channel are the context the autocomplete does not have. Review accordingly.

All Articles

Related Articles

Git Log Is a Crystal Ball: Reading Engineering Health Between the Commits

Git Log Is a Crystal Ball: Reading Engineering Health Between the Commits

The Dependency You Didn't Write Is the One That'll Break You

The Dependency You Didn't Write Is the One That'll Break You

The Kill Switch You Never Tested: Why Your Rollback Plan Is a Bedtime Story You Tell Yourself

The Kill Switch You Never Tested: Why Your Rollback Plan Is a Bedtime Story You Tell Yourself