publish

suspend fun publish(ops: List<Op>): AppendResult

Archive whatever of ops has not been archived already.

Returns what the underlying Bolt.append did — AppendResult.Skipped when every operation was a compaction record or a duplicate, so nothing was offered to the archive at all.

The reservation protocol, and why it is not simply "append, then remember"

Identities are claimed before the append and released again if it fails. Two concurrent publishes of the same operation therefore cannot both write it, which "append, then remember" would allow — the window between the two steps is a suspending call, and holding a thread-blocking lock across one is banned here.

A released identity is re-offered by the next anti-entropy round and archived then, so a failure is self-healing rather than permanent — for a refusal and for a backend that threw, which is converted to one. There is one visible consequence, stated rather than hidden: a second publish that arrived during a first one's failed append skipped the operation as claimed, so that round archived nothing either. The identities it lost are on the returned AppendResult.Failed and on health, and the operation is claimed again on the next round.