Skip to content

fix(stream): the mark lands once a later word confirms it - #57

Merged
hannesreinsch merged 1 commit into
mainfrom
fix/the-mark-lands-when-the-next-word-confirms-it
Sep 9, 2026
Merged

fix(stream): the mark lands once a later word confirms it#57
hannesreinsch merged 1 commit into
mainfrom
fix/the-mark-lands-when-the-next-word-confirms-it

Conversation

@hannesreinsch

@hannesreinsch hannesreinsch commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

"Oh, there was a break before, but no punctuation. Maybe we can fix that."

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_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 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_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

streamed  I did not say the three times. I did, however, say really three times.
whole clip I did not say the three times. I did, however, say really three times.

Identical, punctuation included.

_drive_stream in 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

  • Bug Fixes
    • Improved live transcription punctuation handling, restoring sentence-ending punctuation when later speech confirms it.
    • Prevented repeated or unfinished punctuation from appearing in streaming text.
    • Ensured confirmed punctuation appears before subsequent words after a pause.

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
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2126be39-3abc-40e8-b04b-75b6c15a042a

📥 Commits

Reviewing files that changed from the base of the PR and between f554f4d and e97f932.

📒 Files selected for processing (2)
  • murmurflow/dictate.py
  • tests/test_murmurflow.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The 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.

Changes

Streaming punctuation recovery

Layer / File(s) Summary
Alignment and punctuation recovery
murmurflow/dictate.py
stream_tail delegates alignment to _reached. missing_mark detects confirmed punctuation omitted from streamed text. The streaming loop prepends the mark to the next chunk.
Streaming regression coverage
tests/test_murmurflow.py
_drive_stream centralizes streaming test setup. Tests verify deferred periods, repeated hallucinated words, unfinished punctuation, and pause behavior.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to e97f9

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)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: streamed punctuation is restored when a later word confirms it. It is concise and specific.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/the-mark-lands-when-the-next-word-confirms-it

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hannesreinsch
hannesreinsch merged commit e97f932 into main Sep 9, 2026
2 checks passed
@hannesreinsch
hannesreinsch deleted the fix/the-mark-lands-when-the-next-word-confirms-it branch September 9, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant