clusterClient
Constructs a ClusterClient connected to the relay-room cluster.
Manages the full connect → use → reconnect lifecycle:
Connects to the initial endpoint via loom.
Backs a ManagedSeam with the resulting us.tractat.kuilt.core.Seam.
Constructs a single RaftNode over a playerRelayTransport on that seam — it lives for the ClusterClient lifetime, across reconnects.
On transport tear: advances ServerClusterReconnect to the next endpoint, re-joins via loom, and swaps the backing us.tractat.kuilt.core.Seam in the ManagedSeam — the RaftNode is not recreated.
Cross-server resume
A cross-server failover is always a fresh join (#532): each server keeps its seats and its reconnect windows in memory, per room instance, so the next server holds no seat for the client's device key. This extension therefore always performs a plain loom.join() on every reconnect: there is no attempt to restore a seat at the Seam level.
Dispatcher injection
The CoroutineScope receiver IS the dispatcher injection point. All background work (reconnect loop, relay coroutines inside ManagedSeam) runs on the caller's dispatcher. No real-clock defaults are introduced.
Parameters
The Loom fabric for connecting to server endpoints.
Endpoint list and rotation policy.
Stable NodeId for this client — must be in ClusterConfig.learners.
Full cluster membership (voters + this learner).
Raft timing and dedup configuration.
This client's device key store. Required: see us.tractat.kuilt.session.SeamRoomFactory for why, and what to pass. Every room the reconnect loop joins, on any endpoint, is this one device, so they all share it.
How this client obtains its Raft §8 dedup id. ClientIdentity.Auto (default) mints a per-incarnation id; pass ClientIdentity.Durable with a stable ClientId and its persisted floor for cross-crash exactly-once. The floor is what makes a restart survivable: this client keeps its log in memory, so replication brings the earlier incarnation's entries back on every boot. A floor covering them makes them this id's own. One behind them fails its node with us.tractat.kuilt.raft.ClientIdCollisionException, unless the voters have compacted past them: the client then boots clean, and its next serial is a reuse a consumer's table drops.
Injected clock for session resume-token timestamps. Required — no real-clock default (prevents silent virtual-time breakage per the "optional ≠ tuning" policy). Threaded into the room-layer SeamRoomFactory, which stamps reconnect-token issuedAt timestamps and drives partition detection. (Cross-server resume is always terminally refused per the in-memory per-room reconnect registry, so the token is issued but never consumed across a failover — the clock still governs same-server room timing.)
Throws
if clusterConfig has no voters and does not name clientNodeId among its learners — the bootstrap shape raftNode refuses. A config with the cluster's voters in it, as documented above, never reaches this.