fix(app): keep the transcript when diarization loses its audio - #565
Merged
Conversation
Preparing the 16 kHz mix for diarization sat outside the block that treats a diarization failure as a warning, so a file problem there failed the whole job. By then transcription has already finished and produced a non-empty transcript, and that transcript was discarded along with the minutes of compute behind it. Losing it buys nothing: stage 3 tolerates a missing mix, and nothing downstream of this failure needs one, since speaker naming is only ever parked when diarization actually produced speakers. Moving the call inside the block makes the cost proportional. A diarization problem now costs the speaker labels and a warning, which is what every other diarization failure already costs. With that, nothing in the stage can throw any more, so the signature no longer says it can. That is deliberate: the compiler now refuses the next throwing call added outside the block, where a comment would only have asked. Only a paired source can reach this failure. A single-source job wrote its 16 kHz mix during transcription and the preparation step returns early, and since each run owns its working directory no sibling run can take that file away. Refs #558.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #565 +/- ##
=====================================
Coverage 84.8% 84.8%
=====================================
Files 156 156
Lines 12358 12364 +6
=====================================
+ Hits 10487 10495 +8
+ Misses 1871 1869 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third defect from issue #558. Preparing the 16 kHz mix for diarization sat outside the block that treats a diarization failure as a warning, so a file problem there failed the entire job and threw away a transcript that was already finished.
Why the cost was wrong
By the time this step runs, transcription has completed and produced a non-empty transcript, which is where nearly all the compute went. Discarding it buys nothing: stage 3 already tolerates a missing mix, and nothing downstream of this particular failure needs one, because speaker naming is only ever parked when diarization actually produced speakers.
Moving the call inside the block makes a diarization problem cost the speaker labels and a warning, which is exactly what every other diarization failure already costs.
With that move, nothing in the stage can throw any more, so its signature no longer claims it can. That part is deliberate rather than tidying: the compiler now refuses the next throwing call someone adds outside the block, where a comment would only have asked politely.
Reachability
Only a paired source can reach this failure. A single-source job wrote its 16 kHz mix during transcription and the preparation step returns early, and because each run now owns its working directory, no sibling run can take that file away.
Evidence
The test drives a paired job whose sources are removed between transcription and diarization, which is a state a concurrent run relocating staged audio or a user tidying a folder can produce. It was watched fail first, with the real error the pipeline reports (
com.apple.coreaudio.avfaudio error 2003334207), and it pins three things rather than one: the job reachesdone, the warning is recorded, and the transcript exists on disk. Reverting the fix turns all three red.Gates run locally: full test suite, SwiftFormat against the pinned version, SwiftLint,
swiftlint analyze --strictwith zero violations, and the release-mode parity build.Known follow-ups, deliberately not in this change
Refs #558.