kortecxdocs

Core concepts

Mote, journal, projection, commit protocol, refusal gate, and the CapabilityBroker — the model underneath the runtime.

Six ideas explain how Kortecx achieves exactly-once delivery with transparent recovery.

Mote

A mote is one content-addressed step — the atomic unit of work. It is immutable and identified by the hash of its content, so the same inputs always produce the same mote. Re-deriving a mote that already exists is a no-op: you re-read it, you don't re-run it.

Journal

The journal is an append-only log and the single source of truth. Every state transition is recorded as a typed event. Nothing in the system is authoritative except what the journal says happened. Because it is append-only, recovery is just replay.

Projection

A projection is a pure fold over the journal — current state, re-derived from the event history on every restart. Projections are never the source of truth; they are a cache you can always rebuild. This is why a crash is recoverable: throw away in-memory state, replay the journal, and the projection comes back identical.

Commit protocol

Writes go through one of three commit strategies, chosen per operation:

  • IdempotentByConstruction — the write is naturally safe to repeat (content-addressed motes).
  • StageThenCommit — stage the effect, then atomically commit a journal record that makes it durable.
  • ValidateThenCommit — validate the staged result against expectations before committing.

Together these give exactly-once delivery: a partially-applied effect is either completed on replay or never observed.

Refusal gate

The refusal gate rejects unsafe work up front, before any effect runs. Out-of-scope or disallowed operations never start — they are refused, not rolled back. Safety is an invariant, not a cleanup step.

CapabilityBroker

The CapabilityBroker is the single door to world effects — filesystem, network, shell. Nothing touches the outside world except through the broker, which is where policy is enforced. One door means one place to reason about what the runtime can and cannot do.

Putting it together

A workflow is a DAG of motes. Each mote commits through the protocol and is recorded in the journal; effects pass the refusal gate and the CapabilityBroker. Restart at any point and the projection replays to exactly where it left off.