Skip to content

fix(knowledge): classify removed and link X posts in video-digest preflight - #7822

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-6821-39071048083-1
Oct 17, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-6821-39071048083-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #6821

Hold: a human merges this

Summary

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

X preflight now rejects a removed or nonexistent status (no uploader, description or counts) as unavailable and takes a link post's delegation refusal as ok with an empty-media note. Acquisition fails a removed post permanently instead of as rate-limited retry-later. The slice README is written after transcripts and lists only those written; a 0-entry post says no video entries were found.

Not verified

  • The new and existing vitest tests were not run: the lane's run-test-file wrapper only accepts test_*.py, *.test.sh and *.test.mjs, and direct npx vitest was refused. The code and tests are unexecuted.
  • The yt-dlp template field %(description&D|)s was not run against real yt-dlp; the subagent reviewer judged the syntax valid. Deleted (not never-existing) posts, login-required posts and multi-video posts were not probed. The 3-failure retry cap is documented in the queue spoke only, not enforced
  • Build, lint and class audits not run for the same tooling reason.

Fix

  • plugins/knowledge/skills/video-digest/extraction/acquisition/preflight-metadata.js: extra --print probe fields, isEmptyPostShell, unavailable and link-post ok branches for mediaOptional sources
  • plugins/knowledge/skills/video-digest/extraction/adapters/x.js: isRemovedPostPayload and permanent 'X post unavailable' failure
  • plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js: README built from written transcripts, no-video wording
  • plugins/knowledge/skills/video-digest/extraction/adapters/x.test.js, extraction/transcript/write-transcript.test.js: new tests for the three cases
  • plugins/knowledge/skills/video-digest/context/watch-queue.md: spoke documents the new rows and a 3-failure cap on degraded retries per id
  • .changes/knowledge/fix-video-digest-x-preflight-9d3e5a71.md: patch fragment

Verification

The run reports:

Left out: the items under Not verified.

Related

#6821

…flight

Reject empty-shell statuses as unavailable, take link-post delegation refusals as ok, fail removed posts permanently at acquisition, and build the slice README from transcripts actually written.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed e2d68778053897f9d0857f4c03a47cf7ea892654: 0 finding(s), 0 as inline comments.

Security review: PR #7822 (head e2d6877)

No security issues found. I reviewed all 7 changed files, which touch the video-digest X preflight, the X adapter, the transcript README writer, and tests and docs.

The checks I made:

  • Preflight print template. The new fields are %(description&D|)s and three count fields. The description is replaced by a literal D, so attacker-controlled post text never reaches the new fields. Post-controlled title, channel and uploader_id can still contain the 0x1f separator, which could shift fields. The only effect would be a post being classified as enqueue or reject, so this is a correctness edge case and not an exploit. Title and channel display values still go through the existing escapeTableCell and title cap.
  • Empty-shell classification (isEmptyPostShell, isRemovedPostPayload). These are pure predicates on yt-dlp output. They add no command execution, path handling or network access. The worst outcome of a wrong result is a reject or a failed-permanent row.
  • Link-post delegation refusal. It reuses the existing parseDelegationRefusal, which already rejects refused URLs that are X status URLs. The new branch fetches nothing and returns an ok row with a fixed note.
  • README writer. The transcript paths it lists come from adapter-written entry.transcriptPath values, made relative to the slice directory. The README is written inside sliceDir. videoTitle and sourceUrl interpolation into the README markdown was already there. Moving the README write to after the transcripts changes ordering only, and the README is a local artifact.
  • Instruction-surface lens. The watch-queue.md change adds guidance (a retry cap of 3 and a permanent-failure row) and removes or softens no guardrail. I did not need to consult the instruction exception register.

No Actions workflow, permission, secret or dependency-pin changes are in the diff.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed e2d68778053897f9d0857f4c03a47cf7ea892654: 0 finding(s), 0 as inline comments.

I found nothing to block on in PR 7822, so I posted no inline comments. I read all 7 changed files in the diff and the surrounding code in x.js, preflight-metadata.js and write-transcript.js. I did not run the tests, so the new test cases are unverified.

  • Preflight empty-shell check: The print template has 8 fields, which matches the fields.length < 8 guard. In yt-dlp output templates, %(description&D|)s prints D when a description exists and an empty string otherwise. A real post always has an uploader_id, so it never matches the empty shell.
  • Link-post refusal in preflight: The refusal pattern ignores refusals of an X URL itself, so the allow-list misconfiguration case still fails as before. It is gated on mediaOptional, so other sources are untouched.
  • Removed-post acquisition: The new branch only fires when the fallback warning was not seen and the payload is post-level with no uploader, description or counts. A rate-limit fallback that only drops counts still goes to failDegraded.
  • Slice README written last: writeEnvelopeTranscriptArtifacts is the only caller of writeSliceReadme. The loop has no early return, so the README is still written on every normal path. If a caption read throws, no README is written now, where before it was written first. I treated that as acceptable because the whole call throws anyway.

Two points I did not flag, because they are minor and the PR already documents them:

  • Inconsistent signals: Preflight tests channel and uploader_id, while acquisition tests uploader and uploader_id. They agree on every case I could construct.
  • Retry cap is docs-only: The 3-retry cap on degraded failures is guidance in watch-queue.md, not code. The PR says so, but the NOTE above detectSyndicationDegradation in x.js still says a queue-level retry would need an attempt cap.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit d69c29a Oct 17, 2026
20 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-6821-39071048083-1 branch October 17, 2026 22:44
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: risk MED at head e2d68778053897f9d0857f4c03a47cf7ea892654. Only LOW merges without a human; this pull request waits for one.

MED evidence-unbound:claude-review: not bound: no-run
MED evidence-unbound:claude-security-review: not bound: no-run

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.

fix(knowledge): video-digest X preflight misclassifies nonexistent and link posts, and 0-entry runs write a false README

1 participant