Execution model
This notation describes the execution model. It is not a proof of implementation correctness. Replay assumes deterministic reducers, compatible definitions, and available event history or a compatible snapshot.
1. The Canonical Run Log#
A Run is a tuple consisting of a globally unique run identity and an ordered, append-only sequence of immutable events :
Every agent, DAG workflow, child thread, external signal, and observable effect outcome participates in this single, canonical event stream.
2. Thread Universe & Parent Relation#
The units of computation participating in Run form a thread universe with a partial parent relation:
The root thread has . Every child thread references its parent, inducing a strict tree hierarchy over threads within the run.
3. State Transition Function#
Each thread kind (e.g. agent, workflow, or a custom module kind) defines a pure, deterministic state transition function:
Given current state and incoming event , the reducer deterministically computes next state and an ordered sequence of requested effects .
4. Projections as Folds#
Compute state and read models by folding over the event log:
With persisted snapshot checkpoints at event sequence , state reconstruction is accelerated:
5. Causal Ordering vs. Structural Hierarchy#
Log order records when events were appended. Causation IDs record which event caused each one:
Events from concurrent threads can interleave in the log while retaining their causal links.
6. Replay & Durability Invariant#
Let denote the projection filtering events relevant to thread . The state at logical step is reproducible under those assumptions:
During historical replay, the effect stream is ignored by the runtime kernel. Recovery also resumes unfinished work, which may retry external calls. Safe retries require idempotency or reconciliation at the external boundary.