Skip to content

refactor(knowledge): write video-digest watch JSON through one writeJsonFile helper - #15630

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15626-43269229289-1
Nov 12, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #15626

Summary

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

Added writeJsonFile(filePath, value) beside readJsonFile in plugins/knowledge/skills/video-digest/extraction/lib/watch-frame-index.js. It writes the same bytes as before: pretty-printed JSON with a trailing newline, utf8. The two local writeJson helpers in repair-synthesis-promotions.js and sanitize-slice-temp-paths.js are gone, and their 7 calls now call writeJsonFile. The 3 inline writes in export-sheet-frame-index.js, merge-triage-json.js and vision-gated-promote.js call it too. Every fs import and the fs.mkdirSync calls before the inline writes stay. No behavior change. Out of scope and left alone: queue-claim.js, write-watching-manifest.js, course-digest, and the same write in watch/snapshot-bootstrap.js:59, which the issue does not list.

Not verified

  • plugins/knowledge/skills/video-digest/scripts/run-tests.sh all (install, typecheck, vitest) was not run: this lane's Bash runs only the named wrappers. Left to the PR's CI test-node lane.
  • ci-status green: a PR CI check, left to the PR's CI.
  • tidy pass 5 (ai-slop:audit fix): the lane does not allow running detect.sh, so the detector did not run. The one-line fragment was checked by reading it against the catalog, with no findings.
  • Lint of the touched JS files (the package's own lint/typecheck) was not run here; covered by the test-node lane's build step in CI.

Fix

  • plugins/knowledge/skills/video-digest/extraction/lib/watch-frame-index.js: export writeJsonFile with JSDoc types next to readJsonFile; header now says 'reads and writes'
  • plugins/knowledge/skills/video-digest/extraction/watch/repair-synthesis-promotions.js: drop local writeJson; import writeJsonFile and call it at the 3 former writeJson sites
  • plugins/knowledge/skills/video-digest/extraction/watch/sanitize-slice-temp-paths.js: drop local writeJson; import writeJsonFile and call it at the 4 former writeJson sites
  • plugins/knowledge/skills/video-digest/extraction/watch/export-sheet-frame-index.js: import writeJsonFile; replace the inline pretty-printed write
  • plugins/knowledge/skills/video-digest/extraction/watch/merge-triage-json.js: import writeJsonFile; replace the inline pretty-printed write
  • plugins/knowledge/skills/video-digest/extraction/watch/vision-gated-promote.js: import writeJsonFile; replace the inline pretty-printed write
  • .changes/knowledge/work-resolve-issue-issue-15626-43269229289-1-3f69d73e.md: new patch fragment, '### Changed' / 'Internal restructuring, no behavior change.'

Verification

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

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

The run reports:

  • check-changelog-fragments: all 6 fragments valid (run before and after tidy)
  • check-changed-skills: video-digest PASS, 0 errors (5 warnings already present in SKILL.md, untouched by this change)
  • check-affected: 12 passed, 7 skipped (typos not installed; checks that run checked-tree code are left to CI), 0 failed
  • Grep over extraction/watch: no writeJson reference left in the five scripts; the remaining pretty-printed writes are the out-of-scope ones the issue names, plus snapshot-bootstrap.js:59
  • fresh-context review subagent over the full diff: no correctness bugs; written bytes identical; fs still used in each script; tsconfig checkJs accepts the JSDoc types; no other module depended on the removed private helpers
  • tidy-diff over the 17 changed hunks: no edits needed; one out-of-scope proposal (snapshot-bootstrap.js:59 repeats the write)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43269229289

Left out: the items under Not verified.

Related

#15626

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15630 (head d9b2499)

No security issues found.

What I checked: I read all 7 changed files in full in .claude-lane/pr.diff.

  • The PR adds writeJsonFile(filePath, value) to plugins/knowledge/skills/video-digest/extraction/lib/watch-frame-index.js. It runs fs.writeFileSync(filePath, \${JSON.stringify(value, null, 2)}\n`, "utf8"), which writes exactly the same bytes as the inline writes and the two private writeJson` helpers it replaces.
  • Each of the 10 call sites passes the same path expression it passed before (lanePath(...), path.join(triageDir, "manifest.json"), watchPath, selectionPath, indexPath, snapshotMetaPath, decisionsPath, mapPath). No write target moves, and the change adds no path built from untrusted input.
  • The fs.mkdirSync calls before the writes are unchanged. The dryRun guards in repair-synthesis-promotions.js and vision-gated-promote.js still wrap the same writes.
  • The changelog fragment .changes/knowledge/...-3f69d73e.md is metadata only.

Out of scope for this lane: No changed file matches a trusted-path glob. The PR touches no trust control, merge hold, token scope, kill switch, workflow, plugin manifest or standing instruction. Nothing here falls in zizmor's Actions lane.

PR context: It contains no embedded instructions aimed at the review. Its claim of no behavior change matches the code.

Prior findings: None. This is the first review of this PR, so it was not blocking only.

Spend: None.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 7 changed files. None of them match a trusted-path glob.

What changed: A new writeJsonFile(filePath, value) sits beside readJsonFile in lib/watch-frame-index.js. The repeated pretty-printed JSON write in five watch/ scripts now goes through it: the 7 calls to the two removed local writeJson helpers and the 3 inline writes. The helper uses the same fs.writeFileSync(path, \${JSON.stringify(value, null, 2)}\n`, "utf8")expression, so the bytes written and when they are written stay the same. Thefs.mkdirSynccalls before the old inline writes are kept. Every script still has itsfs` import, which only lint would catch anyway.

Things I checked that turned up no problem:

  • No test under extraction/ mocks or spies on fs.writeFileSync. Moving the call into the lib module therefore can't change what a test sees. The tests only use writeFileSync to set up fixtures.
  • writeJson was private to each file, so removing it breaks no other module.

Closing issue #15626, acceptance criteria:

  • "The pretty-printed JSON file write exists once, in writeJsonFile … and the five scripts call it": met. All five scripts import it and call it at every listed site.
  • "Behavior is unchanged": met by reading the code; the write expression is identical. The existing suites would catch a change in output bytes (repair-synthesis-promotions.test.js, sanitize-slice-temp-paths.test.js, export-sheet-frame-index.test.js, vision-gated-cli.test.js).
  • "The diff edits only the listed files": met. It touches the 6 listed files plus the new .changes/knowledge/ patch fragment, whose ### Changed text matches the issue.
  • "Within 400 changed lines and 15 hand-edited files": met.
  • "run-tests.sh all passes" and "ci-status is green": the author says these were not run in the lane and leaves them to CI. I can't run them here, so they are unverified.

No plugin manifest changed. No .claude/rules/ path-scoped rule applies to these files.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for d9b2499

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-15630-d9b2499564d5574ff3d1cccef809b51eb82fc4e6, expires on 2026-12-12.

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=LOW demote=false head=d9b2499564d5574ff3d1cccef809b51eb82fc4e6 rubric=8.4.12 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 12, 2026
Merged via the queue into main with commit 4e69a1f Nov 12, 2026
40 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15626-43269229289-1 branch November 12, 2026 17:59
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 4e69a1f41e8a62d4b55f864f6773d240e847b6d3; 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.

Write video-digest watch JSON through one helper beside readJsonFile

0 participants