- Remove top-level old_text/new_text params from edit tool schema
- Make edits array the sole interface; single edits pass 1-item array
- Simplify normalizeEditInput, removing dual-mode branching logic
- Update UI renderer to only read from edits array
- Remove old_text/new_text from bodyKeys in message summarizer
- Update web session HTML to iterate edits array
- Convert all single-edit tests to use Edits array
- Replace mixed-mode test with empty-array validation test
Two bugs fixed in internal/core/edit.go:
1. fuzzyMatch/mapFuzzyIndex returned wrong byte positions when trailing
whitespace was stripped during normalization. The old rune-counting
approach assumed 1:1 mapping between original and normalized strings,
but whitespace trimming changes string length. This caused the
replacement splice to cut at wrong boundaries, corrupting files.
Fix: replaced with normalizeWithMap() that builds an explicit
byte-position mapping during normalization. Also added ambiguity
guard — multiple fuzzy matches now return no-match instead of
silently picking the wrong one.
2. generateDiff marked the entire rest of the file as changed.
The old code used countNewlines(old[changeIdx:]) to compute the
diff range, which counted ALL newlines from the change point to EOF.
Fix: replaced hand-rolled diff with udiff.Unified() (already a
dependency) for correct standard unified diff output.
Added internal/core/edit_test.go with 33 tests covering fuzzyMatch
position mapping, normalizeWithMap correctness, generateDiff output,
and end-to-end executeEdit scenarios including corruption regression
tests.