Document shared glossaries and downstream preflight

This commit is contained in:
2026-11-27 17:09:21 +00:00
parent 8b9c0e664b
commit 0de73ba25f
22 changed files with 297 additions and 300 deletions

View File

@@ -32,19 +32,19 @@ narratio session init 2026-04-04 --remote --force
If `campaign.yml` sets `session_template_file`, `session init` renders it. Template variables must resolve to concrete values.
Campaigns must provide stable input files for speakers, autocorrect, glossary,
players, and party, and may provide an optional spell-catalog overlay. Session
files may override those paths for one session. The `prepare` stage
materializes them under `inputs/`; configured consumers use the prepared files,
never the original campaign or session source paths. Field definitions and
source IDs are in [Configuration](./config.md#notarius-reference-bindings).
Campaigns provide speakers, autocorrect, and a canonical party; players are
derived from that roster. Glossary selections and the separate spell-catalog
overlay are optional. Preparation writes the shared glossary documents and
other stable inputs under `inputs/`; consumers use verified prepared files.
See [glossary inputs](config.md#glossary-inputs) for selections and sources.
## Standard Session Workflow
1. Select pipeline/campaign/session config.
2. Validate session readiness:
2. Prepare inputs, then validate session readiness:
```bash
narratio run 2026-04-04 --stage prepare
narratio session validate 2026-04-04
```
@@ -82,22 +82,21 @@ comparison details.
### Prompt requirements preflight
Install Scriptorium v0.16.0 and migrate its configuration and prompt definitions
using the [upstream migration guide](https://forge.maximumdirect.net/eric/scriptorium/src/tag/v0.16.0/docs/consumers/upgrading-cli.md).
It must be available before a run whose projected work needs trim or analysis,
and for validation of enabled definitions. Narratio checks requirements before
stage attempts, even when generated transcripts do not yet exist. The check
makes no model call and cannot certify later file contents or generation.
After selected preparation completes or is reused, Narratio checks downstream
work projected to run before processing continues. Audita preflight uses the
prepared glossary files, a synthetic transcript, and the selected Audita
configuration; its native provider smoke checks are enabled. Scriptorium
requirements discovery checks projected trim and analysis bindings. A missing
required binding or failed check stops the invocation; incomplete or conditional
prompt discovery can produce warnings. Already completed work remains recorded.
`session plan` does not invoke these downstream checks.
A missing required prompt binding or variable, or a failed inspection, stops
the invocation. Correct the configuration or downstream installation and retry.
An optional source for a required prompt input and incomplete or conditional
discovery are warnings; later input resolution remains authoritative. Early
preflight failure leaves completed stage records and artifact outputs intact,
including during a forced run. `session plan` reports projected work without
invoking Scriptorium. See the [integration contract](integrations/scriptorium.md)
for stream handling and [configuration](config.md#scriptorium-artifact-entries)
for binding names and sources.
`session validate` checks enabled downstream definitions against existing
prepared glossary records. It does not prepare inputs. Its Audita probe uses a
`runs/.validation` destination namespace, may create or probe directories and
may contact configured providers. The synthetic check establishes readiness for
that probe, not feasibility for a real transcript or editorial quality. See
[Audita](integrations/audita.md) and [Scriptorium](integrations/scriptorium.md).
## Stage Execution and Continuation Behavior
@@ -138,8 +137,8 @@ its fixed descendants without requiring `--force`. Changing prepare selection
semantics likewise reruns all fixed descendants; changing
WhisperX language/service identity reuses prepare; changing a Seriatim merge
transformation reuses prepare and transcribe; and changing a selected Audita
overlay, profile, or module sequence reuses prepare, transcribe, and merge while
rebuilding transcript refinement. A trim change invalidates both render and
overlay or profile reuses prepare, transcribe, and merge while rebuilding
transcript refinement. A trim change invalidates both render and
extract through the fixed dependency relation, while a render-only change
preserves the extract sibling.
@@ -317,26 +316,12 @@ Select the Narratio file with `--overlay testing` on the desired command. Each
downstream selector is used only when its stage actually executes: `polish` for
Audita and `extract` for Notarius. Production can omit both selectors.
For Audita debug inspection, its testing overlay can include:
```yaml
diagnostics:
debug: true
work_dir: /path/to/audita-debug
```
Audita retains detailed artifacts under that directory. Inspect them there;
Narratio does not collect or manage them. Ordinary Audita reports remain a
separate existing integration. Leave debug disabled in Audita's production
configuration unless deliberately needed.
Notarius's debug controls are different: `debug.directory` selects a location
but does not enable capture. Capture requires its `--debug` flag, which Narratio
does not currently forward. Selecting a Notarius testing overlay therefore does
not by itself enable a debug bundle. See the upstream
[Audita configuration](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.1/docs/config.md)
and [Notarius CLI](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/cli.md)
for their respective controls.
Audita's selected configuration controls whether detailed debug capture is
requested. Narratio supplies the run-local `polish/debug` work destination and
the separate `polish/logs` report destination. Notarius's debug directory does
not enable capture; its `--debug` flag is not currently forwarded by Narratio.
See the upstream [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/config.md)
and [Notarius CLI](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.8.1/docs/cli.md).
Edits inside downstream configuration behind an unchanged selector are not
automatically detected by Narratio. To inspect a fresh Audita debug run, explicitly
@@ -413,8 +398,8 @@ are not selectable or published implicitly.
Configured Notarius references resolve only from the current manifest-backed
prepared inputs. Their canonical locations are `inputs/party.yml`,
`inputs/players.yml`, `inputs/glossary.yml`, and, when configured,
`inputs/spell_catalog.json`. Extraction supplies Notarius with verified,
`inputs/players.yml`, the four `inputs/glossaries/{party,campaign,setting,spells}.yml`
files, and, when configured, `inputs/spell_catalog.json`. Extraction supplies Notarius with verified,
content-addressed copies under
`cache/notarius/references/<sha256>/<prepared-basename>`. The full lowercase
SHA-256 digest identifies the reference bytes, so retries and later invocations
@@ -504,55 +489,30 @@ by migration of the restored local manifest before using the new version.
## Migrating Audita and Provider Credentials
This is a breaking clean cutover to Audita v2. Narratio does not translate an
Audita v1 configuration, retain old field aliases, or generate a downstream
configuration. Update both the deployed Audita executable/configuration and
the Narratio pipeline before running polish. Retired Narratio fields are
rejected by strict configuration loading; account for this break when choosing
a release version.
Install Audita v4.2 and its own configuration and selected pipeline before
running polish. Move ordered processing configuration into Audita; remove the
retired Narratio `pipeline.audita.modules` field. Update every old
`narratio.input.glossary` binding to the intended explicit glossary source and
rewrite legacy glossary files into the named-collection format. Narratio does
not translate these settings or files. Install a catalog separately when using
setting or system selections; see [glossary inputs](config.md#glossary-inputs).
| Previous Narratio setting | New ownership and selection |
| --- | --- |
| `audita.base_url` | Audita v2 `backends.<id>.endpoint` |
| `audita.total_llm_concurrency`, `proposal_llm_concurrency`, `validation_llm_concurrency` | Audita v2 `backends.<id>.concurrency` and optional `queue_capacity`; backend capacity is shared across roles |
| `audita.model`, `validation_model` | Audita PromptKit profile files; optionally select them from Narratio with `audita.proposal_profile` and `validation_profile` |
| `audita.llm_api_key` | `audita.credentials: [PROVIDER_KEY_NAME]`, matching each Audita backend's `credential` name |
| `notarius.llm_api_key` | `notarius.credentials: [PROVIDER_KEY_NAME]`, matching references in Notarius-owned profiles |
| `audita.work_dir_retention`, `report` | Remove; Audita's external configuration owns diagnostics and reporting |
List each downstream provider's exact environment-variable name in
`audita.credentials`; Narratio passes resolved values to Audita and does not
infer names or generate the downstream configuration. `audita.config_path`
and `audita.overlay` select Audita's configuration independently of Narratio's
overlay. Consult [Audita's configuration guide](https://forge.maximumdirect.net/eric/audita/src/tag/v4.2.0/docs/config.md).
Operators can install the independently maintained [D&D recipes](https://forge.maximumdirect.net/eric/audita-pipelines-dnd/src/commit/6d5e66dcfca4bb5971a8423332a19ce884b846c0/README.md)
and select their production or testing overlays explicitly; Narratio does not
bundle those recipes or infer a downstream selection.
An Audita configuration can also be selected through `audita.config_path`,
and `audita.overlay` selects an Audita overlay independently of Narratio's
`--overlay`. Narratio forwards no implicit provider key: a single provider-named
secret source may be listed for both adapters, and an Audita-only backend key
may be listed only for Audita. Audita resolves credentials for all configured
backends, including those not currently selected. Notarius looks up its own
profiles; Narratio does not discover their credential names. Credential lists
may be cleared with `[]` in a Narratio overlay.
Prepare the external file from Audita's maintained
[local example](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/examples/minimal-config.yml),
[service example](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/examples/production-config.yml),
and [v2 migration guide](https://gitea.maximumdirect.net/eric/audita/src/tag/v2.0.0/docs/migrations/v2.md).
Before switching the executable, validate the file offline:
```bash
audita config validate --config /usr/local/etc/audita/config.yml
```
Use `audita config print-effective --config /usr/local/etc/audita/config.yml --view profiles`
to inspect downstream profile selection without contacting a provider. For a
production Audita configuration, leave ordinary reports enabled
and debug disabled unless an operator deliberately chooses otherwise; Narratio
does not override those settings. Audita writes `errors.yml`, `recoveries.yml`,
and `report.md` beside the polished output when reporting is enabled. An
exit-zero run with a valid transcript succeeds even if those reports describe
recoverable errors or no applied corrections. See the [Audita integration
contract](./integrations/audita.md) for report placement and limits.
Narratio's polish resume evidence tracks selected config path, Audita overlay,
profiles, ordered modules, description, schema, and output identity. Editing
Audita-owned files behind unchanged selectors is invisible to Narratio; force
polish with `narratio run <session-id> --stage polish --force` after such edits.
Preparation compares effective vocabulary and prepared evidence when deciding
reuse. If it changes, normal preparation invalidation applies; use
`narratio run <session-id> --stage prepare --force` when regeneration is needed.
Polish tracks its selected configuration and prepared glossary evidence, but
does not inspect the contents of Audita-owned files. Force polish after changing
those files behind unchanged selectors. Reports and debug destinations are
run-local; see the [Audita integration contract](integrations/audita.md).
## External Command Lifecycle
@@ -572,9 +532,8 @@ separately without redaction; see its [integration contract](integrations/script
Run-local diagnostics are:
- `runs/{run_id}/polish/outputs/transcripts/errors.yml`,
`recoveries.yml`, and `report.md` when Audita writes them beside its
run-local polished transcript
- `runs/{run_id}/polish/logs/{errors.yml,recoveries.yml,report.md}` when
Audita reporting is enabled, alongside captured streams and invocation records
- `runs/{run_id}/extract/notarius.receipt.json`
- `runs/{run_id}/extract/notarius.stderr.log`
- `runs/{run_id}/extract/notarius-output/` before durable promotion
@@ -589,7 +548,7 @@ current-run diagnostics uploads no run-local files. No distinguished diagnostic
file is uploaded. The durable bundle is never scanned for implicit publication;
only lanes named by explicit `pipeline.publish.outputs` rules are uploaded.
To inspect a published polish report remotely, read its declared object under
the run archive's `polish/outputs/transcripts/` prefix. Session restore does
the run archive's `polish/logs/` prefix. Session restore does
not restore run-archive diagnostics as canonical session files; it restores only
the committed manifest and declared transcript/artifact objects.
@@ -796,6 +755,8 @@ Run-local layout:
- `runs/{run_id}/{stage}/reports`
- `runs/{run_id}/{stage}/config`
- `runs/{run_id}/{stage}/scratch`
- `runs/{run_id}/polish/debug` for Audita's selected work destination
- `runs/.validation/polish` for validation probes
Spool layout (runtime/transient):