FugueId

@Serializable
data class FugueId(val lamport: Long, val replicaId: ReplicaId, val seq: Long) : Comparable<FugueId>

A unique, totally-ordered identity for a single Fugue element.

Carries two orthogonal counters:

  • lamport — the total-order tiebreak used by the Fugue tree. Monotonic per author but not dense (the clock jumps to max(seen) + 1).

  • seq — a dense, contiguous per-author delivery counter (1, 2, 3, …). This is the key into the causal-stability version vectors used by Fugue.compact (same pattern as RgaId.seq for Rga). seq never participates in ordering.

Total order (compareTo): higher lamport wins; replicaId breaks ties deterministically. seq is deliberately excluded — it tracks delivery, not order.

The special sentinel HEAD is the virtual root of the Fugue tree; it sorts before every real id. Its seq is 0 (never an author dot).

Wire-format note: Adding seq is a breaking change relative to the pre-#714 format. This is intentional and cheap pre-1.0 per the design note (docs/op-log-crdt-compaction.md).

Constructors

Link copied to clipboard
constructor(lamport: Long, replicaId: ReplicaId, seq: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val dot: Dot

This id's causal Dot(replicaId, seq). The key into causal-stability VVs.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val seq: Long

Dense per-author delivery counter. Used by causal-stability GC; excluded from ordering.

Functions

Link copied to clipboard
open operator override fun compareTo(other: FugueId): Int