2.7 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. Execution and
readiness share resolved binary, configuration, credential, timeout and cache
options while retaining their own input and diagnostic paths. 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 until authorized cleanup removes run history. Positive native
fallback counts are recorded and reported. internal/artifacts owns the typed
metadata codecs shared by extraction, evidence hydration, resume, and fallback
reporting.
An imported lane is individually available from its validated supplied record without historical Notarius metadata. Extraction is satisfied by supplied products only when all configured lanes are available. Executing a missing bundle regenerates the complete configured set and retires its supplied records.
Resume Validation
Resume checks the direct transcript identity, configured pipeline and lane selection, reference identities, and manifest-backed output checksums and sizes. It does not reopen the original bundle or completion report. 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.