Performs a string replacement edit on a file with CRLF/LF and whitespace
tolerance. Thin wrapper that runs the I/O and applies the resulting cache
effect to cache in one shot (used by tests and any in-process caller that
already holds the cache exclusively).
Quality loop (#494): classify the edit result and feed it into
crate::core::edit_quality. Only two outcomes carry a compression
signal: a clean replacement (success) and an old_string miss
(failure — the body the agent quoted wasn’t what’s on disk). Parameter
mistakes (empty/identical strings, preimage mismatch, missing file) and
already-applied edits say nothing about the read mode and are skipped.