L5 · THE SDK surface (06). Thin — delegates to the internals and exposes nothing else. Phase 1 ships the clojure harness; the Phase-3/4 rlm harness EXTENDS this same surface (recursion is internal), so these signatures do not change.
L5 · THE SDK surface (06). Thin — delegates to the internals and exposes nothing else. Phase 1 ships the clojure harness; the Phase-3/4 rlm harness EXTENDS this same surface (recursion is internal), so these signatures do not change.
(append-fact! handle fact)Append one store-scoped opaque fact {:fact/tag kw :fact/value edn}. The engine orders/persists/serves it and NEVER interprets it. Returns the stamped fact (:fact/id monotonic, :fact/at).
Append one store-scoped opaque fact {:fact/tag kw :fact/value edn}. The
engine orders/persists/serves it and NEVER interprets it. Returns the
stamped fact (:fact/id monotonic, :fact/at).(close-session! handle)Release a handle's store resources (stop live dispatch; close the sqlite connection). A sqlite session can afterwards be reopened with resume-session!.
Release a handle's store resources (stop live dispatch; close the sqlite connection). A sqlite session can afterwards be reopened with resume-session!.
(close-store! store)Close a store opened with open-sqlite-store (releases the JDBC connection).
Close a store opened with open-sqlite-store (releases the JDBC connection).
(delegation-report handle turn-id)What did this turn delegate, and what did the subtree cost? Edges + per-child status/turns/usage/cost (:unknown-aware), plus the turn's self-only numbers.
What did this turn delegate, and what did the subtree cost? Edges + per-child status/turns/usage/cost (:unknown-aware), plus the turn's self-only numbers.
(event-stream handle)The session's FULL ordered event log, served from the durable store — NOT the in-process view's :events, which is a bounded working window after a snapshot reopen (qbu). The log is the truth; this reads the log.
The session's FULL ordered event log, served from the durable store — NOT the in-process view's :events, which is a bounded working window after a snapshot reopen (qbu). The log is the truth; this reads the log.
(facts-since handle fact-id)Ordered store-scoped facts with :fact/id > fact-id — the stream disposable app projections fold from.
Ordered store-scoped facts with :fact/id > fact-id — the stream disposable app projections fold from.
(fork-session! cfg source-sid)(fork-session! cfg source-sid opts)^:alpha / U1 (hermes-fractal upstream) — HOST-side fork: a fresh session
materialized from a selected immutable head of a persisted :store :sqlite
session, REPL vars restored at zero token cost, the SOURCE NEVER ADVANCED.
opts {:head/id …} reaches a specific head (including a :turn-aborted
wreckage head — the only way); default is the latest non-aborted head.
Capability clamps to the narrower of cfg and the source; the fork must
re-present the source's surfaces (:bundle/allow-mismatch? to override).
^:alpha / U1 (hermes-fractal upstream) — HOST-side fork: a fresh session
materialized from a selected immutable head of a persisted `:store :sqlite`
session, REPL vars restored at zero token cost, the SOURCE NEVER ADVANCED.
opts {:head/id …} reaches a specific head (including a :turn-aborted
wreckage head — the only way); default is the latest non-aborted head.
Capability clamps to the narrower of cfg and the source; the fork must
re-present the source's surfaces (:bundle/allow-mismatch? to override).(open-sqlite-store dir)Open the durable store under dir directly — for replay/inspection across
runs without resuming a session. Pair with close-store!.
Open the durable store under `dir` directly — for replay/inspection across runs without resuming a session. Pair with `close-store!`.
(pin! handle pin)Upsert a named durable pointer {:pin/name … :pin/ref … (+ :pin/meta, optional :pin/expected-version for CAS)}. Refs are validated against the log (dangling payload/head refs are rejected). Returns the stamped pin.
Upsert a named durable pointer {:pin/name … :pin/ref … (+ :pin/meta,
optional :pin/expected-version for CAS)}. Refs are validated against the
log (dangling payload/head refs are rejected). Returns the stamped pin.(read-payload handle ref-or-value)PUBLIC + load-bearing (06 §3): hydrate any payload-ref the read/live surface returns; a non-ref passes through unchanged.
PUBLIC + load-bearing (06 §3): hydrate any payload-ref the read/live surface returns; a non-ref passes through unchanged.
(replay-responder source sids)Build a respond-fn (use as :adapter :fake + :fake/respond) that serves
the recorded step responses AND recorded leaf (lm/map-lm) calls of sids
from a prior run — deterministic re-execution from the durable log.
source is a session handle or a SessionStore (e.g. open-sqlite-store on
another run's dir). :fractal/replay-leaf-unsupported fires only for leaf
requests no recording covers (a recording made before leaf events existed,
or a diverged fan-out).
Build a respond-fn (use as `:adapter :fake` + `:fake/respond`) that serves the recorded step responses AND recorded leaf (lm/map-lm) calls of `sids` from a prior run — deterministic re-execution from the durable log. `source` is a session handle or a SessionStore (e.g. `open-sqlite-store` on another run's dir). :fractal/replay-leaf-unsupported fires only for leaf requests no recording covers (a recording made before leaf events existed, or a diverged fan-out).
Build a fake responder from [[match reply] …] clauses (10 §1).
Build a fake responder from `[[match reply] …]` clauses (10 §1).
(resume-session! cfg sid)(resume-session! cfg sid opts)^:alpha / Phase 2 (06 §2) — durably reopen a persisted :store :sqlite session by
folding its event log + restoring its REPL vars; returns a fresh handle. Throws if
cfg's store is not :sqlite or the session id is unknown.
^:alpha / Phase 2 (06 §2) — durably reopen a persisted `:store :sqlite` session by folding its event log + restoring its REPL vars; returns a fresh handle. Throws if cfg's store is not :sqlite or the session id is unknown.
(run-turn-with-contract! handle
msg
{:keys [validate max-attempts correction]
:or {max-attempts 3}})run-turn! + the validate→correct→retry loop every downstream consumer has hand-rolled independently. The engine interprets NOTHING — the contract is yours:
:validate (fn [turn-result]) → nil/false = accept; any truthy value is the REJECTION (string or data) fed to the correction message. Called only on :final results. :max-attempts total turns spent before giving up (default 3). :correction (fn [rejection turn-result]) → the next turn's user message (default: a plain restatement of the rejection).
Returns the accepted TurnResult; on exhaustion, the last result with :contract/rejected and :contract/attempts attached. Non-:final terminal results (timeout/budget/error) return immediately — a correction message cannot fix a dead turn.
run-turn! + the validate→correct→retry loop every downstream consumer has
hand-rolled independently. The engine interprets NOTHING — the contract is
yours:
:validate (fn [turn-result]) → nil/false = accept; any truthy value is
the REJECTION (string or data) fed to the correction message.
Called only on :final results.
:max-attempts total turns spent before giving up (default 3).
:correction (fn [rejection turn-result]) → the next turn's user message
(default: a plain restatement of the rejection).
Returns the accepted TurnResult; on exhaustion, the last result with
:contract/rejected and :contract/attempts attached. Non-:final terminal
results (timeout/budget/error) return immediately — a correction message
cannot fix a dead turn.(surface-calls source sid)jz3b · the recorded surface invocations of session sid (requires the run
to have used :surface/record? true), results hydrated — the value to feed a
replay run's :surface/replay-calls. source is a handle or a SessionStore.
jz3b · the recorded surface invocations of session `sid` (requires the run to have used :surface/record? true), results hydrated — the value to feed a replay run's :surface/replay-calls. `source` is a handle or a SessionStore.
(verify-claim source claim)Mechanical existence check for a claimed engine fact: a payload-ref,
{:session/id+:head/id}, {:session/id+:edge/id}, or {:session/id}.
→ {:claim/kind k :verified? bool}. source is a handle or a SessionStore.
Mechanical existence check for a claimed engine fact: a payload-ref,
{:session/id+:head/id}, {:session/id+:edge/id}, or {:session/id}.
→ {:claim/kind k :verified? bool}. `source` is a handle or a SessionStore.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 |