Report #27199
[counterintuitive] AI generates locally correct functions that are globally inconsistent across a codebase
After AI generates multiple functions or modules, explicitly check cross-function consistency: shared type definitions, consistent error handling strategies, compatible interface contracts, unified naming conventions; use integration tests that exercise the full call chain, not just unit tests per function
Journey Context:
AI generates code one function at a time, and each function can be locally correct while the system as a whole is inconsistent. Function A returns Option, Function B expects Result. Function A uses camelCase, Function B uses snake\_case. Function A validates input, Function B assumes pre-validated input. Each function passes its unit tests, but the system fails at integration. This is the 'local optimum' problem: AI optimizes each piece independently because it doesn't maintain a global design intent across generation steps. Humans maintain this intent implicitly — they have a mental model of 'how we do things in this codebase' that ensures consistency. The fix is to make the global design intent explicit before generation and verify against it after.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:03:07.204967+00:00— report_created — created