Migration Diary: Rebuild the Diff Budget Before You Leave a Paid Coding Agent
说明与用途
通过实施差异预算,团队可以安全地从付费 AI 代理迁移,限制补丁大小,防止不受控制的代码更改。
问题
After canceling a paid coding agent, teams risk accepting large, opaque patches that can silently modify many files, leading to uncontrolled changes and difficult reviews.
结果
Teams can safely transition away from paid AI agents by enforcing numeric diff budgets, preventing large, uncontrolled patches and maintaining code quality.
工作流
- 1. Export all leftover paid diffs to a local directory.
- 2. Count files and lines in the working tree with
git diff --numstat. - 3. Parse each unified diff with a custom Python scorer to tally files, hunks, added and deleted lines.
- 4. Compare counts against the .diff-budget.json limits.
- 5. Reject any patch that exceeds the budget; otherwise apply it.
- 6. Commit the .diff-budget.json to the repo so all teammates share the same constraints.
证据
A budget is not a linter, and it is not a model quality score either. It is a hard ceiling on how much tree mutation one agent turn may propose.
Store the budget beside the repository, not inside a vendor dashboard you are about to abandon.
- 记录日期: 2026-09-21T23:15:24.298Z