Skip to content

fix: long dictations no longer lose words after a pause or at the 13s window seam - #307

Merged
znat merged 2 commits into
mainfrom
fix/the-pause-retry-splices-its-tail
Sep 11, 2026
Merged

znat merged 2 commits into
mainfrom
fix/the-pause-retry-splices-its-tail

Conversation

@znat

@znat znat commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Dictations longer than about 13s lost words after a pause: the end of a sentence, or a clause in the middle. Ten dictations were flagged for this between 09-06 and 09-11, and about 1% of all dictations show the same signature in the trace. The words were already missing from the recogniser's first pass, so no transform could put them back.

This bumps FluidAudio from 0.15.5 to 0.15.7. The library now repairs the gaps at its own window seams and starts windows at silence, so the first pass keeps those words. All seven flagged clips that lost a tail or a middle decode whole with the bump alone. No app code needed to change for that.

The second commit keeps the app's own long-pause retry working under the new library. Its old acceptance rule swapped in the whole retry, but only when the retry's opening matched the first pass letter for letter. Under 0.15.7 the retry decodes the opening a little differently more often, so a recovered tail was thrown away with it. The retry now splices only its tail onto the first pass. The first pass's own text and tokens stay exactly as they were.

A reviewer should check splicingTail in Transcriber.swift: the run of words it takes, the word-start guard, and the capital it adds after a full stop.

Why the words went missing — the decoder stopped a second after each 12.88s window seam

Above 15s FluidAudio's batch path decodes 14.88s windows on a 12.88s stride. On every flagged clip the last decoded word ended 0.3 to 1.8s after a seam, then nothing, although the VAD heard speech for several more seconds. One clip lost a clause in the middle the same way. Re-decoding the seven clips from disk reproduced every loss. Cutting their pauses to 0.4s before decoding brought all seven back, and moving one 2.1s pause by 0.1s was enough on its own, so the seam was the cause, not the audio.

The app's retry for this (closeLongPauses) never ran on any of them: it waits for a pause over 8s, and the longest pause in the seven is 4.9s.

