DotContext

@Serializable
class DotContext : Quilted<DotContext>

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".

Stored compactly: the contiguous prefix per replica is a version vector (vv: replica → highest contiguous seq), and any non-contiguous dots wait in a cloud until the gaps before them fill, at which point they compact into the vector. The cloud is required because kuilt fabrics reorder and duplicate frames, so dots can arrive out of order.

It is itself a Quilted: piece is the join (union of both histories). Equality is canonical — compaction pushes the cloud as far into the vector as possible and drops already-covered dots — so two contexts with the same causal history are structurally equal, which the conformance laws rely on.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun add(dot: Dot): DotContext

This history with dot witnessed (idempotent; compacts the cloud).

Link copied to clipboard
open fun causalDots(): Set<Dot>

The causal Dots this state has delivered — (author, author-seq) per op.

Link copied to clipboard
fun contains(dot: Dot): Boolean

True if dot has been witnessed — covered by the vector or held in the cloud.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun nextDot(replica: ReplicaId): Dot

Returns the next Dot for replica to mint for a new local operation.

Link copied to clipboard
open override fun piece(other: DotContext): DotContext

The join: the union of two causal histories.

Link copied to clipboard
open override fun toString(): String