Skip to content

feat(knowledge): cut captions to a ranged watch and skip the caption wait when ASR can stand in - #16448

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-16128-43762956135-1
Nov 15, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-16128-43762956135-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #16128

Summary

Opened by the work-resolve-issue lane. The run's own summary:

A ranged watch --from/--to now cuts caption cues to the range in full-video time before writing the transcript (new cuesInRange in lib/time-range.js), and watching gets the same cut. When the range has no captions, the asr rung runs on the ranged media; that part already landed in #16142. A ranged run of a live-derived video with no captions skips the caption wait when ASR is detected. This follows the recorded decision: no new flag. run-watch probes ASR before acquisition and passes skipCaptionWait through the registry and the YouTube adapter to acquireYouTubeMedia. That function turns an open wait in full mode into a caption-less acquisition with a captionWait note, and the note lands in watch.json's acquire phase; the transcript phase's transcriptStrategy records the asr path. An explicit caption --transcript-strategy never falls through to ASR, so it keeps the wait, as does a run without ASR or a transcript-mode run.

Not verified

  • The vitest suites (acquire.test.js, time-range.test.js, run-watch-time-range.test.js) were not executed: this lane can run no node or test runner. They are left to the PR's CI.
  • Build/lint (biome, tsc type check) for the touched JS could not run here; left to the PR's CI.
  • Tidy skipped: the change touches 15 files, over the 10-file tidy cutoff.

Fix

  • plugins/knowledge/skills/video-digest/extraction/lib/time-range.js: new cuesInRange (overlap filter in full-video time); cuesInMediaTime builds on it
  • plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js: buildTranscriptText takes timeRange and keeps only cleaned cues overlapping it; caption sourceCues are cut the same way
  • plugins/knowledge/skills/video-digest/extraction/acquisition/caption-wait.js: new captionWaitSkippedNote
  • plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.js: skipCaptionWait option turns an open wait in full mode with downloaded media into a caption-less result with an acquireMetrics.captionWait note
  • plugins/knowledge/skills/video-digest/extraction/adapters/adapter-contract.js: AcquireContext.skipCaptionWait documented
  • plugins/knowledge/skills/video-digest/extraction/adapters/registry.js: acquireMedia forwards skipCaptionWait
  • plugins/knowledge/skills/video-digest/extraction/adapters/youtube.js: passes skipCaptionWait to acquireYouTubeMedia
  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch.js: on a ranged run with no caption strategy override, probes ASR before acquire, sets skipCaptionWait, and reuses the probe result for the transcript writer
  • plugins/knowledge/skills/video-digest/extraction/lib/time-range.test.js: cuesInRange test
  • plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.test.js: skip in full mode succeeds caption-less with the note; transcript mode still holds
  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch-time-range.test.js: captionless live-derived ranged run through the real registry/YouTube adapter with fake deps (wait skipped, note in watch.json, asr transcript in full-video time); caption cues cut to range; explicit captions…
  • plugins/knowledge/skills/video-digest/context/watch-pipeline.md: ranged-run caption cut and caption-wait skip documented
  • plugins/knowledge/skills/video-digest/context/output-contract.md: captionWait note also covers a skipped wait
  • plugins/knowledge/skills/video-digest/reference/sources/youtube.md: caption-wait section names the ranged-run skip
  • .changes/knowledge/work-resolve-issue-issue-16128-43762956135-1-9627e1d8.md: minor changelog fragment

Verification

