Ask engineers what they still don't trust AI coding with and the answers cluster tightly: deep performance work, scalability, the failure modes you only meet at 3am. The scepticism is earned — but the usual conclusion (“so a human must review everything”) doesn't scale at AI generation speed. It's worth being precise about why assistants miss these bugs, because the why points at the fix.
The bug the assistant can't see in its own diff
Here's the shape, reduced to its essence — twelve plausible lines:
async function applyRefunds(orderIds) {
const results = [];
for (const id of orderIds) {
const order = await api.getOrder(id); // roundtrip per item
const refund = await api.refund(order); // second roundtrip per item
results.push(refund);
}
return results;
}It passes tests (fixtures have three orders). It reads fine (idiomatic async/await). In production with 100 orders it's 200 sequential roundtrips — tens of seconds on a blocking path — and it trips the payment provider's rate limit partway through a batch of refunds, leaving money in an inconsistent state. When we run this class of snippet through our own gate it comes back REJECTED — 30.8/100, with the latency arithmetic spelled out. The verbatim verdict is on the MCP page.
Why generation can't self-check this
- The defect isn't in the tokens. Every line is individually correct. The bug lives in the product of loop size × latency × rate limit — quantities that appear nowhere in the code the model is scoring itself on.
- Training data rewards the shape. Loop-and-call is the most common pattern for this task online. Fluency and correctness diverge exactly here.
- Self-review inherits self-blindness. Asking the generator to review its own output re-runs the distribution that produced the bug. It usually says the code looks good, because by its lights it does.
What deep review actually requires
Catching this class of defect requires review that is independent of the generator and structured around production quantities, not code aesthetics:
- Complexity on the I/O path, not just big-O on CPU: roundtrips per request, per item, per retry.
- Concrete arithmetic against realistic scale — what does N=100, N=10,000 do to latency, memory, connection pools?
- Rate limits and quotas of every external service on the path, checked against the worst-case call pattern.
- Blocking behaviour: what thread or event loop does this occupy, and for how long?
- Failure-mode review to a published standard — ISO/IEC 25010 reliability and performance-efficiency characteristics — so the bar is stable across changes and models.
Wiring it into the loop
The place to run deep review is inside the assistant's own loop, via MCP: the assistant calls validate_ai_output before presenting work, analyze_code for an on-demand deep pass, and fixes findings while the context is hot. Setup is a one-block config in Claude Code, Cursor or Windsurf — the step-by-step is in our setup guide.
The standard to hold
“AI can't do deep performance work” is half right: generation can't, reliably. Generation plus an independent, veto-empowered review that does the production arithmetic is a different system — one where the bug above never survives to a pull request, whichever model wrote it.
