Vai al contenuto

Blog

Releasev0.19.2

v0.19.2 — file-edit data integrity

Questa è la nota di release così com'è stata pubblicata, non una sua riscrittura. Le note di release sono pubblicate nella lingua in cui sono state scritte.

An eleventh adversarial review, of the file-mutation surface (edit_file / apply_patch / write_file). The logic guards (unique-anchor, path-jail, write-region) reviewed clean — the exposure was entirely at the byte-I/O layer, and it's the kind of silent corruption this surface exists to prevent.

Fixed

  • File edits no longer silently rewrite every line ending. Reads/writes went through Path.read_text/write_text, whose universal-newline translation flipped the WHOLE file to the platform's line ending — a one-line edit on an LF file became a whole-file CRLF diff on Windows (and an LF-flatten on Linux). Edits now read as bytes normalized to \n for matching and write back preserving the file's original newline convention. (A CRLF file also now anchors a model's \n-based match string correctly.)
  • File writes are crash-atomic — temp file + os.replace, so a crash or I/O error mid-write can't truncate the user's existing file.
  • apply_patch anchors every hunk against the ORIGINAL content (not a copy mutated by earlier hunks) and rejects overlapping target regions.
  • Non-UTF-8 files get a clear "not a UTF-8 text file" error instead of an opaque failure — and are never touched.

Note: the newline bug predates the 0.19.x line (it's been in the file tools since surgical editing landed) — this is the fix, not a fresh regression.

Gate: 1447 passed / 3 skipped, mypy + ruff green (+8 byte-level tests).

Upgrade (recommended for anyone using edit_file/apply_patch): `pip install --upgrade 'chimera-agent[full]'`

Leggi la release su GitHub