The default provider: deterministic, offline, no credential.
Standing in the same place vaelii.impl.solve/local-solver stands — the stub that
makes the seam usable before (and without) a real backend. lein test runs the
whole pipeline against it, so the suite needs no API key and opens no socket, and a
deployment with no credential degrades to a provider that proposes nothing rather
than to an exception.
Behaviour is scripted, so a test drives the session loop exactly: :script is
the sequence of turns to hand back, one per complete/stream call, and :default
answers every call past the end of it. Each entry is a full response map, or one of
three shorthands:
"some text" a plain text answer
{:batch {:add […] :remove […]}} text holding that batch in a fenced edn block
{:lines [[sentence context] …]} the selection path's line set (:json? true for
the JSON envelope shape instead)
{:assertions [sentence …]} the page path's bare sentences, in the JSON envelope
it decodes under (:lines? true for the bare-line
shape a model ignoring format writes)
{:candidates [[sentence seg] …]} the reading path's candidates, each naming the
document sentence it came from (:untranslated,
:notes)
{:verdicts [[item verdict] …]} the judging path's answer, one verdict per numbered
claim (true / false / unsure, optional note)
{:tool "kb_sentexes_matching" :input {…}} a tool-use turn (:id optional)
With no :script the provider answers every turn with an empty batch — valid,
applies to nothing, and never varies. That default is the whole-KB path's answer;
on the selection path (session/propose-edit) it reads as unparseable, which is the
safe outcome — the only line set meaning "change nothing" is the reader's selection
itself, and a provider that never saw it cannot write one.
The default provider: deterministic, offline, no credential.
Standing in the same place `vaelii.impl.solve/local-solver` stands — the stub that
makes the seam usable before (and without) a real backend. `lein test` runs the
whole pipeline against it, so the suite needs no API key and opens no socket, and a
deployment with no credential degrades to a provider that proposes nothing rather
than to an exception.
Behaviour is **scripted**, so a test drives the session loop exactly: `:script` is
the sequence of turns to hand back, one per `complete`/`stream` call, and `:default`
answers every call past the end of it. Each entry is a full response map, or one of
three shorthands:
"some text" a plain text answer
{:batch {:add […] :remove […]}} text holding that batch in a fenced `edn` block
{:lines [[sentence context] …]} the selection path's line set (`:json? true` for
the JSON envelope shape instead)
{:assertions [sentence …]} the page path's bare sentences, in the JSON envelope
it decodes under (`:lines? true` for the bare-line
shape a model ignoring `format` writes)
{:candidates [[sentence seg] …]} the reading path's candidates, each naming the
document sentence it came from (`:untranslated`,
`:notes`)
{:verdicts [[item verdict] …]} the judging path's answer, one verdict per numbered
claim (`true` / `false` / `unsure`, optional note)
{:tool "kb_sentexes_matching" :input {…}} a tool-use turn (`:id` optional)
With no `:script` the provider answers every turn with an empty batch — valid,
applies to nothing, and never varies. That default is the *whole-KB* path's answer;
on the selection path (`session/propose-edit`) it reads as unparseable, which is the
safe outcome — the only line set meaning "change nothing" is the reader's selection
itself, and a provider that never saw it cannot write one.(assertion-lines-text sentences)(assertion-lines-text sentences notes)The same sentences as bare lines — what a model that ignores format writes, and the
shape vaelii.impl.llm.session/parse-assertions falls back to.
The same sentences as bare lines — what a model that ignores `format` writes, and the shape `vaelii.impl.llm.session/parse-assertions` falls back to.
(assertions-text sentences)(assertions-text sentences notes)A model-shaped answer for the page path: bare sentences in the JSON envelope
vaelii.impl.llm.page/output-schema constrains decoding to, which is that path's
contract. Each entry is a sentence, or [sentence {:strength :monotonic}] to claim it
known-true. No context — the caller supplies it.
A model-shaped answer for the **page** path: bare sentences in the JSON envelope
`vaelii.impl.llm.page/output-schema` constrains decoding to, which is that path's
contract. Each entry is a sentence, or `[sentence {:strength :monotonic}]` to claim it
known-true. No context — the caller supplies it.(batch-text batch)(batch-text batch prose)A model-shaped answer carrying batch in the fenced edn block the session parser
reads. prose (optional) is written above it.
A model-shaped answer carrying `batch` in the fenced `edn` block the session parser reads. `prose` (optional) is written above it.
(candidates-text candidates)(candidates-text candidates untranslated notes)A model-shaped answer for the reading path: the JSON envelope
vaelii.impl.llm.text/output-schema constrains decoding to. Each entry is
[sentence segment], or [sentence segment opts] where opts may carry
:confidence and :strength — so a test scripts exactly which sentence of the document
a candidate claims to have come from, which is the whole of how a span reaches
provenance. untranslated is [[segment reason] …].
A model-shaped answer for the **reading** path: the JSON envelope `vaelii.impl.llm.text/output-schema` constrains decoding to. Each entry is `[sentence segment]`, or `[sentence segment opts]` where `opts` may carry `:confidence` and `:strength` — so a test scripts exactly which sentence of the document a candidate claims to have come from, which is the whole of how a span reaches provenance. `untranslated` is `[[segment reason] …]`.
The no-script answer: a syntactically valid proposal that changes nothing.
The no-script answer: a syntactically valid proposal that changes nothing.
(json-lines-text lines)(json-lines-text lines notes)The same line set in the JSON envelope a model decoding under
vaelii.impl.llm.selection/output-schema produces — the other shape the parser
tolerates, for a test that drives it.
The same line set in the JSON envelope a model decoding under `vaelii.impl.llm.selection/output-schema` produces — the *other* shape the parser tolerates, for a test that drives it.
(last-user-text p)The text of the newest user turn a stub provider saw — what a test asserts the repair loop actually fed back.
The text of the newest user turn a stub provider saw — what a test asserts the repair loop actually fed back.
(lines-text lines)(lines-text lines notes)A model-shaped answer for the selection path: the line set in the editor's own
format, which is the contract vaelii.impl.llm.session/parse-lines reads. Each entry
is [sentence context] or [sentence context {:strength :monotonic}], so a test
scripts exactly what the reader would have typed. notes rides above them as prose,
which is where a model's commentary lands in this format.
A model-shaped answer for the **selection** path: the line set in the editor's own
format, which is the contract `vaelii.impl.llm.session/parse-lines` reads. Each entry
is `[sentence context]` or `[sentence context {:strength :monotonic}]`, so a test
scripts exactly what the reader would have typed. `notes` rides above them as prose,
which is where a model's commentary lands in this format.(provider)(provider {:keys [script default log]})A stub Provider. opts:
:script a vector of turns (full response maps or the shorthands above)
:default the response for every turn past the script (default: an empty batch)
:log an atom the provider conjes each request onto, for assertions
The returned value also answers :log and :calls through meta, so a test that
did not supply an atom can still see what was asked.
A stub `Provider`. `opts`: :script a vector of turns (full response maps or the shorthands above) :default the response for every turn past the script (default: an empty batch) :log an atom the provider `conj`es each request onto, for assertions The returned value also answers `:log` and `:calls` through `meta`, so a test that did not supply an atom can still see what was asked.
(requests p)The requests a stub provider has been handed, oldest first.
The requests a stub provider has been handed, oldest first.
(verdicts-text verdicts)A model-shaped answer for the judging path: the JSON envelope
vaelii.impl.llm.oracle/output-schema constrains decoding to. Each entry is
[item verdict] or [item verdict note], where verdict is true / false /
unsure — so a test scripts a judge that agrees, disputes or shrugs at a named claim,
and can leave one out to drive the unanswered path.
A model-shaped answer for the **judging** path: the JSON envelope `vaelii.impl.llm.oracle/output-schema` constrains decoding to. Each entry is `[item verdict]` or `[item verdict note]`, where `verdict` is `true` / `false` / `unsure` — so a test scripts a judge that agrees, disputes or shrugs at a named claim, and can leave one out to drive the unanswered path.
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 |