Systems Specification
Append-Only Event Ledger
A durable, replayable record of everything a distributed agent system did, and the sufficient state to reconstruct why.
An event ledger is an append-only, immutable log of every externally observable action a system takes: each tool result, environment observation, and state mutation, recorded with the parameters needed to reproduce it. This specification defines the record format, the ordering and durability guarantees, the replay procedure, and the operational limits. The design goal is a sufficient statistic: given the ledger up to step n−1, step n can be re-executed deterministically at zero upstream cost. Nothing here depends on a model; every guarantee is enforced by a program.
Principles
Five constraints shape every decision below. They are stated first so the rest of the document can be read as their consequences rather than as a list of features.
P1 · Append-only
A record, once written, is never mutated or deleted. History is a fact, not a mutable view. Corrections are new records that reference the old, so the trail of what was believed at each step survives.
P2 · Self-describing
Each record carries its own schema tag, actor, and causal parent. A reader reconstructs the graph from the records alone, with no side table and no external index required to make sense of them.
P3 · Content-addressed
Large payloads are stored once and referenced by hash. The ledger holds the causal skeleton; the bodies live beside it, so a record stays small and a replay verifies integrity for free.
P4 · Deterministic replay
Every model call records its seed and sampling parameters. A failure that cannot be replayed cannot be engineered away, so replayability is a property of the record, not of the harness that produced it.
P5 · Verify by log, not by claim
An actor's narration is evidence of intent, never of outcome. A claim is grounded against the recorded execution or it is clipped. Judgment lives in a deterministic verifier, never in a model.
Architecture
The write path
Actors never touch the ledger file directly. Each mutation passes through a write-ahead entry, so a crash between the intent and the effect is recoverable rather than a silent gap.
actor ledger reader ┌─────────┐ append ┌──────────────────┐ ┌──────────┐ │ tool │────────>│ write-ahead │ │ replayer │ │ call │ │ then commit │ <────────│ verifier │ └─────────┘ └───────┬──────────┘ read └──────────┘ │ seal at close v refs/ledger/<run> (immutable, git-object)
The same lifecycle reads more like a datapath as a flow rail. Both figures are
first-class in this style: reach for the ASCII diagram when the shape is spatial
(branches, boundaries, a grid of cells), and for .flow when the
shape is a single path a record travels down.
.flow grid: node cards, labeled edges, and bands grouping the mutable stages against the sealed one.Trust boundaries
Spans are classed at registration, never inferred from output text. A read-only span replays freely; a mutating span is fenced behind the write-ahead log and, in replay, behind a sandbox.
┌─────────────── READ-ONLY (replayable) ───────────────┐ │ query_store read_file web_search │ └──────────────────────────────────────────────────────┘ ┌─────────────── MUTATING (WAL-fenced) ────────────────┐ │ write_store exec_shell send_message │ └──────────────────────────────────────────────────────┘
Data model
One record is one line: a JSON object terminated by a newline. Its identity is its byte offset in the ledger file, so no field carries an id the reader could disagree with.
// one ledger record. field names are short: readers pay per byte. { "ts": "2026-09-14T22:04:02.104Z", // wall clock, display only "mono": 3937119184239575, // monotonic ns, ordering "actor": "reviewer-security", "kind": "tool_result", "parent": 40318, // byte offset of the causal parent "class": "READ_ONLY", "call": { "model":"sonnet", "seed":88213, "temp":0.0 }, "body": "sha256:e3b0c442…b7852b855" // content-addressed, stored beside }
Record kinds
The set is closed. A new kind is a decision, not a convenience, because every verifier switches on it.
| kind | emitted by | read by | replayable |
|---|---|---|---|
| say | any actor | humans | n/a |
| find | reviewers | the tally | n/a |
| evid | checks | the verifier | yes |
| tool_result | the harness | the replayer | yes |
| mutation | the harness | the sandbox | fenced |
| ask | any actor | a human | n/a |
Protocol
Ordering
Two questions have two answers. In what order did records land? is the byte offset, exact and free. When did each happen? is the monotonic stamp, which is send-time and may disagree with landing order by a sub-millisecond margin under contention.
Replay throughput is bounded by the slower of parse and integrity check. With batched hashing the check dominates only for large bodies:
State trace
A task's stage is not stored; it is folded from the records. The trace below reconstructs one task's path from its ledger slice.
offset kind actor stage after ────── ──── ───── ─────────── 00000 say developer building 40318 tool_result harness building 40961 find reviewer-security revise <- blocker 41502 say developer building 42088 find reviewer-security merged <- cleared
Operation
Replay walkthrough
Drag the control to step a failed run to the record before the fault. Up to the cursor, cached results are served from the ledger; the cursor step runs live. Everything before it costs nothing.
Record at cursor
Timeline of a fault
Operator checklist
- Ledger sealed to
refs/ledger/<run>at task close. - Seed and sampling params present on every model span.
- Mutating spans fenced behind the write-ahead log.
- Tail-based sampling retains 100% of error traces.
- Secret and PII scrubbing verified on the collector.
Recovery from a torn write
Circuit breaker on a runaway loop
Experiments
Each row is a claim about the design tested against the reference implementation. Status is measured, not asserted.
| claim | method | result | status |
|---|---|---|---|
| Concurrent append never tears a record | 8 writers × 200 records | 1600 / 1600 intact | Implemented |
| Replay reproduces a failure at zero cost | cached prefix, live tail step | exact, $0 upstream | Implemented |
| Grounding cuts fabricated claims | clip against execution log | 90% → 4%1 | Partial |
| Cross-VLAN causal back-trace | walk data-dependency edges | origin found in 1 pass | Implemented |
| Distillation reuses learned strategy | contrastive pivot extraction2 | not yet built | Critical gap |
Implementation
The reference implementation is three small programs: the record primitive (append, read, seal), the folder that reconstructs state, and the verifier that grounds claims. Each is under a few hundred lines and depends only on the kernel, git, and the standard library. See the reference tree and the conformance suite.
References
- Execution-log grounding for autonomous research agents. Prior art, unverified citation. Confirm before quoting the figure.
- Contrastive trajectory distillation into reusable strategy memory. Prior art, unverified citation.
- Knight, J. C. and Leveson, N. G. An experimental evaluation of the assumption of independence in multiversion programming. IEEE TSE, 1986.
- Lamport, L. Time, clocks, and the ordering of events in a distributed system. CACM, 1978.