pub enum AppendOutcome {
Appended {
seq: u64,
},
IdempotentReplay {
prior: PriorEvent,
},
Conflict {
prior: PriorEvent,
},
}Expand description
The three observable outcomes of an append_and_apply_idempotent call —
the shared --idempotency-key contract that event create, discussion resolve, and future keyed verbs (spinoff approve|reject, run create,
node report) all answer to, lifted out of each CLI’s private log scan.
The discriminator is whether a prior event with the same kind + key
already exists, and — if so — whether the call’s (node_id, data) identity
matches that prior event:
AppendOutcome::Appended— no prior event carried this key: a fresh event was appended and folded into the projections.seqis its sequence.AppendOutcome::IdempotentReplay— a prior event carried this key and the samenode_id+data: a true retry. Nothing was appended; thepriorevent (itsseq/node_id/data) is returned so the caller can surface the original sequence.AppendOutcome::Conflict— a prior event carried this key but with a differentnode_idordata: the key was reused for a different request (a client bug, Stripe-style). Nothing was appended;prioris returned so the caller can build a precise conflict error (e.g. diff the payload vs. the node id).
Variants§
Appended
A fresh event was appended and applied; seq is its sequence number.
IdempotentReplay
The key matched a prior event with identical node_id + data. No new
event was written; prior.seq is the original sequence to surface.
Fields
prior: PriorEventThe pre-existing matching event (its seq, node_id, and data).
Conflict
The key matched a prior event whose node_id or data differs from this
request. No new event was written; the caller should reject the reuse.
Fields
prior: PriorEventThe pre-existing event recorded under the same key, for the caller’s
conflict diagnostics (prior.seq is the original sequence).