Forward sessions through PromptKit requests
This commit is contained in:
@@ -15,7 +15,7 @@ Notarius relies on the root `promptkit` package to:
|
||||
- construct an `Engine` with filesystem-backed prompt, schema, and optional
|
||||
profile sources;
|
||||
- prepare and run a `RunRequest` with named inline artifacts, variables,
|
||||
prompt identity, and profile selection;
|
||||
a direct session ID, prompt identity, and profile selection;
|
||||
- return rendered debug material, validated structured output, selected
|
||||
profile and model metadata, and token usage;
|
||||
- distinguish structured-output validation failure from execution failure; and
|
||||
@@ -27,6 +27,12 @@ adapter boundary. It also retains responsibility for pipeline retries,
|
||||
scheduling, debug persistence, redaction, profile provenance, and conversion
|
||||
from private model responses into durable domain artifacts.
|
||||
|
||||
Notarius sends its trimmed run session through PromptKit's direct session
|
||||
field, which is authoritative for provider session behavior. It also retains
|
||||
the same value as the `session_id` prompt variable for maintained prompt
|
||||
compatibility. Session IDs are stable, non-secret correlation identifiers and
|
||||
may be exposed to providers and provider observability.
|
||||
|
||||
## Notarius Ownership
|
||||
|
||||
[LLM Runtime Internals](../internal/llm.md) describes how Notarius mounts
|
||||
|
||||
@@ -26,12 +26,15 @@ durable schemas. Those responsibilities remain with the module and its
|
||||
|
||||
`PromptKitClient` validates the request target and prompt identity, maps each
|
||||
named material to a PromptKit inline artifact while preserving its origin URI,
|
||||
maps the request session to the existing `session_id` prompt variable, forwards
|
||||
profile selection, then prepares and runs the prompt. PromptKit v0.1.0 has no
|
||||
direct request-level session field. The adapter 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
|
||||
PromptKit.
|
||||
maps the trimmed request session to PromptKit's direct per-run session field,
|
||||
retains the same value as the `session_id` prompt variable for maintained
|
||||
prompt compatibility, forwards profile selection, then prepares and runs the
|
||||
prompt. The direct field is authoritative for provider session behavior. A
|
||||
session ID is a stable, non-secret correlation identifier and may be exposed
|
||||
to providers and provider observability. The adapter 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 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
|
||||
@@ -136,7 +139,7 @@ does not install another timeout wrapper around PromptKit.
|
||||
|
||||
The selected PromptKit profile owns generation settings. Notarius binding
|
||||
retries remain outside the adapter and repeat the complete module operation
|
||||
and validation chain. PromptKit v0.1.0 does not add a provider retry loop.
|
||||
and validation chain. PromptKit does not add a provider retry loop.
|
||||
Operator-facing behavior is summarized in
|
||||
[Operations](../operations.md#operational-limits), and the pinned upstream
|
||||
contract is identified in
|
||||
|
||||
@@ -91,31 +91,6 @@ safety checks, and deterministic application of accepted changes.
|
||||
- Add media-type validators when non-JSON artifact representations are
|
||||
introduced.
|
||||
|
||||
## LLM Runtime Evolution
|
||||
|
||||
### Native Session Propagation
|
||||
|
||||
- Once upstream PromptKit exposes a direct request-level session identifier,
|
||||
propagate the existing `StructuredCompletionRequest.SessionID` through the
|
||||
PromptKit adapter's native session field.
|
||||
- Preserve the current `--session-id` invocation contract and its run-wide
|
||||
propagation to every prompt-facing module and validator. Do not introduce a
|
||||
second session configuration surface.
|
||||
- Retain session identity in checkpoint provenance so runs with different
|
||||
sessions cannot reuse one another's LLM-derived checkpoints.
|
||||
- Define the upstream compatibility and prompt-variable transition explicitly:
|
||||
native provider session behavior must not silently remove a `session_id`
|
||||
prompt variable while maintained prompts still consume it.
|
||||
- Add adapter and assembled-run coverage for exact forwarding, trimming,
|
||||
concurrent-run isolation, and unsupported-provider behavior once the
|
||||
upstream contract is available.
|
||||
|
||||
This work is blocked because PromptKit v0.1.0 does not expose the required
|
||||
direct request-level session field. Notarius already carries a run-scoped
|
||||
session ID through its CLI, pipeline requests, checkpoint identity, and a
|
||||
`session_id` prompt variable; that prompt-variable propagation is not native
|
||||
provider session support.
|
||||
|
||||
## Further Reference Evolution
|
||||
|
||||
- Make prior-run artifacts easier to bind as references without changing the
|
||||
|
||||
Reference in New Issue
Block a user