# AI-Generated Code Hides Silently-Broken Potemkin Features
## Claim
AI-generated code can contain functions that parse and execute without error while silently doing nothing or the wrong thing, and this bug class survives demos and non-expert code review specifically because nothing about running it looks broken.
<!-- atomicity: 1 idea ✓ -->
## Scope & conditions
- Applies most directly when the reviewer lacks the domain expertise to read the generated code line-by-line (a non-Rust-programmer directing a Rust interpreter build, for instance).
- The failure mode is distinct from a crash or visible error — it requires behavioral testing (does the function actually do what it claims?) rather than static review or "it ran without erroring."
- Doesn't establish that this bug class is more common in AI-generated code than in traditionally hand-written code; the source only demonstrates that it exists and evades casual review, not a comparative rate.
## Evidence
Phargo's from-scratch PHP interpreter shipped multiple "Potemkin builtins": `clone` parsed and executed but evaluated to `NULL` engine-wide (breaking every `DateTimeImmutable`), `unset($arr[$key])` was a total no-op, `trim($str, $charlist)` silently ignored its charlist argument, and `spl_autoload_register()` accepted an autoloader and never called it. Each "would survive a demo" and "a code review by someone who doesn't read Rust" — only PHP's own 22,000-file regression suite caught them.
## Links
- [[AI & the Future of Knowledge Work MOC]] — the bug class that survives review because the code looks correct
- [[3. Resources/Permanent Notes/Comprehension Debt Is the Real Cost of Unattended Autonomy]] — extends: the specific mechanism by which unread AI-shipped code becomes debt — it looks done because nothing errors
- [[3. Resources/Permanent Notes/External Test Oracles Make AI-Generated Code Trustworthy]] — evidence-for: this is the exact bug class that motivates needing an oracle the reviewer didn't write
- [[3. Resources/MOCs/AI Agent Safety MOC]] — applies-in: a concrete failure taxonomy for anyone reviewing AI-generated code outside their own expertise
## Tests / falsifiers
- Audit a sample of AI-generated PRs across several unrelated codebases for the "runs without erroring but does nothing" pattern; if it's rare outside interpreter/compiler work specifically, the claim should narrow to that domain rather than generalize.
- Check whether static analysis tools (not just behavioral test suites) can catch Potemkin-style bugs — if they can, the claim that only an external test oracle catches them needs revising.
## Maintenance
- Last tended: 2026-08-16
- Next review: 2026-11-16
## Source
- [[3. Resources/Literature Notes/I Don't Know Rust. My AI Is Rewriting PHP in It Anyway]] — catalogs the Potemkin-builtin bugs found in the Phargo project.