Expand description
The format-independent diff model and fidelity ladder.
A Diff is a set of addressed Deltas, each carried at a
Fidelity rung. The binary rung here is the floor every document
diffs at; FormatPackages project documents to text so the ladder can
raise deltas to the text rung, and later to rich deltas in the format’s
own terms.
Structs§
- Address
- Where a delta lands, in the format’s own terms.
- Delta
- One addressed difference inside a
Diff, carried at its own rung. - Diff
- The differences between two versions: addressed deltas, each carried at the highest fidelity the ladder could raise it to.
- Line
- One line of a text-rung comparison: what happened and the line’s content.
- Package
Error - Why a package could not handle a document it detected.
- Package
Id - The identity of a format package: its name plus semver version.
- Projection
- A deterministic text rendering of a document, stamped with the package that produced it. The original document is always kept.
Enums§
- Confidence
- How strongly a package claims a document.
- Delta
Kind - What kind of change one
Deltarecords. - Fidelity
- The rung a delta is carried at: the format-independent fidelity ladder.
- Line
Kind - What happened to one line at the text rung.
Constants§
- NO_
NEWLINE_ MARKER - The marker line carried after a changed line that has no trailing newline, following git’s convention, so a terminal-newline edit stays visible in the comparison.
Traits§
- Format
Package - One format’s support, shipped as its own versioned unit: the ecosystem’s public ABI (ADR-0003).
Functions§
- as_text
- The bytes as text, when they are valid UTF-8 without NUL — the precondition for diffing at the text rung without a projection.
- detect_
package - The package that claims the document most confidently; equal claims break by package id, so selection is deterministic whatever order the registry was built in.
- diff_
lines - The text rung: the line-level comparison of two texts.
- diff_
listings - The binary rung: diff two file listings by content id alone.