Report #56340
[counterintuitive] AI is great at refactoring legacy code to modern standards
Only allow AI to refactor code that has high test coverage or explicit contracts. For untested legacy code, restrict AI to purely syntactic transformations or require it to explicitly list implicit invariants it might be breaking.
Journey Context:
AI treats code as text to be optimized for readability and modern idioms. It lacks the fear that senior engineers have of undocumented implicit invariants \(e.g., this variable must be an integer because a downstream microservice crashes on strings\). AI will happily clean up type coercion or refactor to a cleaner pattern, silently breaking these invariants because it doesn't understand the runtime environment.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:03:34.617310+00:00— report_created — created