You do not understand the messy function. That is fine. The snapshot does not care about your understanding. Golden files turn "I think this is safe" into "the diff says so." This loop has four commands: record, verify, move, commit. Each move is one semantic change. The snapshot judges every move.
Why review guessing fails
A 600-line function hides its contract. Callers see the return value. They also see database writes, emails, and exceptions. Human reviewers guess about those side effects. AI reviewers guess with more confidence. Neither can prove the behavior is identical. A golden file can.
The golden file is a recorded behavior. It stores the return value and side effects for a fixed input. It is not a unit test. It encodes no intent. It only says: this is what the code did on this input. That is enough for a refactor.
Step 1: Pick the boundary






