lcert_verify.diff

Compare two bundles: what changed, and did it help.

The question anyone iterating on a design actually asks is not "does this verify" but "is it better than last time". That needs a comparison that says which loci changed class and which way the margins moved.

One rule throughout: a diff is not a verdict. It reports movement between two artifacts and nothing more. If either side does not verify, that is stated and the comparison is still shown — but regressed is computed only from what both sides actually establish, never from a bundle that failed to check.

def diff_bundles(dir_a, dir_b, *, anchor_a: str = '', anchor_b: str = '') -> Dict:

Compare two bundle directories.

Anchors are optional here and their absence is reported rather than ignored: a diff between two unanchored bundles compares two documents of unknown provenance, which is worth knowing before acting on it.

def format_diff(d: Dict) -> str: