Repository navigation
fix(cli): preserve quiet speech before detected onset - #5164
Conversation
terencecho
left a comment
There was a problem hiding this comment.
Review at d61a723997fc0fbaebb84ea04c5d4fcf5ac2790a — approved.
packages/cli/src/commands/transcribe.ts:413-416 now writes the entire normalized decoder word array to transcript.json and caption HTML without applying the relative-energy onset as a word boundary. SRT/VTT export reads that same transcript. The public-command regression at packages/cli/src/commands/transcribe.test.ts:115-140 asserts all five supplied words in both outputs, including words before the 10-second onset. Six focused command/normalization suites passed (197 tests); required checks passed at this head. No previous review findings were present.
Nonblocking trade-off: A hallucinated decoder word over genuinely silent leading audio will now also be retained; the old timestamp filter could suppress it but also deleted real quiet speech. This is consistent with the stated preserve-normalized-words contract, not evidence that native recognition is complete. The test mocks decoder output and onset; I did not independently run a native model. speechOnsetSeconds remains an energy estimate, so the status line at transcribe.ts:432-439 can say “speech detected at 10.0s” despite preserved words beginning earlier. Consider labeling it as an estimated energy onset to avoid suggesting a first-word boundary.
— tai
Verdict: APPROVE
Reasoning: The command no longer drops recognized normalized words at an unreliable energy boundary, and its JSON and caption outputs remain aligned. The silent-intro false-positive trade-off and onset wording do not contradict the explicitly chosen inclusive output contract.
Edit accuracy: accurate 2059 (base branch 2059), smooth 1619 of thoseThe gate passes. Quarantined, measured but not gated (0) |
When speech starts quietly and becomes louder later, the relative energy onset can occur after words Whisper has already recognized. The CLI then deleted those early words from the transcript and captions.
Preserve every normalized decoder word at the shared command output step. Keep speech-onset metadata informational and remove the unused trimming helper.
Validation: the public-command Spanish regression fails on main when the early words disappear. The command and normalization suites pass three times each, and restoring the filter makes the regression fail again. Lint, formatting, comment checks, and CLI typecheck pass. A native multilingual decoder run on a soft-start Spanish clip independently confirmed meaningful speech before the estimated onset.