Liking cljdoc? Tell your friends :D

fractal.engine.api

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.
raw docstring

append-fact!clj

(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).
sourceraw docstring

close-session!clj

(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!.
sourceraw docstring

close-store!clj

(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).
sourceraw docstring

compact-session!clj

(compact-session! handle)
source

delegation-reportclj

(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.
sourceraw docstring

event-streamclj

(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.
sourceraw docstring

events-sinceclj

(events-since handle ev-id)
source

facts-sinceclj

(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.
sourceraw docstring

fork-session!clj

(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).
sourceraw docstring

list-pinsclj

(list-pins handle)
source

make-configclj

(make-config opts)
source

open-sqlite-storeclj

(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!`.
sourceraw docstring

pin!clj

(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.
sourceraw docstring

progressclj

(progress handle)
source

read-payloadclj

(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.
sourceraw docstring

read-pinclj

(read-pin handle pin-name)
source

replay-responderclj

(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).
sourceraw docstring

responderclj

Build a fake responder from [[match reply] …] clauses (10 §1).

Build a fake responder from `[[match reply] …]` clauses (10 §1).
sourceraw docstring

resume-session!clj

(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.
sourceraw docstring

run-turn!clj

(run-turn! handle msg)
source

run-turn-async!clj

(run-turn-async! handle msg)
source

run-turn-with-contract!clj

(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.
sourceraw docstring

start-session!clj

(start-session! cfg)
(start-session! cfg opts)
source

stop-session!clj

(stop-session! handle)
(stop-session! handle opts)
source

subscribe!clj

(subscribe! handle callback)
source

surface-callsclj

(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.
sourceraw docstring

verify-claimclj

(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.
sourceraw docstring

viewclj

(view handle)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close