pub(crate) fn compute_repairs(
snapshot: &[(StateUpdateKindJson, Timestamp, Diff)],
) -> (Vec<(StateUpdateKindJson, Diff)>, RepairStats)Expand description
Inspect a consolidated snapshot and return the updates needed to converge
every affected Role onto a single canonical-form +1 (or zero rows, for
the dropped case), and every untouched Role onto canonical form so future
writers’ retractions consolidate.
The returned Vec is safe to feed straight into compare_and_append.
Two passes:
- For each dangling
-1Role row matching the v80-form-drift signature, cancel it (+1of the same bytes) and retract every parsed-equal stale+1sibling. - For each remaining
+1Role row whose stored bytes don’t match the canonical re-serialization of its parsed value, retract it and insert the canonical form. Skipped for anyRoleKeywhose dangling-1we declined to repair in pass 1 — partial rewriting there would manufacture a fresh dangling diff against the canonical form.
Separated from upgrade so it can be unit-tested without spinning up a
real catalog handle.