Skip to content

feat(knowledge): record the primary entry's media files in watch.json for relayout - #8193

Merged
kyle-sexton merged 5 commits into
mainfrom
work-resolve-issue/issue-7034-39106135673-1
Oct 19, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
work-resolve-issue/issue-7034-39106135673-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #7034

Summary

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

The watch acquire phase now records the primary entry's video, info JSON and caption file names in watch.json (phases.acquire.metrics.primaryMedia). relayout-slice.js selects those files in media mode, so a multi-video X post can be re-laid out with media. An older watch.json with no recorded entry and more than one video is still refused.

Not verified

  • Fragment-mode changelog fragment not created: the knowledge plugin is not in fragment mode, so plugin.json and CHANGELOG.md were bumped directly instead.
  • The type check (tsc) and lint were not run here; the review subagent could not run them either.

Fix

  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch.js: acquire metrics gain primaryMedia {video, infoJson, caption} as basenames
  • plugins/knowledge/skills/video-digest/extraction/watch/relayout-slice.js: media mode uses the recorded primary entry (validated as a plain file name present in the work dir), pairs the caption tracks by the info JSON stem, and skips the video-id equality check for a recorded entry
  • plugins/knowledge/skills/video-digest/extraction/watch/relayout-slice.test.js: three tests for a two-video session (recorded primary, recorded non-first primary, no record still refused)
  • plugins/knowledge/skills/video-digest/extraction/watch/run-watch-envelope.test.js: the acquire path writes primaryMedia to watch.json
  • plugins/knowledge/.claude-plugin/plugin.json: version 0.24.0 to 0.25.0
  • plugins/knowledge/CHANGELOG.md: 0.25.0 entry (the knowledge plugin is not in fragment mode)

Verification

The run reports:

Left out: the items under Not verified.

Related

#7034

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review (incremental, 158ac5f → 940c3b5)

No security issues found.

Scope: relayout-slice.js and relayout-slice.test.js. The change makes a recorded bare <id>.json info file usable. When the info name doesn't end in .info.json, the caption stem now falls back to the video's basename.

  • Path handling: recordedName still requires a value equal to its own path.basename that is also in the directory listing of workDir. The info.json read and the path.join calls therefore stay inside workDir, with no traversal.
  • Symlinks: ls filters on Dirent.isFile(), which excludes symlinks.
  • Stem source: the new stem comes from path.basename(videos[0], …), a work-directory filename, so it is not attacker-shaped input. Matched .vtt names are directory entries, so the transcript/… destination can't contain a path separator.
  • Information flow: the loosened check lets a <id>.json in the temp session be parsed as the metadata object. That session is the pipeline's own acquisition output, and the file is parsed as JSON and not executed. No new trust boundary is crossed.
  • Test: the new test only exercises the fallback and adds no risk.

I did not read the instruction exception register, because the diff touches no instruction surface.

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Incremental review of 940c3b5 against 158ac5f, covering relayout-slice.js and relayout-slice.test.js. No findings.

What changed

  • recordedInfo is now any recorded name that is a plain file present in the work dir. Before, it had to end in .info.json.
  • The caption stem is infoName minus .info.json when it has that suffix. Otherwise it is the video's basename.

Checked by reading the code

  • The <id>.json case now works: the recorded file is read as the info JSON, and <id>.en.vtt is still paired.
  • The old stem line, infoName.slice(0, -".info.json".length), would have cut the wrong characters from a bare <id>.json. The fallback fixes that.
  • With no recorded video, infoName is ${id}.info.json, so the stem is unchanged.
  • An empty id still refuses before stem is computed.
  • recordedName still requires a plain basename that exists in the work dir, so a recorded <id>.json cannot traverse paths.
  • The new test deletes .info.json and writes only <id>.json. It asserts the title read from that file and the copied caption track. It would fail if the fallback broke.

Not verified

  • I could not run the test suite here, because the command needed approval I didn't have. Everything above is from reading the diff and the surrounding source; the PR's pass counts are author-claimed.

Closing issue #7034

  • This increment doesn't touch the acceptance criteria.
  • Whole-PR criteria were reviewed earlier at 158ac5f.

kyle-sexton and others added 2 commits October 18, 2026 20:37
knowledge is in fragment mode, so a pull request may not bump its
version or add a CHANGELOG.md heading. Revert the 0.25.0 bump and
heading and carry the same entry as a minor fragment under
.changes/knowledge/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n suffix in relayout

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of 3 on 158ac5f.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 2 of 3 on 940c3b5.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: the verifier verdict refuses verify:earlier-fail at head 940c3b524fde92332ac4939117f171f7d54fb6a7. That refusal needs a human, who merges in person; the pr-merge lane will not merge this pull request.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Oct 19, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 872a7ca Oct 19, 2026
29 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-7034-39106135673-1 branch October 19, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(knowledge): record the primary entry's media files in watch.json so multi-video X posts can be re-laid out with media

1 participant