[Documentation Policy](../policy/documentation.md) before canonical documentation
changes. Prefer graph-based code discovery as directed by `AGENTS.md`.
This is application orchestration work, not a kit upgrade. Use the selected
PromptKit v0.25.0, CommandKit v0.8.0, ckprompt v0.12.0, and ConfigKit v1.4.0 APIs.
Do not change dependency versions or implement provider mechanics locally.
If a required native operation proves unavailable, describe the concrete API gap
before expanding scope; do not silently replace native resolution with a private
resolver or weaken the accepted preflight behavior.
## Current Baseline And Intended Seams
The reviewed baseline is commit `714d4456d9e8cb36fd3e039cdadb7ae7f23f568b`.
Verify current source before editing; names below locate owners, not required new
filenames or private helper names.
| Area | Current implementation and intended change |
| --- | --- |
| Command composition | `internal/cli/application.go` installs pipeline commands and the native `run` alias. Add another domain command and native alias, retaining lazy help/version construction. |
| Invocation selection | `run_input.go`, `execution_overrides.go`, and `pipeline_run.go` contain run flags, supplied values, configuration selection, reference selectors, resolution, and construction. Share these rather than copy the run handler. |
| Offline validation | `internal/preflight/preflight.go` inspects known dependencies of resolved modules and validators without input reads, construction, or network activity. Preserve `pipeline validate` at that boundary. |
| Domain preparation | `MaterializeReferences` and `pipeline.Prepare` materialize references and construct the complete typed implementation set. Constructors already validate many domain references. Keep those checks with their owners. |
| Source parsing | `prepareRunSource` in `runner_boundaries.go` parses through the prepared adapter, validates the generic document, and builds the run's source index inside execution. Extract the parsing/validation portion for preflight reuse without chunking. |
| Native resource declarations | `ModuleSpec.Prompts` lists initial and correction dependencies together; validator specs list assessment prompts. Resource existence is not the same as execution-target selection. Distinguish continuation-only dependencies when discovering targets. |
| Capture and outcomes | `run_debug.go`, `run_capture.go`, `pipeline_run.go`'s `finish`, and `run_result.go` implement early capture, retained causes, and native reporting. Reuse lifecycle mechanisms, not artifact-publication state. |
Use the selected native [smoke API][smoke-api], [inspection API][inspection-api],
[consumer guide][promptkit-consumer], and [CommandKit reporting guide][reporting]
as upstream contracts. Native `SmokeTestRequest` accepts profile/prompt/backend
selection, an execution override, and an optional transient-retry count.
and other execution-only controls do not manufacture smoke work.
4. Interpret returned observations, including partial reports on errors:
| Observation | Readiness treatment |
| --- | --- |
| Native operation error, cancellation, or reported execution failure | Failed required check; preserve the cause and any gathered evidence. |
| Diagnostic unsupported or known inapplicable, without an independent execution error | No readiness check entry, warning, missing-coverage claim, or replacement test. |
| Supported/applicable check unfinished, or its required result is unknown | Failed required check, not success based on nil error. |
| Reachability | Requires completed diagnostic and affirmative `EndpointReachable`. An HTTP response is reachability, not authentication success. |
| Available authentication | Requires completed diagnostic and affirmative `CredentialsAccepted`. Merely supplying credentials is insufficient. |
| Structured generation | Requires completed generation and affirmative `GenerationCompleted`, `ValidJSON`, and `SchemaMatched`. Do not require unrelated HTTP or text-inference facts. |
5. Keep native reports/attempts/usage available for debug capture separately from
the small public checks. Preserve native typed error identity. A negative
factual result with nil Go error needs an application outcome cause/message,
not provider-response prose parsing. Strict/permissive mode never changes
these verdicts.
**Evidence and acceptance:** Native HTTP/client fixtures prove successful probe
deduplication, actual request override propagation, nil-error negative/unknown
facts, unavailable capability handling, and cancellation with partial evidence.
Use independent literal verdicts and exact paid call counts where contractual;
do not reproduce PromptKit's provider test suite.
**Validation:** `go test ./internal/preflight`. This stage fits one prompt and
does not include filesystem destinations or command/report wiring.
coverage, one representative native override including a supplied zero/empty
where supported, and exclusion of unselected work. Reuse lower-level coverage
for the remaining selection cases instead of multiplying flag combinations.
4. Verify supported/applicable negative observations, no warning for unavailable
capabilities, cache warning with readiness true, failed readiness report plus
unsuccessful exit, and native alias behavior through the assembled route.
Reuse Stage 4/6 tests where they already prove a behavior at the right boundary.
5. Review every verification row in feature-roadmap Section 5 and map it to
existing or newly added test evidence. Add tests only for consequential gaps.
Retain normal offline `pipeline validate` and ordinary run regression coverage.
**Evidence and acceptance:** Tests are deterministic, offline, secret-free, and
independent of installed live providers. Successful preflight is not asserted to
guarantee later model/domain acceptance. No live API or Narratio subprocess test
is required for the default suite or release gates.
**Validation:** `go test ./internal/cli ./internal/preflight ./internal/framework/pipeline`.
This stage fits one prompt devoted to assembled verification, not documentation.
## Stage 9: Document Commands And Consumer Operation
**Goal:** Document the implemented product surface for operators and consumers.
**Work and canonical owners:**
| File | Update |
| --- | --- |
| `docs/cli.md` | Command and alias; shared run inputs and preflight-specific effects; affirmative readiness checks; report/check fields, failed assessments, native statuses, and one implementation-checked structured example. Keep offline validate distinct. |
| `docs/consumers/subprocess.md` | First-class preflight-then-run invocation with references; synthetic versus real input; process status plus optional report decoding on failure. Preserve the successful-run completion protocol separately. |
| `docs/consumers/dnd-pipeline.md` | Brief optional preflight workflow using the maintained full pipeline; link to CLI and generic consumer owners rather than duplicate their contracts. |
| `docs/operations.md` | Provider contact/cost, output/cache temporary probes, cleanup, cache bypass/refresh behavior, requested debug, and remaining destination roots. Link elsewhere for syntax and report fields. |
Cross-check documentation against the assembled command/help and tests. Use
affirmative user-facing descriptions of performed checks; do not add an unsupported
capability/coverage disclaimer catalogue. Narratio's original request remains
background, with its existing link to the accepted design.
**Evidence and acceptance:** The structured report example matches the actual
serializer. Consumers can distinguish failed readiness with an available report
from early native errors, and always use process status. The preflight example
and run example preserve identical selections/references without claiming that
a fixture establishes readiness of a future transcript.
**Validation:** Run both command help routes, inspect the Stage 8 report fixtures,
verify changed local links, and run `git diff --check`. No live-provider run is
needed to verify documentation. Four focused public docs fit one prompt.
## Stage 10: Align Internal Documentation And Architecture Boundaries
**Goal:** Document the implemented shared preparation/native smoke boundaries in
their existing canonical homes, with narrow architecture wording changes.
**Work and canonical owners:**
| File | Update |
| --- | --- |
| `docs/internal/cli.md` | Shared selection/preparation, separate execution/smoke handoffs, command outcomes and capture ownership. |
| `docs/internal/pipeline.md` and `docs/internal/modules.md` | Shared parse/domain-check seam and small initial-target declaration, only where implementation changed. |
| `docs/internal/state.md` and `docs/internal/llm.md` | Capture/probe lifecycle and the application-specific use of native smoke results; smoke evidence remains separate from ordinary observations. |
| `docs/internal/overview.md` | Update the preflight component row and execution map to reflect implemented boundaries, without creating an architecture policy here. |
| `docs/integrations/pkg-promptkit.md` and `docs/integrations/pkg-commandkit.md` | Briefly identify the application integration of native smoke/reporting APIs and link their selected canonical upstream docs. Do not write a copy of the library manuals. |
| `docs/policy/architecture.md` | Retain offline rules for `pipeline validate` and dependency inspection; distinguish explicit online preflight, its allowed input/probe/capture effects, and pipeline-owned readiness interpretation. Revise the broad statement that capture belongs only to run. Preserve provider/config/CLI ownership and all unrelated constraints. |
Update only affected sections, keeping these changes concise. No new ADR is
needed for this explicit command within the existing native-kit ownership
decisions. Link upstream for native APIs and keep invocation syntax/report
contracts in `docs/cli.md` rather than repeating them in internal guides.
**Evidence and acceptance:** Current implementation maps, offline inspection
language, capture ownership, and target-selection declarations are accurate.
Architecture still permits input-free/provider-free offline validation and
shared storage-free loaders, while explicitly permitting the accepted online
preflight effects. No unrelated invariant or safety contract is strengthened.
**Validation:** Review changed passages against their actual code owners and
tests; check affected local links and `git diff --check`. This is one prompt of
narrow cross-document edits, not a rewrite of the documentation suite.
## Stage 11: Verify End-To-End Completion
**Goal:** Complete the sprint with full code, documentation, and scope verification.
Review every requirement in `preflight.md` against implementation and test
evidence. In `docs/roadmap/future.md`, point feature context to `preflight.md` and
sequencing to this plan. Update implementation status only after successful
verification; do not delete planning documents unless requested.
Run the final checks using the selected Go toolchain and normal repository setup:
```sh
go test ./...
go vet ./...
go build ./cmd/notarius
go run ./cmd/notarius help pipeline preflight
go run ./cmd/notarius preflight --help
go run ./cmd/notarius pipeline validate dnd-session --config examples/dnd-complete/config.yml
```
The last command stays offline; do not run the maintained configuration's new
online preflight against a real provider as a mandatory check. Verify local
Markdown links in changed documents, run `git diff --check`, and inspect
`git status --short` for accidental binaries, captures, credentials, or generated
data. Remove only build outputs created by this sprint when appropriate.
**Final acceptance:** All feature-roadmap requirements have corresponding code
and verification evidence; both command spellings work; ordinary run and offline
validation retain their contracts; native target/override/fact semantics are
honored; no accepted cache state is consulted or changed by preflight; capture,
cancellation, and delivery failures retain causes; current documentation matches
the implementation. Record remaining concrete gaps instead of declaring the
feature complete on partial test evidence. This final stage is one prompt.
## Open Questions
None. The accepted product decisions are complete. Private helper names, capture
layout, and check-class identifiers may be selected during implementation within
the contracts above; they do not require another product-design decision.