749 lines
37 KiB
Markdown
749 lines
37 KiB
Markdown
# Operations Guide
|
|
|
|
Operator workflow for running, recovering, and publishing Narratio sessions.
|
|
|
|
For command syntax, see [docs/cli.md](./cli.md). For field-level config, see [docs/config.md](./config.md).
|
|
|
|
## Campaign and Session Selection
|
|
|
|
Identity and exact-file selection are complementary: a selected file supplies
|
|
configuration and an explicit ID asserts its effective identity. Session domain
|
|
commands take positional identity; `--session-file` selects its source. An
|
|
explicit `--party-file` supplies the roster consistently across consumers.
|
|
See [CLI selectors](cli.md#configuration-selectors) and
|
|
[configuration discovery](config.md#discovery-and-selection) for selection rules.
|
|
Existing scripts should follow the [CLI migration table](cli.md#migration-from-the-previous-cli).
|
|
|
|
## Session Initialization
|
|
|
|
Use `session init` to generate a concrete session file for local or remote use.
|
|
|
|
Local file:
|
|
|
|
```bash
|
|
narratio session init 2026-04-04 --output ./session.yml --date 2026-04-04 --title "Session 12"
|
|
```
|
|
|
|
Remote session object:
|
|
|
|
```bash
|
|
narratio session init 2026-04-04 --remote --force
|
|
```
|
|
|
|
Installation config supplies services, credentials, and an optional reference
|
|
catalog. Onboard a campaign with [campaign.yml](../examples/campaigns/lantern-coast/campaign.yml),
|
|
[party.yml](../examples/campaigns/lantern-coast/party.yml), and
|
|
[speakers.yml](../examples/campaigns/lantern-coast/speakers.yml). The campaign
|
|
selects its roster, speakers, optional catalog sources, inline vocabulary and
|
|
replacement rules. The roster describes characters and players; speaker mapping
|
|
separately describes recordings. The example uses synthetic catalog data.
|
|
|
|
`session init` uses a campaign template if configured, otherwise the installation
|
|
template or built-in default. Supply session audio and metadata, for example:
|
|
|
|
```bash
|
|
narratio session init 2026-04-04 --output ./session.yml --audio-dir ./audio
|
|
```
|
|
|
|
Preparation resolves the roster, rules, and vocabularies into standalone inputs.
|
|
See [Configuration](config.md#campaign) for fields, inheritance and clearing.
|
|
|
|
## Migrating to the shared pipeline
|
|
|
|
Before upgrading an existing deployment, retain its authored sources and any
|
|
committed snapshots. Convert campaign identity and inputs to the shared campaign
|
|
fields and Narratio extension in [Configuration](config.md#campaign); replace
|
|
file-based autocorrection with inline rules and the private spell source with a
|
|
shared glossary. Reauthor wrapperless vocabularies as shared envelopes. Remove
|
|
retired spool/audio-cache settings, Notarius descriptor fields, `resume`, and
|
|
`chunk_cache`; select native `cache` and optional debug controls as needed.
|
|
Keep external tool configuration under each tool's ownership: Audita uses its
|
|
version 3 configuration and Notarius its version 6 configuration. Consult the
|
|
[Audita](integrations/audita.md) and [Notarius](integrations/notarius.md)
|
|
contracts for their upstream guides.
|
|
|
|
Move unsupported local state aside before regenerating it; restore only a
|
|
supported committed session manifest, or regenerate and republish. Do not edit
|
|
state markers manually. Products now use flat session paths and diagnostics use
|
|
latest-attempt views; explicit remote destinations remain independent. Review
|
|
cleanup and separately configured subprocess caches before removing old state.
|
|
This guidance does not create a release or publish any changes.
|
|
|
|
## Standard Session Workflow
|
|
|
|
1. Select pipeline/campaign/session config.
|
|
2. Prepare inputs, then validate session readiness:
|
|
|
|
```bash
|
|
narratio run 2026-04-04 --stage prepare
|
|
narratio session validate 2026-04-04
|
|
```
|
|
|
|
3. (Optional) inspect stage decisions:
|
|
|
|
```bash
|
|
narratio session plan 2026-04-04
|
|
```
|
|
|
|
4. Run the pipeline:
|
|
|
|
```bash
|
|
narratio run 2026-04-04
|
|
```
|
|
|
|
5. Check state:
|
|
|
|
```bash
|
|
narratio session status 2026-04-04
|
|
```
|
|
|
|
Status distinguishes currently resolved configuration provenance from the last
|
|
persisted configuration, helping diagnose overlay switches without changing
|
|
semantic resume authority. Run and plan reports describe execution and decisions;
|
|
see the [report fields](cli.md#public-domain-report-fields).
|
|
|
|
Before switching an operational overlay, compare its effective configuration
|
|
with the base through `narratio config diff --against-overlay NAME`. When using an
|
|
explicit root, supply it with both `--config` and `--against-config`. Each side
|
|
loads independently using its own defaults. Native inspection retains authored
|
|
family declarations; use `narratio artifacts list` to review concrete identities,
|
|
outputs, dependencies, and selected-party members. See
|
|
[configuration inspection](cli.md#configuration-inspection) for selection and
|
|
comparison details.
|
|
|
|
### Prompt requirements preflight
|
|
|
|
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. Notarius inspection
|
|
and preflight use its configured pipeline and the verified transcript when available,
|
|
or a synthetic transcript otherwise. Both may contact providers. 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.
|
|
|
|
`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
|
|
|
|
Canonical stage order:
|
|
|
|
1. `prepare`
|
|
2. `transcribe`
|
|
3. `merge`
|
|
4. `polish`
|
|
5. `normalize`
|
|
6. `trim`
|
|
7. `render`
|
|
8. `extract`
|
|
9. `analyze`
|
|
10. `publish`
|
|
11. `notify`
|
|
12. `cleanup`
|
|
|
|
Execution rules:
|
|
|
|
- succeeded stages are skipped unless `--force` is set; stages with semantic
|
|
configuration contracts additionally require matching versioned evidence;
|
|
- `run` continues interrupted or partially completed sessions by running non-succeeded stages;
|
|
- forcing a stage marks succeeded transitive dependents as `stale` before the
|
|
replacement runs; render and extract are independent siblings; and
|
|
- an executed failure, changed self-skip, or success that replaces a different
|
|
effective outcome uses the same fixed dependency relation. A
|
|
repeated self-skip with the same reason and no outputs is stable and does not
|
|
perpetually rerun dependent work.
|
|
|
|
Every aggregate stage except analyze currently provides semantic-configuration
|
|
evidence; transcribe additionally reconciles per-speaker completion evidence,
|
|
while analyze retains its more precise per-artifact fingerprints and validator.
|
|
Prepare additionally validates current stable/local/S3 source identity and the
|
|
checksums of its durable prepared copies before reuse. Changed bytes, audio
|
|
membership, S3 object identity, or missing/tampered copies rerun prepare and
|
|
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 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.
|
|
|
|
Operational timeouts, retry/concurrency tuning, executable paths,
|
|
workspace placement, reports, diagnostics, and secret values are
|
|
excluded. Configuration, models, prompts, modules, or resources loaded
|
|
privately inside external tools remain unobservable to Narratio. If their
|
|
contents change behind the same configured identifier, explicitly force the
|
|
affected stage.
|
|
|
|
An explicit self-skip is a durable `skipped` stage outcome that later runs
|
|
reconsider. It differs from successful no-output execution: disabled `render`
|
|
and `publish`, and absent or no-executable `analyze`, record `succeeded` with
|
|
metadata and no outputs. Ordinary later runs reuse those successful results;
|
|
force the affected stage after enabling or configuring it. Optional artifact
|
|
inputs are omitted only from the consuming artifact invocation and do not make
|
|
the stage self-skip.
|
|
|
|
Single-stage execution:
|
|
|
|
```bash
|
|
narratio run 2026-04-04 --stage normalize --force
|
|
```
|
|
|
|
Contiguous bounded execution uses inclusive canonical endpoints:
|
|
|
|
```bash
|
|
narratio session plan 2026-04-04 --from extract --through analyze --force
|
|
narratio run 2026-04-04 --from extract --through analyze --force
|
|
```
|
|
|
|
Omitting `--from` selects from `prepare`; omitting `--through` selects through
|
|
`cleanup`. Force applies only within the selected range. Repeating `--from`,
|
|
`--through`, or `--force` is rejected instead of resolving by argument order.
|
|
The plan command uses the same selection contract and prints only the selected
|
|
range. Planning is read-only: it clones the loaded manifest, models selected
|
|
stage transitions and invalidation in memory, and invokes resume validation
|
|
without writing the manifest, creating run directories, materializing files,
|
|
or invoking pipeline adapters. Analyze detail separates explicit targets,
|
|
prerequisite rebuilds, scheduled execution, and current reuse. This lets a
|
|
coarsely stale aggregate analyze stage show zero artifact executions when its
|
|
selected artifact evidence is still semantically current.
|
|
|
|
Before a bounded run or plan whose range starts after `prepare`, every excluded
|
|
prefix stage must already have a session-manifest status of `succeeded` or
|
|
`skipped`. Narratio reports the first absent, pending, running, failed, stale,
|
|
or interrupted prerequisite without creating a run-local directory or changing
|
|
session state. Widen `--from` to include that stage, or recover it explicitly
|
|
before retrying. Excluded prefix stages are not resume-validated or repaired as
|
|
part of the bounded invocation; selected stages still reject missing, unsafe,
|
|
or manifest-inconsistent inputs at their owning boundary.
|
|
|
|
Stages after `--through` are not prerequisites and are never scheduled by the
|
|
bounded invocation. A selected forced stage can mark one of those succeeded
|
|
dependents stale through the fixed invalidation relation, but the dependent
|
|
does not execute until a later invocation selects it. Production composition
|
|
likewise initializes only collaborators needed by the selected range and
|
|
shared session lifecycle. In particular, render does not require Notarius or
|
|
Scriptorium, extract does not require Scriptorium, and analyze does not require
|
|
the transcription, Seriatim, Audita, or Notarius adapters.
|
|
|
|
### Transcription continuation and replacement
|
|
|
|
Transcribe checkpoints each validated speaker independently. If a later
|
|
speaker exhausts HTTP retries, the process is canceled, or the aggregate stage
|
|
save fails, the aggregate stage is not successful and downstream merge cannot
|
|
consume the partial set. The last successfully saved speaker records and their
|
|
canonical `transcripts/raw/<speaker>.json` files remain durable, however.
|
|
|
|
After correcting the underlying problem, retry normally:
|
|
|
|
```bash
|
|
narratio run 2026-04-04 --stage transcribe
|
|
```
|
|
|
|
Narratio hashes the current prepared audio, validates recorded transcript JSON,
|
|
checksum, size, and location, and calls WhisperX only for missing or obsolete
|
|
speakers. A changed audio file replaces only its speaker; a changed WhisperX
|
|
URL or language makes every current speaker non-reusable. Retry, timeout, and
|
|
concurrency tuning do not invalidate completed speakers.
|
|
|
|
Use force only when every current transcript must be replaced, including after
|
|
a WhisperX model or private server-side configuration changes behind the same
|
|
URL and language:
|
|
|
|
```bash
|
|
narratio run 2026-04-04 --stage transcribe --force
|
|
```
|
|
|
|
Force durably clears the reusable collection before sending requests. If that
|
|
forced attempt fails, a later ordinary retry reuses only replacement speakers
|
|
checkpointed after the reset; it does not revive pre-force results. Do not edit
|
|
speaker checksums or copy older JSON into the canonical directory to influence
|
|
reuse.
|
|
|
|
The first current Narratio invocation that selects transcribe for an older
|
|
aggregate-only manifest retranscribes every current speaker once because the
|
|
old record cannot prove which audio bytes produced each file. Subsequent runs
|
|
reuse the new versioned evidence normally. The overall session-manifest schema
|
|
identifier is unchanged, but older strict-decoding Narratio binaries may reject
|
|
a manifest after current Narratio writes the additive speaker fields; retain a
|
|
backup or complete the upgrade before relying on downgrade.
|
|
|
|
Restoring a manifest does not implicitly publish or restore every raw speaker
|
|
file. If a recorded canonical transcript is absent locally, ordinary
|
|
reconciliation schedules that speaker again. Removing run directories does not
|
|
remove canonical checkpointed transcripts and does not by itself invalidate
|
|
them.
|
|
|
|
## Artifact Development Workflows
|
|
|
|
Choose the narrowest workflow that matches the intended replacement:
|
|
|
|
| Intent | Command | Preserved and rebuilt state |
|
|
| --- | --- | --- |
|
|
| Rebuild analysis only | [`narratio run 2026-04-04 --stage analyze --force`](./cli.md#run) | Preserves transcripts and the current extraction bundle; force-runs selected analysis artifacts and their required analysis prerequisites. |
|
|
| Rebuild extraction and analysis | [`narratio artifacts regenerate 2026-04-04`](./cli.md#artifacts-regenerate) | Preserves transcripts; force-runs the complete configured extraction bundle, then selected analysis. `--artifacts` narrows analysis only. |
|
|
| Continue bounded work normally | [`narratio run 2026-04-04 --from extract --through analyze`](./cli.md#run) | Uses ordinary resume decisions: current extraction and analysis can be skipped, while incomplete or obsolete work runs. |
|
|
|
|
All three stop before publication. Inspect the results and run
|
|
[`narratio run SESSION --stage publish --force`](./cli.md#run) separately when delivery is intended.
|
|
|
|
For the extraction-plus-analysis development loop, use:
|
|
|
|
```bash
|
|
narratio artifacts regenerate 2026-04-04
|
|
narratio artifacts regenerate 2026-04-04 --artifacts session_recap,player_handout
|
|
```
|
|
|
|
This command shares the forced bounded execution operation from
|
|
`extract` through `analyze`. Extraction always rebuilds its complete configured
|
|
bundle. Analysis rebuilds the selected targets and their required analysis
|
|
prerequisites, or uses the normal default selection when no artifact names are
|
|
given. The command does not run publish, notify, or cleanup; delivery and
|
|
retention remain separate operator actions.
|
|
|
|
Inspect current artifact evidence, then publish explicitly when the regenerated
|
|
set is ready:
|
|
|
|
```bash
|
|
narratio session artifacts 2026-04-04
|
|
narratio run 2026-04-04 --stage publish --force
|
|
```
|
|
|
|
If planning or execution reports stale, missing, failed, or tampered
|
|
analysis evidence, regenerate the affected target instead of copying an older
|
|
canonical file into place or editing the manifest. See
|
|
[Troubleshooting: Analysis artifact evidence is not current](./troubleshooting.md#analysis-artifact-evidence-is-not-current).
|
|
|
|
Analyze checkpoints each completed configured artifact before starting later
|
|
artifact work. After a partial failure or interruption, retry normally: valid
|
|
earlier checkpoints are reused and execution resumes with failed, stale, or
|
|
missing work in dependency order. `--force` is unnecessary unless the operator
|
|
intends to replace otherwise-current artifacts.
|
|
|
|
### Developing With Audita And Notarius Overlays
|
|
|
|
All three applications use ConfigKit, but each owns its root configuration and
|
|
its own `overlays/` directory beside that file. A Narratio testing overlay can
|
|
explicitly select downstream testing overlays without requiring their names to
|
|
match. For example, Narratio's `overlays/testing.yml` may contain:
|
|
|
|
```yaml
|
|
audita:
|
|
overlay: testing
|
|
notarius:
|
|
config_overlay: downstream-economy
|
|
```
|
|
|
|
Place Audita's settings in `overlays/testing.yml` beside its configuration, and
|
|
Notarius's settings in `overlays/downstream-economy.yml` beside its configuration.
|
|
Use each tool's own schema for model/profile selection and other settings;
|
|
Narratio neither copies those settings nor implicitly forwards its overlay name.
|
|
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.
|
|
|
|
Set `audita.debug: true` in Narratio to request Audita debug capture. Omission
|
|
or false adds no debug override. Narratio supplies the run-local `polish/debug` work destination and
|
|
the separate `polish/logs` report destination. Set `notarius.debug: true` to request Notarius capture; its debug directory alone
|
|
does not enable capture.
|
|
See the upstream [Audita configuration](https://forge.maximumdirect.net/eric/audita/src/tag/v4.3.0/docs/config.md)
|
|
and [Notarius CLI](https://gitea.maximumdirect.net/eric/notarius/src/tag/v0.10.0/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
|
|
rerun polish, for example:
|
|
|
|
```sh
|
|
narratio run SESSION --overlay testing --force --from polish --through polish
|
|
```
|
|
|
|
This replaces polish output and invalidates dependent results; it is not a
|
|
diagnostics-only operation. Selecting testing does not create an isolated
|
|
workspace or retain a separate current result.
|
|
|
|
Review downstream retry settings and Narratio's extraction timeout together;
|
|
retries can increase elapsed time and provider charges.
|
|
|
|
Selecting Narratio's `testing` overlay then supplies `downstream-economy` only
|
|
when extraction executes. Switching that explicit selector makes a recorded
|
|
extraction non-current and reruns it when `extract` is in the selected stage
|
|
range; the usual dependent invalidation then applies. Selecting an overlay does
|
|
not create a separate workspace or retain a separate current extraction result.
|
|
|
|
Narratio cannot observe edits inside Notarius configuration behind an unchanged
|
|
selector. Force extraction after such an edit when a replacement is intended.
|
|
Use `artifacts regenerate` when both extraction and analysis must be rebuilt;
|
|
use `run SESSION --stage analyze --force` when the existing extraction bundle
|
|
should be preserved. Field
|
|
semantics belong in [Configuration](./config.md#notarius-configuration-overlay),
|
|
with Audita selectors covered under
|
|
[Audita selection and credentials](./config.md#audita-selection-and-credentials).
|
|
Exact downstream invocations belong in the [Audita](./integrations/audita.md)
|
|
and [Notarius](./integrations/notarius.md#invocation) integration contracts.
|
|
|
|
## Artifact Selection
|
|
|
|
For a configured artifact family, selecting its family key expands to every
|
|
concrete character artifact. Select a concrete generated key to operate on one
|
|
member only. Manifests and plan output retain the concrete key as the durable
|
|
identity and include the family and character ID as optional provenance.
|
|
|
|
`--artifacts` can be used on `run`, `session plan`, and
|
|
`artifacts regenerate`. For a bounded run or plan, the selected range must contain `analyze`
|
|
or `publish`.
|
|
|
|
Selection behavior:
|
|
|
|
- validates names against the derived concrete catalog and family selections;
|
|
- selects explicit analyze targets and permits their required configured
|
|
prerequisites to be reused or rebuilt first;
|
|
- filters publish rules for `narratio.artifact.<name>` sources only;
|
|
- does not suppress built-in transcript, bounds, or explicitly configured
|
|
`narratio.extraction.<name>` publish sources; and
|
|
- never partially selects Notarius lanes.
|
|
|
|
## Extraction Workflow
|
|
|
|
Disabled extraction records a skipped outcome. When enabled, Narratio uses the
|
|
configured Notarius pipeline and verified prepared inputs. Bind the shared party
|
|
and combined glossary as described in [Configuration](config.md#notarius-reference-bindings).
|
|
The final trimmed transcript and content-identified snapshots under
|
|
`inputs/references/` are passed to the subprocess.
|
|
|
|
Successful configured lanes become flat `artifacts/<name>.json` products and
|
|
`narratio.extraction.<name>` sources. The original bundle remains under the
|
|
producing run for evidence; it is not implicitly published. A failed replacement
|
|
does not make the earlier extraction record current. Native fallback counts and
|
|
readiness warnings remain visible in command reports.
|
|
|
|
Narratio can reuse completed extraction without starting Notarius. When extraction
|
|
runs, Notarius owns its own cache and configuration. Select native `cache` if
|
|
needed; force extraction requests `refresh`. Configure downstream cache locations
|
|
in Notarius, outside Narratio cleanup. A changed private downstream model or config
|
|
is not automatically detected; force extraction when fresh work is needed.
|
|
See [Notarius integration](integrations/notarius.md).
|
|
|
|
## Migrating Manifest Overlay Provenance
|
|
|
|
Manifests containing `effective_config.selected_profile` are rejected by strict
|
|
decoding. Historical session state is not converted in place; move it aside and
|
|
regenerate the session using the supported format. Do not edit immutable remote
|
|
snapshots.
|
|
|
|
## Migrating Audita and Provider Credentials
|
|
|
|
Install Audita v4.3.0 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).
|
|
|
|
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.3.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.
|
|
|
|
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
|
|
|
|
When an external command is cancelled or times out, Narratio terminates its
|
|
owned descendants as well as the command itself. Cancellation first requests
|
|
termination where the platform supports it, then force terminates after a
|
|
bounded wait. A command is not considered finished until its leader has been
|
|
reaped, and descendants that keep standard output or error open cannot keep
|
|
the invocation blocked. Other operating systems fail closed rather than launch
|
|
a command without tree ownership.
|
|
|
|
Subprocess diagnostic streams are separately redacted and capped at 8 MiB per
|
|
invocation. Narratio does not retain configured credential values in these logs
|
|
or their error tails; reaching a capture limit terminates the command tree and
|
|
reports which stream exceeded the limit. Scriptorium result stdout is captured
|
|
separately without redaction; see its [integration contract](integrations/scriptorium.md).
|
|
|
|
Run-local diagnostics are:
|
|
|
|
- `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/logs/notarius.report.json`
|
|
- `runs/{run_id}/extract/logs/notarius.stderr.log`
|
|
- `runs/{run_id}/extract/notarius-output/` for retained original bundles
|
|
|
|
The run upload is an allowlist derived from the session manifest's declared
|
|
current-run outputs, logs, and generated configurations, not a workspace scan.
|
|
References to canonical session files and prior-run paths are excluded. Each
|
|
declared source is opened without following symlinked ancestors or the leaf,
|
|
verified as a regular file, and streamed from that verified descriptor.
|
|
Unlisted files and unsafe entries are never uploaded; a run with no declared
|
|
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/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.
|
|
|
|
To intentionally replace the current extraction result, run:
|
|
|
|
```bash
|
|
narratio run 2026-04-04 --stage extract --force
|
|
```
|
|
|
|
Narratio automatically reruns extraction when its recorded invocation contract,
|
|
prepared Narratio reference identities, or durable output validation changes.
|
|
The semantic portion covers Notarius enablement, pipeline identity, declared
|
|
reference mapping, output contracts, and the explicit Notarius configuration
|
|
profile selector. Executable, timeout, working directory, and private
|
|
config-file paths are operational and do not invalidate a current result.
|
|
It cannot fingerprint configuration or profile contents, prompts, modules, or
|
|
other references loaded transitively by Notarius itself. Force extraction after
|
|
changing any of those inputs behind an unchanged selector, even when the
|
|
top-level Narratio and Notarius config paths remain the same. A forced extract
|
|
marks successful downstream stages stale. Ordinary extraction failures or
|
|
outcome changes also stale affected downstream stages, while an identical
|
|
repeated `notarius_disabled` self-skip does not repeatedly invalidate them.
|
|
|
|
Publish reuse additionally tracks enabled/run-upload behavior, normalized
|
|
output rules, and remote backend/bucket/region/endpoint/root identity.
|
|
Credential environment names, local workspace placement, and run IDs are
|
|
excluded. Regardless of semantic reuse evidence, executing publish reads
|
|
independent remote locks directly and rechecks initially unlocked sources
|
|
before commit selection.
|
|
|
|
## Publish Workflow
|
|
|
|
Run publish only:
|
|
|
|
```bash
|
|
narratio run 2026-04-04 --stage publish --force
|
|
```
|
|
|
|
This selection stops after publish and does not invoke cleanup. A
|
|
default full `run` continues through notify and cleanup.
|
|
|
|
Publish commit model:
|
|
|
|
- uploads eligible run files under `{session_prefix}/runs/{run_id}/`, excluding
|
|
audio and the run-local Notarius staging bundle;
|
|
- uploads prepared campaign, session, and party documents under the run's
|
|
`prepare/inputs/` prefix, when recorded by the manifest;
|
|
- uploads configured published outputs and `previous/**` cache files into the
|
|
same immutable run scope, including only explicitly configured extraction
|
|
lanes;
|
|
- writes `{session_prefix}/runs/{run_id}/commit.json` after all declared
|
|
immutable objects are uploaded and verified; and
|
|
- writes `{session_prefix}/current/commit-pointer.json` once, last.
|
|
|
|
`current/commit-pointer.json` is the remote current-state commit marker. It
|
|
selects exactly one immutable commit, which declares the complete object set.
|
|
|
|
## Remote Commit Migration
|
|
|
|
The immutable remote commit contract uses
|
|
`runs/{run_id}/commit.json` to declare a run's complete object set and a small
|
|
`current/commit-pointer.json` to select it. The pointer binds the selected
|
|
commit by version, checksum, size, and storage generation; committed artifacts
|
|
are also checksum- and generation-bound. Readers accept this contract now and
|
|
strictly reject mismatched or unknown data.
|
|
|
|
A selected commit may carry a `published_output` declaration from an earlier
|
|
run in the same campaign/session. Restore, previous-session caching, status,
|
|
and artifact inspection use that declaration's exact immutable key and stable
|
|
source; they do not reconstruct a current-run key or scan the session prefix.
|
|
Other artifact types remain confined to the selected commit's own run.
|
|
|
|
When the pointer is absent, remote state is not published; republish the
|
|
session to establish a committed snapshot. Remote commit state does not carry
|
|
local `current_pointer_written` metadata.
|
|
|
|
## Publish Locks
|
|
|
|
Each mutable lock is an independent strict JSON object at
|
|
`{session_prefix}/locks/{sha256(source)}.lock`. The lowercase digest is computed
|
|
from the exact canonical source. Listing validates every object in that
|
|
reserved prefix and reports locks sorted by source.
|
|
|
|
Upgrades do not read, migrate, or delete the retired `{session_prefix}/locks.yml`
|
|
object. It has no effect on publication and may be removed manually after
|
|
verifying lock commands and publication behavior with the upgraded Narratio
|
|
version. No migration command is required.
|
|
|
|
Operational rules:
|
|
|
|
- add uses conditional creation and reports an existing lock;
|
|
- add with `--force` observes the current generation and attempts one
|
|
generation-matched replacement. A concurrent change is reported for an
|
|
explicit operator retry;
|
|
- remove is idempotent and reports whether a lock was present;
|
|
- the initial publish lock snapshot controls output planning. A locked source
|
|
carries its exact declaration from the prior current commit when available;
|
|
a never-published locked source remains absent even when required;
|
|
- carried bytes are not copied. Publish verifies the prior object's exact key,
|
|
size, and generation without downloading it; and
|
|
- after immutable uploads and the immutable commit, publish re-reads every
|
|
initially unlocked participating source. A newly added lock prevents the
|
|
current pointer from advancing, although the immutable attempt may remain.
|
|
A removed initial lock may conservatively cause one carry.
|
|
|
|
Examples:
|
|
|
|
```bash
|
|
narratio session locks list 2026-04-04
|
|
narratio session locks add 2026-04-04 narratio.artifact.session_recap --reason "manual edits" --force
|
|
narratio session locks remove 2026-04-04 narratio.artifact.session_recap
|
|
```
|
|
|
|
## Restore Workflow
|
|
|
|
Use restore when local durable session state is missing or stale and remote committed current state is authoritative.
|
|
|
|
Dry run:
|
|
|
|
```bash
|
|
narratio session restore 2026-04-04 --dry-run
|
|
```
|
|
|
|
Apply:
|
|
|
|
```bash
|
|
narratio session restore 2026-04-04
|
|
```
|
|
|
|
`--dry-run` does not write durable session files. It still reads the selected
|
|
remote current state and may read object identity/content needed to classify the
|
|
plan, so it is not a network-free operation.
|
|
|
|
Default restore scope:
|
|
|
|
- the committed session manifest, prepared inputs, and transcript/artifact
|
|
objects declared by the selected remote commit
|
|
- `inputs/previous/**` when needed by configured previous-session artifact inputs;
|
|
each is selected from its exact committed `published_output` declaration
|
|
|
|
Optional:
|
|
|
|
- `--include-audio` to include `audio/**`
|
|
- `--force` to overwrite eligible conflicting regular files; it never replaces
|
|
directories, symlinks, or other non-regular local targets
|
|
|
|
Restore treats a local leaf symlink or any symlinked ancestor beneath the
|
|
selected session root as a conflict, even when the linked content matches the
|
|
selected remote object. `--force` does not override that conflict.
|
|
|
|
Before each install, restore validates the destination again beneath the
|
|
selected session root. A target changed into a symlink, directory, or other
|
|
non-regular entry is not overwritten.
|
|
|
|
Restore writes an execution report under `runs/<run_id>/restore/logs/restore.json`;
|
|
`logs/restore` points to the latest actual restore attempt.
|
|
|
|
If restore fails after beginning installation, it leaves a durable
|
|
`.restore-incomplete.json` marker in the session root. Pipeline runs will stop
|
|
until you rerun the same restore command and it completes. Restore intentionally
|
|
does not try to roll back files already installed; retrying the selected remote
|
|
snapshot is the recovery procedure.
|
|
|
|
## Local State Layout
|
|
|
|
A session lives at `{workspace.root}/work/{campaign}/{session_id}`. It contains
|
|
`manifest.json`, prepared `inputs/` and `audio/`, `transcripts/` (including
|
|
`raw/` speaker files), flat `artifacts/`, and `runs/` for actual attempts.
|
|
Previous-session inputs live under `inputs/previous/`; verified subprocess
|
|
reference snapshots live under `inputs/references/`.
|
|
|
|
Each attempted stage writes actual logs and debug capture beneath its run.
|
|
`logs/<stage>` and `debug/<stage>` are relative links to the latest attempt,
|
|
including failed attempts; skipped work does not rotate them. Restore writes its
|
|
own diagnostic attempt. Original Notarius bundles remain in the producing run.
|
|
Automatic cleanup retains current view targets and session-durable bundle evidence.
|
|
|
|
Remote audio is downloaded to a temporary sibling and verified before replacing
|
|
its single prepared `audio/` copy. Restore follows the same layout. Subprocess
|
|
cache and state locations are configured separately in those applications.
|
|
|
|
Only `narratio.session-manifest.v2` is supported. Move older local state aside
|
|
and regenerate it, or restore a supported committed snapshot; republish after
|
|
regeneration when remote state is incompatible. Do not edit old markers by hand.
|
|
|
|
### Workspace Permissions
|
|
|
|
Ordinary Narratio workspace content is intentionally shareable with the
|
|
workspace group. On POSIX systems, Narratio-created workspace
|
|
directories converge on setgid `02775`; ordinary files, including manifests,
|
|
transcripts, generated configuration, logs, reports, and Notarius artifacts,
|
|
converge on `0664`. Narratio explicitly applies these modes so a restrictive
|
|
caller umask does not remove group write or setgid. It does not change file or
|
|
directory ownership: the configured workspace's existing group is inherited.
|
|
|
|
API keys are credentials, not ordinary workspace data. Store them outside the
|
|
shared workspace or in a separately restricted credential location; ordinary
|
|
workspace group access must never be treated as authorization to read keys.
|
|
Provision a credential directory as `0700` and credential files as `0600`;
|
|
these permission modes are an operator requirement and are not enforced by
|
|
ConfigKit.
|
|
|
|
Pipeline acquisition uses the directory declared in the main pipeline file,
|
|
when present, before resolving typed credentials. Remove `--secrets-dir` from
|
|
old invocations and declare `config.secrets_dir`, or provision environment values.
|
|
A pipeline beside the former system-wide directory can select `secrets`; other
|
|
layouts follow [ConfigKit's path rules](https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/config.md#explicit-secrets-directory-bootstrap).
|
|
See [Secrets Handling](config.md#secrets-handling) for Narratio's integration.
|
|
|
|
S3 `access_key_id` and `secret_access_key` are an optional pair of typed
|
|
environment references. When both are absent, the AWS SDK retains its default
|
|
credential provider chain. When both are configured, Narratio supplies their
|
|
load-time resolved values through an explicit static provider. Audita and
|
|
Notarius credential lists likewise resolve at pipeline load. Each adapter
|
|
receives only its listed names and captured values, with no alias mapping or
|
|
ambient environment inheritance. See [configuration](./config.md#audita-selection-and-credentials).
|
|
|
|
External adapter results are individually bounded before Narratio validates or
|
|
materializes them. These per-file limits do not reserve disk space: prevent hard
|
|
disk exhaustion with filesystem, service, container, or volume quotas sized for
|
|
the session workload.
|
|
|
|
## Cleanup
|
|
|
|
Use `narratio session clean SESSION` to remove an entire local session, or
|
|
`narratio session clean --all` for all local sessions. Add `--dry-run` to inspect
|
|
planned targets. These commands do not delete subprocess caches or remote data.
|
|
|
|
Automatic run cleanup requires `workspace.cleanup_after_publish` and successful
|
|
publication evidence. It preserves current log/debug targets and retained Notarius
|
|
bundle evidence. A failed cleanup can be retried without republishing; bounded
|
|
runs ending before cleanup do not execute it. See [cleanup internals](internal/stage-cleanup.md).
|
|
|
|
## Operational Caveats
|
|
|
|
- Local and S3 audio modes are mutually exclusive.
|
|
- Publish requires prerequisite stages through `render` and `analyze` to be succeeded.
|
|
- Markdown publish defaults require render outputs (`transcripts/final.md` and `transcripts/final.trimmed.md`).
|
|
- Restore requires configured object storage and committed remote current state.
|
|
- Each reached pipeline acquisition applies its configured startup before typed
|
|
credential resolution and object-store initialization.
|
|
|
|
Console progress and informational diagnostics use native invocation visibility.
|
|
`--progress` shows work without requiring verbose mode; `--verbose` adds source
|
|
and decision context. Console `--debug` does not enable downstream debug capture
|
|
or change retention. Downstream streams stay in captured logs. See
|
|
[CLI reporting](cli.md#reporting-and-visibility) for mode combinations and formats.
|