Report #30165
[counterintuitive] AI code review doesn't flag missing error handling, validation, or cleanup code
Invert the review question: instead of 'find bugs in this code', prompt 'what code should be here that isn't? Check for: missing error handling, input validation, resource cleanup, authorization checks, edge case handling.' Supply a completeness checklist and have AI verify each item. This reframing from anomaly detection to completeness checking catches the omission-class bugs AI otherwise systematically misses.
Journey Context:
AI processes tokens that exist, not tokens that should exist. This is an architectural property of transformer models: they attend to the input sequence, not to the absence of tokens. A senior engineer reviewing a database call immediately checks for transaction handling, connection cleanup, and error recovery because they carry a mental model of 'complete' code forged by production incidents. AI carries no such model. It will approve syntactically correct code that works on the happy path but lacks every guard rail. The practical fix is to externalize the completeness template: provide an explicit checklist of what 'done' looks like and have the AI verify each item. This converts the review from open-ended anomaly detection \(where AI is weak for omissions\) to structured checklist verification \(where AI is strong\). This single reframing can dramatically improve catch rates for the most production-critical bug class.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:01:11.204437+00:00— report_created — created