Skip to content

Reject invalid transcription times before they become audio citations. - #1560

Merged
WaylandYang merged 3 commits into
deeplethe:devfrom
virtue039:fix/transcript-validate-segment-times
Dec 2, 2026
Merged

WaylandYang merged 3 commits into
deeplethe:devfrom
virtue039:fix/transcript-validate-segment-times

Conversation

@virtue039

@virtue039 virtue039 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

An invalid timestamp in a transcription provider's response can point a citation at the wrong part of the recording. Retrying the ingestion job would upload and transcribe the entire recording again.

What changes

Validate the start, end, and ordering of timestamps for each segment containing text. If one fails validation, reject the whole transcription response and report the segment number and reason. Every accepted passage then has timing information its citations can use. Valid passages from a rejected response are discarded along with the invalid passage.

Return the existing Unreadable error for these validation failures. The ingestion pipeline marks that error as terminal, so the job queue stops automatic retries.

How it was checked

The regression covers a missing start, a negative start, a nonnumeric end, and an end just before its start. It checks the error type, the segment number, and the reason. The new type assertion failed on the published commit and passed with the local review change.

  • The local revision on top of e1b0033 passed all four transcript tests on macOS arm64. The Rust workspace suite passed with 1,871 tests and six ignored, using a dedicated PostgreSQL test database and Poppler.
  • cargo fmt --all --check and cargo clippy --locked --workspace --all-targets -- -D warnings passed.

Before review

  • The published commit is signed off under the DCO.

Signed-off-by: Virtue039 <77153652+virtue039@users.noreply.github.com>
@WaylandYang

Copy link
Copy Markdown
Contributor

Thanks, the validation itself looks right. One question about what happens when it fails: reading() now returns a plain anyhow error, so the pipeline treats it as retryable. Each retry re-uploads and re-transcribes the whole recording, up to max_attempts. Since a bad timestamp is a property of the provider's response for that file, should this be terminal (.context(Terminal) or the existing unreadable path), so we don't pay for repeated transcriptions?

Also, is rejecting the whole recording intended? The alternative is keeping the text and dropping only the bad segment's anchor. Either way is defensible; please say which in the description.

@virtue039

Copy link
Copy Markdown
Contributor Author

Thanks for raising the retry cost. I’m routing invalid provider timestamps through Unreadable so the existing pipeline marks this failure as terminal. I’m keeping whole-response rejection because every accepted passage needs usable citation timing. The updated regression checks the error type, segment number, and reason.

Signed-off-by: Virtue039 <77153652+virtue039@users.noreply.github.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a bad timestamp now stops the job, so the recording isn't transcribed again.

@WaylandYang
WaylandYang merged commit a8aa4ba into deeplethe:dev Dec 2, 2026
6 checks passed
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.

2 participants