Liking cljdoc? Tell your friends :D

fractal-engine.api

Stable public Clojure API for library consumers.

This namespace is the supported facade for starting sessions, running turns, reading canonical session state, and checking claim provenance. It intentionally stays generic: the model-facing runtime surface remains the six functions installed inside a session namespace (FINAL, lm, map-lm, rlm, map-rlm, attach-rlm).

Stable public Clojure API for library consumers.

This namespace is the supported facade for starting sessions, running turns,
reading canonical session state, and checking claim provenance. It intentionally stays
generic: the model-facing runtime surface remains the six functions installed
inside a session namespace (`FINAL`, `lm`, `map-lm`, `rlm`, `map-rlm`,
`attach-rlm`).
raw docstring

alias-session!clj

(alias-session! store-root alias session-id)

Create an alias fact pointing alias to session-id.

Create an alias fact pointing `alias` to `session-id`.
sourceraw docstring

auth-statusclj

(auth-status provider-id)

Return auth availability data for provider-id.

Return auth availability data for `provider-id`.
sourceraw docstring

check-claimsclj

(check-claims final)
(check-claims final base)

Check evidenced claims against the filesystem.

base resolves relative evidence paths.

Check evidenced claims against the filesystem.

`base` resolves relative evidence paths.
sourceraw docstring

check-consistencyclj

(check-consistency store-root)
(check-consistency store-root opts)

Validate the canonical SQLite + BlobStore root and derived Datahike index.

Returns a report map with typed issue maps in :issues; ordinary consistency failures are reported, not thrown.

Validate the canonical SQLite + BlobStore root and derived Datahike index.

Returns a report map with typed issue maps in `:issues`; ordinary consistency
failures are reported, not thrown.
sourceraw docstring

configclj

(config)
(config opts)

Normalize engine configuration.

Accepts the same generic keys used by the engine, including :runs-dir, :models, :max-turns, :max-fanout, :max-leaf-concurrency, :call-timeout-ms, :retry, and provider-specific test hooks such as :scripted/responses or :scripted/response-fn.

Normalize engine configuration.

Accepts the same generic keys used by the engine, including `:runs-dir`,
`:models`, `:max-turns`, `:max-fanout`, `:max-leaf-concurrency`,
`:call-timeout-ms`, `:retry`, and provider-specific test hooks such as
`:scripted/responses` or `:scripted/response-fn`.
sourceraw docstring

event-streamclj

(event-stream locator)

Return the canonical event stream for a session locator.

Return the canonical event stream for a session locator.
sourceraw docstring

extract-claimsclj

(extract-claims final)

Extract evidenced claims from a final value.

Extract evidenced claims from a final value.
sourceraw docstring

fork-session!clj

(fork-session! cfg source-handle target-store-root)
(fork-session! cfg source-handle target-store-root opts)

Fork a session from a canonical session id, alias, or handle and return a live handle.

target-store-root, when present, is the canonical store root for the fork.

opts may include :turn, :id, or :alias.

Fork a session from a canonical session id, alias, or handle and return a live handle.

`target-store-root`, when present, is the canonical store root for the fork.

`opts` may include `:turn`, `:id`, or `:alias`.
sourceraw docstring

list-sessionsclj

(list-sessions store-root)

List canonical session records under store-root.

List canonical session records under `store-root`.
sourceraw docstring

load-atclj

(load-at root-locator address)

Load the node at address within a root session locator.

Load the node at `address` within a root session locator.
sourceraw docstring

load-nodeclj

(load-node locator)
(load-node locator address)

Load one node from a session locator. Defaults to the root node.

Load one node from a session locator. Defaults to the root node.
sourceraw docstring

node-locatorclj

(node-locator root-locator address)

Resolve a node address to its canonical locator, starting at root-locator.

Resolve a node address to its canonical locator, starting at `root-locator`.
sourceraw docstring

node-provenanceclj

(node-provenance root-dir address)

Return the final value, claims, child refs, and leaf refs for a node address.

Return the final value, claims, child refs, and leaf refs for a node address.
sourceraw docstring

progressclj

(progress locator)

A lightweight, ref-free live snapshot of a session locator. Pairs with run-turn-async!.

A lightweight, ref-free live snapshot of a session locator. Pairs with
`run-turn-async!`.
sourceraw docstring

provider-descriptorclj

(provider-descriptor provider-id)

Return the generic provider descriptor for provider-id.

Return the generic provider descriptor for `provider-id`.
sourceraw docstring

rebuild-index!clj

(rebuild-index! store-root)

Rebuild the derived Datahike index from canonical SQLite rows and BlobStore refs.

Rebuild the derived Datahike index from canonical SQLite rows and BlobStore refs.
sourceraw docstring

resolve-sessionclj

(resolve-session store-root id-or-alias)

Resolve id-or-alias to a canonical session locator/ref map.

Resolve `id-or-alias` to a canonical session locator/ref map.
sourceraw docstring

resume-session!clj

(resume-session! cfg source-handle)
(resume-session! cfg source-handle opts)

