pub struct Event {
pub session_id: String,
pub ts_ms: i64,
pub kind: EventKind,
pub step: Option<i64>,
pub summary: String,
pub body_json: Option<Value>,
pub blob_hash: Option<String>,
pub blob_size: Option<u64>,
pub correlates: Option<i64>,
}Expand description
An event to append to a session (SRS §4.1 events).
Fields§
§session_id: StringOwning session id (full UUID string).
ts_ms: i64Milliseconds since session start.
kind: EventKindEvent kind.
step: Option<i64>1-based step ordinal, or None for non-step events (FR-3.4).
summary: StringOne-line summary (≤ 120 chars per SRS §4.1).
body_json: Option<Value>Kind-specific structured payload.
§Cross-event correlation (correlate_key)
Adapters cannot know the DB row id an event will receive, so to express
“this tool_result belongs to that tool_call” they emit a string
correlate_key field inside body_json (the Claude adapter uses the
tool_use.id for a tool_call and the tool_use_id for a
tool_result). The recorder’s drain thread resolves that key to the
referenced event’s row id and stores it in Event::correlates. The
FR-3.4 step pass then makes a correlated tool_result share its
tool_call’s step. See the adapter module and FR-1.5.
blob_hash: Option<String>Blob hash for large payloads stored out-of-line.
blob_size: Option<u64>Uncompressed size of the blob, if blob_hash is set. The writer uses
this to seed the blobs.size column on first reference.
correlates: Option<i64>Correlated event id (e.g. tool_result → tool_call).