kuilt-cluster
kuilt-cluster is the server-cluster facade for kuilt-raft. It packages the two-tier overlay topology — a complete-graph voter core (K_m) plus a sparse learner periphery — as two high-level types: ServerCluster (server side) and ClusterClient (client side).
What it provides
ClusterClient (commonMain)
Wraps a Raft learner RaftNode and exposes:
propose(command)— proposes with an auto-minted monotonicrequestId. Forwards to the current leader; suspends until committed. Returns the committedLogEntry.propose(command, requestId)— cross-crash exactly-once overload. Persist therequestIdbefore calling; replay it after a crash or failover. The server'sClientSessionTable.shouldApplydeduplicates retries.committed: Flow<Committed>— the committed log stream. Single-collection contract (mirror ofRaftNode.committed): collect once perClusterClient; fan out withshareInif multiple consumers are needed.role: StateFlow<RaftRole>— alwaysRaftRole.Learnerin the relay model.close()— cancels the underlyingRaftNode.
Obtain an instance via clusterClientWithNode(raftNode) (tests / caller-managed transport) or via CoroutineScope.clusterClient() (production relay-room path).