5.5 KiB
Operations
This guide describes the implemented operator lifecycle for Narratio.
For field-level configuration, see docs/config.md. For full command/flag reference, see docs/cli.md.
Normal workflow (S3-first path)
- Upload session
.flacfiles to the session audio prefix in object storage:{root_prefix}/campaigns/{campaign}/sessions/{session_id}/{audio_s3.prefix}
- Run Narratio:
narratio run --session-id 2026-04-04
- Read success output:
narratio run: session <session_id>; executed=<n> skipped=<n>; manifest=<path>manifest=<path>is the local session manifest path to use withstatus.
Notes:
- This command relies on discoverable
pipeline.ymlandsession.ymlunless--configand--sessionare passed explicitly. - For S3 audio input,
session.inputs.audio_s3.prefixmust be configured and audio files must already exist remotely.
Local filesystem layout and state artifacts
Session root:
{workspace.root}/work/{campaign}/{session_id}/
Primary state:
manifest.json: session-level manifest (authoritative local stage state).runs/{run_id}/manifest.json: run-level manifest for one invocation..lock: session lock file while a run is active.
Canonical session directories:
inputs/audio/transcripts/artifacts/reports/logs/config/current/runs/
Run-local stage directories:
runs/{run_id}/{stage}/- Stage runtime files are written under deterministic run-local subdirectories such as:
outputs/,logs/,reports/,config/,scratch/
Behavior notes:
- Layout creation is idempotent.
- Durable outputs are promoted to canonical session paths after stage success.
- Run-local artifacts remain in
runs/{run_id}/...unless configured post-archive cleanup removes that run scope.
Remote archive layout and publish contract
When archive is enabled and run upload is enabled, archive publishes to object storage under:
- Session prefix:
{root_prefix}/campaigns/{campaign}/sessions/{session_id}/ - Run prefix:
{session_prefix}/runs/{run_id}/
Archive uploads:
- Run record files from run root (including stage subtrees and run manifest), excluding local
audio/. - Promoted artifacts from
archive.promote_artifactsto session-level keys.
Publish order (commit contract):
- Upload
current/manifest.json - Upload
current/run_id.txtlast
Meaning of current/run_id.txt:
- It is the effective remote commit marker for published session state.
- It is written only after required run uploads and required promotions succeed.
Resume, retry, and safe rerun behavior
Default skip behavior:
runandrun-stageskip stages already markedsucceededunless--forceis set.
Resume behavior:
resumestarts at the first non-succeededstage in canonical stage order.- If all stages are
succeeded,resumeprints that no stages remain. resume --forceruns full stage order rather than starting at first non-succeeded.
Forced rerun behavior:
- Successful forced rerun of an upstream stage marks downstream previously
succeededstages asstale. stalestages are not treated as complete and are eligible to run in subsequent commands.
Targeted rerun with one stage:
narratio run-stage --force <stage>
Valid stage names:
prepare,transcribe,merge,polish,normalize,trim,analyze,archive,notify
Safe operator pattern:
- Force-rerun the stage that changed.
- Run
resumeto rebuild downstream stages in order.
Cleanup behavior
Cleanup is considered only after run execution completes and only when archive stage both executed and succeeded.
Configured cleanup toggles:
pipeline.spool.delete_audio_after_archive=true- deletes only run-scoped spool audio directory:
{spool.root}/{campaign}/{session_id}/{run_id}/audio/
- deletes only run-scoped spool audio directory:
pipeline.workspace.cleanup_after_archive=true- deletes only run-scoped local run directory:
{workspace.root}/work/{campaign}/{session_id}/runs/{run_id}/
- deletes only run-scoped local run directory:
Eligibility gates for cleanup:
- archive is enabled
- archive run upload is enabled
- archive metadata indicates run record upload happened
- archive metadata indicates
currentpointer write completed (current/run_id.txtwritten)
Cleanup does not run for:
- failed runs
- incomplete runs
- unarchived runs
- archive-skipped runs (
archive.enabled=falseorarchive.upload_run=false)
Failure and recovery playbooks
What remains after failure:
- Session manifest remains on disk.
- Run manifest remains under
runs/{run_id}/manifest.json. - Run-local stage artifacts/logs/config/reports remain under
runs/{run_id}/.... - Failed/incomplete runs remain local-only.
- Remote current pointer is not committed if archive prerequisite or pointer-write steps fail.
Recommended recovery flow:
- Inspect current state:
narratio status --manifest <manifest-path-from-run-output>
- Fix the root cause (config, input, credentials, adapter availability, etc.).
- Continue with:
narratio resume --session-id <id>for ordered continuation, ornarratio run-stage --force <stage>for targeted correction, thenresume.
Operational caveats
statusrequires an explicit manifest path; there is no direct session-id lookup command.- S3 audio mode and local audio mode are mutually exclusive in session config.
- Archive verifies stage prerequisites (
preparethroughanalyze) before publishing. - By default, archive does not upload local
audio/into run history. - Unknown CLI commands fail and print usage.