Add Notarius v0.9.0 adoption roadmap

This commit is contained in:
2026-11-28 00:00:31 +00:00
parent 55a4c49a31
commit 65b774b568

331
docs/roadmap/notarius.md Normal file
View File

@@ -0,0 +1,331 @@
# Adopt Notarius v0.9.0
## Purpose
Adopt Notarius's native execution, output, and cache contracts while removing
Narratio machinery for retired upstream interfaces. Preserve Narratio's ownership
of prepared inputs, extraction requirements, durable artifacts, and stage reuse.
This is a proposed feature roadmap. Open decisions appear at the end; settle
them before preparing the implementation plan. Implementation is one end-to-end
cutover, without compatibility aliases, legacy conversion, or a second adapter.
## Upstream Baseline
The latest upstream release verified on 2026-11-27 is **v0.9.0**, at commit
`f01df93d352811be9fb1c97cd2efc94449f184c9`. Notarius remains a separately installed
executable; adopting it does not require importing its Go packages into Narratio.
Canonical references:
- [Release notes](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/releases/v0.9.0.md)
- [Migration guide](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/consumers/native-migration.md)
- [Subprocess guide](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/consumers/subprocess.md)
- [CLI reference](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/cli.md)
- [Configuration](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/config.md)
- [Published domain files](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/integrations/json-output.md)
- [Complete D&D workflow](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/consumers/dnd-pipeline.md)
The [current integration](../integrations/notarius.md) targets the v0.8.1
receipt/index contract. v0.9.0 removes that protocol and changes invocation,
configuration, caching, and validation controls. Its domain artifact schemas and
lane filename mapping remain unchanged.
## Ownership And Scope
Follow [ADR 0003](../adr/0003-assign-configuration-ownership.md): ConfigKit owns
configuration resolution, CommandKit owns native CLI behavior, and Narratio
consumes resolved values to orchestrate the pipeline. Notarius owns its pipeline,
prompts, profiles, validation, fallback construction, and accepted-result cache.
Do not duplicate downstream configuration resolution, infer provider settings,
implement semantic validation already owned by Notarius, or inspect private
cache/debug formats. Preserve shared subprocess supervision, credential supply,
redaction, cancellation, and native error handling.
The [workspace roadmap](workspace.md) owns broader filesystem reorganization.
This adoption must remove index-dependent assumptions wherever they occur, but
does not require that reorganization. Use the workspace paths in effect when
implemented, through the existing path owner. Reconcile overlapping extraction
and debug work rather than implementing two competing layouts.
## Native Invocation
Keep the native `notarius run <pipeline_id>` route. Update the adapter's argument
vector to use these interfaces:
| Concern | Target behavior |
| --- | --- |
| Transcript | `--input-file <absolute final trimmed transcript path>` replaces `--input`. |
| Configuration | Preserve the selected `--config` path; forward `config_overlay` through `--overlay`. |
| Machine report | Request `--format json` instead of `--json`, independently of Narratio's own output format. |
| References | Retain repeated `--reference <selector>=<verified snapshot path>`. |
| Output | Supply a Narratio staging root through `--output-dir`. |
| Cache | Use native `--cache auto\|bypass\|refresh`; remove `--resume` and `--chunk_cache`. |
Preserve omitted versus explicitly supplied overlay values and let Notarius
interpret them. Keep flags after the complete command path. Run the selected
pipeline normally: Narratio's required-output map does not implicitly become a
`--lane` filter that changes execution or generated dependencies.
Keep the existing minimal child environment and exact-name credential forwarding.
Use Notarius's native input-based LLM session selection unless a separate product
requirement calls for an override. Do not add generic execution overrides or
version negotiation merely to perform the cutover.
## Completion And Required Artifacts
Wait for successful process completion before parsing stdout. The native report
provides `pipeline`, `artifact_count`, and an absolute `output_directory`, with
optional `debug_directory` and positive `fallback_count`. It is not a versioned
receipt, validation ledger, or artifact inventory.
Use the reported directory as the exact run root beneath the supplied staging
root. Read required lane files at the documented `lanes/<mapped-lane-id>.json`
paths. Apply the upstream filename mapping for custom lane IDs; do not silently
restrict operators to the simple IDs used by the maintained D&D example.
Every configured extraction output remains required. Check the expected pipeline,
safe file placement, regular-file status, bounded JSON readability, and checksums
using existing production machinery. The proposed simplification of output
contracts is OD-1. Preserve `narratio.extraction.<output_key>` identities and
manifest-backed resolution for analysis and publication.
`artifact_count` includes all published deliverables, including available enabled
auxiliaries and reused results. It must not be compared with the number of
Narratio's required outputs as an acceptance test. The maintained complete D&D
pipeline still supplies ten lanes; `chunk-map.json` and `evidence-context.json`
are optional domain auxiliaries, not reporting sidecars. Retain them with the
bundle when produced; adding selectable Narratio sources for them is not required
for this adoption.
Remove receipt/index/sidecar parsing, descriptor matching, rejection and warning
count reconciliation, and the non-selectable `notarius_index` manifest output.
Remove dependencies on those records from stage execution, evidence inspection,
catalog hydration, reuse, publication, and restore. Do not replace them with a
Narratio-created imitation index or require optional debug capture for acceptance.
Record Narratio's own input/output evidence and the native completion information
needed for provenance. The completion report has no upstream run-ID field;
do not invent one or derive identity by parsing directory names. Keep configured
expectations distinct from facts actually attested by the producer.
Preserve staged validation and atomic promotion before recording stage success.
Nonzero exit, malformed successful stdout, or missing required files remain
failures. A native capture/report failure can occur after files are published;
retain useful diagnostics under the existing failure lifecycle, but do not
automatically recover success from those files or partial stdout. Preserve native
errors through the shared subprocess path rather than adding an error taxonomy.
## Native Cache And Narratio Reuse
Replace `pipeline.notarius.resume` and `pipeline.notarius.chunk_cache` with an
optional `pipeline.notarius.cache` using the native modes. Omission adds no flag
and preserves downstream configuration. Forced extraction passes `--cache refresh`.
Keep the two reuse decisions separate:
- Narratio reuses a completed extraction from its manifest and semantic evidence.
- An executed Notarius invocation applies its own accepted-result cache policy.
Cache and debug controls alone must not invalidate Narratio's completed stage.
Continue fingerprinting result-affecting Narratio inputs, reference content,
output selection, pipeline identity, and explicit overlay selection. Do not hash
or interpret private downstream configuration to construct another cache key.
Notarius cache hits reuse accepted results without fresh semantic assessment.
Model, settings, or validation-policy changes can still hit. Document forced
extraction as the way to request fresh work after such downstream edits; native
refresh then prevents cache reuse during that execution. Notarius owns cache
placement and cleanup. Old Notarius caches remain ignored and untouched.
Replace index-based extraction evidence with the existing Narratio-owned output
records, checksums, and provenance adapted to the new contract. Old extraction
evidence becomes obsolete when evaluated through normal stage reuse rules. Do
not introduce a legacy reader, delete historical bundles, or rerun unrelated
completed stages solely because the adapter changed. Preserve ordinary dependent
invalidation when extraction must be rerun.
## Prepared References And Glossaries
Reuse the prepared-input and verified-reference paths introduced by the Audita
work. The four glossary collections remain shared domain inputs. Consumers may
use a subset or a saved domain projection; do not force every subprocess to
accept all four collections.
Notarius v0.9.0 retains text slots for `party`, `players`, and `glossary`, plus
the separate structured `spell_catalog` slot. It does not introduce four typed
glossary inputs. Preserve explicit selector-to-source mappings and verify source
content through the same paths used for execution.
The current `glossary` binding can continue to use
`narratio.input.glossary.campaign`. The canonical roster and players projection
remain separate from the party glossary. Decide whether a combined glossary
projection is useful in OD-4; do not create an automatic combination simply
because four collections exist.
Keep `narratio.input.spell_catalog` as the optional
[Notarius spell-catalog overlay](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.9.0/docs/integrations/dnd-spell-catalog-overlays.md).
That structured rules catalog has a different purpose and schema from the spells
glossary. Do not convert one into the other or infer a Notarius ruleset from a
Narratio reference-catalog system selector.
Generated same-run registry, scene, combat, and occurrence handoffs stay owned
by the Notarius pipeline. Narratio supplies only its configured external inputs.
## Preflight
Extend `internal/preflight` and the shared adapter wiring. Automatic checks run
after selected preparation and before processing when enabled extraction remains
to be executed. `session validate` checks enabled Notarius definitions against
existing prepared inputs independently of stage reuse. `session plan` remains
subprocess-free, and preflight does not create a successful stage record.
The native offline check is:
```text
notarius pipeline validate <pipeline_id> --config <config_path> [--overlay <selector>] --format json
```
It validates configuration, modules, and known pipeline/resource dependencies.
It needs no transcript, reference bytes, credentials, provider calls, or state
directory. A separate `config validate` call would duplicate configuration
acquisition without establishing provider readiness.
Use native `pipeline show` with the same configuration selection to verify that
Narratio's required lane IDs exist before processing begins. This is a check of
Narratio's output requirements against the public pipeline description, not a
reimplementation of downstream scheduling or validation. Actual output checks
remain authoritative after execution.
Two coverage limits must remain explicit:
1. `pipeline validate` does not accept run-time `--reference` bindings. It cannot
validate the exact invocation's selector bindings; a pipeline relying on CLI
files to satisfy required external slots can fail offline validation before
those bindings are supplied.
2. It does not verify credentials, completed provider targets, or model access.
Native `promptkit test` commands can probe explicitly selected profiles, but
v0.9.0 has no pipeline-aware provider readiness command equivalent to Audita's
full preflight. Pipeline inspection does not enumerate every completed target.
Use shared prepared-reference integrity checks where they apply. Do not supply
dummy references, rewrite downstream configuration, or build another pipeline
planner to disguise missing coverage. Do not treat an ordinary synthetic
Notarius run as an upstream readiness command: it executes real pipeline work.
OD-3 determines the supported readiness coverage and treatment of the binding
gap. Selected checks must preserve native failures; unsuccessful inspection must
not become a successful readiness result. Reports must distinguish offline
validation from live provider checks.
## Diagnostics
Capture the native completion report, invocation record, and stderr as Logs.
Reuse current stream limits and credential redaction. Keep structured stdout
separate from diagnostic streams; Narratio's display flags must not suppress the
machine report it needs to consume.
Support an enable-only `pipeline.notarius.debug` selector, coordinated with the
[workspace roadmap](workspace.md). True adds `--debug`; omission or false leaves
downstream capture policy unchanged. Supply an actual run-local `--debug-dir`
destination even when capture can be enabled through downstream configuration.
A destination alone does not enable native capture.
Debug remains optional, local, and private to Notarius. Do not depend on its file
names, parse its contents as a public API, or use its `latest` link to locate
outputs. Capture does not imply that arbitrary filesystem content is sanitized.
## Delivery And Validation
Update adapter contracts and tests together with extraction, configuration,
artifact evidence, preflight wiring, and manifest/publication consumers. Remove
obsolete receipt fixtures and assertions instead of preserving them alongside
the new protocol. Keep changes behind existing application and adapter boundaries.
Use focused tests at the production boundaries to establish:
- Native arguments, exact overlay forwarding, configured references, native
cache selection, forced refresh, and enable-only debug behavior.
- Successful report parsing and required domain-file resolution, including a
custom mapped lane ID, optional auxiliaries, missing/unsafe files, nonzero exit,
malformed stdout, and the fallback policy selected in OD-2.
- Durable promotion, subsequent artifact resolution/publication/restore, ordinary
reuse, changed-reference invalidation, and obsolete extraction evidence.
- Shared automatic and explicit preflight selection, preparation ordering,
missing required lane definitions, subprocess failures, and accurate reporting
of the coverage selected in OD-3.
Refresh the opt-in real Notarius boundary test for v0.9.0 using a controlled local
provider fixture. Exercise the maintained complete pipeline and native reuse
without making paid provider access a routine test prerequisite. Run focused
tests during development and the repository checks in [Development](../development.md)
before completing implementation.
Update the canonical integration, configuration, operations, internal, and
troubleshooting documents when behavior lands, together with maintained examples.
Release guidance must cover removed Narratio fields/output constraints, native
cache behavior, changed extraction evidence, and downstream Notarius configuration
version 6. Link to upstream migration guidance for resource composition,
producer modes, semantic correction turns, and concurrency. Narratio must not
translate those downstream settings or own their defaults.
Use v0.9.0 as the tested native integration baseline. Unsupported old interfaces
fail normally; no runtime version gate or compatibility fallback is required.
## Open Decisions
### OD-1: Required-output validation
**Recommendation:** keep each output's `lane_id` and existing safe, bounded JSON
and checksum checks; remove `media_type`, `schema_id`, `schema_version`, and
`module_key` descriptor constraints. Notarius no longer emits descriptors to
compare with them. Trust its native publication contract for domain validation.
This deliberately gives up publisher-attested schema/module matching. If Narratio
needs independent payload compatibility validation, identify the concrete
consumer requirement and supported schemas before adding it. Retaining those
fields as unchecked labels would provide false assurance; reproducing every
Notarius semantic validator would duplicate ownership.
### OD-2: Qualified fallback acceptance
**Recommendation:** honor native successful completion when the operator has
selected permissive behavior, subject to Narratio's required-file checks. Record
positive `fallback_count` and expose the qualification in ordinary extraction
results, including later reuse, rather than hiding it behind verbose output.
The count identifies fallback-emitting operations, not affected lanes or files.
Do not infer per-lane quality from it. Rejecting every qualified result is an
available stricter policy, but would override the operator's downstream choice.
Notarius's default strict mode remains its own default.
### OD-3: Readiness coverage for this release
**Recommendation:** adopt native offline validation, required-lane inspection,
and shared prepared-reference checks as a bounded first step, while explicitly
acknowledging that this does not satisfy the goal of checking every provider
credential before processing.
Decide whether that limited coverage is acceptable for this adoption, or whether
pipeline-aware upstream readiness is a prerequisite. An explicitly configured
set of native profile probes is another option, but duplicates profile selection
and cannot automatically promise complete coverage.
Also settle how to support pipelines whose required references are supplied
only through run flags. The maintained complete D&D pipeline passes native
offline validation, but that does not close the general binding gap. Do not
silently require all operator pipelines to duplicate those bindings in downstream
configuration or suppress failures that might represent real errors.
### OD-4: Glossary selection
**Recommendation:** retain explicit bindings and the existing campaign-glossary
example for the initial adoption. Decide whether extraction needs setting terms
or another combination in addition to campaign terms.
If it does, prepare and retain one named shared domain projection containing the
selected collections, using their canonical format and native composition rules.
Supply it through the existing text slot. Add only the projection needed by the
workflow, without a generic projection framework, bespoke collision policy, or
an upstream multi-glossary dependency.