2026-05-24 01:02:47 +00:00
# Audita LLM Runtime
2026-11-23 04:47:06 +00:00
`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.
2026-11-10 17:52:14 +00:00
Each resolved pipeline entry receives role-bound clients with its selected
profiles and effective budgets. Clients share engine-local backend admission.
2026-11-15 01:25:55 +00:00
The adapter uses ordinary `Run` with `OperationTimeout` and `OnPrepared` , passes
2026-11-23 04:47:06 +00:00
no per-call output override, and decodes the response after the selected prompt's
contract has been applied.
2026-11-15 01:25:55 +00:00
The operation budget includes preparation, admission, retries, and structural
2026-11-16 14:27:54 +00:00
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
2026-11-16 15:19:59 +00:00
supplies prompt metadata to observers. With debug capture enabled, it also
2026-11-23 04:47:06 +00:00
supplies the native prepared request, including the contract and message hash,
when preparation reaches that point.
2026-11-16 14:27:54 +00:00
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 )
2026-11-10 17:52:14 +00:00
for failure behavior and the [configuration reference ](../config.md ) for sources.
2026-11-16 14:36:07 +00:00
When correction repair is enabled, the runner checks the module's repair prompt
and coordinator before submitting proposal work. The proposal call captures a
native immutable PromptKit exchange. Each actionable correction starts an independent
2026-11-15 01:25:55 +00:00
`Engine.Coordinate` branch from that exchange. PromptKit assembles continuation
history, owns the additional-turn budget, and delivers the last permitted response
2026-11-23 04:47:06 +00:00
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.
2026-11-15 01:25:55 +00:00
An opaque exchange in the structured-output contract keeps provider state outside
modules and validators. The adapter shares request construction, notifications,
2026-11-16 14:27:54 +00:00
observers, and once-only completion between ordinary and coordinated calls.
Completion attaches terminal counts when available and records one logical finish.
2026-11-17 04:17:24 +00:00
Progress uses the adapter's logical call boundaries. Writes to the diagnostic
stream occur outside PromptKit's operation deadline.
2026-11-16 14:27:54 +00:00
Prepared requests and terminal output travel in the returned response for an
optional interaction artifact. Logical call notifications carry metadata.
2026-11-15 01:25:55 +00:00
Audita owns actionable rejection, revision decoding, withdrawal, current previews,
2026-11-16 14:36:07 +00:00
and full revalidation. Each branch returns its attempt facts and final approval
to the section runner. Accepted siblings remain independent. Requesting more work
2026-11-15 01:25:55 +00:00
at the budget boundary produces exhaustion without allocating another logical call.
A canceled, undelivered response supplies diagnostic evidence only; it cannot enter
the approved set. Repair disabled in configuration bypasses coordination entirely.
2026-11-11 17:42:30 +00:00
The runner supplements each repair instruction with its current proposal preview
as described in the [module guide ](modules.md#failure-and-outcome-behavior ).
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 ).
2026-11-11 04:18:05 +00:00
2026-11-23 04:47:06 +00:00
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.
2026-11-16 14:27:54 +00:00
Processing operations retain the failure class, reason, and underlying error.
When a client omits the reason, the operation uses `internal_failure` and keeps
the original class and error chain. Ordinary reports use compact outcomes.
Request and response evidence is optional debug material. The runner preserves
ordered pipeline traversal and deterministic section collection while canceling
and joining peers on fatal errors.