Skip to content

fix(knowledge): check temp free space before a video-digest watch downloads media - #16940

Merged
melodic-automation-lanes[bot] merged 5 commits into
mainfrom
work-resolve-issue/issue-14708-44162684025-1
Nov 18, 2026
Merged

melodic-automation-lanes[bot] merged 5 commits into
mainfrom
work-resolve-issue/issue-14708-44162684025-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #14708

Summary

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

The video-digest watch now checks free space in the OS temp directory before it downloads, as the recorded decision chose (option A: a free-space check plus TMPDIR docs, no new flag). A new watch/temp-space-check.js runs one metadata-only yt-dlp probe with the watch's own format selector and reads the selected formats' size from %(filesize,filesize_approx)s. It doubles that size, scaled to the range's share for a ranged run, and compares it to statfs free space. watchUrl exits 1 before acquisition when space is short, with a message naming the directory, the space needed, the space free and the TMPDIR workaround. When no size is known it warns and continues. Design choice: the probe is a separate yt-dlp call in watchUrl, not a hook inside acquisition, because yt-dlp downloads in a single call and the acceptance criteria put the check in watchUrl. It goes through the same auth-fallback spawn path as the queue preflight, so a bot-checked video gets the same cookie fallback. The skill's gotchas, the watch-pipeline reference and the SKILL.md gotchas index document setting TMPDIR (TEMP on Windows) for the whole session.

Not verified

  • vitest suite (the new and edited tests) not run: this lane cannot run node or vitest, so the PR's CI runs them
  • tsc --checkJs and biome lint over the changed JS not run here: neither tool runs in this lane, so the PR's CI covers them
  • tidy skipped: the change touches 16 files, over the 10-file tidy cutoff
  • Not run against a real large video on a small tmpfs (no yt-dlp or network here). The size field behavior rests on the yt-dlp source read above.
  • Review finding left as is: the estimate counts yt-dlp staging only, not the frames and contact sheets that also go to OS temp, so it is a lower bound. That is within the issue's 'about 2x'.
  • Review finding left as is: an X post with no video still runs the probe and prints the 'free space not checked' warning. This matches the criterion that a missing size warns and continues.
  • Review finding left as is: the probe is one extra yt-dlp metadata request before acquisition. It uses --sleep-requests and the same 429 backoff as acquisition, but adds no phase gap between itself and the download.

Fix

  • plugins/knowledge/skills/video-digest/extraction/watch/temp-space-check.js: new module. Size probe (yt-dlp --skip-download -f <watch selector> --print size/duration, auth fallback, --sleep-requests), output parse (sums one line per media entry, unknown when any entry has none), estimate (2x,…
  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch.js: watchUrl runs checkTempSpace against os.tmpdir() after the temp dirs exist and before acquisition. Prints the message, exits 1 on short (the existing cleanup removes the unrecorded temp dirs), continues on unknown. Header comment…
  • plugins/knowledge/skills/video-digest/extraction/watch/temp-space-check.test.js: new tests for probe args, parsing (NA, several entries), probe success and failure via an injected spawn, the estimate (plain and ranged), byte formatting, and checkTempSpace's short, enough, unknown, probe-failed and…
  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch-failure-temp.test.js: mocks checkTempSpace. Adds run-level tests: short exits 1 before acquireMedia and removes all three temp dirs; unknown goes on to acquire.
  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch-signal.test.js: the fake yt-dlp answers the --print size probe and blocks only on the download, so the signal still lands mid-download.
  • plugins/knowledge/skills/video-digest/extraction/watch/{run-watch-asr-cues,run-watch-captionless-youtube,run-watch-degradation,run-watch-envelope,run-watch-signal-watching,run-watch-time-range,mixed-source-storage-invariant}.test.js: each stubs ./temp-space-check.js as enough, so these in-process…
  • plugins/knowledge/skills/video-digest/context/gotchas.md: new 'Small temp filesystem' section: the check's behavior, and the TMPDIR (TEMP on Windows) workaround. It must stay set for every later run.mjs call because tempSession paths are stored relative to the temp dir.
  • plugins/knowledge/skills/video-digest/context/watch-pipeline.md: one sentence on the pre-download check, pointing to the gotcha.
  • plugins/knowledge/skills/video-digest/SKILL.md: Gotchas index lists the new section.
  • .changes/knowledge/work-resolve-issue-issue-14708-44162684025-1-b3e7f29d.md: patch changelog fragment (Fixed).

Verification

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

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

The run reports:

  • read https: //raw.githubusercontent.com/yt-dlp/yt-dlp/master/README.md: output-template alternatives are separated with ','; --print implies --simulate; intermediary files go to the --paths temp path
  • read https: //raw.githubusercontent.com/yt-dlp/yt-dlp/master/yt_dlp/YoutubeDL.py: a merged format's filesize_approx is sum(filtered('filesize', 'filesize_approx')); process_video_result does new_info.update(fmt) before __forced_printings, so --print reports the selected format's size
  • read https: //nodejs.org/api/fs.html: fsPromises.statfs added in v19.6.0/v18.15.0; bavail times bsize gives available bytes
  • read https: //nodejs.org/api/os.html: os.tmpdir() reads TMPDIR, TMP, TEMP on POSIX and TEMP, TMP on Windows
  • lib/temp-session-paths.js serializeTempPath/resolveTempPath read: temp paths are stored relative to os.tmpdir() and resolved against it again, which backs the 'keep TMPDIR set for the session' docs
  • check-changelog-fragments: all 17 fragments valid
  • check-changed-skills: video-digest PASS, 0 errors (5 warnings already present, none from this change)
  • check-affected: 15 passed, 7 skipped over 16 changed files
  • cant-fail-scan --file temp-space-check.test.js --check: PASS, no findings, after changing one recomputed expected value to a literal
  • cant-fail-scan --file run-watch-failure-temp.test.js --check: PASS, no findings
  • fresh-context review subagent over the whole diff: no high-severity findings. Fixed what it confirmed: the signal test's fake yt-dlp now answers the probe so the test still covers a mid-download signal; the size sum covers several media entries; the probe uses --sleep-requests; the warning names…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44162684025

Left out: the items under Not verified.

Related

#14708

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

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental, blocking only): no security issues found

