Skip to content

refactor(knowledge): simplify video-digest transcript and watch helpers - #15339

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14610-43000519949-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14610

Summary

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

Reviewed the 13 listed video-digest files against /simplify's four checks and simplified the two that had room. The other 11 were already tight, so they are untouched. In detect-recoverable-bootstrap.js, one listDir helper replaces two copies of the missing-directory guard, and the CLI hands its detection result to formatRecoverCommand (new optional second parameter) instead of running detection a second time. In write-transcript.js, captionlessEntryCount is computed with one filter instead of a counter in the loop, writeSliceReadme builds the transcript lines only on the branch that uses them, and toWatchCue's parameter uses the existing WatchCue typedef. Outputs, exit codes, written files, printed text, flags and exported names are unchanged.

Not verified

  • vitest suites for the knowledge plugin (write-transcript.test.js, detect-recoverable-bootstrap.test.js, duration-mismatch.test.js) and biome lint were not run: this lane runs only the named wrappers, no node or test runner. Left to the PR's CI.
  • ci-status green is a PR CI check, left to the PR's CI.
  • tidy recorded as skipped: tidy-diff ran passes 1-4 in full, but pass 5 (ai-slop:audit fix) could not run the detector, digest-guard.sh or git branch, which the lane's Bash allowlist blocks. The one fragment line got a hand rubric read only, with no tell found and no edit.
  • 11 of the 13 listed files left unchanged (asr_transcribe.py, derive-video-slug.js, proper-noun-repair.js, run-transcript.js, transcript-strategy.js, vitest.config.ts, dedupe-synthesis-dir.js, duration-mismatch.js, expand-visual-gaps.js, export-sheet-frame-index.js, finalize-vision.js): the review…
  • Proposed, not applied: in write-transcript.js, move the EDGE_PUNCTUATION constant above comparableWord, its first user, for reading order. The edit tool could not match the line's mixed Unicode literals byte for byte, and the change is cosmetic.
  • Untracked dotfiles in the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) are not from this run; they look like sandbox mount points and are not part of this change.

Fix

  • plugins/knowledge/skills/video-digest/extraction/watch/detect-recoverable-bootstrap.js: one listDir helper for workDirComplete and countMatchingFiles; formatRecoverCommand takes an optional detection already run (defaults to running one, so existing one-argument callers behave the same); the CLI…
  • plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js: captionlessEntryCount computed in the return via entries.filter instead of a loop counter; writeSliceReadme maps transcriptFiles only on the branch that uses them; toWatchCue param uses the WatchCue typedef
  • .changes/knowledge/work-resolve-issue-issue-14610-43000519949-1-a8364f69.md: knowledge patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

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

  • 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 (run before and after tidy)
  • check-changed-skills: video-digest PASS, 0 errors, 5 warnings that predate this change (SKILL.md size and prose; this change touches no SKILL.md)
  • check-affected: 12 passed, 7 skipped over 3 changed files (run before and after tidy)
  • fresh-context review subagent over the full diff: no observable behavior difference for any input the callers, tests or JSDoc types allow; write-transcript.test.js:579 (captionlessEntryCount 1) and detect-recoverable-bootstrap.test.js formatRecoverCommand calls still hold; let without an…
  • code-tidying:tidy-diff over the 13 changed hunks: passes 1-4 found nothing to change; pass 5 hand rubric read of the fragment line found no AI-writing tell
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43000519949

Left out: the items under Not verified.

Related

#14610

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

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15339 (head a702d85)

I found no security issues.

I read every hunk of all 3 changed files. None of them matches a trusted-path glob, and the change touches no trust control, plugin manifest or instruction surface.

  • plugins/knowledge/skills/video-digest/extraction/watch/detect-recoverable-bootstrap.js: a new listDir helper takes over the old missing-directory guard (dir && fs.existsSync(dir)). It returns the same results as before: workDirComplete still returns false for an unset or missing directory because .every over an empty list fails, and countMatchingFiles still returns 0. formatRecoverCommand gets an optional detection parameter. When the parameter is left out it runs detection as before. The only new caller, the CLI, passes the result it computed a moment earlier for the same sliceDir. No untrusted input can supply that object, so no injection path is added to the recover command string.
  • plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js: the JSDoc now uses the existing typedef. transcriptLines is now built only on the branch that uses it, with the same output. captionlessEntryCount is now computed with a filter instead of a counter in the loop, giving the same value. The README string is built from the same inputs as before.
  • .changes/knowledge/…a8364f69.md: a changelog fragment, prose only.

