File: internal/tool/edit_match.go L635-672 vs L536-565.
lenientRecountRaw counts candidate blocks with BOTH-side TrimSpace for every transform, but trailing-whitespace-tolerant matching semantics preserve leading indentation (only trailing ws ignored). End-to-end repro: a file where old_text byte-exact count is 1 under trailing-tolerant matching, but a second block differing in leading indent gets counted -> edit_file rejects with 'matched 2 times ... line(s): 1, 6' - a correct unique edit fails as false ambiguity.
Impact: Medium - recurring friction on whitespace-tolerant edits.
Fix: recount per-transform semantics (rstrip-only for trailing-tolerant).
Verified by independent re-review with end-to-end EditFile.Execute repro.
File: internal/tool/edit_match.go L635-672 vs L536-565.
lenientRecountRaw counts candidate blocks with BOTH-side TrimSpace for every transform, but trailing-whitespace-tolerant matching semantics preserve leading indentation (only trailing ws ignored). End-to-end repro: a file where old_text byte-exact count is 1 under trailing-tolerant matching, but a second block differing in leading indent gets counted -> edit_file rejects with 'matched 2 times ... line(s): 1, 6' - a correct unique edit fails as false ambiguity.
Impact: Medium - recurring friction on whitespace-tolerant edits.
Fix: recount per-transform semantics (rstrip-only for trailing-tolerant).
Verified by independent re-review with end-to-end EditFile.Execute repro.