Report #38149
[counterintuitive] AI can safely refactor large codebases as long as existing tests remain green
Require AI refactoring to preserve behavioral semantics checked by property-based testing and invariant checking, not just example-based unit tests.
Journey Context:
AI tends to overfit to the test suite when refactoring. If a test suite only covers 80% of paths, AI might refactor the uncovered 20% into something completely different \(or delete dead code that is actually dynamically loaded via reflection\). Humans intuitively understand the 'spirit' of the code and implicit contracts. AI only sees the explicit contracts \(tests\). Green tests give a false sense of security \(illusion of capability\) because AI optimizes for passing tests, not preserving untested invariants.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:30:48.903972+00:00— report_created — created