Embedded text: the PR context contains no directives aimed at this lane. It does mention untracked dotfiles in the lane's checkout, including .mcp.json, but none of them is part of this diff.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15339, a refactor of the video-digest transcript and watch helpers

No findings. I read every hunk of all 3 changed files. None of them matches a trusted path.

Is behavior unchanged? (checked by reading the code; I ran nothing)

  • write-transcript.js / writeSliceReadme: The transcript list is now built only in the else branch. The old code built it and then always overwrote it in the two earlier branches, so the output is the same for every input.
  • write-transcript.js / captionlessEntryCount: This now comes from entries.filter((entry) => !entry.caption).length at the return. The loop at L406-L476 never changes entry.caption, and continue never skipped the old counter because the counter came first. The count is identical.
  • write-transcript.js / toWatchCue: The JSDoc now uses the WatchCue typedef at L41. It has the same shape as the type it replaces.
  • detect-recoverable-bootstrap.js / listDir: It returns [] when the directory is unset or missing. That keeps the old results: false from workDirComplete and 0 from countMatchingFiles. The every over the three file extensions is equivalent to the old three-way &&.
  • detect-recoverable-bootstrap.js / formatRecoverCommand(sliceDir, detection = …):
    • Every existing caller passes one argument, so the default runs and they behave as before. Those callers are run-resume.js:103 and the tests in detect-recoverable-bootstrap.test.js.
    • No caller passes the function by reference (for example to .map), which could feed a stray second argument into detection.
    • The CLI now reuses its own result, which was computed for the same sliceDir in the same synchronous call. This drops a second filesystem scan and changes no output.

Closing issue #14610 acceptance criteria

  • Behavior and exported names unchanged; no listed file renamed: met, as checked above.
  • Diff edits only listed files plus a fragment: met. The two code files are both on the issue's list, and the third file is the changelog fragment.
  • Within 400 lines and 15 files: met (about 30 changed lines, 2 hand-edited files).
  • ci-status green: I can't see CI from here. The author left it to PR CI, so this is unverified.
  • knowledge fragment with bump: patch, ### Changed, and the line "Internal simplification, no behavior change.": met.
  • Test coverage: this is a refactor that must not change behavior. Existing tests cover formatRecoverCommand with one argument and captionlessEntryCount (the PR body cites write-transcript.test.js:579, which I did not open). That is enough coverage for a change that adds no behavior.

Other notes

  • The PR body says vitest and biome were not run by its own lane. Those claims, and the "Verification" section, are author-claimed; I did not verify them.
  • No plugin manifest changed, so there are no manifest lines.
  • No paved-path or path-scoped rule criteria apply to these JS logic changes.
  • I found no embedded instructions in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for a702d85

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-15339-a702d85de82617c12bb2f5060768b53ef7fc2d02, expires on 2026-12-11.

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

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 11, 2026
Merged via the queue into main with commit ba411b7 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14610-43000519949-1 branch November 11, 2026 12:02
@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/transcript/write-transcript.js 1 1 0 0 0 0
plugins/knowledge/skills/video-digest/extraction/watch/detect-recoverable-bootstrap.js 2 3 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/knowledge/skills/video-digest/extraction/transcript/write-transcript.js:257 SBR productive no-assertion
plugins/knowledge/skills/video-digest/extraction/watch/detect-recoverable-bootstrap.js:35 LCR productive input-gap
plugins/knowledge/skills/video-digest/extraction/watch/detect-recoverable-bootstrap.js:44 SBR productive input-gap
plugins/knowledge/skills/video-digest/extraction/watch/detect-recoverable-bootstrap.js:140 other productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

Simplify the video-digest knowledge plugin code (5 of 8)

0 participants