Skip to content

refactor(knowledge): simplify video-digest watch scripts (6 of 8) - #14987

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14611-42758077548-1
Nov 10, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14611

Summary

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

Simplified the eight listed video-digest watch scripts. Behavior is unchanged: same exports, flags, outputs, exit codes and messages. Changes: repeated session-range checks and repeated watch.json metrics lookups now go through one shared check or one lookup; repeated read-if-exists and claims-dir path code now uses one small private helper each; the duplicate outcomeFloors call in buildFloorsLine is gone; parsePromotionPair has one return path; rebuild-visual-frames builds its markdown lines in one array; and recover-watch-bootstrap reads its selected count and target once. One simplification, an Array.from rewrite of downsampleSelectedFrames, was reverted because it would round down a fractional target that the loop does not round down.

Not verified

  • vitest suites for the watch scripts were not run here (this lane runs no test runner); left to the PR's CI
  • Biome and checkJs were not run directly; only what check-affected runs, plus the reviewer reasoning through formatting by hand. Left to the PR's CI
  • ci-status green is a PR CI check; left to the PR's CI
  • tidy: passes 4-5 (docs-hygiene and ai-slop) on the changelog fragment were skipped, because its only prose line is required verbatim by the issue's acceptance criteria. Passes 1-3 ran and made no edits
  • tidy proposal, not applied: post-bootstrap-slice.js swallows any snapshotBootstrapContactSheets error silently (silent fallback). This behavior predates the change, and changing it would change behavior, which this issue rules out
  • the checkout has untracked runner files (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) that this run did not create; they are not part of this change

Fix

  • plugins/knowledge/skills/video-digest/extraction/watch/init-watch-checklist.js: buildFloorsLine reads the sheet-triage percent from the floors it already computed instead of calling outcomeFloors a second time; one metrics local replaces four watch.phases?.watching?.metrics chains; a private…
  • plugins/knowledge/skills/video-digest/extraction/watch/list-promotion-candidates.js: a private inSession(ts, session, durationSec) helper replaces three copies of the session-range test; the per-session count is a number instead of an array that was only used for its length.
  • plugins/knowledge/skills/video-digest/extraction/watch/merge-triage-json.js: the triage directory is computed once and reused for the batches directory and the manifest path.
  • plugins/knowledge/skills/video-digest/extraction/watch/post-bootstrap-slice.js: dropped the explicit default { force: false } and the redundant = undefined in the catch; reworded the trailing comment.
  • plugins/knowledge/skills/video-digest/extraction/watch/promote-key-frames.js: parsePromotionPair picks its separator index in one expression and has one return path; the CLI passes the parsed pairs inline.
  • plugins/knowledge/skills/video-digest/extraction/watch/queue-claim.js: a private claimsDirPath helper replaces three path.join(epicDir, "claims") copies; the payload literal is on one line.
  • plugins/knowledge/skills/video-digest/extraction/watch/rebuild-visual-frames.js: the table rows are spread into the lines array instead of push calls; the label is inlined.
  • plugins/knowledge/skills/video-digest/extraction/watch/recover-watch-bootstrap.js: selectedCount and targetMinFrames are read once and reused in five places; resolveWorkArtifacts names its file-name locals videoName and infoName so the *Path names mean joined paths.
  • .changes/knowledge/work-resolve-issue-issue-14611-42758077548-1-322c09d6.md: new patch fragment, ### Changed with "Internal simplification, no behavior change."

Verification

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

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

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 7 fragments valid (run before and after tidy)
  • .lane/checks/bin/check-changed-skills: video-digest PASS, 0 errors, 5 warnings, all of them about SKILL.md content this change does not touch (run before and after tidy)
  • .lane/checks/bin/check-affected: 12 passed, 7 skipped, 0 failed over 9 changed files (run before and after tidy)
  • fresh-context review subagent over the full diff, checking behavior preservation, test assertions, and Biome/checkJs: no findings
  • code-tidying:tidy-diff over the 40 changed hunks: no edits; one proposal (pre-existing silent catch in post-bootstrap-slice.js); markdown passes skipped
  • git-read diff --shortstat HEAD: 8 tracked source files, 80 insertions and 80 deletions, plus 1 new 7-line changelog fragment; within the 400-line and 15-file limits
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42758077548

Left out: the items under Not verified.

Related

#14611

