Completengine


A Concurrent Event Engine, Catalogued.

An almanac in five plates — from emission to replay.

Plate I — Frontispiece

On Emission

An event arrives at the harbour like a coral spore set adrift on the night current. It is small, exact, and dated. The engine receives it without ceremony.

Each emission is committed to the ledger before any consumer is told of it. The order is preserved, the timestamp is monotonic, and the payload is inviolate. We do not buffer in vanity, nor batch in haste — we simply record, and let the rest of the codex find its way.

“Begin, always, with the event — never with the consumer.”

The throughput, when one must speak of it, is roughly one million events per second on a single shard, and never the limit a designer should optimise for first.

Plate II — On Emission

On Partitioning

The shoal is split, gently, by a key — the most discreet of architects.

A partition is not a wall; it is a shoal, an aggregation of events that swim together because they share a name. The router, posted at the gills of the engine, reads the key and ushers each event into its proper current.

  1. ◦ I ◦ Hash partitioning — even-handed, blind to volume, the courteous default.
  2. ◦ II ◦ Range partitioning — for ledgers that prefer their entries in temperate order.
  3. ◦ III ◦ Composite key — a tenant and a topic, set as a brace.
  4. ◦ IV ◦ Sticky session — for the conversational events that will not be parted.
  5. ◦ V ◦ Manual placement — for the connoisseur who knows precisely where her shoal should swim.
“Partition by intent, never by accident of throughput.”

Plate III — On Partitioning

On Resolution

Specimen Plate — The Anatomy of the Engine

The engine, when sectioned for the curious, is most clearly understood as a single fish. The scheduler is its eye, gauging when each consumer is fit to feed. The partition router is its gills, parting the inflow into shoals. The event bus, lodged centrally, is its swim bladder — lifting and steadying the system without effort. The replay log traces the lateral line, sensitive to every disturbance ever recorded. And the output stream is the tail, which propels the whole into history.

Plate IV — On Resolution, with Specimen

On Replay

A history, properly kept, may always be re-told. Replay is not a recovery feature — it is a way of life.

To replay an event is to step the engine back to a prior afternoon and let history unfurl again, identically, deterministically, all the way to the present. The lateral line of the fish remembers; the tail does not lie.

// A small treatise on replay, in code:
const engine = await Completengine.open({
  ledger:     "./events.codex",
  partition:  hashOf("tenant"),
  determinism: "strict",
});

// Step the engine back to a moment, then re-tell.
await engine.replay({
  from:    "2026-04-12T09:00:00Z",
  through: "2026-04-12T17:30:00Z",
  speed:   "natural",
});
“Determinism is the kindest form of trust.”

And so the codex closes — not with a flourish, but with a quiet promise: every event you commit is preserved, parted, resolved, and ready to be told again.

Plate V — On Replay

Colophon

Set in Mulish & Cormorant Garamond Italic. Code in JetBrains Mono.

Plates drawn by hand. Borders drawn by the engine.

Completengine v1.0  ·  build 976db42f96f1  ·  MMXXVI

completengine.net