Replace the Scriptorium adapter with PromptKit
This commit is contained in:
@@ -51,7 +51,7 @@ catalog used for resolution and the concrete constructors used for preparation.
|
||||
Tests may provide a catalog or registries instead; production code must not
|
||||
silently merge an injected partial catalog with production registrations.
|
||||
|
||||
The production LLM factory builds the Scriptorium-backed client from resolved
|
||||
The production LLM factory builds the PromptKit-backed client from resolved
|
||||
configuration, creates one scheduler from the effective global LLM limit, and
|
||||
wraps the client before it reaches modules. Registration and LLM construction
|
||||
errors are returned before a pipeline is prepared. Concrete module keys and
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# LLM Runtime Internals
|
||||
|
||||
`internal/framework/llm` is Notarius’s provider-independent structured
|
||||
completion boundary. It adapts framework requests to Scriptorium, bounds
|
||||
completion boundary. It adapts framework requests to PromptKit, bounds
|
||||
provider calls, assembles registered prompt and schema assets, records selected
|
||||
profiles, and redacts provider errors. The architectural boundary is defined in
|
||||
[Architecture](../policy/architecture.md#llm-boundary); profile sources,
|
||||
@@ -24,22 +24,22 @@ adapter does not own source evidence, artifact conversion, normalization, or
|
||||
durable schemas. Those responsibilities remain with the module and its
|
||||
[integration contract](../integrations/).
|
||||
|
||||
`ScriptoriumClient` validates the request target and prompt identity, maps each
|
||||
named material to a Scriptorium inline artifact while preserving its origin URI,
|
||||
`PromptKitClient` validates the request target and prompt identity, maps each
|
||||
named material to a PromptKit inline artifact while preserving its origin URI,
|
||||
forwards session and profile selection, then prepares and runs the prompt. It
|
||||
returns Scriptorium’s validated raw bytes rather than re-encoding the decoded
|
||||
returns PromptKit’s validated raw bytes rather than re-encoding the decoded
|
||||
target. An empty optional material is represented as one space so its named
|
||||
input is retained by Scriptorium.
|
||||
input is retained by PromptKit.
|
||||
|
||||
An empty request profile lets the prompt select its configured default. The CLI
|
||||
prepares every explicitly selected binding profile before a run begins, so a
|
||||
missing explicit profile fails before stage execution. Calls record the profile
|
||||
actually selected by Scriptorium; the recorder deduplicates non-secret profile
|
||||
actually selected by PromptKit; the recorder deduplicates non-secret profile
|
||||
identity, provider, and model values for manifest use.
|
||||
|
||||
## Shared Provider-Call Limit
|
||||
|
||||
Production construction creates one Scriptorium client and wraps it in one
|
||||
Production construction creates one PromptKit client and wraps it in one
|
||||
scheduled client. The scheduler has a fixed, positive permit limit, serves
|
||||
queued calls in FIFO order, and removes a queued call when its context is
|
||||
cancelled. A granted permit is released exactly once on every completion path.
|
||||
@@ -54,7 +54,7 @@ and its effective default are owned by
|
||||
## Prompt And Schema Assets
|
||||
|
||||
An `AssetRegistry` collects prompt and schema filesystems from production module
|
||||
families. It flattens registered roots into the Scriptorium filesystems and
|
||||
families. It flattens registered roots into the PromptKit filesystems and
|
||||
rejects invalid roots, unreadable assets, duplicate paths, and missing prompt
|
||||
or schema files during preparation. The framework’s `promptfs` helper combines
|
||||
module-owned prompt files with reusable domain fragments without making the
|
||||
@@ -95,14 +95,14 @@ meaningful input placement and cache controls of the prompt being changed.
|
||||
|
||||
## Validation, Repair, And Retries
|
||||
|
||||
Scriptorium performs prompt rendering, provider execution, and the prompt’s
|
||||
PromptKit performs prompt rendering, provider execution, and the prompt’s
|
||||
structured-output validation. The adapter reports an empty result, validation
|
||||
failure, empty structured body, or decode failure as
|
||||
`ErrInvalidStructuredOutput`, while retaining the returned raw bytes and debug
|
||||
material when they exist. Provider failures remain operational errors rather
|
||||
than output-validation failures.
|
||||
|
||||
Prompt-declared repair is executed within Scriptorium’s structured-output flow.
|
||||
Prompt-declared repair is executed within PromptKit’s structured-output flow.
|
||||
The current production D&D prompt manifests set repair attempts to zero. That
|
||||
setting does not replace pipeline retry behavior: a binding’s configured retry
|
||||
count reruns its stage attempt after an error or rejection, and an exhausted
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
## Status
|
||||
|
||||
Planned.
|
||||
In progress. The dependency and framework adapter replacement is implemented;
|
||||
the configuration, module asset terminology, and remaining provenance alignment
|
||||
are still planned.
|
||||
|
||||
## Objective
|
||||
|
||||
|
||||
Reference in New Issue
Block a user