Expand description
The Vlo kernel: a pure, event-sourced state machine (see docs/workflows.md for the
reducer contract and docs/kernel-protocol.md for the wire protocol).
Zero I/O, zero clock, zero randomness of its own. Everything it needs arrives on the
event (ts_ms, random) or in the run’s persisted state, and everything it decides
leaves as a declarative write-set the host applies atomically. That is what lets the
same logic run on wasm in Node today and natively in a Durable Object later.
Errors are values: no input can make the kernel panic, which matters because the
wasm profile builds with panic = "abort".
Re-exports§
pub use api::version;pub use api::FEATURES;pub use error::code;pub use error::KResult;pub use hash::state_hash;pub use ids::derive_ids;pub use prepare::prepare_event;pub use reduce::reduce_step;pub use refold::refold_check;pub use retry::plan_retry;pub use validate::validate_event;
Modules§
- api
- String-in / string-out surface: exactly what crosses the wasm boundary.
- canonical
- Canonical JSON: parse, then re-serialize compact with object keys sorted.
- classify
- Event classification. The kernel routes on the header alone; it never parses a payload to decide what an event means.
- error
- Kernel error codes and constructors.
- guards
- Shared preconditions for
prepare_event: the checks that decide whether an event may touch a step at all, before anything is folded. - hash
- State hashing (see
docs/kernel-protocol.md). The hash covers the kernel’s own bookkeeping and the user state together, so a re-fold that diverges in either is caught. - ids
- Deterministic identifier derivation. Every id a run produces is a pure function of
(run_id, step_id, attempt), which is what makes task dispatch idempotent across crashes and re-pushes. - prepare
prepare_event: decide what an incoming event means before any reducer runs.- reduce
reduce_step: turn a reducer’s(state, commands)into the transition write-set.- refold
- Re-fold comparison (see
docs/kernel-protocol.md). The host re-folds the last N events over the previous checkpoint and hands both hash sequences here; the first divergent seq is what it records asnondeterminism_detected. - retry
- Retry planning. Pure: the only entropy is the
randomthe host already journaled, so a replay plans the same delay. - step_
machine - The step state machine (see
docs/kernel-protocol.md). - steps
- Operations on
KernelState::steps. - validate
- Envelope validation. Runs before every other export so no later stage has to re-check field shape.
Constants§
- DEFAULT_
LEASE_ TTL_ MS - Lease a task holds before the reaper may re-dispatch it.
- DEFAULT_
QUEUE - Queue a task lands on when the reducer names none.