pub struct JournalEvent {
pub schema_version: u32,
pub seq: u64,
pub ts: u64,
pub idempotency_key: String,
pub kind: EventKind,
}Expand description
One line of journal.jsonl: a schema-versioned, sequenced, timestamped
envelope around an EventKind.
The kind payload is #[serde(flatten)]ed so the on-disk line is a single
flat JSON object ({"schema_version":1,"seq":3,"ts":…,"idempotency_key":…, "kind":"target_published","target":"cargo","receipt":{…}}), keeping it
jq/tail-friendly (AGENTS-AI-FIRST-CLI §2).
Fields§
§schema_version: u32The durable schema version of this event (see JOURNAL_SCHEMA_VERSION).
seq: u64Monotonic sequence number within the run, starting at 1. The reducer’s
high-water mark: an event at or below the applied seq is a no-op on
replay (append-then-apply crash recovery, ADR-0003 §2).
ts: u64Event time as whole seconds since the Unix epoch, from the injected
Clock (never wall-clock directly, so runs are deterministic under test).
idempotency_key: StringStable semantic key identifying what subject this event records (e.g.
published:cargo, phase_completed:build). It is metadata, not the
append gate: it deliberately ignores the payload (a phase’s outcome, a
receipt’s version), so it is safe for diagnostics and for a coordinator’s
own “have I already acted on this subject?” lookups, but it must not
be used to suppress an append — a phase that completed Failed and then,
after a resume, completes Ok shares this key yet is a distinct fact that
must be recorded. Replay idempotency is provided by Self::seq (the
high-water mark), not by this key.
kind: EventKindThe event payload, flattened into this envelope.
Trait Implementations§
Source§impl Clone for JournalEvent
impl Clone for JournalEvent
Source§fn clone(&self) -> JournalEvent
fn clone(&self) -> JournalEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JournalEvent
impl Debug for JournalEvent
Source§impl<'de> Deserialize<'de> for JournalEvent
impl<'de> Deserialize<'de> for JournalEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for JournalEvent
Source§impl PartialEq for JournalEvent
impl PartialEq for JournalEvent
Source§impl Serialize for JournalEvent
impl Serialize for JournalEvent
impl StructuralPartialEq for JournalEvent
Auto Trait Implementations§
impl Freeze for JournalEvent
impl RefUnwindSafe for JournalEvent
impl Send for JournalEvent
impl Sync for JournalEvent
impl Unpin for JournalEvent
impl UnsafeUnpin for JournalEvent
impl UnwindSafe for JournalEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.