safe-refactor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSafe refactor
安全重构
Define behavior-preservation boundary and establish verification before structural edits.
- Keep feature changes outside refactor.
- Move one ownership boundary at a time.
- Preserve public interfaces, failure behavior, ordering, and compatibility unless explicitly scoped.
- Keep intermediate states buildable and testable.
- Avoid dependency or configuration growth without correctness need.
Run same proof after change. Stop when behavior matches and requested structure is achieved.
定义行为保留边界,并在进行结构编辑前建立验证机制。
- 功能变更需与重构操作分开进行。
- 每次仅调整一处所有权边界。
- 除非有明确的范围规定,否则需保留公共接口、错误行为、执行顺序及兼容性。
- 确保重构过程中的中间状态可构建、可测试。
- 若非正确性所需,避免增加依赖或配置项。
变更后执行相同的验证流程。当行为与原代码一致且达到预期结构时停止。