Skip to main content

Module kernel

Module kernel 

Source
Expand description

Run lifecycle and kernel boot integration for the event store.

This module owns the kernel side of the SPEC’s run lifecycle: it scans the on-disk instance directory for crashed predecessors before a fresh run opens, seals each survivor, opens the new run, blocks start() until the writer acknowledges the RunStarted entry, and seals the manifest with a final RunEnded entry on graceful stop. The writer’s halt callback is wrapped in a typed HaltSignal that the kernel caller polls to convert a fail-stop into kernel shutdown rather than a panic.

Structs§

EventStoreLifecycle
Kernel-facing wrapper that bundles every event-store concern: predecessor recovery, the open run, the halt signal, and the seal-on-drop fail-safe.
EventStoreLifecycleOptions
Non-serialized lifecycle policy for advanced event-store callers.
EventStoreSession
Live event-store session owned by the kernel between start() and finalize_stop().
HaltSignal
A thread-safe halt signal the kernel registers with the writer.
RecoveredRun
The outcome of sealing a single crashed predecessor.
RecoveryOutcome
Result of the predecessor recovery sweep performed in the kernel constructor.

Enums§

BootError
Errors surfaced by the boot path.
KernelError
Typed error surfaced when the event store fails the run lifecycle.

Functions§

build_run_id
Builds the <start_ts_init>-<short_uuid> run id used as the manifest key and on-disk file name.
open_run
Opens a fresh run, spawns the writer, and submits a blocking RunStarted entry.
open_run_with_options
Opens a fresh run with process-local lifecycle options.
recover_predecessors
Sweeps <base_dir>/<instance_id>/ for crashed predecessor runs and seals each one.