Pre-alpha documentation
Durability is evidence, not process memory.
The StateKnot durability model separates logical work, physical ownership, external effects, and authoritative graph state.
Why the boundaries exist
Agent work crosses databases, model providers, tools, humans, and remote agents. A process crash cannot prove whether an external request ran, and an in-memory future cannot authorize a replacement worker. StateKnot therefore records the evidence needed to make the next decision without pretending that every side effect is exactly once.
The evidence chain
-
Journal
Append-only canonical facts establish what became authoritative and in which run-local order.
-
Checkpoint
An immutable graph and state snapshot is anchored to an exact journal head and parent checkpoint.
-
Lease and fence
A database-clock lease grants temporary ownership; every worker write repeats its monotonically increasing fencing epoch.
-
Invocation ledger
Model and tool intent, physical attempts, terminal evidence, and unknown external effects survive process loss.
-
Pending result
One logical node result commits before the barrier and remains reusable if a sibling or worker crashes.
-
Barrier
A complete canonical result set becomes one successor checkpoint and consumes its pending inputs atomically.
Logical identity is not worker identity
A node activation belongs to an exact tenant, run, graph namespace,
superstep, and node. A physical AttemptId and its worker
FencingEpoch describe who tried to execute that logical work. Recovery
may replace the physical attempt without changing result order or silently creating
another logical invocation.
External work never runs inside a database transaction
StateKnot commits intent or an attempt start, closes the transaction, and only then dispatches model, tool, A2A, or human work. The returned evidence is committed in a later transaction. This prevents long-held database locks while keeping crash boundaries explicit.
Exactly-once database mutation does not imply exactly-once real-world side effects. Tools use idempotency keys where supported and preserve an explicit unknown outcome when completion cannot be proven.
What recovery can decide today
Recovery now reloads the exact compiled graph from a tenant-scoped immutable registry, recompiles its canonical bytes, validates the checkpoint binding, and then verifies pending results and complete attempt histories under one live fence. It classifies each ready node as completed, dispatchable, deferred, in flight, failed, or exhausted, then requires a durable attempt start before node code can launch. When every unsettled node is deferred, the store atomically releases the lease into an indexed database-time wakeup; direct claims cannot run it early.
The durable Driver now freezes executable schemas, reducers, and nodes; independently replays every committed noninitial checkpoint; renews the lease while node code runs; commits Continue barriers; and returns typed Wait/Terminal/failure handoffs. Read the runtime integration contract and Agent Loop contract before wiring a worker deployment.