pub struct LogRow {Show 16 fields
pub ts: DateTime<Utc>,
pub ts_seq: u64,
pub event: LogEvent,
pub ref_: Option<String>,
pub source: Option<String>,
pub result: LogResult,
pub license: Option<String>,
pub size_bytes: Option<u64>,
pub store_path: Option<String>,
pub capability: Capability,
pub session_id: String,
pub error_code: Option<String>,
pub schema_version: String,
pub canonical_digest: Option<String>,
pub prev_hash: String,
pub this_hash: String,
}Expand description
One row of the provenance log (PROVENANCE_LOG.md §3).
The on-disk wire field names match the spec table; struct-field order is not load-bearing for the hash because canonicalization sorts keys lexicographically (see PROVENANCE_LOG.md §4).
Schema version: this struct is the v2 row shape (ADR-0024).
Every v2 row carries schema_version = "v2" literally; the
canonical_digest field carries the ADR-0021 §1 audit identity of
the fetch on rows where one applies (Fetch / Resolve /
StoreWrite) and is None on session bookend rows
(SessionStart / SessionEnd / CapabilityResolved) that have no
ref. v1 rows (pre-Slice-4) lack both fields and MUST be migrated via
migrate_v1_to_v2 before the v2 binary can read them — the
deny_unknown_fields + non-defaulted schema_version shape ensures
v1 rows fail to parse loudly rather than producing silent hash-chain
mismatches.
Fields§
§ts: DateTime<Utc>RFC3339 UTC timestamp of the append (millisecond precision).
ts_seq: u64Per-session monotonic sequence number, starting at 1.
event: LogEventEvent class (see LogEvent).
ref_: Option<String>Optional reference (DOI / arXiv id). Wire field name is ref.
source: Option<String>Optional source name (e.g. unpaywall).
result: LogResultResult (see LogResult).
license: Option<String>OA license string (event=fetch, result=ok); None otherwise.
size_bytes: Option<u64>Bytes written / fetched, on success rows.
store_path: Option<String>Path to the stored payload, relative to the store root
(event=fetch, result=ok); None otherwise.
capability: CapabilityCapability under which the row was written (REQUIRED, every row).
session_id: String26-char ULID identifying the process invocation (REQUIRED).
error_code: Option<String>Stable error code on failure rows.
schema_version: StringRow schema version. Always LOG_SCHEMA_VERSION ("v2") for
new rows written by this build (ADR-0024). v1 rows lack this
field; they MUST be migrated via migrate_v1_to_v2 first.
canonical_digest: Option<String>Canonical-digest of the fetch’s audit identity (ADR-0021 §1) as
64 lowercase hex chars. Present on rows with a ref (Fetch,
Resolve, StoreWrite); None on session bookend rows. The
digest is computed from a crate::CanonicalRef whose
resolver_profile matches this row’s source field for
migrated v1 rows; new v2 rows MAY pass an explicit
resolver_profile distinct from source.
prev_hash: String64 lowercase hex chars, OR the literal string "GENESIS" for the
first row of a fresh log file.
this_hash: String64 lowercase hex chars. SHA-256 of canonical JSON of THIS row with
the this_hash field removed. See module docs.