Skip to content

refactor(knowledge): simplify course-digest extraction code (3 of 3) - #14865

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14600-42704433158-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14600

Summary

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

Simplified four of the 14 listed course-digest extraction files without changing behavior. playwright-selectors.js now builds its selectors with two small local helpers, anyOf and classContains, in place of repeated [...].join(", ") and split constants; every exported string is byte-identical. validators.js shares one lessonDirOf helper between checkTranscripts and checkResourceFlags and builds schema.consistency with one check call. validate-extraction.js drops its module-level args/log state and the triple filter in summarize. hotmart.js inlines the frame count in extractFrames. The other ten listed files (mux.js, types.js, run.mjs, setup-deps.mjs, the three test-support stubs, vitest.config.ts, run-tests.sh, and utils.js) were reviewed and left as they were: they are already minimal or are thin wrappers, and a utils.js findFirstVideoLesson rewrite was reverted because it changed the error thrown on malformed input.

Not verified

  • vitest suite (npm test in course-digest/extraction, including lib/validators.test.js and utils.test.js) was not run: this lane cannot run npm or node; left to the PR's CI
  • Lint/format (prettier/eslint) on the touched JS files was not run here: no lint wrapper is available in this lane; left to the PR's CI
  • tidy-diff ai-slop pass: the deterministic detector (detect.sh) is not on this lane's Bash allowlist, so only the rubric read ran on the changelog fragment (no findings)
  • check-affected skipped typos (not installed) and the validate-plugins steps that run code from the checked tree

Fix

  • plugins/knowledge/skills/course-digest/extraction/lib/playwright-selectors.js: anyOf/classContains helpers replace array joins and the CLASS_CONTAINS_PREFIX/TRANSCRIPT_CLASS/INSTRUCTOR_CLASS constants; exported selector strings unchanged
  • plugins/knowledge/skills/course-digest/extraction/lib/validators.js: private lessonDirOf helper shared by checkTranscripts and checkResourceFlags; checkSchema builds the inconsistent list with filter/map and pushes schema.consistency through one check call with the same arguments as before
  • plugins/knowledge/skills/course-digest/extraction/validate-extraction.js: args and log are locals of main (logChecks takes log as a parameter), removing the bindCli module state; summarize counts by severity through one local helper
  • plugins/knowledge/skills/course-digest/extraction/lib/players/hotmart.js: extractFrames returns the captureCanvasFrames count directly
  • .changes/knowledge/work-resolve-issue-issue-14600-42704433158-1-d207d5a2.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

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

  • 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/review)
  • check-changed-skills: course-digest PASS, 0 errors, 4 pre-existing warnings about SKILL.md size and gotchas, none from this diff
  • check-affected: 12 passed, 7 skipped over the changed files
  • fresh-context review subagent over the full diff: no behavior change in hotmart.js, playwright-selectors.js, validators.js or validate-extraction.js (selector strings byte-identical, Map order and details key order kept); it flagged that the utils.js findFirstVideoLesson rewrite changed the…
  • git-read diff --stat HEAD after the revert: 4 source files, 45 insertions, 60 deletions; utils.js unchanged
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42704433158

Left out: the items under Not verified.

Related

#14600

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

Security review: no security issues found

I read every hunk of all 5 changed files. This is a refactor with no behavior change, and none of the changes touches a security-relevant surface:

  • plugins/knowledge/skills/course-digest/extraction/lib/playwright-selectors.js: the new anyOf and classContains helpers build the same selector strings as before, for example classContains("transcript") gives [class*="transcript"]. Every argument is a hard-coded literal, so no outside input reaches a selector.
  • plugins/knowledge/skills/course-digest/extraction/lib/validators.js: the new lessonDirOf helper builds the lesson path with the same join(modulesDir, mod.slug, lessonDirName(...)) call as before, so path handling is unchanged. The checkSchema rewrite only changes how results are gathered, not which checks run.
  • plugins/knowledge/skills/course-digest/extraction/validate-extraction.js: args and log moved from module-level variables into main, and summarize counts through one local helper. CLI parsing and the report output are unchanged.
  • plugins/knowledge/skills/course-digest/extraction/lib/players/hotmart.js: extractFrames now returns the frame count directly, with the same arguments to captureCanvasFrames.
  • .changes/knowledge/...d207d5a2.md: a changelog fragment only.

No changed file matches a trusted-path glob. The diff changes no plugin manifest, no workflow, no trust control and no standing instruction. The PR context holds no text telling the lane to pass the PR, skip a check, drop a finding or post elsewhere. No earlier review by this lane is on record, so this is a full review, not blocking-only.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 5 changed files. This was a full review, not blocking-only: no earlier head was reviewed and there are no prior findings.

Behavior equivalence (checked against the head source):

  • lib/playwright-selectors.js: anyOf(...) produces the same .join(", ") as before, and classContains(name) produces the same [class*="name"] string. Each exported selector builds to the same string as before. The constants that were removed (CLASS_CONTAINS_PREFIX, TRANSCRIPT_CLASS, INSTRUCTOR_CLASS) were never exported, so no exported name changes.
  • lib/validators.js: lessonDirOf builds the same join(...) path as the inline code it replaces. In checkSchema, schema.consistency calls check(passed, severity, message, details) with the same values in both branches: (true, PASS, …, {}) or (false, WARN, …, { inconsistentFields }). The entries are still { field, present, total }, in Map iteration order.
  • validate-extraction.js: args and log were used only inside main and logChecks, and logChecks now takes log as a parameter. No other function in the file reads them. summarize returns the same counts.
  • lib/players/hotmart.js: extractFrames returns the same { method: "canvas-seek", count }.

Closing issue #14600 acceptance criteria:

  • Behavior unchanged: met, by reading the code; I did not run anything. No exported name, flag or printed string changes. Nothing in the PR or the repository tests that the selector strings stay byte-identical, but no change of that kind happens here.
  • Only listed files plus a changelog fragment are edited: met.
  • Within 400 lines and 15 files: met, with 4 source files and about 105 changed lines.
  • ci-status green: I can't judge this from the diff; it is left to CI.
  • Fragment: met. bump: patch, ### Changed, "Internal simplification, no behavior change."

The PR body says vitest and lint were not run in the lane; that claim is the author's and unverified here. I ran no tests myself.

No embedded instructions were found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for ae1cfa2

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-14865-ae1cfa2c808b7aca4f2467408f6f4b89b339dd86, 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 9, 2026
Merged via the queue into main with commit 6b0f6aa Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14600-42704433158-1 branch November 9, 2026 22:11
@github-actions

github-actions Bot commented Nov 9, 2026

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/course-digest/extraction/lib/players/hotmart.js 0 1 0 0 0 0
plugins/knowledge/skills/course-digest/extraction/lib/playwright-selectors.js 0 2 0 0 0 0
plugins/knowledge/skills/course-digest/extraction/lib/validators.js 2 1 0 0 0 0
plugins/knowledge/skills/course-digest/extraction/validate-extraction.js 1 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/knowledge/skills/course-digest/extraction/lib/validators.js:34 other productive input-gap
plugins/knowledge/skills/course-digest/extraction/lib/playwright-selectors.js:9 other productive no-assertion
plugins/knowledge/skills/course-digest/extraction/lib/playwright-selectors.js:10 other productive no-assertion
plugins/knowledge/skills/course-digest/extraction/lib/players/hotmart.js:573 other 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 course-digest knowledge plugin code (3 of 3)

0 participants