Liking cljdoc? Tell your friends :D

fractal-engine.artifacts

The artifact layer. Holds live session state, records canonical facts/payloads through session-db, and keeps an in-memory folded view for the active process.

The artifact layer. Holds live session state, records canonical facts/payloads
through session-db, and keeps an in-memory folded view for the active process.
raw docstring

add-call!clj

(add-call! state call)
source

add-eval!clj

(add-eval! state eval-row)
source

add-event!clj

(add-event! state event)

Emit an annotation/lifecycle event (no row change of its own). Returns the event id for boundary call sites.

Emit an annotation/lifecycle event (no row change of its own). Returns the
event id for boundary call sites.
sourceraw docstring

add-message!clj

(add-message! state role content)
(add-message! state role content turn-id)
(add-message! state role content turn-id extra)
source

add-snapshot!clj

(add-snapshot! state snapshot)
source

add-turn!clj

(add-turn! state turn)
source

add-turn-id!clj

(add-turn-id! state turn-id k value)
source

add-turn-ids!clj

(add-turn-ids! state turn-id k values)
source

artifact-versionclj

source

checkpoint!clj

(checkpoint! state)

Boundary hook retained inside the runtime. Canonical persistence already happened event-by-event in emit!, so there is no automatic filesystem output.

Boundary hook retained inside the runtime. Canonical persistence already
happened event-by-event in `emit!`, so there is no automatic filesystem output.
sourceraw docstring

child-call-typesclj

source

child-idclj

(child-id n)
source

child-locator-for-callclj

(child-locator-for-call parent-locator call)
source

complete-invocation!clj

(complete-invocation! state invocation-id completion)
source

complete-turn-invocations!clj

(complete-turn-invocations! state turn-id caller-head-after)
source

create-head!clj

(create-head! state head)

Append one immutable completed-state boundary for the session. The current ref advances in Datahike only after the immutable head fact has been written.

Append one immutable completed-state boundary for the session. The current ref
advances in Datahike only after the immutable head fact has been written.
sourceraw docstring

current-head-idclj

(current-head-id state)
source

current-turnclj

(current-turn state turn-id)
source

derive-treeclj

(derive-tree dir session calls)
source

derive-usageclj

(derive-usage dir calls)
source

derive-usage-reportclj

(derive-usage-report locator calls)
(derive-usage-report locator calls {:keys [turn-id]})

Usage at two scopes from the same canonical call facts:

  • :usage/turn is the completed turn only, including any child sessions that were invoked by calls in that turn.
  • :usage/cumulative is the whole current session tree up to the selected head.

This is intentionally a read-side projection. It does not change accounting or create a second cost model; it only slices the existing call rows by :call/turn-id before applying derive-usage.

Usage at two scopes from the same canonical call facts:

- `:usage/turn` is the completed turn only, including any child sessions that
  were invoked by calls in that turn.
- `:usage/cumulative` is the whole current session tree up to the selected
  head.

This is intentionally a read-side projection. It does not change accounting
or create a second cost model; it only slices the existing call rows by
`:call/turn-id` before applying `derive-usage`.
sourceraw docstring

emit!clj

(emit! state event)

Record one event: assign its id and timestamp, write canonical SQLite facts plus BlobStore payload refs, then fold it into the in-memory view. Serialized per session so DB event order and the live view stay consistent under the parallel fanout of map-lm/map-rlm. The reentrant monitor lets update-turn!/update-call! read-then-emit atomically.

Record one event: assign its id and timestamp, write canonical SQLite facts
plus BlobStore payload refs, then fold it into the in-memory view.
Serialized per session so DB event order and the live view stay consistent
under the parallel fanout of map-lm/map-rlm. The reentrant monitor lets
`update-turn!`/`update-call!` read-then-emit atomically.
sourceraw docstring

fail-invocation!clj

(fail-invocation! state invocation-id failure)
source

flush!clj

source

head-idclj

(head-id)
source

invocation-idclj

(invocation-id)
source

leaf-call-typesclj

source

load-state!clj

(load-state! {:keys [store-root session-id head-id]})
source

logical-session-idclj

(logical-session-id state)
source

mark-error!clj

(mark-error! state error)
source

mark-final!clj

(mark-final! state value)
source

new-state!clj

(new-state! {:keys [id logical-id kind provider parent resumed-from forked-from
                    cache-id initial-head? alias title origin]
             store-root-dir :store-root})
source

next-counter!clj

(next-counter! state k)
source

pathclj

Filesystem path helper for artifact-adjacent readers.

Storage authority lives in session-db/store namespaces; this remains a small file helper for read-side compatibility such as eval result readers.

Filesystem path helper for artifact-adjacent readers.

Storage authority lives in session-db/store namespaces; this remains a small
file helper for read-side compatibility such as eval result readers.
sourceraw docstring

payload-ref!clj

(payload-ref! locator value)
source

project-valueclj

(project-value value)
(project-value value depth)
source

provider-call-typesclj

source

read-edn-fileclj

Read an EDN file, returning default when absent.

This delegates to store.io and does not participate in session storage.

Read an EDN file, returning default when absent.

This delegates to store.io and does not participate in session storage.
sourceraw docstring

read-refclj

(read-ref locator ref)
source

root-call-typesclj

source

session-idclj

(session-id)
source

session-id-for-locatorclj

(session-id-for-locator locator)
source

session-locatorclj

(session-locator root session-id)
source

set-current-head!clj

(set-current-head! state head-id)

Move the session's current ref to an existing head without creating a new head. Used by same-session restore when a continuation starts from an existing same-session head.

Move the session's current ref to an existing head without creating a new head.
Used by same-session restore when a continuation starts from an existing
same-session head.
sourceraw docstring

start-invocation!clj

(start-invocation! state invocation)

Append the start fact for one RLM session invocation. Leaves never use this; leaf work remains represented only as call rows.

Append the start fact for one RLM session invocation. Leaves never use this;
leaf work remains represented only as call rows.
sourceraw docstring

store-rootclj

(store-root state)
source

store-root-for-locatorclj

(store-root-for-locator locator)
source

surfaceclj

source

surface-versionclj

source

update-call!clj

(update-call! state call-id f & args)
source

update-status!clj

(update-status! state status)
source

update-turn!clj

(update-turn! state turn-id f & args)
source

value-bytesclj

(value-bytes value)
source

value-ref!clj

(value-ref! locator value)
(value-ref! locator value opts)
source

value-summaryclj

(value-summary value)
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