Refactor in small reversible steps.
- •Define behavior-preserving target and affected boundaries.
- •Create small edits per step and keep call sites compilable.
- •Run focused checks after each step.
- •Keep rollback options explicit (git diff checkpoints).
- •End with verification summary: what changed, what stayed invariant, and what was validated.