FluidAudio 0.15.6 and 0.15.7 target exactly this on the batch path: seam-gap repair (#761), end-aligned final window (#800), merge token order (#830), silence-aligned window starts on v3 (#869). All on by default. The app builds AsrManager with the default config, so nothing else changes.

Measurements — 7 of 7 flagged clips recovered, 30 of 30 short clips unchanged

The seven flagged clips, re-decoded from disk with the 0.15.7 build (--transcribe, scratch config): all seven come back with the words the speaker reported, for example "possible resulting sentences", "in the natural language package", "banner dismissed", "into complex analysis".

A sample of 90 live dictations since 09-09, raw first-pass text against the live record:

outcome clips
identical 69
longer, a real tail recovered 1
shorter, a trailing "Mm-hmm" gone 1
one or two words differ 15

Every differing clip is over 16s. All 30 clips under 12s decode identically, so the single-window path is untouched. Decode time median is unchanged; the longest went from 0.2s to 0.96s.

The app's other repairs were re-run against their own archived case sets under 0.15.7 and each still fires: 46 of 46 empty-decode clips are still empty on the first pass (the pad recovers 31), and 47 of 56 invented-ending clips still get an invented ending on the first pass. None was removed.

The retry splice — fires on 5 of 140 long-pause clips, recovers 18 words, changes nothing else

On the clip that showed the problem (10s pause, "will engage gently" lost), the two decodes differed by one number's notation: "seventy-one percent" against "71%". The letters-and-digits prefix test failed and the tail went with it.

splicingTail takes the retry's words that start after the first pass's last word and inside a VAD segment (0.3s margin over the VAD's own 0.75s hangover), as one contiguous run, and appends them. It refuses when the first taken token has no word-start mark, so text and tokens keep agreeing on word count. Confidence is recomputed from the joined tokens as withoutInventedTail does. When the first pass ended on a sentence mark, the tail gets a capital.

Every second archived live dictation with a pause over 8s, the population where the retry runs: 140 clips. The splice fired on 5 and recovered 18 words. Three match what the old build delivered live; two gain words the live delivery never had ("view transforms", "I came back to French transport"). The other 135 are untouched by the change. The seven flagged clips still decode exactly as with the bump alone; the retry does not fire on them.

extends stays for the padded second-opinion arms, which are still taken or dropped whole.

What this does not fix
  • A pause inside a single window. One flagged clip (13.9s, 8s pause) still loses "that heartbeat". Closing pauses before the first pass was measured on 250 archived clips and rejected: at 4s it recovers 6 and loses 57, because the VAD calls soft speech silence and the cut deletes real words.
  • Invented endings over trailing silence. One flagged clip still gets one; it passed the after-speech rule because one word scored 0.81 against the 0.8 ceiling. Unchanged here.

🤖 Generated with Claude Code

znat and others added 2 commits September 11, 2026 18:33
… window seam

FluidAudio 0.15.5 -> 0.15.7. The batch path now repairs seam gaps
(FluidAudio #761), end-aligns the final window (#800), keeps merge token
order (#830) and uses silence-aligned window starts on v3 (#869).

Re-decoded the 7 flagged clips from 09-06 to 09-11 that lost a tail or a
middle: 7/7 come back whole. On a 90-clip sample since 09-09: 69 same,
1 longer, 1 shorter, 15 differ by a word or two, all on clips over 16s;
every clip under 12s decodes the same.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Nathan Zylbersztejn <[email protected]>
The long-pause retry closes the pause and decodes the clip again, then had to
say everything the first pass said before it could be taken. Under FluidAudio
0.15.7 the windows sit elsewhere, so the retry's decode of the opening differs
more often and the guard refused tails that were real.

Measured today on parrotflow-2026-09-11T11-58-59-4DCBA9FA.wav. The only
difference was notation: the first pass wrote "seventy-one percent", the retry
wrote "71%". `extends` compares on letters and digits, which leaves "71"
against "seventyonepercent", so the prefix test failed and "will engage gently"
was thrown away with it.

The retry is no longer taken or dropped whole. The first pass keeps its text
and its tokens exactly, and only the retry's words that start after the first
pass stopped and that the gate heard speech at are appended. `extends` stays
for the padded arms, which are still all-or-nothing.

The spliced tail takes a capital when the first pass ended on a full stop. The
retry read the closed-up pause as one sentence and wrote its first word
lowercase; on the recording that pause is 8s or more of silence.

Over 140 live dictations with an internal pause above 8s: the splice fires on
5, recovering 18 words. Three come back exactly as the 0.15.5 build delivered
them, two recover a tail 0.15.7 had lost. No seam repeats a word. The other
135 are untouched by this. The 7 clips the bump fixed decode unchanged and the
retry does not fire on any of them.

Signed-off-by: Nathan Zylbersztejn <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@greptile-apps

greptile-apps Bot commented Sep 11, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository.

@coderabbitai

coderabbitai Bot commented Sep 11, 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: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 86806642-c4e1-4c6f-9fa4-b457528b4f03

📥 Commits

Reviewing files that changed from the base of the PR and between 737ef6c and 700653b.

⛔ Files ignored due to path filters (1)
  • Package.resolved is excluded by !**/Package.resolved
📒 Files selected for processing (2)
  • Package.swift
  • Sources/ParrotFlow/Transcriber.swift

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


Walkthrough

The package now requires FluidAudio 0.15.7. Long-pause retries preserve the original transcript prefix and append only recovered tail words when speech boundaries and token alignment are valid. The recovery logic recalculates confidence, restores sentence-start capitalization, and records unrecoverable rewrites for diagnostics. Documentation describes prefix validation and the eight-second pause threshold.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to 70065

The update preserves original transcript prefixes and appends only validated recovery tails; no current merge-blocking risk was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary fix: preventing lost words after pauses and at the approximately 13-second window seam.
Description check ✅ Passed The description explains the cause, implementation, measurements, reviewer focus, and known limitations. It does not follow the template's plain-text three-to-six-sentence format or include the standa…
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 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

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.

@znat
znat merged commit 066ddfe into main Sep 11, 2026
4 checks passed
@znat
znat deleted the fix/the-pause-retry-splices-its-tail branch September 11, 2026 16:59
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