Package-level declarations
Types
The result of MovableTree.addNode: the updated tree, the newly minted node id, and the Patch that encodes the insertion delta for delta-propagation to peers.
A probabilistic, mergeable Bloom filter: an approximate set whose merge is bitwise OR of the underlying bit array — trivially idempotent, commutative, and associative. A Bloom filter records whether elements might have been added and never produces false negatives (every added element always reports present), with a tunable false-positive rate.
Custom KSerializer for BloomFilter that chooses between two wire formats based on density, to keep delta messages O(k) instead of O(m):
A bounded / escrow counter: a shared budget pre-divided into per-replica quotas, with the invariant quota(r) >= 0 enforced locally and the derived global invariant "total spent <= total received" held by construction. No coordination is required for the local check — only for redistributing quota via transfer.
KSerializer for a Map that emits entries in key order, so that — subject to the precondition below — two replicas at the same logical state produce identical bytes regardless of merge history or host platform.
A full delta-state CRDT built from a DotStore and the DotContext that adjudicates its dots. piece is the causal join: merge the stores using both contexts, then union the contexts. This is the glue that turns any DotStore shape (DotSet now; DotFun/DotMap later) into a Quilted.
A Count-Min sketch: approximate per-item frequency over a stream, in fixed width × depth memory. Think of it as the frequency complement to a Bloom filter — where a Bloom filter answers "is X present?", a Count-Min sketch answers "how often?".
The causal history of a replica: every Dot it has ever witnessed, live or already removed. It is the memory that outlives a delete — that is what lets a merge tell "I saw that dot and dropped it on purpose" from "I just haven't seen it yet".
A DotStore mapping each Dot to a value V. Because a dot is minted once and never reused, a dot in both stores carries the same value, so the causal join needs no value-level conflict resolution — surviving dots simply keep their value. As Causal<DotFun<V>> this is a Multi-Value Register: concurrent writes each keep their (dot, value), surfacing the conflict rather than hiding it.
Custom KSerializer for DotFun<V> that emits DotFun.values entries sorted by Dot key (lexicographically by replica, then by seq), producing identical bytes for any two replicas at the same logical state regardless of delivery order.
Custom KSerializer for DotMap<K, S> that emits DotMap.entries in a canonical order, producing identical bytes for any two replicas at the same logical state regardless of delivery order (issue #713).
Custom KSerializer for DotSet that emits DotSet.dots sorted by Dot (lexicographically by replica, then by seq), producing identical bytes for any two replicas at the same logical state regardless of delivery order.
A container of Dots, optionally each carrying a payload. The shapes — DotSet (presence), and later DotFun (dot → value) and DotMap (key → store) — all share the one causal join defined here in spirit; pairing any of them with a DotContext inside a Causal yields a full delta-state CRDT.
An entry in an EphemeralMap: a nullable value tagged with a per-replica monotonic clock.
A presence/awareness CRDT.
A stateful wrapper around EphemeralMap that stamps local receive times and drives TTL eviction.
The side a node occupies relative to its FugueNode.parent in the Fugue tree.
A gauge: the current level of something — temperature, queue depth, players online, memory in use. Where a counter answers "how many so far?", a gauge answers "what is it right now?" — the reading that a Sum metric cannot express, because levels go up and down and only the latest reading matters.
A grow-only counter over Double — the exact-precision sibling of GCounter.
An explicit-bucket histogram: you choose the bucket boundaries up front — say [10, 50, 100] milliseconds — and each bucket counts how many recorded values fell in its range. It answers "how are my measurements distributed?" when you already know the ranges you care about (SLA thresholds, size classes), the classic fixed-bucket histogram shape.
A HyperLogLog cardinality estimator: a sketch that answers "how many distinct items have been added?" using a fixed, small amount of memory instead of keeping the full set.
Builds the per-replica clock an EphemeralMap slot is stamped with, packed so that a restarted replica always out-clocks its own dead incarnation.
A JSON scalar value held by a JsonNode.Leaf.
A replicated tree that supports concurrent move/reparent operations without ever producing a cycle.
Records that the ops identified by droppedDots have been garbage-collected from the move-log.
A multi-value register holding the value(s) last written. A single write yields one value; concurrent writes from different replicas are all retained until a later write observes and supersedes them — surfacing the conflict rather than silently picking a winner.
An observed-remove map: keys K each carry a Quilted value S that merges via its own Quilted.piece. A concurrent put of the same key survives a remove (add-wins on the key), and a key's value is every surviving write to it, pieced together.
Custom KSerializer for ORMapEntry<S> that emits ORMapEntry.contributions sorted by Dot key, so two replicas at the same logical state produce identical bytes regardless of the order their merges happened to run in.
An observed-remove (add-wins) set of E. Concurrent add and remove of the same element resolve in favour of the add: a remove only cancels the adds it has actually witnessed (the Dots currently on the element), so an add the remover never saw survives. This is the usable form of the dots + causal context machinery — e.g. a presence set of who is currently online.
A counter that supports reset-to-zero without coordination, using causal context to distinguish increments the resetter has observed (cleared by a reset) from those concurrent with it (which survive the merge).
Custom KSerializer for RgaOp<V> that correctly threads vSerializer through to RgaOp.Insert.value, bypassing the limitation in the compiler-generated sealed-class serializer where the V type parameter defaults to PolymorphicSerializer(Any::class).
A set with tombstoned remove: two grow-only sets, the added set and the removed (tombstone) set, both merged by union. An element is present iff it was added and is not tombstoned. Tombstones win permanently — once removed, an element can never be re-added; even a fresh add will be masked.
A per-author high-water version vector: replicaId → highest contiguous seq.
Functions
This state with the delta mutate produces from it absorbed — the delta-mutator law X.piece(mᵟ(X)) spelled once, so a caller need not name X twice.
Absorb a patch into this state via Quilted.piece.