propose

suspend fun propose(command: ByteArray): LogEntry

Proposes command with an auto-minted, monotonic requestId.

Suspends until a quorum commits the entry. On transport tear the Raft engine throws us.tractat.kuilt.raft.LeadershipLostException; callers can retry with the same requestId via the propose(command, requestId) overload.

Returns the committed LogEntry — guaranteed to appear in committed.

Throws

if this client was built with ClientIdentity.Durable, whose floor could not cover a serial the node drew for itself. Use the overload with a requestId.


suspend fun propose(command: ByteArray, requestId: Long): LogEntry

Proposes command with a caller-pinned requestId for cross-crash exactly-once dedup.

The caller must persist requestId before invoking this method: under ClientIdentity.Durable, as that identity's new issuedThrough. A retry with the same requestId and the same command bytes coalesces to the original committed entry via us.tractat.kuilt.raft.ClientSessionTable.shouldApply. A requestId names one command: never reuse it for a different one. Retry before issuing a higher one, which abandons this one: ClientIdentity.Durable says why.

Throws

if the leader still holds a committed result for requestId and command differs from it. Nothing was appended; do not retry under the same requestId.