The fidelity write tier arrives: surgical, byte-preserving edits that change only the bytes a filter targets and leave every other byte -- comments, indentation, quoting, key order -- untouched, or refuse. In the same release, byte-preserving reads become the default and the re-serializing pipeline moves behind --normalize.
Added
- Write tier: surgical value edits. yqr can now mutate a document through the fidelity engine, changing only the targeted bytes: assignment
.a.b = <rhs>(scalar literal or a.-rooted path), append.xs += <item>, new-key assign.a.new = <rhs>, anddel(.a.b). Each edit passes through the engine's re-parse guard -- an edit that would restructure the document is refused (exit 5) rather than emitted, and scalar writes are quoted to match the neighbouring style. A filter is either a read-only query or a single mutation; mixing them is a parse error. -i/--in-placeflag writes the mutated document back to the input file atomically (temp file + rename,fsyncbefore rename, symlinks followed, owner-only temp permissions). Using-iwith stdin or with a read-only filter is an error, diagnosed before any input is read. Without-i, the mutated document is printed to stdout (byte-exact except the edit).- Structural delete of multi-line and nested block entries (e.g.
del(.spec.template)), which the single-line delete path rejects. Flow-style and sole-entry deletes remain refused with a clear message. --normalize/-Nflag for the re-serializing pipeline: it drops comments and canonicalizes scalars (e.g.007becomes7).
Changed
- Byte-preserving reads are now the default.
yqr '.' file.yamlreproduces the input byte-for-byte -- comments, quoting, indentation, scalar spellings, and line endings survive -- with no flag. Untouched nodes are emitted as their original source bytes; computed, absent, and unaddressable nodes fall back to typed rendering per node. --enginenow selects the backend for the default (byte-preserving) read. Under--normalizethe re-serializing pipeline runs and the engine choice has no observable effect beyond the up-front name validation.
Breaking
--preserve/-premoved. Byte preservation is now the default, so the flag is gone. Replaceyqr -p '.' fwithyqr '.' f; useyqr --normalize '.' ffor the re-serializing behaviour.
Security
- Bumped the transitive
crossbeam-epochpin0.9.18 -> 0.9.20to clear RUSTSEC-2026-0204. It reaches the build only through thecriteriondev-dependency (benchmarks), so released binaries were never affected; the change is lockfile-only.
Full changelog: https://github.com/zoosky/yqr/blob/v0.4.0/CHANGELOG.md