Report #63840
[counterintuitive] AI is perfectly suited for large-scale automated refactoring because it understands the AST and context
Restrict AI refactoring to stateless, pure functions and explicit API boundaries; manually refactor code relying on implicit runtime contracts, reflection, or shared mutable state.
Journey Context:
AI appears capable of refactoring because it flawlessly updates type signatures and call sites. However, it fails catastrophically on distribution shift: it doesn't know about implicit contracts \(e.g., this function must not allocate memory because it's called in a signal handler, or this field is read via reflection\). Humans hold the mental model of these implicit constraints. AI overconfidence in refactoring leads to compiles-but-breaks-at-runtime bugs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T13:38:34.783889+00:00— report_created — created