diff --git a/docs/roadmap/scriptorium.md b/docs/roadmap/scriptorium.md index 0df8991..6ab7502 100644 --- a/docs/roadmap/scriptorium.md +++ b/docs/roadmap/scriptorium.md @@ -95,10 +95,14 @@ scriptorium promptkit requirements show PROMPT_ID --format json Supply the same effective configuration, prompt, profile, applicable variables, and session context as the eventual generation request. Preserve qualified IDs -and upstream selection semantics. Discovery and execution share request-context -construction so character-specific variables and Narratio's session routing -value agree. Existing downstream selectors remain authoritative; this work does -not introduce another configuration-resolution layer. +and upstream selection semantics. Discovery, preview, and generation share +request-context construction so character-specific variables and session routing +agree. Preserve Narratio's existing `session_id=narratio-session-` +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 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 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 findings with the affected trim prompt or concrete analysis artifact. Retain existing Narratio source validation and dependency planning as their respective @@ -118,9 +130,12 @@ authorities. Inspection covers relevant trim generation and effective selected analysis targets, including character-family expansion and required prerequisite work. -Unselected integrations and work that will be reused retain their existing -execution behavior. Exact automatic invocation points and incomplete-discovery -policy are the decisions at the end of this roadmap. +Use the existing planner to skip work it can establish will be reused and inspect +work that may execute under the projected plan. Earlier stages may produce +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 @@ -173,7 +188,7 @@ sufficient; inspect different variable contexts independently where needed. Add contextual operator findings for definite missing bindings and discovery 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. ### Deployment and documentation @@ -211,11 +226,14 @@ boundaries. Cover the consequential migration risks: - Native exit classifications, cancellation, capture failures, partial delivery, and output validation retain correct stage-completion behavior. - Discovery works without generated files and identifies mismatched names, - required variables, conditional inputs, and incomplete findings. -- Discovery and execution agree on effective request context, including expanded - families, selected prerequisites, and session variables. -- Selected inspection entry points preserve their documented state effects and - avoid generation or paid provider operations. + required variables, conditional inputs, and incomplete findings; uncertain + optional-source availability warns without changing binding policy. +- Discovery, preview, and generation agree on effective request context, + including expanded families and variable-based session routing. +- 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 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. 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. -## Open Decisions +## Inspection Policies ### Automatic inspection entry points -**Recommendation:** Inspect applicable pending Scriptorium work before expensive -stage execution, and include requirements findings in `session validate`. +Inspect applicable projected Scriptorium work before stage attempts begin, and +include requirements findings in `session validate`. Keep ordinary `session plan` independent of subprocess inspection for this scope. -This catches definite binding mistakes early while preserving the current -planning boundary. A failed required inspection stops the affected execution or -validation with context; unrelated stage-only invocations remain unaffected. -Scriptorium must consequently be available earlier for an invocation that will -need it. Validation inspects enabled trim and analysis definitions; execution -uses its selected pending work and prerequisite closure. +An unsuccessful inspection or definite missing requirement stops the affected +execution or validation with ordinary contextual error reporting. Early preflight +failure does not invalidate +previously completed outputs. Unrelated stage-only invocations remain unaffected. -**Alternative:** Restrict discovery to explicit `session validate`. This preserves -execution's current dependency timing and makes checks opt-in, but operators can -still discover binding errors only after expensive upstream work if they omit -validation. - -**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. +Scriptorium must consequently be available earlier for an invocation whose +projected work needs it. Validation inspects enabled trim and analysis definitions +and their required prerequisites, including disabled prerequisites. Execution +uses its selected projected work and prerequisite closure as described above. ### Incomplete or conditional discovery -**Recommendation:** Fail for definite missing required bindings or required -variables. Display incomplete-discovery issues and unresolved conditional +Fail for definite missing required bindings or required variables. Display +incomplete-discovery issues and unresolved conditional requirements as warnings while allowing execution to proceed when no definite missing requirement is established. This uses native findings without making static analyzability a new validity requirement for prompts. Later preparation 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 [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