Scope: the changes since e93f2cbc30d611fdac51be49b638c1ea346a9568, in one file: plugins/knowledge/skills/video-digest/extraction/watch/temp-space-check.js. I read the file's whole hunk in .claude-lane/incremental.diff.

What changed: one comment line was added above adapter.matchUrl(url) (temp-space-check.js#L187). It links to yt-dlp's documentation on playlist expansion. No code, input handling, spawn argument, credential or control flow changed.

Security reading:

  • No trusted paths: the file matches none of the trusted-path globs.
  • No manifests: no plugin manifest changed.
  • No instructions removed: no standing instruction was deleted or softened.
  • Behaviour unchanged: the early return for URLs the adapter doesn't claim, reviewed at the earlier head, is unchanged.

Blocking only: this lane had already reviewed an earlier head, so this review reported only CRITICAL and IMPORTANT findings. It found none.

Prior findings: none carried forward. This lane's only earlier post was a summary with no line anchor, and it reported no findings.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44177707133

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed a5d5b30
Run 44177707133

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head e93f2cbc30d611fdac51be49b638c1ea346a9568. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@github-actions github-actions Bot 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.

claude-review: 1 inline finding(s) on 193737db1ff127bc36e4c0a2d7e432d2239d5eb4; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): free-space check before a video-digest watch download

This review covers only the push since e93f2cbc, which changed one file. I report blocking findings only, because this lane has already reviewed an earlier head.

What changed: the push adds one comment line to temp-space-check.js:189. The new line links yt-dlp's video-selection docs as the source for the claim that a playlist URL expands to every entry. It sits above the unclaimed-URL early return. No code behaviour changed.

The earlier finding stays fixed: an unclaimed URL still returns { state: "enough" } before any probe runs. Its thread is settled, and this push does not touch the logic it relied on.

No new blocking findings.

Not verified by me: whether CI passes. This lane ran no code.

Advisory and manifest lines (1)
  • Loosened-check verdict: fail (default; the prompt has no loosened_check_verdict: line); patterns: 0. This push adds only a comment and loosens nothing.

No verifier subagent ran, because there were no candidates.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44213752063

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM64u5PI
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed e93f2cb
Run 44213752063

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on e93f2cb.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44213752063

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44220189953

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed a712091
Run 44220189953

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for a712091

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-16940-a712091a33239c911aad6458228a52631fbbe14e, expires on 2026-12-18.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=a712091a33239c911aad6458228a52631fbbe14e rubric=10.2.1 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 18, 2026
Merged via the queue into main with commit 17816ab Nov 18, 2026
45 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14708-44162684025-1 branch November 18, 2026 03:00
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

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.

video-digest watch fails on a large video when OS temp is a small tmpfs, and nothing can relocate its media staging

1 participant