Expand description
KernelJournal — the durable transaction capability of the Canonical Kernel ABI (spec §9.1).
The Rust port of node/src/runtime/kernel-journal.ts, which is the authoritative interface
shape for all four SDKs. Three rules give this module its shape:
- Records are opaque. core owns canonical serialization and hashing
(
KernelRecord::record_bytes()/record_digest()/expected_head()). The host stores the bytes verbatim and indexes them by the digest core handed it. A journal that re-serialised a record to recompute its hash would make “the host recomputed and disagreed” a reachable state; it is not one here. - CAS is a storage-layer primitive, not a read-compare-write sequence. §9.1 requires a real
atomic operation (file lock / atomic link publish / conditional database update).
InMemoryKernelJournalis atomic only within one process and says so in its own type;FileKernelJournalis atomic across processes (see its type docs). - The journal’s sequence space is
step_seq— the operation’s record-chain position — and is completely independent ofsuper::session_log::SessionLog’s business eventseq. Pruning a journal prefix can never punch a hole in business event numbering (spec Task 8b, criterion 4). That is why this is a separate trait rather than more methods onSessionLog(§9.4): a custom business-projection log must never be forced to masquerade as a transactional journal. One type may implement both.
Failures are typed so a caller can tell “retry after rebuild” from “this storage is broken” from
“someone handed me a corrupt chain” — a durable-step wrapper must never publish effects on any
of them, and must never collapse them into one opaque error. See JournalError.
Structs§
- Checkpoint
Candidate - The host-persistable part of
kernel.checkpoint_candidate()(spec §12.3). - File
Kernel Journal - Cross-process atomic reference implementation of
KernelJournal(spec Task 8b). - InMemory
Kernel Journal - Single-process dev/test implementation (spec Task 8b, criterion 2).
- Installed
Checkpoint - An installed checkpoint. Flattens node’s
InstalledCheckpoint extends CheckpointCandidate. - Journal
Append Receipt - Journal
Entry - A stored record.
previous_record_digestis the CAS precondition it was appended under. - Journal
Head - The journal head: the last record of an operation’s chain.
- Journal
Prune Receipt - Journal
Record Input - What a host hands the journal: core’s opaque bytes plus the identity core assigned them.
Enums§
- Journal
Error - Why a journal operation failed, split into the three classes a caller must treat differently.
Traits§
- Kernel
Journal - The durable transaction capability (spec §9.1). Deliberately not part of
super::session_log::SessionLog(§9.4).