Skip to content

Bug: adjacent video caption cues lose word boundaries in transcripts #3928

Closed

Description

@yannickmonney

Bug: adjacent video caption cues lose word boundaries in transcripts

P2. Locally reproduced at current main f406afc4aa0d4b916d6f09ff9781400a92d7f4d0, with a separate independent review and replay.

Reproduction and result

Supply a synthetic VTT track with three adjacent cues, all in the same paragraph:

WEBVTT

00:00:00.000 --> 00:00:02.000
We will

00:00:02.000 --> 00:00:04.000
ship Monday.

00:00:04.000 --> 00:00:06.000
Thank you.

Run the actual video ingestion worker with fixed metadata/VTT and inert media, storage and job-service boundaries. Both human and automatic caption modes complete with the captured transcript payload:

[00:00:00] We willship Monday.Thank you.

The same malformed text reaches both the synthetic file-finalizer arguments and the blob bytes. Expected for these ordinary English cues: We will ship Monday. Thank you.. The missing boundaries alter readable words and sentences in the transcript offered as file content. No downstream LLM/search effect was measured.

Root

services/platform/backend/core/video_links/captions_parser.ts:108 trims each cue. The worker converts those cues to paragraph segments around ingest_video_link.ts:594–599. backend/core/file_metadata/paragraphize.ts:114 concatenates the paragraph with current.join(''), assuming its segments already carry any necessary separators. Whisper segments commonly contain leading spaces; trimmed VTT segments do not.

Use source-aware joining that preserves cue word boundaries while respecting punctuation, token splits and scripts written without spaces. A universal join(' ') change to the shared paragraphizer risks damaging Whisper and CJK output.

Evidence and controls

Ten tests passed in the coordinator's replay and an independent review replay: two worker cases demonstrate the same defect for human and automatic tracks; eight controls preserve both same-start speakers, collapse a growing auto-caption line, preserve one intact cue, break on a pause or speaker change, keep Japanese unspaced, retain Whisper leading spaces, and check growing-line dedup directly.

Evidence under /Users/yannick/.codex/notes/tale-1000-additional/video-caption-spacing-next/: worker-spacing.test.ts, pure-controls.test.ts, parent-replay.log, independent-replay.log, independent-review.md. Replay from the current-source platform checkout:

bunx vitest --config /Users/yannick/.codex/notes/tale-1000-additional/video-caption-spacing-next/vitest.config.ts run --reporter verbose

The worker's real parser, dedup and paragraphizer run. Media extraction and storage/native job services are controlled; finalization is in memory. The log key persistedTranscript names a captured file payload, not real PostgreSQL persistence. No download, media process, provider, real database, production test or downstream model execution occurred. Synthetic VTT files are retained.

Deduplication and acceptance

This was disclosed as a pre-existing follow-up in PR #3884. #3705 repaired lost distinct cues with the same start timestamp; the cues here have different starts, so that repair does not solve spacing. Current all-state caption-spacing/transcript-space searches and the baseline/accepted ledger found no equivalent issue. Human/automatic variants count as one paragraph-joining cause.

Acceptance: preserve the English word and sentence boundaries above, retain both same-start speakers and growing-line dedup, and keep unspaced-script, punctuation, paragraph/speaker and Whisper controls green.

Fresh main verification before publication

Main advanced during preparation, so publication was stopped and the probe was rerun from a clean detached checkout at 6483479b810228407994bff6ad04faa8a6c3d58c (merged #3906). The fresh parent run passed with the same observations and controls. Its log is parent-current-6483479.log, beginning with the actual checkout HEAD receipt. The earlier f406afc4 passages/logs describe the initial reproduction; fixed source markers inside scratch observation payloads identify that original probe, not the current replay revision. The intervening delta adds task-board search/read recovery and a shared query option type; the reported root is unchanged. No fix was observed in this delta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions