The compiler is the first explanation of a change, expressed in the language's own terms. It cannot tell us whether a
rule is legally correct or whether a screen is useful. It can tell us whether the program's stated relationships are
internally coherent: a value is owned somewhere, a borrowed value outlives its use, errors are handled, every variant is
accounted for. That is an unusually strong first filter for AI-generated code because it turns a vague instruction into
a precise question the toolchain can answer.
For a refactor, compile early and often. Let the type system show where the old story and the new story disagree before
you spend time polishing either one.