The runner ran each check from the base copy against a026763:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 3 fragments valid
  • check-changed-skills: video-digest PASS, 0 errors, 5 warnings, none new to this change (they cover SKILL.md size, an unguarded injected command, a numbered procedure and judgment language at an existing line)
  • check-affected: 14 passed, 7 skipped, over 15 changed files
  • fresh-context review subagent of the whole diff: one medium finding (the wait was skipped even under an explicit caption --transcript-strategy, which never falls to ASR) fixed and covered by a test; one low finding (the skip note asserted that ASR runs) reworded; one low finding (an extra ASR probe…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43762956135

Left out: the items under Not verified.

Related

#16128

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed a026763e5a7e24a7179ba5ad871e8f21857da04a: read 15 of 15 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read the whole diff, every hunk of all 15 listed files.

What the change does. It changes the knowledge:video-digest watch pipeline, which is local media tooling:

  • Caption cut: a new cuesInRange function filters caption cues to a numeric time range.
  • buildTranscriptText: it now cuts its cues by timeRange when one is given.
  • skipCaptionWait: a new boolean option passes from run-watch.js through registry.js and youtube.js to acquireYouTubeMedia. In full mode, with downloaded media and ASR detected, it turns an open caption wait into an acquisition that goes ahead without captions and records a note.

Security surface checked.

  • Injection: none. skipCaptionWait is a boolean, and youtube.js sets it with === true. It never reaches buildYtDlpArgs or any spawn argument. The timeRange that reaches yt-dlp is unchanged by this diff. The new note text only goes into watch.json and CLI output.
  • ASR probe: run-watch.js now calls the existing detectAsrCapability() earlier and hands the result to the transcript writer. That function already ran in the transcript writer, so no new command runs and no new input reaches it.
  • Controls: no trust controls, workflows, token or kill-switch code, merge holds or plugin manifests are touched. None of the changed files match a TRUSTED PATHS: glob.
  • Instructions: no guardrails are removed from any instruction surface. The doc edits (watch-pipeline.md, output-contract.md, youtube.md) describe the new behaviour and loosen no standing rule.
  • Tests: the test changes use local fixtures and fake dependencies only.

Embedded text: there are no directives aimed at the review in the PR context.

Spend: none beyond the normal run. The ranged ASR probe is local and costs nothing.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed a026763e5a7e24a7179ba5ad871e8f21857da04a: read 15 of 15 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #16448 (head a026763)

I read every hunk of all 15 changed files. I also read the unchanged code they call: writeEnvelopeTranscriptArtifacts and buildTranscriptText in write-transcript.js, resolveTranscriptStrategy, the caption-wait block in acquireYouTubeMedia, watchUrl in run-watch.js, and the mock setup in run-watch-time-range.test.js.

No findings.

Closing issue #16128 (done-when items as restated in the recorded decision comment)

  • "Captions are cut to the range; when none exist, the asr rung runs on the ranged media."
    • Met. cuesInRange filters the cleaned caption cues before repair and formatting, and it also filters sourceCues.
    • Tested: time-range.test.js covers cuesInRange, and run-watch-time-range.test.js covers both the caption-cut case and the transcript in full-video time.
    • The ASR-on-ranged-media path was already in place and tested before this PR.
  • "A ranged run of a live-derived video with no captions does not enter the caption wait when asr is available … and records which path it took."
    • Met. run-watch.js probes ASR before acquisition, but only on a ranged run whose strategy override is null or asr. It passes skipCaptionWait to the acquire call.
    • acquireYouTubeMedia skips the hold only in full mode with downloaded media, and records captionWaitSkippedNote in acquireMetrics.captionWait.
    • The transcript phase records transcriptStrategy: "asr".
    • Tested end to end through the real registry and YouTube adapter, with fake I/O. Unit tests in acquire.test.js cover the full-mode skip and the transcript-mode hold.
    • One small gap: the test "keeps the caption wait under an explicit caption strategy" only checks that skipCaptionWait: false is passed. The acquire unit tests cover the hold behavior that follows from that flag.
  • The decision's build note asked for "no new flag". No new flag was added.

Checks I traced in the code:

  • When the wait is skipped, captionWait is not returned, so run-watch does not take the CAPTIONS_PENDING_EXIT branch. The test expects result.captionWait to be undefined.
  • captionOptional now runs before the wait check. Nothing changes as a result, because artifacts.videoPath is already resolved at that point.
  • buildTranscriptText's new timeRange option defaults to null, so the non-ranged callers are unchanged.
  • cuesInMediaTime now reuses cuesInRange. Watching cues get filtered twice, which is harmless and gives the same result.
  • The pre-probed ASR result is handed to the transcript writer through detectAsr, so ASR is not probed a second time on the ranged path.

Not verified: the vitest suites, biome and tsc. I had no runner in this lane. The PR body says they were not run either and leaves them to CI. The author's claim that the changelog and changed-skills checks passed is unverified by me.

Spend (not a finding): a ranged run without a caption-strategy override now always runs the ASR toolchain probe (it spawns interpreters) before acquiring, even when captions turn out to exist. That costs local run time only, nothing billed.

No plugin manifest changed. The changelog fragment's bump: minor matches a feature-level behavior change. The PR context file contains no embedded instructions to this lane.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head a026763e5a7e24a7179ba5ad871e8f21857da04a, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=a026763e5a7e24a7179ba5ad871e8f21857da04a rubric=9.4.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit f2added Nov 15, 2026
49 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-16128-43762956135-1 branch November 15, 2026 21:53
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit f2added8484de4acc849e87905f17fb13eee093c; later checks count it verified from this comment.

@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 3, survived 4, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 43%; mutation score 43%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.js 0 1 0 0 0 0
plugins/knowledge/skills/video-digest/extraction/adapters/registry.js 1 0 0 0 0 0
plugins/knowledge/skills/video-digest/extraction/lib/time-range.js 0 1 0 0 0 0
plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js 1 1 0 0 0 0
plugins/knowledge/skills/video-digest/extraction/watch/run-watch.js 1 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/knowledge/skills/video-digest/extraction/acquisition/acquire.js:422 LCR productive no-assertion
plugins/knowledge/skills/video-digest/extraction/lib/time-range.js:136 ROR productive input-gap
plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js:478 other productive no-assertion
plugins/knowledge/skills/video-digest/extraction/watch/run-watch.js:349 LCR productive input-gap

The run's summary has the full report.

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.

knowledge:video-digest: digest a time range of a video (--from/--to) - part 2 of 4

0 participants