The Patch Window: Let a Model Refactor Only Lines Your Tests Already Cover
The smallest safe change is a bounded change. Bounds beat instructions. Give the model a line window, not a file. Most refactor prompts fail for one reason. They hand over too much surface. A model that can edit any line will edit lines nobody verified. The fix is mechanical. Map the seams. Measure coverage. Emit a window. Reject any patch that steps outside it. Below is the workflow I use on…
The smallest safe change is a bounded change. Refactoring prompts often fail because they offer too much surface area. A model that can edit any line may edit lines that haven't been verified. The solution is mechanical—identify the seams and measure coverage to emit a line window. Reject any patch that steps outside the window.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.