Skip to content

refactor(knowledge): simplify video-digest metadata parsing and adapter validation - #14873

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14604

Summary

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

Simplified two of the four listed video-digest files without changing behavior. In video-metadata.js, a stringOrEmpty helper replaces five repeated typeof-string ternaries, and parseVideoMetadata returns its fields inline with the same key order. In adapter-contract.js, validateAdapter iterates Object.entries(REQUIRED_METHOD_ARITY), which drops the keyed lookup and its cast while keeping the same order. It also drops the typeof-string guards in front of CAPTION_CLASSES.includes and TRANSCRIPT_STRATEGIES.includes: both lists hold only strings and includes uses SameValueZero, so a non-string value already fails the check. registry.js and shared-adapter-suite.js were reviewed and left unchanged, because the remaining candidates (sharing the host-match rule, sharing the distinct-module set) would either dedupe across files, which this issue rules out, or change identity semantics. Rewriting createSourceAdapter's errorPatterns freeze with Object.fromEntries was tried and reverted: it would widen the type to an index signature that the checkJs lane checks against SourceErrorPatterns.

Not verified

  • vitest suites for video-metadata.test.js, adapter-contract.test.js and the adapter tests could not run in this lane (no interpreter or test runner allowed); left to the PR's CI
  • tsc checkJs type check of extraction/ was not run here; the reviewer checked type compatibility by reading only; left to the PR's CI
  • tidy passes 4-5 (markdown writing rules, ai-slop fix) skipped for the changelog fragment: its only body line is text the issue requires word for word
  • Changes left uncommitted in the working tree, as the runner's instructions require (the runner turns them into a patch)

Fix

  • plugins/knowledge/skills/video-digest/extraction/acquisition/video-metadata.js: added a stringOrEmpty helper; parseChapters, parseComments and parseVideoMetadata use it, and parseVideoMetadata's locals are inlined into the returned object in the same key order
  • plugins/knowledge/skills/video-digest/extraction/adapters/adapter-contract.js: validateAdapter loops over Object.entries(REQUIRED_METHOD_ARITY) and drops redundant typeof-string guards before the captionClass and transcriptStrategy includes checks
  • .changes/knowledge/work-resolve-issue-issue-14604-42704491755-1-d0a59844.md: patch fragment, ### Changed, 'Internal simplification, no behavior change.'

Verification

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

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

The run reports:

  • check-changelog-fragments: all 19 fragments valid (run before and after tidy)
  • check-changed-skills: video-digest PASS, 0 errors, 5 warnings that predate this change in SKILL.md and context files this change does not touch
  • check-affected: 12 passed, 7 skipped over 3 changed files (run before and after tidy)
  • code-tidying:tidy-diff over the 9 changed hunks: passes 1-3 found nothing more to edit
  • fresh-context review subagent: no findings. It confirmed that every change behaves the same for all inputs, that the checkJs config (extraction/tsconfig.json, strict off, strictNullChecks on) accepts the casts and Object.entries tuple types, that REQUIRED_METHODS is still imported by…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42704491755

Left out: the items under Not verified.

Related

#14604

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

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 3 changed files. I found no correctness or maintainability problems. This is the lane's first review of this pull request, so it covered advisory findings as well as blocking ones.

Behavior is unchanged. I checked this by reading the code. I ran nothing.

  • video-metadata.js: stringOrEmpty(x).trim() gives the same result as the old typeof x === "string" ? x.trim() : "". parseVideoMetadata builds its fields from the same expressions in the same key order: id, title, description, chapters, heatmap, comments, durationSec. The heatmap expression is copied over unchanged.
  • adapter-contract.js method loop: REQUIRED_METHODS is defined as Object.keys(REQUIRED_METHOD_ARITY) (adapter-contract.js#L408). So Object.entries(REQUIRED_METHOD_ARITY) visits the same keys in the same order, and violations come out in the same order. The comment at L399-L406 that says the key order matters is still accurate. REQUIRED_METHODS is still exported, and adapter-contract.test.js and fixture-adapter.test.js still use it, so no exported name changed.
  • adapter-contract.js dropped typeof checks: CAPTION_CLASSES (select-caption.js#L35) and TRANSCRIPT_STRATEGIES (L411) are frozen arrays that hold only strings. Array.prototype.includes compares with SameValueZero, so a value that isn't a string still fails the check, and the same violation is pushed.

Closing issue #14604 acceptance criteria

  • Behavior unchanged, no file renamed, moved or deleted: met (see above). Existing tests on these paths could catch a regression. I did not run them, and neither did the author's lane, which says vitest and the tsc checkJs check are left to CI.
  • The diff touches only listed files plus a changelog fragment: met.
  • Within 400 changed lines and 15 files: met (about 30 lines, 2 source files).
  • ci-status is green: I can't check this from here. It's left to CI.
  • knowledge fragment is bump: patch with ### Changed and "Internal simplification, no behavior change.": met.

No plugin manifest changed. I found no embedded instructions in the PR context or prior-findings files.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14873, no security issues found

I read every hunk of all 3 changed files. None of them matches a trusted-path glob, and none touches a trust control, workflow, plugin manifest or standing instruction.

What changed

  • plugins/knowledge/skills/video-digest/extraction/acquisition/video-metadata.js: a new stringOrEmpty helper takes the place of the repeated typeof === "string" ternaries, and the locals in parseVideoMetadata are now written inline in the returned object. Every input still gets the same output: a value that is not a string becomes "", and heatmap is still narrowed to an object or null.
  • plugins/knowledge/skills/video-digest/extraction/adapters/adapter-contract.js: validateAdapter now loops over Object.entries(REQUIRED_METHOD_ARITY) instead of REQUIRED_METHODS. At head, REQUIRED_METHODS is Object.keys(REQUIRED_METHOD_ARITY) (L408), so the same methods are checked in the same order and no check is narrowed. The change also drops the typeof guards before the CAPTION_CLASSES.includes and TRANSCRIPT_STRATEGIES.includes checks. Both arrays hold only string literals and includes compares with SameValueZero, so a value that is not a string is still rejected and validation is no looser.
  • .changes/knowledge/...md: a changelog fragment (patch bump, prose only).

Other checks

  • The PR context holds no embedded text telling the lane to pass the PR, skip a check, drop a finding or post somewhere else.
  • Prior findings: this lane had not reviewed an earlier head of this PR (blocking only: no), so this was a full review.
  • Spend: none. Nothing here can cause a charge.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for d1c3451

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-14873-d1c3451196261fc0ee6b3377b7927e051ca51920, expires on 2026-12-09.

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
Merged via the queue into main with commit 1cf6dde Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14604-42704491755-1 branch November 10, 2026 01:07
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 4, survived 3, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 57%; mutation score 57%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/knowledge/skills/video-digest/extraction/acquisition/video-metadata.js 1 3 0 0 0 0
plugins/knowledge/skills/video-digest/extraction/adapters/adapter-contract.js 3 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/knowledge/skills/video-digest/extraction/acquisition/video-metadata.js:74 other productive input-gap
plugins/knowledge/skills/video-digest/extraction/acquisition/video-metadata.js:91 other productive input-gap
plugins/knowledge/skills/video-digest/extraction/acquisition/video-metadata.js:118 LCR productive input-gap

The run's summary has the full report.

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 (2 of 8)

0 participants