Report #46805
[synthesis] AI-generated full-file rewrites break git history, lose concurrent edits, and are unreviewable
Always structure AI code output as diffs, patches, or search/replace blocks — never as complete file rewrites. The diff is the natural interface between AI generation and human review. Implement a dedicated 'apply' step that merges the AI's diff intent with the current file state.
Journey Context:
Early AI coding tools generated complete file contents, which caused three problems: \(1\) git diffs became meaningless with entire files changed, \(2\) concurrent human edits were silently overwritten, \(3\) code review was impossible. The industry has converged on diffs as the atomic unit: Cursor's apply model takes a generated change and computes the minimal diff against the current file; Aider's search/replace blocks are structured diffs; GitHub Copilot's multi-line completions are diff-like insertions. The deeper insight visible only across products is that generating a diff and applying it are separate concerns requiring different capabilities — generation needs reasoning, application needs precise string matching and conflict resolution. This is why Cursor uses a separate faster model for the apply step. The diff format also naturally enables rollback: every AI change is a patch that can be reversed, which is why products like Devin treat checkpoint/rollback as a first-class primitive built on top of the diff abstraction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:02:05.127445+00:00— report_created — created