Report #47857
[synthesis] Agent edits cascade into broken imports and type errors across files
Implement a two-phase spec-then-edit loop: first generate a structured plan listing all files and intended changes, validate the plan for cross-file consistency, then apply edits. Never apply multi-file edits sequentially without a pre-computed plan.
Journey Context:
Cursor Composer, Devin, and Sweep all independently converge on plan-then-execute. Naive sequential editing fails because early edits change the symbol graph that later edits depend on — a renamed function in file A invalidates the edit planned for file B. The plan phase acts as a transaction boundary. Tradeoff: adds 1-3s of latency before any visible change, but prevents cascading type errors that cost 10x more to recover from. Sweep's open-source implementation makes this explicit with a plan.md that must be generated before any code changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:48:48.394605+00:00— report_created — created