Skip to content

refactor(animation): simplify the scripts without changing behavior - #14535

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14397

Summary

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

Simplified seven of the nine listed animation scripts with edits that keep behavior identical: decode.py runs its three ffprobe calls through one helper; prereq.py, produce.py, inkstats.py, woodcut_marks.py, capture.mjs and ink.js drop repeated expressions, redundant branches and temporaries; render.py gets a line re-wrap. workdir.py was already minimal and is unchanged. ink.js keeps the exact order of its random-number calls and its floating-point arithmetic, so rendered frames stay the same. No names, flags, printed text or exit codes changed, and no test, eval or fixture was touched.

Not verified

  • Python test suites (test_produce.py, test_render.py, test_inkstats.py, test_woodcut_marks.py, animation.test.sh) and ruff not run: this lane cannot run interpreters or test runners; left to the PR's CI
  • ci-status green is a PR CI check; left to the PR's CI
  • tidy-diff passes 4-5 (docs-hygiene write-for-humans, ai-slop fix) skipped on the changelog fragment: its only line is the exact text the issue requires; code passes 1-3 ran and found nothing further to edit
  • build/lint step: no build exists for these scripts, and no linter could run in this lane; check-affected covered what it runs locally
  • workdir.py left unchanged: each function is already a one-line path builder, and nothing simplifies without changing exported names

Fix

  • plugins/animation/scripts/decode.py: new private _ffprobe(video, entries) helper; probe() and end() call it instead of repeating the same subprocess.run argument list three times
  • plugins/animation/scripts/prereq.py: _run returns subprocess.run directly inside the try; the ffmpeg-version row builds the 'need' and 'have' version strings once instead of repeating the f-strings
  • plugins/animation/scripts/produce.py: color() is a single boolean expression; new split_packs() shared by check_brief and brief_packs; read_approval merges three early returns into one condition with the same short-circuit order; cmd_approve, cmd_shots and cmd_review drop redundant temporaries and…
  • plugins/animation/scripts/inkstats.py: film_end has one fallthrough return instead of two; islands() indexes the stats array directly instead of unpacking unused values
  • plugins/animation/scripts/woodcut_marks.py: _blank uses np.full; the loop-invariant slit row is moved out of the loop
  • plugins/animation/scripts/capture.mjs: one fail() helper defined up front and used by every exit-1 error path; the canvas element is looked up once when reading the size
  • plugins/animation/scripts/ink.js: splatter() names the speck position and the cos/sin of the dash angle once; same live() call order and the same arithmetic
  • plugins/animation/scripts/render.py: re-wrapped the over-long render.json dict line
  • .changes/animation/work-resolve-issue-issue-14397-42595399565-1-2e921c18.md: patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 9ad5ffd:

  • 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 4 fragments valid (run before and after tidy)
  • .lane/checks/bin/check-changed-skills: no changed skills, nothing to gate (run before and after tidy)
  • .lane/checks/bin/check-affected: 13 passed, 6 skipped over 9 changed files (run before and after tidy)
  • fresh-context review subagent over the whole diff: no problems found; it checked JS temporal-dead-zone ordering, live() call order, float associativity, np.full broadcasting, short-circuit order and return values, and the tests that call the changed modules
  • git-read diff --unified=0 HEAD: confirmed the old ffprobe argument lists and the old brief_packs filter match the new shared helpers exactly (the two points the reviewer could not see)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42595399565

Left out: the items under Not verified.

Related

#14397

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

Code review: PR #14535, simplifying the animation scripts with no behavior change

No findings. I read every hunk of all 9 changed files and checked each edit against #14397's rule that behavior stays the same.

  • capture.mjs: fail now sits at module top (line 20), so it is defined before open() and the <workers> check call it. The message and exit code 1 are the same as the inline console.error + process.exit(1) it replaces. No other fail binding conflicts with it. Looking up the canvas once returns the same [width, height].
  • ink.js: live() is still called in the same order. In the speck branch, show comes first, then the x jitter, then the y jitter, because const declarators are evaluated left to right. The float association is unchanged: (cx + cos·d) + jitter, then + 0.5. In the dash loop, c and s call no RNG, so a, d, l and the width's live() keep their order.
  • decode.py: _ffprobe builds the same argument list as each of the three calls it replaces, with the same check=True and .stdout.
  • inkstats.py: film_end returns the same thing on every path. [2] of connectedComponentsWithStats is the stats array, as st was before.
  • prereq.py: the cached _run returns the same value. The need/have strings match the old f-strings character for character.
  • produce.py: color() still returns a strict bool on every branch. read_approval keeps its short-circuit order, so digest() is only computed when the earlier checks pass. report() returns 1 when there are problems (produce.py:313), so return report(problems) in cmd_approve keeps exit code 1. gate() returns 0 or 2, so gate(prod) or report(...) behaves the same. split_packs does exactly what the two inline copies did.
  • woodcut_marks.py: np.full((h, w, 3), CREAM, np.uint8) fills each pixel's 3 channels with CREAM the same way img[:] = CREAM did. Moving sy out of the loop changes nothing, since it does not depend on the loop.
  • render.py: line re-wrap only.

Closing issue #14397 acceptance criteria:

  • Behavior unchanged: met, as far as reading the code shows (above).
  • Only the listed files and a changelog fragment are edited: met.
  • Within 400 lines and 15 files: met.
  • Fragment with bump: patch, ### Changed and the required line: met.
  • ci-status green: depends on this PR's CI, not checked here.

The author says the Python suites and ruff were not run. I did not run them either, since this lane has no shell, so that runtime check is left to CI.

The diff changes no plugin manifest, so no manifest checks apply.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #14535 (refactor(animation): simplify the scripts without changing behavior)

I found no security issues. I read every hunk of all 9 changed files. None of them matches a trusted path, and the diff changes no plugin manifest, workflow, trust control or instruction surface.

What I checked:

  • decode.py: the new _ffprobe(video, entries) helper still calls subprocess.run with an argument list, not a shell string. entries is always a hard-coded literal, and video is still passed as one argument through str(video). The arguments are the same as the three calls it replaces, so this adds no injection risk.
  • produce.py read_approval: this is the board-approval gate. The three merged conditions are checked in the same order with the same short-circuiting: approved is True, then boards_digest matches, then note is a non-empty string. It returns None in exactly the cases it did before.
  • produce.py, other commands: report() returns 1 if problems else 0 (produce.py#L310-L313), so cmd_approve still returns 1 and writes no approval.json when problems exist. gate() returns 2 or 0 (produce.py#L355-L359), so gate(prod) or report(...) and the walrus form in cmd_review behave the same as before.
  • prereq.py _run: it still returns None when OSError is raised and returns the completed process otherwise.
  • capture.mjs: fail() now sits before its first use and matches the old inline exit paths. The size lookup runs only in the page.
  • ink.js, inkstats.py, woodcut_marks.py, render.py: pure computation or formatting refactors with no input-handling or trust-boundary surface.
  • Changelog fragment: data only.

The PR context holds no embedded instructions aimed at this review.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 9ad5ffd1bcdae96a0d986b66b0c7d356ee200af9. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 9ad5ffd

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-14535-9ad5ffd1bcdae96a0d986b66b0c7d356ee200af9, 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 d1c3918 Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14397-42595399565-1 branch November 9, 2026 11:03
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit d1c3918f282b073f1195c26a9869709c54bf290f; 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 scripts animation plugin code

0 participants