Files
narratio/docs/internal/stage-extract.md

2.0 KiB

Internal: Extract Stage

Responsibility

The extract stage invokes the configured Notarius pipeline on the verified final trimmed transcript and prepared references, promotes configured lane products, and records Narratio-owned content evidence. Notarius owns its pipeline, cache, validation and completion protocol; see the integration contract.

Lifecycle

Disabled extraction records a skip. An execution resolves manifest-backed input identities, creates immutable content-addressed reference snapshots, and invokes Notarius with run-local output, log and debug destinations. The adapter accepts a successful native completion report for the expected pipeline and confined output directory. The stage reads each configured lane JSON, validates its safe path and content, then promotes all required products to flat artifact paths before recording success. The original bundle and optional domain auxiliaries stay in the producing run. Positive native fallback counts are recorded and reported.

Resume Validation

Resume checks the direct transcript identity, configured pipeline and lane selection, reference identities, and manifest-backed output checksums and sizes. Cache and debug selection, executable version and private downstream config are not blanket invalidators. Force invokes extraction with cache refresh. A failed replacement is not represented as a current successful extraction.

Failure Behavior

Native errors, malformed completion, missing required lanes, unsafe paths, or invalid JSON fail the attempt while preserving available diagnostics. A partial report or incidental output is not success. See operations.

Implementation And Focused Tests

internal/stage/extract.go, extract_preflight.go, extract_native_test.go, internal/artifacts/extraction_evidence.go, and internal/adapters/notarius/ own the stage, readiness, evidence and subprocess boundaries. The opt-in notarius_cache_integration_test.go exercises a real executable.