Document and verify multi-format audio discovery
This commit is contained in:
@@ -681,6 +681,21 @@ Audio rules:
|
||||
|
||||
- configure local mode (`audio_dir` or `audio_files`) or S3 mode (`audio_s3.prefix`), not both.
|
||||
- `audio_s3` requires `pipeline.storage.backend: s3` and a configured S3 bucket.
|
||||
- Explicit `audio_files` take precedence over `audio_dir`. Paths are resolved relative
|
||||
to the session document and must identify regular files. Explicit files and
|
||||
manifest-registered audio may have any suffix or none.
|
||||
- Local directory scans are non-recursive. S3 selection scans the configured
|
||||
prefix relative to the session's S3 prefix. Both use the same case-insensitive
|
||||
candidate suffixes: `.aac`, `.aif`, `.aifc`, `.aiff`, `.alac`, `.amr`,
|
||||
`.ape`, `.au`, `.caf`, `.flac`, `.m4a`, `.m4b`, `.mka`, `.mp2`, `.mp3`,
|
||||
`.mp4`, `.oga`, `.ogg`, `.opus`, `.snd`, `.wav`, `.wave`, `.weba`, `.webm`,
|
||||
`.wma`, and `.wv`. Other entries are ignored by automatic discovery.
|
||||
- Distinct local paths with the same full basename receive distinct prepared
|
||||
names. Speaker IDs use the prepared filename without its final extension. If
|
||||
two resulting IDs match, choose one encoding or rename the recordings. S3
|
||||
objects with the same full basename are rejected.
|
||||
- Selection does not verify encoding. The transcription backend determines
|
||||
whether it can decode the selected bytes.
|
||||
|
||||
### Storage backend selection
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@ Narratio sends an HTTP `POST` to the configured transcription URL using
|
||||
- `language`: the configured language string.
|
||||
|
||||
The server must return a `2xx` response whose body is valid JSON. Narratio does
|
||||
not currently require a more specific response schema at this boundary.
|
||||
not currently require a more specific response schema at this boundary. The
|
||||
backend determines codec and container support; a malformed or unsupported
|
||||
recording remains a transcription failure. Narratio does not transcode or probe
|
||||
the selected audio. See [audio selection](../config.md#session).
|
||||
|
||||
The transcription URL must be an absolute `http` or `https` URL. Each
|
||||
application attempt creates one bounded multipart framing and streams the audio
|
||||
|
||||
@@ -21,7 +21,7 @@ Materialize canonical current-session inputs before processing stages.
|
||||
- `inputs/glossaries/{party,campaign,setting,spells,combined}.yml`
|
||||
- `inputs/players.yml`
|
||||
- `inputs/party.yml`
|
||||
- `audio/*.flac`
|
||||
- prepared recordings in `audio/`
|
||||
- optional `inputs/previous/manifest.json`
|
||||
- optional `inputs/previous/artifacts/**`
|
||||
- deterministic `manifest.inputs` entries (checksums + provenance)
|
||||
@@ -34,9 +34,11 @@ Materialize canonical current-session inputs before processing stages.
|
||||
envelope with checksums, sizes, and provenance. The combined record declares
|
||||
its four individual input dependencies.
|
||||
- enforces local audio vs S3 audio mutual exclusivity.
|
||||
- rejects duplicate explicit local audio sources after resolution.
|
||||
- uses `internal/audio` for read-only source discovery shared with inspection;
|
||||
rejects duplicate explicit local audio sources after resolution.
|
||||
- gives distinct local source paths with the same basename deterministic unique
|
||||
prepared filenames so neither source is overwritten.
|
||||
prepared filenames so neither source is overwritten; unresolved speaker-ID
|
||||
collisions fail before audio materialization.
|
||||
- downloads S3 audio into a temporary sibling before verifying and installing the prepared copy; its recorded identity comes from the same response as the bytes.
|
||||
- writes effective autocorrection rules as a Seriatim envelope, with checksum,
|
||||
size, and source provenance, including an empty list when no rules apply.
|
||||
@@ -96,5 +98,5 @@ reusable; changed or unavailable evidence causes a normal prepare rerun.
|
||||
`internal/stage/prepare_resume_test.go`,
|
||||
`internal/stage/semantic_contracts_initial.go`,
|
||||
`internal/stage/semantic_contracts_initial_test.go`,
|
||||
`internal/audio/s3_audio_test.go`,
|
||||
`internal/audio/discovery_test.go`, `internal/audio/s3_audio_test.go`,
|
||||
`internal/previouscache/*_test.go`
|
||||
|
||||
@@ -6,7 +6,7 @@ Generate raw per-speaker transcripts from prepared audio using WhisperX.
|
||||
|
||||
## Inputs
|
||||
|
||||
- `audio/*.flac` from `prepare`
|
||||
- prepared recordings in `audio/` from `prepare`
|
||||
|
||||
## Outputs
|
||||
|
||||
@@ -15,7 +15,9 @@ Generate raw per-speaker transcripts from prepared audio using WhisperX.
|
||||
## Key Behavior
|
||||
|
||||
- discovers prepared audio from manifest inputs or the canonical audio
|
||||
directory and derives each speaker identity from its `.flac` filename.
|
||||
directory. Manifest-selected files are authoritative; fallback scans use the
|
||||
shared candidate filter. Speaker IDs remove the final filename extension;
|
||||
duplicate IDs are rejected before dispatch.
|
||||
- hashes the current audio and reconciles it with the versioned per-speaker
|
||||
completion collection before starting HTTP work.
|
||||
- reuses only records whose audio identity, observable WhisperX semantics,
|
||||
@@ -83,7 +85,7 @@ reuse it normally.
|
||||
|
||||
- [WhisperX](../integrations/whisperx.md) owns HTTP, retry, timeout, and
|
||||
cancellation semantics.
|
||||
- [Configuration](../config.md#pipeline) owns concurrency and other
|
||||
- [Configuration](../config.md) owns source selection, concurrency, and other
|
||||
operator-selected values.
|
||||
- Implementation and tests: `internal/stage/transcribe.go`,
|
||||
`internal/stage/transcribe_reconciliation.go`,
|
||||
|
||||
@@ -260,8 +260,10 @@ 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
|
||||
speakers. Preparation and inspection share read-only [audio selection](config.md#session);
|
||||
prepared recordings retain their bytes and filename suffixes. 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Multi-Format Audio Inputs and Shared Discovery
|
||||
|
||||
Status: Agreed scope; implementation pending
|
||||
Status: Implemented and verified
|
||||
|
||||
## Goal
|
||||
|
||||
@@ -21,7 +21,7 @@ shared-discovery remediation in
|
||||
The original audit identified inconsistent discovery under the old behavior;
|
||||
the multi-format scope follows the operator's later decision.
|
||||
|
||||
## Current Baseline
|
||||
## Historical Baseline
|
||||
|
||||
Reviewed against `aa0379294fba8422f7e6469261e4730b1c19bd8e`.
|
||||
|
||||
@@ -238,7 +238,8 @@ benchmark requirement is introduced.
|
||||
## Relationship to Other Work
|
||||
|
||||
This roadmap owns the multi-format extension and shared discovery work associated
|
||||
with CAT-12. Original audit findings remain open until implementation is verified.
|
||||
with CAT-12. CAT-12 is closed after implementation and verification; the
|
||||
historical audit reports remain unchanged.
|
||||
|
||||
The agreed source-identity and transfer-size changes in
|
||||
[topic 4](audit/discussion.md#4-keep-downloaded-audio-and-its-source-identity-together)
|
||||
|
||||
@@ -41,8 +41,8 @@ their scope. Unless assigned otherwise, a finding remains independent audit
|
||||
remediation. Shared code does not make a refactoring a prerequisite or assign
|
||||
the whole finding to a roadmap.
|
||||
|
||||
Nine entries are closed by the safety and transfer remediation sprint; 34 remain
|
||||
open. **Planned** identifies an agreed remedy awaiting
|
||||
Ten entries are closed by the safety, transfer, and audio discovery work; 33
|
||||
remain open. **Planned** identifies an agreed remedy awaiting
|
||||
implementation. **Potentially eliminated** requires verification that the offending
|
||||
lifecycle is removed. **Coordinate** identifies shared changes, not a commitment
|
||||
that the roadmap implements the entire finding. Findings close only after their
|
||||
@@ -58,7 +58,7 @@ Decisions on [audio generation/size handling](discussion.md#4-keep-downloaded-au
|
||||
[subprocess completion](discussion.md#5-finish-subprocess-shutdown-before-releasing-its-files),
|
||||
[publication source lifetimes](discussion.md#6-open-publication-sources-as-they-are-needed),
|
||||
and [audio selection and naming](discussion.md#7-give-preparation-and-inspection-the-same-audio-selection-rules)
|
||||
are agreed; audio selection remains pending in its separate roadmap. Topic 1
|
||||
are agreed and implemented. Topic 1
|
||||
records cancellation-aware workspace lock waiting, now implemented. Remote checkpoint timing and
|
||||
failure handling are deferred, not decisions blocking publication import.
|
||||
|
||||
@@ -369,15 +369,19 @@ S3 is unnecessary.
|
||||
|
||||
### CAT-12 — P2: Share audio discovery and accept valid same-basename recordings in inspection
|
||||
|
||||
Status: Open
|
||||
Status: Closed
|
||||
|
||||
**Disposition / owner.** Planned — the [audio-inputs roadmap](../audio-inputs.md)
|
||||
owns shared discovery, regular-file eligibility, broad automatic extension
|
||||
filtering, and early unresolved speaker-stem collision errors, as agreed in
|
||||
**Disposition / owner.** Implemented and verified under the
|
||||
[audio-inputs roadmap](../audio-inputs.md) and
|
||||
[discussion topic 7](discussion.md#7-give-preparation-and-inspection-the-same-audio-selection-rules).
|
||||
Coordinate with the [restore roadmap's preparation changes](../session-restore.md#adapt-preparation-and-operator-reporting)
|
||||
without making either feature a prerequisite for the other. Implementation and
|
||||
verification remain pending.
|
||||
|
||||
**Closure.** `internal/audio` owns local and S3 selection, prepared names, and
|
||||
speaker-ID collision checks. Preparation, reuse, and inspection consume these
|
||||
selections; transcription accepts manifest-selected files and uses the shared
|
||||
filter for fallback. Audio discovery and real preparation/inspection tests cover
|
||||
same-basename and mixed-format selection; transcription retry and WhisperX HTTP
|
||||
and replay tests cover durable reuse and byte-preserving transport. Full tests,
|
||||
race tests, vet, and build pass on Go 1.27.4.
|
||||
|
||||
Original findings: [CX-01](03-complexity.md#cx-01--p2-audio-discovery-is-duplicated-and-inspection-rejects-valid-inputs),
|
||||
[BN-04](11-boundaries.md#bn-04--p3-audio-discovery-is-owned-independently-by-preparation-and-inspection).
|
||||
|
||||
@@ -413,7 +413,7 @@ the current publication must remain unchanged on failure. CAT-09 is closed._
|
||||
|
||||
## 7. Give preparation and inspection the same audio selection rules
|
||||
|
||||
Status: Decisions agreed; implementation pending
|
||||
Status: Implemented and verified
|
||||
|
||||
Finding: [CAT-12](catalog.md#cat-12--p2-share-audio-discovery-and-accept-valid-same-basename-recordings-in-inspection).
|
||||
|
||||
@@ -421,8 +421,8 @@ Roadmap owner: [Multi-Format Audio Inputs and Shared Discovery](../audio-inputs.
|
||||
|
||||
### Concrete example
|
||||
|
||||
The operator selects `first/speaker.flac` and `second/speaker.flac`. Preparation
|
||||
accepts these distinct recordings and gives the prepared copies distinct names.
|
||||
At the audit baseline, the operator selects `first/speaker.flac` and
|
||||
`second/speaker.flac`. Preparation accepts these distinct recordings and gives the prepared copies distinct names.
|
||||
Inspection rejects them because their basenames match. A status command can
|
||||
therefore report unavailable audio for a session preparation can process.
|
||||
|
||||
@@ -468,7 +468,7 @@ Operator response:
|
||||
|
||||
_Approved: regular-file selection, shared broad audio-extension filtering for
|
||||
automatic discovery, extension-agnostic explicit inputs, and early rejection of
|
||||
unresolved speaker-stem collisions. CAT-12 remains open pending implementation
|
||||
unresolved speaker-stem collisions. CAT-12 is closed after implementation
|
||||
and verification._
|
||||
|
||||
## After Discussion
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Multi-Format Audio Inputs Implementation Plan
|
||||
|
||||
Status: Ready for implementation
|
||||
Status: Complete
|
||||
|
||||
Baseline: `0288111c721ed49f19aade68370f30f92017d581`.
|
||||
|
||||
@@ -271,6 +271,8 @@ decoder toolchain, or new performance gate is needed.
|
||||
|
||||
## Stage 7: Align documentation and verify the final sprint state
|
||||
|
||||
**Complete.** Documentation and CAT-12 are updated; Go 1.27.4 tests, race tests, vet, build, and diff checks pass.
|
||||
|
||||
1. Update `docs/config.md` as the canonical owner of source-selection semantics
|
||||
and the extension set. Explain automatic versus explicit selection, current
|
||||
S3 prefix behavior, and the operator action for unresolved speaker-stem
|
||||
|
||||
@@ -974,7 +974,7 @@ Symptom:
|
||||
Likely causes:
|
||||
|
||||
- incorrect `session.inputs.audio_s3.prefix`;
|
||||
- no matching `.flac` objects;
|
||||
- no matching [audio candidates](config.md#session);
|
||||
- storage connectivity or permissions failure.
|
||||
|
||||
Diagnostics:
|
||||
|
||||
Reference in New Issue
Block a user