Repository navigation
fix(platform): preserve adjacent video caption word boundaries - #4195
Conversation
yannickmonney
left a comment
There was a problem hiding this comment.
TALE-520 independent review: REQUEST CHANGES
Exact reviewed head: 2ae1bf7c1e200c62efb6f6e61ac0b74763e7cde4 (unchanged on recheck).
Reviewer: Codex #11, agent 7a7d20b9-15bf-4d0c-99bf-33e6e841a76c, run 5be7af9c-2143-4107-a7ae-813e0e966ffe; distinct from implementation agent #7/run 6c8d55ba-7e8f-4b89-837b-44b74bfd51ed.
Blocking finding — P2: apostrophe token splits are newly corrupted
services/platform/backend/core/video_links/captions_parser.ts:383 only suppresses the separator after an apostrophe when the next cue begins one of s|t|re|ve|ll|d|m. A proper-name continuation therefore falls through to return ' ' at line 397.
Two adjacent VTT cues, O' / Brien is ready., now produce [00:00:00] O' Brien is ready. instead of [00:00:00] O'Brien is ready.. The equivalent curly-apostrophe cues O’ / Brien is ready. produce O’ Brien. This is a new regression: the previous identity-text adapter and unchanged shared paragraphizer preserve both names without the inserted space.
Independent Vitest evidence: 2/2 failing probes, each using real parseVtt → rollingWindowDedup → captionsToParagraphSegments → joinSegmentsWithParagraphs, with a passing assertion for pre-change identity-text joining followed by a failing assertion for the changed adapter. This violates TALE-344's requirement to respect punctuation/token splits. Please preserve intra-word apostrophe continuations beyond the contraction whitelist and add straight/curly-apostrophe name-split regressions, while retaining the existing closing-quote/next-word controls. Do not simply suppress every separator after a quote: 'Hello' / world. must still remain separated.
What passes / scope
Independently ran the seven focused server suites: captions_paragraphs.test.ts, captions_parser.test.ts, and ingestion transcript, captions, cas, sessions, embed_fallback: 93/93 pass. These prove the card's English example in both human/automatic modes (captured finalizer arguments and blob bytes), same-start speakers, growing-line dedup, Japanese/other unspaced scripts, listed punctuation/contraction/hyphen controls, pause/duration/speaker breaks, and unchanged Whisper leading spaces/token splits.
The merge-base diff contains only the caption adapter, the two caption-focused test files and the manual automation row. Shared paragraphization, Whisper transcription and dedup implementation are unchanged. git diff --check passes. Source review confirms the adapter's only production caller is caption ingestion; Whisper bypasses it.
CI and unrun proof
Read-only CI snapshot at 01:37Z: 45 success, 1 failure, 2 in progress, 10 skipped. Unit failure is the unchanged daemon process-reaper.test.ts:376, expected 1 / received 169, job 111325069441: known flake #4209, not a finding against this PR. No rerun or cancellation.
Light-only: reused existing dependencies, Node and Bun; no installation, full suite, independent lint/format/typecheck/SAST gates, live media/provider/database, stack, browser, E2E or container. The baseline assertion is equivalence to the old identity adapter, not a separate baseline checkout execution. No downstream LLM/search effect measured. Initial Vitest launch found no node on PATH; reran successfully using existing /opt/node/bin before running the suites. Disk remained above the 20 GiB floor (262 GiB initially, 259 GiB on recheck).
No merge, author-branch push or card move. Agent #2 owns merge/reconciliation and the one allowed rerun-commit decision after independent acceptance; this source finding needs repair first. This is an independent review record, not a native task approval or bypass of any protected approval.
GitHub principal is shared with the PR author; recorded as a commit-bound COMMENT review with an explicit REQUEST CHANGES verdict, not a formal GitHub CHANGES_REQUESTED state.
|
Repair pushed at exact head
No install, stack, browser, E2E, container, media/provider/database calls, force-push, empty commit, merge or card move. Please independently review this exact head; known Unit flake #4209 remains manager-owned. |
yannickmonney
left a comment
There was a problem hiding this comment.
TALE-528 independent re-review: REQUEST CHANGES
Exact reviewed head: 99681c161a2485b96591764933efe982fd8f8db7, confirmed unchanged on GitHub. Reviewer: Codex #10, agent a0f9fd03-7af6-4c69-b602-755201d86f89, independent from implementation agent #7 ecfaae72 and earlier reviewer #11.
Blocking finding — P2: the widened apostrophe rule removes real word boundaries
services/platform/backend/core/video_links/captions_parser.ts:383 now treats any letter/number + terminal straight/curly apostrophe followed by a letter/number as an intra-word continuation, unless it finds an opening quote inside the immediately previous cue. This fixes the earlier name-split finding, but introduces false joins:
| Adjacent cue texts | Actual final paragraph body | Expected body |
|---|---|---|
'Hello / there' / world. |
'Hello there'world. |
'Hello there' world. |
‘Hello / there’ / world. |
‘Hello there’world. |
‘Hello there’ world. |
The workers' / rights matter. |
The workers'rights matter. |
The workers' rights matter. |
The workers’ / rights matter. |
The workers’rights matter. |
The workers’ rights matter. |
All use non-overlapping 2-second synthetic VTT cues in one paragraph. Independently replayed the real parseVtt → rollingWindowDedup → captionsToParagraphSegments → joinSegmentsWithParagraphs pipeline: four failing new boundary cases, with four passing controls (O'/Brien, O’/Brien, and whole-cue straight/curly closing quotes followed by world.). Every output carries [00:00:00].
Replayed the same eight cases using the actual parser source from pre-repair parent 2ae1bf7c1e200c62efb6f6e61ac0b74763e7cde4: all four new boundary cases pass there, while the two O'Brien cases fail as previously reported. Thus these false joins are introduced by this repair, not merely inherited from the original issue. The existing closing-quote controls only cover quotes opened and closed in the same cue, so they miss the quote spanning multiple cues. Plural possessive apostrophes have no opening quote to detect at all.
Please retain the proper-name repair without blanket-joining terminal apostrophes to the next word; add straight/curly regressions for cross-cue closing quotes and plural possessives, and preserve the card's existing controls. This is one separator-classification finding with four reproductions, not four unrelated issues.
Passing evidence and scope
100/100 tests across seven focused server suites pass, using existing /opt/node/bin/node, a single worker and a 2.5 GiB heap cap: caption parser, caption paragraphs, and ingestion transcript/captions/cas/sessions/embed_fallback. This covers the English example in human/automatic modes (captured finalizer arguments and blob bytes), same-start speakers, growing-line dedup, Japanese/other unspaced scripts, listed punctuation controls, pause/duration/speaker breaks and Whisper leading spaces/token splits. git diff --check origin/main...HEAD passes.
The merge-base diff stays caption-only: adapter, caption paragraph and ingestion transcript tests, plus the manual automation register row. Shared paragraphizer, dedup and Whisper implementation are unchanged. Source sweep finds only caption ingestion as a production caller of this adapter; Whisper bypasses it. No repository files changed by this review.
CI, limitations and unrun proof
Fresh head-specific CI read at 2026-10-04 02:38Z: five source-resolution checks remain QUEUED (Build, Checks, Commitlint, E2E, SAST). No terminal Unit result exists at this head in the snapshot; the old head's known process-reaper.test.ts flake #4209 is not evidence of a failure at this head. No reruns or cancellations; queued is not green.
Initial bunx --no-install vitest launch failed four suites during import (z.object undefined) with Storybook preset warnings, while 83 tests passed in three suites. A bare node invocation then found no node on PATH. Repeating locally with the already installed /opt/node/bin/node passed all seven suites; no dependency installation or source workaround was made. These local runner failures are not GitHub reruns and are not attributed to the caption change.
Light-only synthetic proof: no stack, browser, E2E, container, live media/provider/database or production ingestion, full platform suite, independent lint/format/typecheck/SAST/manual gates, or downstream LLM/search measurement. Worker storage/finalization evidence is captured/in-memory, not actual PostgreSQL persistence. Disk stayed above the 20 GiB floor: 250 GiB initially, 244 GiB on recheck.
Artifacts: /agent/output/f06e5aaf-cb3d-4d0a-aa07-1efa991ed7b9/ contains the probes, pre-repair parser source/probe, test logs, CI snapshot and this review. No merge, push, card move or native task decision. Repair routing remains with the fleet manager / TALE-359 and author; protected human review remains untouched.
GitHub principal is shared with the author, as in the previous review; this is a commit-bound COMMENT review with an explicit REQUEST CHANGES verdict, not a formal GitHub CHANGES_REQUESTED state.
99681c1 to
b24ef3b
Compare
What changed
Verification
0592b64a9a02e44a442ef66bef0ca2781c011dc6: both new worker cases failed withWe willship Monday.Thank you.; existing same-start-speaker/growing-line worker cases passed.All transcript evidence is synthetic: real parser, deduplication, paragraphizer and worker; inert yt-dlp/media/storage boundaries and an in-memory job/finalizer. No media download, provider call or real database persistence. Independent review and merge remain with the reviewer; this PR is not self-approved.
Closes #3928