From 5382058b280f54879eb1aa088bcf0bace4f4f34f Mon Sep 17 00:00:00 2001 From: Eric Rakestraw Date: Sat, 28 Nov 2026 04:34:14 +0000 Subject: [PATCH] Document pipeline preflight for consumers and operators --- docs/cli.md | 46 ++++++++++++++++++++++++++++++++-- docs/consumers/dnd-pipeline.md | 9 ++++++- docs/consumers/subprocess.md | 25 +++++++++++++++--- docs/operations.md | 20 +++++++++++++-- docs/roadmap/implementation.md | 2 ++ 5 files changed, 94 insertions(+), 8 deletions(-) diff --git a/docs/cli.md b/docs/cli.md index 163fba35..fad685e6 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -23,6 +23,8 @@ notarius completion bash notarius pipeline list notarius pipeline show PIPELINE_ID notarius pipeline validate PIPELINE_ID +notarius pipeline preflight PIPELINE_ID --input-file PATH +notarius preflight PIPELINE_ID --input-file PATH notarius pipeline run PIPELINE_ID --input-file PATH notarius run PIPELINE_ID --input-file PATH notarius config scopes @@ -106,7 +108,8 @@ This is distinct from native configuration validation: request preparation and dynamic selections are checked when used. Show and validate accept configuration selection and native report controls. -They inspect the complete configured pipeline; lane selection belongs to run: +They inspect the complete configured pipeline; lane selection belongs to run +and preflight: ~~~sh notarius pipeline list --config examples/dnd-complete/config.yml --format json @@ -114,6 +117,44 @@ notarius pipeline show dnd-session --config examples/dnd-complete/config.yml notarius pipeline validate dnd-session --config examples/dnd-complete/config.yml ~~~ +### Preflight + +`preflight PIPELINE_ID` is the native alias for `pipeline preflight PIPELINE_ID`. +Both accept the same required input, selection, reference, destination, debug, +and native override flags as [run](#run). Preflight constructs selected modules, +checks the supplied input and external references, checks output and applicable +cache access, and invokes available native reachability, authentication, and +structured-generation checks for selected model targets. Checks sharing a profile +or backend share the corresponding probe. It does not execute the pipeline or +publish domain artifacts. Unlike offline validation it can contact providers and +incur inference costs; see [Operations](operations.md#preflight-lifecycle). + +The assessment contains `pipeline`, `ready`, `checks`, and an optional +`debug_directory`. Each check has a stable class `id`, a structured `scope`, a +`result` (`passed`, `failed`, or `warning`), a `message`, and sometimes a `code`. +Scopes may identify a path, profile, backend, pipeline, or associated bindings. +Cache access problems warn without making readiness false. A failed or incomplete +required check makes readiness false. Default text shows the summary, failures, +and warnings; verbose visibility adds successful details. JSON and YAML serialize +the same assessment. For example, a portion of a successful JSON assessment is: + +~~~json +{ + "checks": [ + {"id":"input","message":"Source input is valid.","result":"passed","scope":{"path":"/data/source.json"}} + ], + "pipeline": "campaign", + "ready": true +} +~~~ + +The checks shown are illustrative, not an exhaustive list. When an assessment is +available it is delivered even for unsuccessful readiness; early argument or +loading errors can have no assessment. Always use process status as well: capture +or report delivery can fail independently of a ready assessment. Quiet mode can +suppress stdout and failed delivery can leave partial output. Readiness applies +to the supplied input, not a later transcript; run validates its own input. + ### Run ~~~text @@ -349,7 +390,8 @@ quiet command. Run capture selection remains independent of that final mode. `--format json --verbose` keeps successful stdout report-only JSON while useful diagnostics go to stderr. No application-wide structured error envelope is -introduced; failed stdout is not a success document. +introduced. A failed preflight may nevertheless deliver its readiness assessment; +run completion reports remain success-only. | Status | Meaning | | --- | --- | diff --git a/docs/consumers/dnd-pipeline.md b/docs/consumers/dnd-pipeline.md index 329e87c8..05df5409 100644 --- a/docs/consumers/dnd-pipeline.md +++ b/docs/consumers/dnd-pipeline.md @@ -20,7 +20,7 @@ CLI reference paths use the process working directory. Absolute caller paths are useful for services. Keep credentials in the intended environment, not files, arguments, sessions, or logs. -Preflight without credentials or inference: +Validate without credentials or inference: ~~~sh notarius config validate --config /absolute/path/to/notarius.yml @@ -54,6 +54,13 @@ reach every selected target declaring the slot; narrower overrides follow the combat, and NPC-occurrence handoffs stay in pipeline configuration, not CLI file bindings. +For an optional online readiness check, use `notarius preflight dnd-session` +with the same configuration, transcript, output root, and reference arguments as +the run above. Check process status and any available assessment as described in +the [subprocess workflow](subprocess.md#prepare-and-run); the +[CLI reference](../cli.md#preflight) owns report semantics. A synthetic input +checks that input only, not a subsequent final transcript. + The ordinary input-based session is suitable without an override. Use `--llm-session-id` only to intentionally change its native selection. Sessions correlate provider routing; they are not credential or output identities. diff --git a/docs/consumers/subprocess.md b/docs/consumers/subprocess.md index 76dca925..034d4b8f 100644 --- a/docs/consumers/subprocess.md +++ b/docs/consumers/subprocess.md @@ -27,17 +27,36 @@ notarius pipeline validate pipeline-id \ Omit the overlay for the composed base. Pipeline validation needs no transcript, reference bytes, credentials, provider call, or state directory. -Then run with first-class source and output inputs: +Optionally perform online readiness checks with the same selection and references +that will be used for execution: + +~~~sh +notarius preflight pipeline-id \ + --config /absolute/path/to/notarius.yml --overlay production \ + --input-file /absolute/path/to/source.json \ + --reference party=/absolute/path/to/party.txt \ + --output-dir /absolute/path/to/output-root --format json +~~~ + +Check process status even when a report is present. On nonzero status, decode an +available complete assessment for details when useful; early errors may produce +none and failed delivery may leave partial bytes. `ready: true` alone does not +override a failing status. A synthetic transcript is ordinary supplied input: +its successful assessment does not establish readiness of a future transcript. +Preflight can contact providers and incur costs; see +[preflight operation](../operations.md#preflight-lifecycle). + +Then run with the same selection and reference: ~~~sh notarius run pipeline-id \ --config /absolute/path/to/notarius.yml --overlay production \ --input-file /absolute/path/to/source.json \ + --reference party=/absolute/path/to/party.txt \ --output-dir /absolute/path/to/output-root --format json ~~~ -Pass external references as separate arguments, for example -`--reference party=/absolute/path/to/party.txt`. Unqualified selectors reach +Pass external references as separate arguments. Unqualified selectors reach compatible selected targets; narrower selectors are exceptional overrides. Generated same-run handoffs stay configured, not CLI files. The [reference selector contract](../cli.md#reference-selectors) owns matching and diff --git a/docs/operations.md b/docs/operations.md index 43c8b0d4..11420760 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -144,6 +144,22 @@ signal can terminate the process. There is no shutdown deadline or guarantee that collaborators which ignore cancellation will stop; forced termination may leave capture incomplete. Embedded application callers retain their own contexts. +## Preflight Lifecycle + +Explicit online preflight reads the selected input and references, prepares the +pipeline, and contacts selected providers for applicable native access and +structured-generation checks. These checks can incur inference charges. It does +not publish extraction artifacts or use accepted cache entries as readiness proof. + +Preflight creates the output root if necessary and writes, closes, and removes a +temporary access file. For selected cacheable work, auto and refresh similarly +probe the cache root without reading or changing accepted entries; bypass and +deterministic work do not access it. Cache probe problems warn; output access +failure fails readiness. Temporary probe files are removed when possible, but +newly created roots can remain. Requested debug uses the real capture lifecycle +and is required work. See [CLI Reference](cli.md#preflight) for the command and +assessment and [Debug Bundles](#debug-bundles) for capture handling. + ### Acceptance And Fallback PromptKit owns transient retries and structural repair. Application semantic @@ -249,9 +265,9 @@ Directory configuration alone does not enable it. Explicit empty disables it; a nonempty invocation override can re-enable it. [Configuration](config.md#file-shape-and-defaults) owns defaults/origins; [CLI Reference](cli.md#run) owns mode ordering. -Allocation creates the run directory and updates `latest` to a relative link +Allocation creates the capture directory and updates `latest` to a relative link at session start. It reflects the last successful start link update, including a -run that later fails. Completion never retargets it. Concurrent starts retain +invocation that later fails. Completion never retargets it. Concurrent starts retain separate directories; disabled capture leaves the link untouched. This link is not an output-discovery API. diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md index b26640a4..063b3bb7 100644 --- a/docs/roadmap/implementation.md +++ b/docs/roadmap/implementation.md @@ -447,6 +447,8 @@ This stage fits one prompt devoted to assembled verification, not documentation. ## Stage 9: Document Commands And Consumer Operation +**Status:** Complete. + **Goal:** Document the implemented product surface for operators and consumers. **Work and canonical owners:**