Merge-Risk: max=MEDIUM demote=false head=d2e7b4cc4669f241624cc0db45479069f9f414dd rubric=8.3.3 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-review reviewed d2e7b4cc4669f241624cc0db45479069f9f414dd: read 9 of 9 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

I read every hunk of all 9 changed files. I checked each rewrite against the base behavior and found nothing that changes outputs, exports, flags or written files.

Checks against the base code:

  • init-watch-checklist.js: buildFloorsLine now uses Math.round(floors.minSheetTriageRatio * 100) on the floors it already has. That is exactly what floorSheetTriagePct computes, with the same typeof sessionCount === "number" ? sessionCount : 1 argument. The exported floorSheetTriagePct is still used at line 383. The metrics local and the readTextIfExists helper give the same fallbacks. The removed sessions local had no other reader.
  • list-promotion-candidates.js: inSession keeps the ts != null guard and the endSec ?? durationSec end. The extras filter still requires Number.isFinite first, so all three call sites match the old checks.
  • merge-triage-json.js: lanePath is path.join(sliceDir, lane, ...rest) (slice-lanes.js#L35), so joining batches onto the triage directory gives the same path.
  • promote-key-frames.js: the single-expression separator is the same as before. A pipe wins; otherwise the search for : starts at index 2 when the pair begins with a drive letter, else at 0. slice gives the same sourcePath and destName, and the -1 error path is unchanged.
  • recover-watch-bootstrap.js: selectedCount and targetMinFrames are read from selection after its last reassignment, and watching.selectedFrames and watching.targetMinFrames are those same values, so the five uses are unchanged. In resolveWorkArtifacts, renaming the locals keeps the same returned paths.
  • post-bootstrap-slice.js, queue-claim.js, rebuild-visual-frames.js: these produce the same results. force defaults to false, a let with no assignment is still undefined after the catch, the claims directory path is the same, and the markdown lines come out in the same order.

Closing issue #14611 acceptance criteria:

  • Behavior unchanged: met, by my reasoning above. Existing tests that could catch a regression were not run by me (I have no shell). The PR's own test and check results are author-claimed and unverified.
  • Only listed files and a changelog fragment edited: met.
  • Within 400 lines and 15 files: met (about 160 changed lines over 8 source files and 1 fragment).
  • ci-status green: left to CI; not verified here.
  • Fragment bump: patch with ### Changed and "Internal simplification, no behavior change.": met.

No plugin manifest changed and no .claude/rules paths apply. I found no embedded instructions in the PR context. Nothing is held.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #14987, head d2e7b4c

I read every hunk of all 9 changed files. I found no security issues.

This pull request refactors eight video-digest watch scripts under plugins/knowledge/skills/video-digest/extraction/watch/ and adds a changelog fragment. No changed file matches a trusted-path glob. The diff touches no workflow, action, trust control, merge hold, token request, plugin manifest or standing instruction such as a skill body, CLAUDE.md or a hook list.

What I checked:

  • parsePromotionPair in promote-key-frames.js, the only parsing of operator input that leads to file paths: the rewrite picks the same separator as the base. If a | is present it is used. Otherwise the search for : starts at index 2 when the pair begins with a drive letter, else at 0. indexOf(":", 0) is the same as indexOf(":"). The error for a pair with no separator is unchanged, so how the source and destination are split is unchanged.
  • Path handling in queue-claim.js, merge-triage-json.js and recover-watch-bootstrap.js: the new helpers (claimsDirPath, triageDir) and the renamed locals (infoName, videoName) build the same path.join results as the base. None of them adds an input that reaches a path.
  • readTextIfExists in init-watch-checklist.js reads the same two local files as the inline code it replaces.
  • post-bootstrap-slice.js: the empty catch was already there. Leaving out { force: false } changes nothing, because initWatchChecklist defaults force to false.
  • The PR context file contains no embedded instructions aimed at this lane.

The prior-findings file shows no earlier review by this lane, so this was a full review, not a blocking-only one.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for d2e7b4c

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-14987-d2e7b4cc4669f241624cc0db45479069f9f414dd, expires on 2026-12-10.

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 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit ada1e74 Nov 10, 2026
75 of 76 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14611-42758077548-1 branch November 10, 2026 06:00
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit ada1e748225d1d3074aa5b382934880558bca9d3; 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 (6 of 8)

0 participants