fix(stream): the mark lands once a later word confirms it - #57
Conversation
Reported as "there was a break before, but no punctuation", and it is the cost the last commit named out loud rather than a new defect. A mark rides on the word in front of it, and `stable_prefix` will not type the mark on a word still touching the end of the audio — a pause is how whisper decides a sentence ended, and it takes that decision back the moment the speaker carries on. So the word landed bare and nothing could ever put the mark on afterwards: the word is on screen and there is no un-type. A LATER pass answers the question the earlier one could not. If the word carrying the mark is no longer at the end of the transcript — real speech follows it, and whisper STILL ends the sentence there — the mark was decided WITH the following audio, which is the same test every other word passes before it is typed. `missing_mark` returns it, joined to its word with no space in front, and only ever in the same breath as the word that proves it. So it can never be the lone full stop of #55: no confirming word, no mark. `_reached` is split out of `stream_tail` because both now ask the same question about the same two sequences — where does the screen END inside this transcript — and two answers to that would drift apart word by word. Driven through the reported sequence, the streamed text is now identical to the whole-clip transcript, punctuation included: I did not say the three times. I did, however, say really three times. `_drive_stream` in the tests is the loop's four calls in its own order, so the three earlier reports are replayed against it too and none of them regressed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7oJz8M9QzsdJimoM318cj
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe streaming path now centralizes tail alignment and restores punctuation when later settled text confirms a sentence boundary. Tests add reusable stream driving and cover deferred punctuation, hallucinated words, unfinished punctuation, and pauses. ChangesStreaming punctuation recovery
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Streaming transcription now restores confirmed sentence punctuation without emitting standalone marks during pauses. The affected regression cases are covered, with no current merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The cost #55 named out loud, now paid off rather than a new defect.
Why the mark went missing
A mark rides on the word in front of it.
stable_prefixwill not type the mark on a word still touching the end of the audio — a pause is how whisper decides a sentence ended, and it takes that decision back the moment the speaker carries on. So the word landed bare, and nothing could ever put the mark on afterwards: the word is already on screen and there is no un-type.What answers it
A later pass. If the word carrying the mark is no longer at the end of the transcript — real speech follows it, and whisper still ends the sentence there — then the mark was decided with the following audio. That is the same test every other word passes before it is typed.
missing_markreturns it, joined to its word with no space in front, and only ever in the same breath as the word that proves it. So it can never be the lone full stop of #55: no confirming word, no mark._reachedis split out ofstream_tailbecause both now ask the same question about the same two sequences — where does the screen end inside this transcript — and two answers to that would drift apart word by word.Driven through the reported sequence
Identical, punctuation included.
_drive_streamin the tests is the loop's four calls in its own order, so the three earlier reports (#53 ellipsis, #55 lone period, #56 repeated word) are replayed against it too. None regressed.Gate
204 passed, ruff clean, mypy clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01P7oJz8M9QzsdJimoM318cj
Summary by CodeRabbit