Expand description
Reconcile two Stores. Any store can be a sync peer.
Sync reads through the replication surface (list_raw / get_raw), so it
sees tombstones. For a key held by both sides it uses each record’s bounded
ancestors list (spec §3.4) to tell “one side is behind” (overwrite it)
from “the sides diverged”. Diverged tombstones converge on the higher
revision. A tombstone against a live edit is a conflict. Two diverged live
records take the class-aware merge: append-only kinds union, and
structured/opaque divergences surface as conflicts.
sync_with_ancestry 3-way-merges structured bodies against their real
common ancestor when an AncestryStore retains it;
sync uses an empty base (ADR 0016).
Structs§
- Sync
Conflict - A divergence that could not be auto-merged and needs caller/CLI resolution: an unmergeable body divergence, or a delete (one side a tombstone) against a concurrent edit. Neither side is written.
- Sync
Report - What a sync run did.
Functions§
- sync
- Reconcile stores
aandb. After a run with noconflictsthat did not exhaust [MAX_SYNC_PASSES], both stores hold the same record (live or tombstone) for every key. - sync_
with_ ancestry - As
sync, but 3-way-merges divergentStructuredbodies against their real common ancestor when one is available.ancestryis a content-addressed store of past bodies keyed by revision hash (seeAncestryStore): when two records diverge from a shared parent revision whose body it holds, that body is the merge base; otherwise sync falls back to the empty base (ADR 0016).