Report #55084
[synthesis] Agent introduces catastrophic bugs by refactoring instead of applying minimal bug fixes
Constrain the agent's edit capabilities to single-function or search-and-replace replacements for bug-fix tasks; explicitly forbid file-wide rewrites unless requested.
Journey Context:
LLMs are trained on vast amounts of 'clean code' and design patterns. When they see a messy function, their prior biases them toward 'improving' it. A 1-line bug fix turns into a 50-line refactor. The agent is confident because it's applying 'best practices,' but it lacks the global context to know the refactor breaks other modules. Constraining the edit scope physically prevents the model from acting on its refactoring bias. This synthesizes LLM pre-training distributions with software engineering minimal-change principles.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:57:06.426490+00:00— report_created — created