2026-05-18 22:03:59 -05:00
|
|
|
# Stage: transcribe
|
|
|
|
|
|
|
|
|
|
## Purpose
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
Generate raw per-speaker transcripts from prepared audio using WhisperX.
|
2026-05-18 22:03:59 -05:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
## Inputs
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
- `audio/*.flac` from `prepare`
|
2026-05-18 22:03:59 -05:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
## Outputs
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
- `transcripts/raw/<speaker>.json`
|
2026-05-18 22:03:59 -05:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
## Key Behavior
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
- discovers prepared audio from manifest inputs or canonical audio directory.
|
2026-08-10 21:53:54 +00:00
|
|
|
- derives the transcript identity from the prepared `.flac` filename.
|
2026-08-31 23:55:08 +00:00
|
|
|
- dispatches one WhisperX request per prepared file through a bounded errgroup.
|
2026-05-23 12:57:59 +00:00
|
|
|
- validates each output as JSON.
|
2026-08-10 21:53:54 +00:00
|
|
|
- writes run-local outputs then materializes canonical transcript outputs only
|
|
|
|
|
after every planned request succeeds.
|
2026-05-18 22:03:59 -05:00
|
|
|
|
2026-05-23 12:57:59 +00:00
|
|
|
## Invariants
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-08-10 21:53:54 +00:00
|
|
|
- prepared audio identities must be unique; prepare disambiguates distinct
|
|
|
|
|
source paths that share a basename.
|
2026-05-23 12:57:59 +00:00
|
|
|
- output path returned by adapter must match requested output path.
|
2026-08-10 21:57:54 +00:00
|
|
|
- an empty adapter result path means the requested path; adapters cannot select
|
|
|
|
|
an alternate destination.
|
2026-08-10 21:53:54 +00:00
|
|
|
- each successful output is validated before stage success, and cancellation or
|
|
|
|
|
incomplete dispatch cannot be reported as a successful result.
|
2026-08-09 21:50:21 +00:00
|
|
|
|
2026-08-30 12:54:38 +00:00
|
|
|
## Resume Evidence
|
|
|
|
|
|
|
|
|
|
Transcribe records a versioned semantic-configuration fingerprint containing
|
|
|
|
|
the Narratio-visible WhisperX service URL and recognition language. Changes to
|
|
|
|
|
either rerun transcription and stale its fixed descendants while leaving
|
|
|
|
|
prepare reusable. Retry count/delay, concurrency, timeout, credentials, and
|
|
|
|
|
diagnostic locations are operational and do not change this evidence.
|
|
|
|
|
|
|
|
|
|
WhisperX models or private service configuration not exposed by Narratio's
|
|
|
|
|
adapter contract cannot be fingerprinted; use `--force` after changing them.
|
|
|
|
|
An existing successful transcribe record without evidence reruns once when
|
|
|
|
|
selected.
|
|
|
|
|
|
2026-08-09 21:50:21 +00:00
|
|
|
## Related Contracts And Tests
|
|
|
|
|
|
|
|
|
|
- [WhisperX](../integrations/whisperx.md) owns HTTP, retry, timeout, and
|
|
|
|
|
cancellation semantics.
|
|
|
|
|
- [Configuration](../config.md#pipeline) owns concurrency and other
|
|
|
|
|
operator-selected values.
|
|
|
|
|
- Implementation and tests: `internal/stage/transcribe.go`,
|
2026-08-30 12:54:38 +00:00
|
|
|
`internal/stage/transcribe_test.go`,
|
|
|
|
|
`internal/stage/semantic_contracts_initial.go`, and
|
|
|
|
|
`internal/stage/semantic_contracts_initial_test.go`
|