Pure read-side substrate shared by every rendering of a run (agent CLI today,
human TUI later). It folds a session's event journal — events.ednl, the source
of truth, correct even mid-turn — into an addressable, recursively-navigable
node tree. It deliberately reads the journal, never the boundary-materialized
.edn projections (those are stale between turn boundaries).
Addresses are the whole point of the recursive read: every node has a path like
root, root/child-0001, root/child-0001/child-0004. A renderer shows a node
plus the addresses of its children, and the caller drills by re-issuing with the
child's address. Same scheme on the CLI and (later) in the TUI.
Pure read-side substrate shared by every rendering of a run (agent CLI today, human TUI later). It folds a session's event journal — `events.ednl`, the source of truth, correct even mid-turn — into an *addressable, recursively-navigable* node tree. It deliberately reads the journal, never the boundary-materialized `.edn` projections (those are stale between turn boundaries). Addresses are the whole point of the recursive read: every node has a path like `root`, `root/child-0001`, `root/child-0001/child-0004`. A renderer shows a node plus the addresses of its children, and the caller drills by re-issuing with the child's address. Same scheme on the CLI and (later) in the TUI.
(child-calls {:keys [calls]})Calls that spawned a child session, in spawn order.
Calls that spawned a child session, in spawn order.
(child-dir parent-dir call)Absolute on-disk dir for a child call, resolved against its parent dir.
Absolute on-disk dir for a child call, resolved against its parent dir.
(journal-events dir)Raw event stream for a session dir, in append order. Tolerates concurrent appends (a half-written trailing line is dropped), so it's safe to poll a live run.
Raw event stream for a session dir, in append order. Tolerates concurrent appends (a half-written trailing line is dropped), so it's safe to poll a live run.
(leaves dir {:keys [calls]})Leaf calls with their input and result resolved from refs. Ordered by batch index then call id.
Leaf calls with their input and result resolved from refs. Ordered by batch index then call id.
(load-at root-dir address)Load the full node at address within the run rooted at root-dir. nil if the
address doesn't resolve.
Load the full node at `address` within the run rooted at `root-dir`. nil if the address doesn't resolve.
(load-node dir)(load-node dir address)Build ONE node at address from session dir. Heavy fields (steps, leaves,
resolved final) are realized; children are returned as lightweight refs
(address + label + dir) so a node load is one journal fold, not a whole subtree.
Drill into a child by calling load-node (or tree) on its dir/address.
Build ONE node at `address` from session `dir`. Heavy fields (steps, leaves, resolved final) are realized; children are returned as lightweight *refs* (address + label + dir) so a node load is one journal fold, not a whole subtree. Drill into a child by calling `load-node` (or `tree`) on its dir/address.
(node-dir root-dir address)Resolve a node address ("root", "root/child-0001", "root/child-0001/child-0004") to its on-disk dir, starting from the root run dir. Returns nil if any segment doesn't resolve. The first segment ("root") names the run dir itself.
Resolve a node address ("root", "root/child-0001", "root/child-0001/child-0004")
to its on-disk dir, starting from the root run dir. Returns nil if any segment
doesn't resolve. The first segment ("root") names the run dir itself.(resolve-ref dir ref)Resolve a value-ref ({:value/kind :inline|:blob ...}) against its session dir. Returns ::missing for an unreadable blob, nil for a nil ref.
Resolve a value-ref ({:value/kind :inline|:blob ...}) against its session dir.
Returns ::missing for an unreadable blob, nil for a nil ref.(steps {:keys [messages]})Pair each assistant message with the observation the host returned for it. One step = one ▷wrote / ◁observed exchange. Numbered from 1.
Pair each assistant message with the observation the host returned for it. One step = one ▷wrote / ◁observed exchange. Numbered from 1.
(strip-fence s)Drop the ```clojure fences so the bare code shows; the kernel evaluated exactly this text.
Drop the ```clojure fences so the bare code shows; the kernel evaluated exactly this text.
(tree dir)(tree dir address label)Recursively fold the whole run into a summary tree: each node carries its
address, label, status, model and counts, plus expanded child nodes. Cheaper per
node than load-node (no step/leaf/final text), so it scales to the whole tree.
Recursively fold the whole run into a summary tree: each node carries its address, label, status, model and counts, plus expanded child nodes. Cheaper per node than `load-node` (no step/leaf/final text), so it scales to the whole tree.
(view dir)Fold a session dir's journal into the materialized view. Pure; zero provider calls (events carry results, not recipes).
Fold a session dir's journal into the materialized view. Pure; zero provider calls (events carry results, not recipes).
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 |