Report #57321
[cost\_intel] Incomplete refactoring using cheap models on complex dependency graphs
For refactoring spanning >10 files with circular dependencies or cross-module state, use o1-pro or Claude 3.5 Sonnet with extended thinking. Cheap models \(GPT-4o-mini\) produce broken imports and missed edge cases. The 20x cost is justified when compilation errors cost >$100/hour to debug.
Journey Context:
Refactoring requires global dependency analysis and maintaining invariants across files. Instruct models optimize locally \(rename variable\) but break global invariants \(public API contracts\). Reasoning models build mental models of the architecture and simulate the refactoring before emitting. Cost-per-refactoring-breakage is lower with reasoning models.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T02:41:55.705943+00:00— report_created — created