Document the library migration and update examples

This commit is contained in:
2026-11-23 04:47:06 +00:00
parent fa5d834f13
commit 752ec676a6
18 changed files with 217 additions and 75 deletions

View File

@@ -1,23 +1,23 @@
# Audita LLM Runtime
`llm.NewRuntime` assembles one captured PromptKit engine using its default
catalog, Audita's embedded prompts and schemas, and optional operator sources
anchored to the recorded application main context. Captured host sources and
message files are passed to output collision checks. An embedded-only diagnostic
construction distinguishes shipped asset failures from operator-source failures;
it never replaces the requested engine.
`internal/appconfig` assembles one shared result and bootstraps configured
secrets before loading. `llm.NewRuntime` captures a PromptKit engine from that
result. Effective host sources and message files are passed to output collision
checks. Native errors and source evidence are retained for classification.
Each resolved pipeline entry receives role-bound clients with its selected
profiles and effective budgets. Clients share engine-local backend admission.
The adapter uses ordinary `Run` with `OperationTimeout` and `OnPrepared`, passes
Audita's per-call schema and repair budget, and decodes only validated results.
no per-call output override, and decodes the response after the selected prompt's
contract has been applied.
The operation budget includes preparation, admission, retries, and structural
repair. An expired parent context stops processing and retains any native cause.
With an active parent, PromptKit's operation deadline remains recoverable even
when a preparation error wraps it. A native transport timeout affects the HTTP
attempt and is recorded as a transport failure. The prepared notification
supplies prompt metadata to observers. With debug capture enabled, it also
supplies the actual request messages when preparation reaches that point.
supplies the native prepared request, including the contract and message hash,
when preparation reaches that point.
PromptKit owns backend and credential selection. When a required credential is absent,
the CLI identifies the role, profile, and environment variable using the native
diagnostic. See the [integration contract](../integrations/openai-compatible-llm.md)
@@ -28,8 +28,8 @@ and coordinator before submitting proposal work. The proposal call captures a
native immutable PromptKit exchange. Each actionable correction starts an independent
`Engine.Coordinate` branch from that exchange. PromptKit assembles continuation
history, owns the additional-turn budget, and delivers the last permitted response
for assessment. Follow-ups select the repair prompt, profile, and output schema
directly; Audita does not rerender the original proposal or assemble replay messages.
for assessment. Follow-ups select the repair prompt and profile; the prompt owns
its contract. Audita does not rerender the original proposal or assemble replay messages.
An opaque exchange in the structured-output contract keeps provider state outside
modules and validators. The adapter shares request construction, notifications,
observers, and once-only completion between ordinary and coordinated calls.
@@ -51,12 +51,11 @@ The bundled prompts separate durable system principles from the initial user
assignment so later repair instructions can allow acceptable minor cleanup;
see [prompt instruction ownership](prompts.md).
The observation collector tracks logical calls and execution events, and enrolls
selected runs in a native `ExecutionGroup`. Proposal, repair, and nested validator
clients explicitly share the invocation observer; history reuse adds no extra run.
Native summaries deduplicate terminal totals by run ID and retain terminal coverage
separately from usage presence and completeness. Logical calls and run membership
can differ, especially on failures before execution.
The optional debug collector tracks logical calls and native execution events,
and replays selected events into a native `ExecutionGroup`. The invocation
context also carries ckprompt's optional usage observer through proposal, repair,
and nested validation. See the [PromptKit execution guide](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/consumers/pkg-promptkit.md)
for native observation and aggregation semantics.
Processing operations retain the failure class, reason, and underlying error.
When a client omits the reason, the operation uses `internal_failure` and keeps