Document the shared pipeline and verify the cutover
This commit is contained in:
@@ -19,8 +19,8 @@ focused stage documents.
|
||||
## Integration Contracts
|
||||
|
||||
- [Audita](./audita.md): transcript polishing (`audita process`).
|
||||
- [Notarius](./notarius.md): complete pipeline execution and safe JSON bundle
|
||||
discovery (`notarius run`).
|
||||
- [Notarius](./notarius.md): complete pipeline execution and safe JSON product
|
||||
promotion (`notarius run`).
|
||||
- [Party](./party.md): canonical campaign roster input.
|
||||
- [Seriatim](./seriatim.md): merge, normalize, trim, and render operations.
|
||||
- [Scriptorium](./scriptorium.md): artifact generation, prepared previews, and
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Integration: Audita
|
||||
|
||||
Narratio invokes Audita v4.2 for polishing. Its adapter supplies the prepared
|
||||
Narratio invokes Audita v4.3.0 for polishing. Its adapter supplies the prepared
|
||||
party, campaign, setting, and spells documents as repeated `--glossary-file`
|
||||
arguments, the merged transcript and requested output, and run-local report and
|
||||
work destinations. Optional config, overlay, profile, transcript-description,
|
||||
and output-schema selectors are forwarded only when set. `audita.debug: true`
|
||||
forwards `--debug`; false adds no debug override. Audita owns its
|
||||
configuration, ordered pipeline, profiles, and native discovery. Narratio does
|
||||
not generate a downstream configuration. See [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/config.md)
|
||||
and its [runtime glossary input contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/integrations/transcript-glossary-files.md).
|
||||
not generate a downstream configuration. See [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
||||
and its [runtime glossary input contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/transcript-glossary-files.md).
|
||||
|
||||
All four entry lists are supplied, including empty ones, and replace same-named
|
||||
Audita-configured lists. Other collections and omitted instruction fields retain
|
||||
native downstream composition. The [configuration reference](../config.md#glossary-inputs)
|
||||
Audita-configured lists. Other collections and configured instructions retain native downstream
|
||||
composition; shared collection extensions are data, not prompt guidance. The [configuration reference](../config.md#glossary-inputs)
|
||||
explains selection and migration of the prepared inputs.
|
||||
|
||||
After preparation, Narratio runs native Audita preflight when projected polish
|
||||
@@ -22,7 +22,7 @@ they can contact providers and destination probes can create directories.
|
||||
`session validate` uses existing prepared records and a validation probe
|
||||
namespace. A successful check is not a guarantee about later real-transcript
|
||||
processing or editorial quality. See [operations](../operations.md#prompt-requirements-preflight)
|
||||
and [Audita preflight](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/cli.md#preflight).
|
||||
and [Audita preflight](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/cli.md#preflight).
|
||||
|
||||
Each `pipeline.audita.credentials` value is an exact ConfigKit secret reference.
|
||||
Narratio forwards selected names and captured values in the child environment
|
||||
@@ -36,7 +36,7 @@ is accepted even when ordinary reports describe recoverable errors or no
|
||||
corrections. Narratio records available `errors.yml`, `recoveries.yml`, and
|
||||
`report.md` from the requested report directory as diagnostics, each subject
|
||||
to a 16 MiB bound. Reports may be absent when disabled. See Audita's
|
||||
[output contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/integrations/output-files.md).
|
||||
[output contract](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/integrations/output-files.md).
|
||||
|
||||
On nonzero exit, Narratio preserves the subprocess error and available run-local
|
||||
evidence and does not promote an incidental transcript. The generated invocation
|
||||
|
||||
@@ -1,205 +1,49 @@
|
||||
# Notarius Integration Contract
|
||||
|
||||
## Boundary
|
||||
|
||||
Narratio uses Notarius as a subprocess to extract configured structured JSON
|
||||
lanes from the final trimmed Seriatim transcript. Narratio owns invocation,
|
||||
safe bundle discovery, lane selection, and its own artifact metadata. Notarius
|
||||
owns pipeline definitions, lane schemas, the receipt, and bundle formats.
|
||||
|
||||
Canonical Notarius v0.8.1 references:
|
||||
|
||||
- [CLI reference](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/cli.md)
|
||||
- [Subprocess consumer contract](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/consumers/subprocess.md)
|
||||
- [D&D pipeline and lane contracts](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/consumers/dnd-pipeline.md)
|
||||
- [Run-result receipt](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/integrations/run-result.md)
|
||||
- [JSON output bundle](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/integrations/json-output.md)
|
||||
- [D&D spell-catalog overlay](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/integrations/dnd-spell-catalog-overlays.md)
|
||||
|
||||
The [complete Narratio example](../../examples/pipeline.full.annotated.yml)
|
||||
records the exact current constraints for all ten D&D lanes. Treat the linked
|
||||
Notarius documents as canonical when changing those values; Narratio does not
|
||||
duplicate the complete schemas.
|
||||
Narratio invokes a separately installed Notarius v0.10.0 executable and the
|
||||
operator's existing Notarius configuration and pipeline. Narratio does not build
|
||||
that configuration. The [Notarius consumer guide](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/consumers/dnd-pipeline.md)
|
||||
owns the maintained pipeline and [CLI](https://forge.maximumdirect.net/eric/notarius/src/tag/v0.10.0/docs/cli.md)
|
||||
owns its invocation and native output contracts. Controlled local-provider
|
||||
compatibility was exercised against commit `752c9b44d2c0bb3bfb1e02a5d4379f7cc5b6261e`.
|
||||
|
||||
## Invocation
|
||||
|
||||
When `pipeline.notarius.enabled` is true, Narratio resolves the executable,
|
||||
configuration path, input path, output directory, and working directory to
|
||||
absolute paths. Configured references require support for the `--reference`
|
||||
contract introduced in Notarius v0.6.0. Cache controls require support for the
|
||||
selected `--resume` and `--chunk_cache` flags. Notarius v0.8.1 is the tested
|
||||
cache integration baseline, not an unconditional minimum version; Narratio
|
||||
does not impose a runtime version gate. Each reference binding is a separate
|
||||
argument before `--json`. When `pipeline.notarius.config_overlay` is present,
|
||||
its exact value is another argument pair before `--json`:
|
||||
Narratio supplies `run <pipeline_id>`, `--config`, `--input-file`, `--output-dir`,
|
||||
`--debug-dir`, and `--format json`. It forwards an explicitly selected overlay,
|
||||
cache mode, and reference bindings; debug true requests capture. The configured
|
||||
child credentials are forwarded by exact name and captured streams are redacted.
|
||||
The same selected configuration, credentials, references and cache mode are used
|
||||
for native pipeline inspection and preflight. Preflight may contact providers and
|
||||
probe destinations; a synthetic transcript establishes readiness for that input
|
||||
only. See [operations](../operations.md#prompt-requirements-preflight).
|
||||
|
||||
```text
|
||||
notarius run <pipeline_id> --config <config_path> --input <trimmed_json> --output-dir <staging_dir> [--resume] [--chunk_cache <mode>] [--reference <selector>=<verified_snapshot_path>]... [--config-overlay <name>] --json
|
||||
```
|
||||
|
||||
Notarius v0.8.1 is a known supporting version for `--config-overlay`; using the
|
||||
option requires a compatible Notarius executable, but deployments that omit the
|
||||
field acquire no additional version requirement. Omitted or null configuration
|
||||
adds no flag. Supplied empty, `default`, and named selectors are forwarded
|
||||
without normalization so Notarius can apply its own ConfigKit semantics. This
|
||||
option selects a Notarius configuration overlay, not a PromptKit profile through
|
||||
`--llm-profile`, and Narratio never substitutes its own selected overlay name.
|
||||
A missing or invalid downstream overlay is an ordinary Notarius subprocess
|
||||
failure: Narratio does not retry without the selector or fall back to another
|
||||
overlay.
|
||||
|
||||
Reference paths are absolute stable snapshots streamed from manifest-verified
|
||||
canonical files prepared inside the current Narratio session workspace. They
|
||||
live at `cache/notarius/references/<sha256>/<prepared-basename>` and retain the
|
||||
full lowercase content digest. Narratio verifies snapshot checksum and size
|
||||
before and after the subprocess, reconstructs missing or corrupt regular files
|
||||
from a still-valid prepared source, and passes only configured bindings,
|
||||
ordered lexically by normalized selector, as direct argument-vector entries
|
||||
without shell interpretation. Symlinks, directories, other non-regular
|
||||
conflicts, and prepared-source mismatches fail rather than being deleted. A CLI
|
||||
binding takes precedence over a matching external path in Notarius
|
||||
configuration. Narratio never emits `--without-reference`.
|
||||
|
||||
For canonical party configuration, the `party` binding is the unchanged,
|
||||
validated authored roster and the `players` binding is its generated
|
||||
projection. Both retain their established `narratio.input.party` and
|
||||
`narratio.input.players` source IDs, and both are resolved from the prepared
|
||||
manifest rather than from campaign configuration at extraction time.
|
||||
|
||||
The `glossary` slot may bind `narratio.input.glossary.campaign`; the four
|
||||
prepared glossary sources are explicit and the retired monolithic source is
|
||||
not an alias. The separate Notarius spell-catalog overlay remains unchanged.
|
||||
|
||||
The maintained D&D boundary binds only the four campaign-owned external slots:
|
||||
|
||||
```text
|
||||
notarius run dnd-session \
|
||||
--config <absolute config path> \
|
||||
--input <absolute trimmed transcript path> \
|
||||
--output-dir <absolute staging directory> \
|
||||
--reference glossary=<absolute verified glossary snapshot> \
|
||||
--reference party=<absolute verified party snapshot> \
|
||||
--reference players=<absolute verified players snapshot> \
|
||||
--reference spell_catalog=<absolute verified spell catalog snapshot> \
|
||||
--json
|
||||
```
|
||||
|
||||
The spell-catalog binding is omitted when the campaign does not maintain that
|
||||
optional overlay. Registry, scene-description, combat-turn, and occurrence
|
||||
handoffs generated during the same Notarius run remain in Notarius pipeline
|
||||
composition and must not be emitted as CLI references. The linked CLI and D&D
|
||||
consumer documents own selector targeting, declared slots, media compatibility,
|
||||
and generated-handoff collision rules.
|
||||
|
||||
Standard output is reserved for the JSON receipt. Standard error is captured
|
||||
separately as diagnostic output. Narratio applies the configured timeout and
|
||||
does not interpret stdout as a receipt unless the subprocess exits successfully.
|
||||
It does not pass a Narratio session ID or run `notarius config validate`
|
||||
automatically; the configured working directory and Narratio's minimal child
|
||||
environment apply to the subprocess.
|
||||
|
||||
Ordinary extraction maps `pipeline.notarius.resume: true` to `--resume` and a
|
||||
nonempty `pipeline.notarius.chunk_cache` to `--chunk_cache <mode>`. Forced
|
||||
extraction always omits `--resume` and supplies `--chunk_cache refresh`.
|
||||
Notarius owns checkpoint enablement, recording, identity, and both cache roots;
|
||||
Narratio neither reads nor synthesizes its configuration. Use explicit
|
||||
persistent roots in Notarius when reuse must span subprocess invocations.
|
||||
Changing a reference path/digest or other upstream identity input correctly
|
||||
causes a cold miss. Chunk refresh bypasses lookup and publishes the accepted
|
||||
replacement for the active source; it does not delete unrelated plans or
|
||||
checkpoint state.
|
||||
|
||||
When `pipeline.notarius.credentials` is absent, null, or empty, Narratio adds no
|
||||
credentials to that environment. When configured, each list entry names an
|
||||
environment variable whose already-loaded nonempty value is forwarded under
|
||||
that exact name. Operators must use the names referenced by the selected
|
||||
Notarius/PromptKit providers. Narratio does not inspect the Notarius configuration
|
||||
to infer providers or destination names, and it does not forward unrelated
|
||||
credentials from its parent environment or secrets directory. A Narratio
|
||||
overlay replaces the whole credential list; `[]` clears it.
|
||||
|
||||
Every selected name is registered with Narratio's shared streaming redactor.
|
||||
Credential bytes written by the child to captured stdout, captured stderr, or
|
||||
stderr-derived failure diagnostics are replaced with `<redacted>`, including
|
||||
custom names not known to the built-in sensitive-name list. Narratio does not
|
||||
serialize the credential into arguments, stage metadata, manifests, or
|
||||
generated configuration.
|
||||
|
||||
This captured-stream protection is not a filesystem sandbox. Notarius remains
|
||||
responsible for keeping credentials out of files it writes directly, including
|
||||
bundle artifacts and its own diagnostics. Narratio does not scan or rewrite
|
||||
arbitrary downstream files and cannot promise redaction of transformed or
|
||||
encoded credentials.
|
||||
The prepared shared roster can bind to `party`; the combined shared glossary can
|
||||
bind to both `glossary` and `spell_catalog`. Notarius owns collection selection,
|
||||
D&D recognition, its configuration and caches. See [configuration](../config.md#notarius-reference-bindings).
|
||||
Narratio stage reuse and Notarius cache reuse are separate. Forced extraction
|
||||
requests native cache refresh.
|
||||
|
||||
## Accepted Result
|
||||
|
||||
Narratio's tested invocation baseline is Notarius v0.8.1. The accepted
|
||||
receipt remains `notarius.run-result.v2`; reference flags do not change the
|
||||
receipt or ten-lane output contract. The receipt
|
||||
must identify the configured pipeline, and its `index_file` must be exactly
|
||||
`index.json` beneath the reported bundle root. The production index must name
|
||||
the management files exactly as `manifest.json`, `rejected.json`,
|
||||
`warnings.json`, and `diagnostics.json`. All receipt, index, and lane paths must
|
||||
stay inside that bundle; symlinks and non-regular lane payloads are rejected.
|
||||
After a successful exit, Narratio reads the native JSON completion report, checks
|
||||
its pipeline and confined output directory, and validates each configured
|
||||
`lanes/<lane-id>.json` as a safe regular JSON file. It promotes those required
|
||||
lanes to flat session artifacts and records content evidence. The reported
|
||||
`artifact_count` can include reused or auxiliary results; it is not an inventory.
|
||||
Optional `chunk-map.json` and `evidence-context.json` stay with the retained
|
||||
original bundle. A positive native `fallback_count` remains visible in fresh and
|
||||
reused reports.
|
||||
|
||||
Supported receipt and index shapes tolerate unknown fields for forward
|
||||
compatibility, while required identity, validation, count, manifest,
|
||||
rejection, warning, diagnostic, and lane-list fields remain mandatory.
|
||||
Narratio applies bounded reads to the receipt, index, rejection, warning, and
|
||||
diagnostic documents. Warning and diagnostic envelopes, group counts,
|
||||
occurrence counts, truncation state, framework-owned origins, and
|
||||
receipt-to-bundle counts must be internally consistent. Optional chunk-map and
|
||||
evidence-context descriptors must carry their complete generic contract
|
||||
metadata when present.
|
||||
|
||||
For every entry in `pipeline.notarius.outputs`, Narratio requires exactly one
|
||||
index descriptor with the configured lane ID, media type, schema ID, schema
|
||||
version, and, when configured, module key. Missing, duplicate, rejected, or
|
||||
incompatible required lanes fail extraction even if Notarius exited zero. A
|
||||
configured lane whose v2 validation summary is `rejected` or `incomplete` also
|
||||
fails extraction.
|
||||
An accepted reused producer may report `producer_attempt_count: 0`; Narratio
|
||||
preserves that valid summary rather than treating it as a missing field.
|
||||
Unconfigured lanes may remain in the preserved bundle but do not become
|
||||
selectable Narratio sources.
|
||||
|
||||
Each accepted configured lane is registered as
|
||||
`narratio.extraction.<output_key>`. The bundle index is retained for audit and
|
||||
resume validation but is not selectable. Scriptorium and publish rules consume
|
||||
only explicitly named lane sources; `--artifacts` never selects Notarius lanes.
|
||||
|
||||
## Failure And Compatibility Behavior
|
||||
|
||||
- Startup and nonzero-exit errors fail extraction and retain captured diagnostics.
|
||||
- Invalid receipt JSON or an unsupported receipt schema fails before bundle use.
|
||||
- Unsafe or incompatible index data and required-lane rejection fail before the
|
||||
staged bundle is promoted to durable storage.
|
||||
- Contract and external provenance metadata are preserved on lane artifact
|
||||
records and through explicit publication.
|
||||
- Undeclared selectors, incompatible reference files, and external/generated
|
||||
reference collisions are Notarius errors and fail extraction normally.
|
||||
|
||||
Rejection, validation, warning, and diagnostic summaries retain bounded stable
|
||||
identity, category, origin, reason-code, status, and occurrence fields without
|
||||
copying free-form external messages into Narratio manifest metadata or reading
|
||||
lane payload bodies.
|
||||
|
||||
Configuration fields and defaults are in [Configuration](../config.md).
|
||||
Operator paths, rerun procedures, and bundle retention are in
|
||||
[Operations](../operations.md). See [Troubleshooting](../troubleshooting.md)
|
||||
for failure recovery.
|
||||
Nonzero exit, malformed completion, unsafe output, or a missing required lane
|
||||
fails extraction. Diagnostics and available files remain for investigation; an
|
||||
incidental file or partial report does not establish success. See
|
||||
[extraction operations](../operations.md#extraction-workflow).
|
||||
|
||||
## Opt-in Integration Test
|
||||
|
||||
The production-boundary cache test requires an absolute path to a locally
|
||||
built Notarius v0.8.1-compatible executable. It uses only a local
|
||||
OpenAI-compatible `httptest` provider and temporary cache/config/output roots:
|
||||
|
||||
```sh
|
||||
NARRATIO_TEST_NOTARIUS_BINARY=/absolute/path/to/notarius \
|
||||
GOWORK=off go test ./internal/stage \
|
||||
-run '^TestNotariusCacheReuseIntegration$' -count=1 -v
|
||||
```
|
||||
|
||||
When the variable is unset, the normal test suite skips this test and never
|
||||
searches `PATH`, a sibling checkout, the network, or a real provider.
|
||||
The [catalog compatibility script](https://forge.maximumdirect.net/eric/narratio-reference-catalog/src/commit/016473fd16b15847f3e913670c423faa7c35720b/scripts/check-compatibility.sh)
|
||||
accepts explicit Narratio and Notarius checkouts and Audita and Notarius binary
|
||||
paths. It uses a controlled local provider and verifies readiness, the ten-lane
|
||||
pipeline, flat promotion, cache reuse, and forced refresh. Ordinary tests skip
|
||||
external binaries.
|
||||
|
||||
Reference in New Issue
Block a user