Restore a session from a canonical session id, alias, or handle and return a live session handle.

opts may include :turn or :id.

Restore a session from a canonical session id, alias, or handle and return a live session handle.

`opts` may include `:turn` or `:id`.
sourceraw docstring

run-task!clj

(run-task! task)
(run-task! cfg task)
(run-task! cfg task opts)

One-shot helper: start a session, run one task, stop the session, and return the turn result map.

opts is passed to start-session!, so callers can set :id, :alias, :store-root, and :overlay.

One-shot helper: start a session, run one task, stop the session, and return
the turn result map.

`opts` is passed to `start-session!`, so callers can set `:id`, `:alias`,
`:store-root`, and `:overlay`.
sourceraw docstring

run-turn!clj

(run-turn! session user-message)

Run one user message on a live session handle. Returns the turn result map. Blocks until the turn settles. Throws :fractal/turn-in-flight if another turn is already running on this handle.

Run one user message on a live session handle. Returns the turn result map.
Blocks until the turn settles. Throws `:fractal/turn-in-flight` if another turn is
already running on this handle.
sourceraw docstring

run-turn-async!clj

(run-turn-async! session user-message)

Run one user message on a background daemon thread. Returns a promise delivering the turn result map (a turn that throws delivers an {:status :error ...} map, not an escaping exception). Poll progress (or load-node) on the session locator to watch the turn in flight, then deref the promise for the result. Throws :fractal/turn-in-flight if another turn is already running on this handle.

Run one user message on a background daemon thread. Returns a promise delivering
the turn result map (a turn that throws delivers an `{:status :error ...}` map, not
an escaping exception). Poll `progress` (or `load-node`) on the session locator to
watch the turn in flight, then deref the promise for the result. Throws
`:fractal/turn-in-flight` if another turn is already running on this handle.
sourceraw docstring

scripted-responderclj

(scripted-responder clauses)

Build a content-addressed value for :scripted/response-fn. clauses is a sequence of [match reply] pairs; the first whose match applies wins. match is a substring of the last user message (string), a predicate on the request (fn), or :default. reply is a string, a response map, or a fn of the request. Race-free under concurrent map-lm/map-rlm fanout, so it is the recommended way to script fanned-out offline runs (a shared response queue has undefined order once leaves run in parallel).

Build a content-addressed value for `:scripted/response-fn`. `clauses` is a
sequence of [match reply] pairs; the first whose `match` applies wins. `match` is
a substring of the last user message (string), a predicate on the request (fn), or
`:default`. `reply` is a string, a response map, or a fn of the request. Race-free
under concurrent `map-lm`/`map-rlm` fanout, so it is the recommended way to script
fanned-out offline runs (a shared response queue has undefined order once leaves
run in parallel).
sourceraw docstring

session-derivationsclj

(session-derivations store-root session-id)

Read derivation/provenance edges where session-id is the source or target.

Read derivation/provenance edges where `session-id` is the source or target.
sourceraw docstring

session-headsclj

(session-heads store-root session-id)

Read immutable head records for a session.

Read immutable head records for a session.
sourceraw docstring

session-invocationsclj

(session-invocations store-root session-id)

Read caller-owned outgoing invocation records for a session.

Read caller-owned outgoing invocation records for a session.
sourceraw docstring

session-locatorclj

(session-locator store-root session-id)

Return the canonical locator for a session id.

Return the canonical locator for a session id.
sourceraw docstring

session-refclj

(session-ref store-root session-id)

Read the canonical current-head ref for a session.

Read the canonical current-head ref for a session.
sourceraw docstring

start-session!clj

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

Start a fresh live session and return a session handle.

opts may include:

  • :id stable session id
  • :alias optional canonical alias
  • :store-root canonical store root for SQLite facts and blobs
  • :overlay extra session-level system instructions appended to the base behavior prompt in the single system message

The overlay specializes the session transcript; it does not add model-facing functions or change engine behavior.

Start a fresh live session and return a session handle.

`opts` may include:
- `:id` stable session id
- `:alias` optional canonical alias
- `:store-root` canonical store root for SQLite facts and blobs
- `:overlay` extra session-level system instructions appended to the base
  behavior prompt in the single system message

The overlay specializes the session transcript; it does not add model-facing
functions or change engine behavior.
sourceraw docstring

stop-session!clj

(stop-session! session)

Mark a live session stopped and flush the session artifacts.

Mark a live session stopped and flush the session artifacts.
sourceraw docstring

summarize-claimsclj

(summarize-claims checks)

Summarize claim check verdicts into totals and an overall trust call.

Summarize claim check verdicts into totals and an overall trust call.
sourceraw docstring

treeclj

(tree locator)
(tree locator address label)

Load the full addressable summary tree for a session locator.

Load the full addressable summary tree for a session locator.
sourceraw docstring

viewclj

(view locator)

Load a session locator's canonical DB/blob view. Pure read; no provider calls.

Load a session locator's canonical DB/blob view. Pure read; no provider calls.
sourceraw docstring

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