Clarify Scriptorium preflight policies and request context

This commit is contained in:
2026-11-26 02:31:57 +00:00
parent 1d1dfdf1ed
commit e586e8c733

View File

@@ -95,10 +95,14 @@ scriptorium promptkit requirements show PROMPT_ID --format json
Supply the same effective configuration, prompt, profile, applicable variables, Supply the same effective configuration, prompt, profile, applicable variables,
and session context as the eventual generation request. Preserve qualified IDs and session context as the eventual generation request. Preserve qualified IDs
and upstream selection semantics. Discovery and execution share request-context and upstream selection semantics. Discovery, preview, and generation share
construction so character-specific variables and Narratio's session routing request-context construction so character-specific variables and session routing
value agree. Existing downstream selectors remain authoritative; this work does agree. Preserve Narratio's existing `session_id=narratio-session-<session_id>`
not introduce another configuration-resolution layer. template variable, including its precedence over configured `vars.session_id`.
Do not supply a direct `--session-id`: that native option bypasses the prompt's
session template and would change routing ownership. Existing downstream
selectors remain authoritative; this work does not introduce another
configuration-resolution layer.
Inspect named requirements before generated files exist. Discovery reads Inspect named requirements before generated files exist. Discovery reads
configuration and prompt resources and makes no model call. ConfigKit's native configuration and prompt resources and makes no model call. ConfigKit's native
@@ -111,6 +115,14 @@ binding map. For example, a source named
`transcript` when explicitly bound under that name. Source identity and binding `transcript` when explicitly bound under that name. Source identity and binding
name remain distinct. name remain distinct.
A configured binding does not guarantee that its source will be available.
Narratio omits unavailable optional sources from the eventual request. When a
prompt requires such an input and availability is unknown, report the uncertainty
as a warning without rejecting the configuration or changing the binding's
optionality. A missing required binding is a definite error; unknown future
source availability is not. Existing runtime input resolution remains
authoritative.
Use native variable-presence findings, including explicit empty values. Associate Use native variable-presence findings, including explicit empty values. Associate
findings with the affected trim prompt or concrete analysis artifact. Retain findings with the affected trim prompt or concrete analysis artifact. Retain
existing Narratio source validation and dependency planning as their respective existing Narratio source validation and dependency planning as their respective
@@ -118,9 +130,12 @@ authorities.
Inspection covers relevant trim generation and effective selected analysis Inspection covers relevant trim generation and effective selected analysis
targets, including character-family expansion and required prerequisite work. targets, including character-family expansion and required prerequisite work.
Unselected integrations and work that will be reused retain their existing Use the existing planner to skip work it can establish will be reused and inspect
execution behavior. Exact automatic invocation points and incomplete-discovery work that may execute under the projected plan. Earlier stages may produce
policy are the decisions at the end of this roadmap. outputs that change later reuse decisions, so preflight does not promise exact
prediction of pending work. Actual execution remains authoritative; do not add a
second planner or simulation system. Unselected integrations remain unaffected.
The inspection policies below define entry points and handling of findings.
### Native findings and their limits ### Native findings and their limits
@@ -173,7 +188,7 @@ sufficient; inspect different variable contexts independently where needed.
Add contextual operator findings for definite missing bindings and discovery Add contextual operator findings for definite missing bindings and discovery
limitations. Keep invocation failures distinct from successful partial reports. limitations. Keep invocation failures distinct from successful partial reports.
Apply the selected entry-point policy without altering unrelated stage selection, Apply the inspection policies without altering unrelated stage selection,
manifest transitions, or ordinary configuration inspection. manifest transitions, or ordinary configuration inspection.
### Deployment and documentation ### Deployment and documentation
@@ -211,11 +226,14 @@ boundaries. Cover the consequential migration risks:
- Native exit classifications, cancellation, capture failures, partial delivery, - Native exit classifications, cancellation, capture failures, partial delivery,
and output validation retain correct stage-completion behavior. and output validation retain correct stage-completion behavior.
- Discovery works without generated files and identifies mismatched names, - Discovery works without generated files and identifies mismatched names,
required variables, conditional inputs, and incomplete findings. required variables, conditional inputs, and incomplete findings; uncertain
- Discovery and execution agree on effective request context, including expanded optional-source availability warns without changing binding policy.
families, selected prerequisites, and session variables. - Discovery, preview, and generation agree on effective request context,
- Selected inspection entry points preserve their documented state effects and including expanded families and variable-based session routing.
avoid generation or paid provider operations. - Inspection covers projected work and required prerequisites, including disabled
prerequisites, while skipping work the planner establishes will be reused.
- Preflight failures precede stage attempts and preserve completed outputs;
`session plan` remains subprocess-free and inspection makes no model calls.
Default tests use subprocess doubles and temporary filesystems. They remain Default tests use subprocess doubles and temporary filesystems. They remain
independent of sibling checkouts, installed downstream tools, real credentials, independent of sibling checkouts, installed downstream tools, real credentials,
@@ -223,48 +241,35 @@ and paid providers. A controlled compatibility check against the selected
Scriptorium release can supplement those tests. Scriptorium release can supplement those tests.
Completion means trim generation, analysis generation, and optional preview use Completion means trim generation, analysis generation, and optional preview use
the native CLI; requirements inspection implements the selected policies; and the native CLI; requirements inspection implements the policies below; and
local integration and operator documentation describe the landed behavior. local integration and operator documentation describe the landed behavior.
## Open Decisions ## Inspection Policies
### Automatic inspection entry points ### Automatic inspection entry points
**Recommendation:** Inspect applicable pending Scriptorium work before expensive Inspect applicable projected Scriptorium work before stage attempts begin, and
stage execution, and include requirements findings in `session validate`. include requirements findings in `session validate`.
Keep ordinary `session plan` independent of subprocess inspection for this scope. Keep ordinary `session plan` independent of subprocess inspection for this scope.
This catches definite binding mistakes early while preserving the current An unsuccessful inspection or definite missing requirement stops the affected
planning boundary. A failed required inspection stops the affected execution or execution or validation with ordinary contextual error reporting. Early preflight
validation with context; unrelated stage-only invocations remain unaffected. failure does not invalidate
Scriptorium must consequently be available earlier for an invocation that will previously completed outputs. Unrelated stage-only invocations remain unaffected.
need it. Validation inspects enabled trim and analysis definitions; execution
uses its selected pending work and prerequisite closure.
**Alternative:** Restrict discovery to explicit `session validate`. This preserves Scriptorium must consequently be available earlier for an invocation whose
execution's current dependency timing and makes checks opt-in, but operators can projected work needs it. Validation inspects enabled trim and analysis definitions
still discover binding errors only after expensive upstream work if they omit and their required prerequisites, including disabled prerequisites. Execution
validation. uses its selected projected work and prerequisite closure as described above.
**Alternative:** Also inspect through `session plan` and expose findings with its
binding view. This improves planning feedback but introduces downstream process
and configuration availability requirements into a currently subprocess-free
planning operation. The planning contract and its tests would need an explicit,
limited revision for read-only discovery.
### Incomplete or conditional discovery ### Incomplete or conditional discovery
**Recommendation:** Fail for definite missing required bindings or required Fail for definite missing required bindings or required variables. Display
variables. Display incomplete-discovery issues and unresolved conditional incomplete-discovery issues and unresolved conditional
requirements as warnings while allowing execution to proceed when no definite requirements as warnings while allowing execution to proceed when no definite
missing requirement is established. This uses native findings without making missing requirement is established. This uses native findings without making
static analyzability a new validity requirement for prompts. Later preparation static analyzability a new validity requirement for prompts. Later preparation
and generation remain authoritative for actual requests. and generation remain authoritative for actual requests.
**Alternative:** Treat every incomplete report or unresolved conditional
requirement as a preflight failure. This offers stricter early checking but can
reject valid dynamic templates and restrict supported upstream behavior. Such a
restriction requires an explicit operator-policy choice.
[release]: https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/releases/v0.16.0.md [release]: https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/releases/v0.16.0.md
[cli]: https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/cli.md [cli]: https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/cli.md
[migration]: https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-cli.md [migration]: https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-cli.md