# Refactor Validation A safe refactor should be evaluated against its **pre-change baseline**, not only against an ideal green suite. ## Before Record, where available: - targeted test results; - broader test results; - lint/type/build results; - browser/visual state if relevant; - migration/config/runtime checks if relevant; - known existing failures and warnings. ## During After each meaningful structural step: - run the narrowest relevant test/check; - verify imports/exports/routes/registration still resolve; - inspect unexpected diff/churn; - stop and correct regressions before continuing. ## After Run the strongest practical combination of: - targeted tests; - broader backend/frontend tests; - lint/type/build; - API contract tests; - migration/config/startup checks; - visual/browser checks where rendered behavior could change; - `git diff --check` or repository equivalent; - final reference/search check before deleting old symbols/files. ## Result classification - **Verified preserved:** required checks ran and no behavioral regression was found. - **Preserved with known baseline failures:** no new failures beyond documented pre-existing ones. - **Partially verified:** some required checks were unavailable; state exactly which. - **Behavior changed:** identify the exact observable difference and whether it is authorized. - **Blocked:** equivalence cannot be established safely with available evidence.