compact

fun compact(stableCut: VersionVector, frontierMax: VersionVector, delivered: VersionVector): Pair<Rga<V>, RgaOp.Compact>?

Garbage-collect tombstoned elements that are causally stable under the eviction-safe causal-stability barrier (ADR-003 addendum v3, #262).

A tombstoned element with dot (r, sᵢ) is purged iff all hold:

  1. Tombstoned — implied (only tombstones are candidates).

  2. Causally stablesᵢ ≤ stableCut[r]: every live peer has delivered it.

  3. Frontier-complete∀x: delivered[x] ≥ frontierMax[x]: this replica has delivered every op below every known frontier, so condition 4 below is complete (any concurrent Insert(_, after=id) that exists anywhere has been delivered locally and is therefore visible to condition 4).

  4. No surviving local successor — no surviving RgaOp.Insert has after == id, preserving the structural-predecessor invariant.

Conditions 2 and 3 are the author-independent barrier the prior scalar watermark silently assumed: a concurrent Insert(J, after=I) minted by a different author cannot coexist with a frontierMax this replica has fully delivered. See the ADR for the by-construction safety argument against the #272 (author-independence) and #275 (eviction) probes.

Parameters

stableCut

S — elementwise min over all live peers' delivered VVs.

frontierMax

F — elementwise max of the live frontier and the retained (evicted-peer) frontier; the set of dots known to exist.

delivered

this replica's own contiguous delivered VV.

Returns the compacted Rga and a RgaOp.Compact delta to broadcast to peers, or null if no element qualifies (or condition 3 is not yet met).

Peers that receive the RgaOp.Compact delta apply it via apply or absorb it through piece — both paths strip the referenced ops from the log.