The artifact layer. Holds the live session state, emits events into the
append-only journal (the source of truth), and materializes projection files at
boundaries. State changes go through emit! -> event/apply-event; the table
files (session/messages/turns/evals/calls/snapshots) and derived views
(final/usage/tree) are rebuilt by checkpoint!, not on every event.
The artifact layer. Holds the live session state, emits events into the append-only journal (the source of truth), and materializes projection files at boundaries. State changes go through `emit!` -> `event/apply-event`; the table files (session/messages/turns/evals/calls/snapshots) and derived views (final/usage/tree) are rebuilt by `checkpoint!`, not on every event.
(add-event! state event)Emit an annotation/lifecycle event (no row change of its own). Returns the event id for compatibility with existing call sites.
Emit an annotation/lifecycle event (no row change of its own). Returns the event id for compatibility with existing call sites.
(add-message! state role content)(add-message! state role content turn-id)(add-message! state role content turn-id extra)(checkpoint! state)Materialize the projection files from the current view. Called at boundaries (turn end, status change, session stop), not per event. The journal already holds every event; these files are derived views for inspection, resume, and fingerprints.
Materialize the projection files from the current view. Called at boundaries (turn end, status change, session stop), not per event. The journal already holds every event; these files are derived views for inspection, resume, and fingerprints.
(emit! state event)Record one event: assign its id and timestamp, append it to the journal (the
durable source of truth, O(1)), then fold it into the in-memory view. Serialized
per session so the journal order and the view stay consistent under the parallel
fanout of map-lm/map-rlm. The reentrant monitor lets update-turn!/update-call!
read-then-emit atomically. Does NOT write projection files — that is checkpoint!,
called at boundaries.
Record one event: assign its id and timestamp, append it to the journal (the durable source of truth, O(1)), then fold it into the in-memory view. Serialized per session so the journal order and the view stay consistent under the parallel fanout of map-lm/map-rlm. The reentrant monitor lets `update-turn!`/`update-call!` read-then-emit atomically. Does NOT write projection files — that is `checkpoint!`, called at boundaries.
(new-state! {:keys [dir id kind provider parent resumed-from forked-from
cache-id]})(value-ref! dir value)(value-ref! dir
value
{:keys [path threshold] :or {threshold inline-byte-threshold}})cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |