Repository navigation
Reject invalid transcription times before they become audio citations. - #1560
Conversation
Signed-off-by: Virtue039 <77153652+virtue039@users.noreply.github.com>
|
Thanks, the validation itself looks right. One question about what happens when it fails: 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. |
|
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
left a comment
There was a problem hiding this comment.
Thanks, a bad timestamp now stops the job, so the recording isn't transcribed again.
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
Unreadableerror 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.
e1b0033passed 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 --checkandcargo clippy --locked --workspace --all-targets -- -D warningspassed.Before review