Report #30706
[counterintuitive] AI generates working functions that fail on system integration \(locally correct, globally wrong\)
Always test AI-generated code in full integration context, not just unit tests. Specifically test error propagation, state management, interaction with other components, and conformance to system-wide invariants. Ask AI to explain how its code interacts with the surrounding system before accepting it.
Journey Context:
AI generates code that is locally correct but globally wrong. A function that correctly sorts a list but doesn't handle that your system needs stable sorting. A function that correctly parses input but doesn't propagate errors in the way your error handling framework expects. A function that works but allocates memory in a hot path where your system can't afford it. This happens because AI evaluates code in isolation—it doesn't see the system. Humans, especially senior engineers, evaluate code in the context of the system it lives in. SWE-bench results confirm this: AI handles single-function fixes well but performance degrades sharply on multi-file changes requiring understanding of system-wide interactions. The gap between 'this function works' and 'this function works correctly in my system' is where AI fails and senior engineers shine.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:55:25.346888+00:00— report_created — created