Skip to content

refactor(playwright): simplify demo-video and update.sh scripts - #14787

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14701

Summary

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

Simplified four of the five listed playwright scripts without changing behavior; force-chrome-foreground.ps1 is untouched, as the issue requires. quality_control.py gets a shorter spans(), one view(j) helper for the two copies of the camera-rect formula, a named caption-band top used in two places, and the running maximum computed once instead of twice. In record.mjs, one stat helper replaces isDir/isFile, the click centre is computed once, and demo.mark is the mark function itself rather than a wrapper. ripple_geometry.py computes the band bounds once for both outer and bbox. update.sh folds require_tool into a loop in check_prereqs, inlines the one-line cleanup trap, and replaces the help-only case with an if. A playwright patch changelog fragment is added.

Not verified

  • Python demo-video tests (test_demo_video.py), update.test.sh, ruff and shellcheck were not run directly in this lane (it runs no interpreter); left to the PR's CI beyond what check-affected ran
  • ci-status green: a PR check, left to the PR's CI
  • tidy passes 4 and 5 (docs-hygiene and ai-slop on markdown) skipped: the only markdown is the changelog fragment, whose wording the issue's acceptance criteria fix verbatim
  • update.sh no longer shares the require_tool/cleanup idiom with its sibling copies in plugins/playbooks (boris) and plugins/firecrawl; the issue leaves cross-file consolidation to the sub-epic's restructuring pass
  • Untracked runner files at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were not created by this change and are not part of it

Fix

  • plugins/playwright/skills/demo-video/scripts/quality_control.py: spans() rewritten as a run list; view(j) helper replaces two copies of the camera-rect formula; band_top named once for the registration rows and the stillness mask; med5 applied through a generator; np.maximum.accumulate computed…
  • plugins/playwright/skills/demo-video/scripts/record.mjs: one stat() helper replaces isDir/isFile; click computes centerOf(box) once; demo.mark is the mark function itself instead of a forwarding wrapper
  • plugins/playwright/skills/demo-video/scripts/ripple_geometry.py: ring() computes the band bounds once and derives outer (clipped) and bbox (rounded) from them
  • plugins/playwright/skills/playwright/scripts/update.sh: require_tool folded into a loop in check_prereqs; cleanup() replaced by an inline single-quoted EXIT trap; the help-only case replaced by an if
  • .changes/playwright/work-resolve-issue-issue-14701-42645395312-1-470b5069.md: patch fragment, '### Changed' with 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 79de521:

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

The run reports:

  • check-changelog-fragments: all 2 fragments valid (run before and after tidy)
  • check-changed-skills: demo-video and playwright PASS, 0 errors; the warnings (description length, unregistered metadata keys) are on SKILL.md text this change did not touch
  • check-affected: 14 passed, 5 skipped (typos not installed; validate-plugins sub-checks and changed-skills skipped because they run checked-tree code), over 5 changed files (run before and after tidy)
  • fresh-context review subagent compared the diff against HEAD: no behavior change for any input a caller in the repository passes; float arithmetic order is preserved, earlierCapture is only used for truthiness, and the update.sh trap still expands TMPDIR_RUN at exit
  • code-tidying:tidy-diff over the 24 changed hunks: one edit (dropped needless !! coercions at record.mjs:57); no comment deletions or residue findings
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42645395312

Left out: the items under Not verified.

Related

#14701

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

Security review: PR #14787 (head 79de521)

I found no security issues. I read every hunk of all 5 changed files. None of them matches a trusted-path glob, and no plugin manifest, workflow, hold path or trust control is touched.

  • .changes/playwright/…-470b5069.md: a new patch changelog fragment. It is prose only and contains no embedded instructions.

  • demo-video/scripts/quality_control.py: pure-numeric refactors that change no behaviour:

    • spans() rewritten as a run list
    • a new view(j) helper
    • band_top named once
    • med5 applied through a generator
    • np.maximum.accumulate computed once

    No new input handling, file paths or subprocess calls.

  • demo-video/scripts/record.mjs: stat(name) still joins name onto the same resolved out directory, with only the fixed literals frames and timeline.json. So the check on whether out holds an earlier capture still accepts and rejects the same directories, and no new path input is introduced. Computing centerOf(box) once and the demo.mark alias change nothing outside the script.

  • demo-video/scripts/ripple_geometry.py: the band bounds are computed once and give the same outer and bbox values.

  • playwright/scripts/update.sh: three changes:

    • The single-quoted trap trap 'rm -rf "$TMPDIR_RUN"' EXIT expands at exit and keeps the quoting, so cleanup still applies only to the mktemp -d directory.
    • The prerequisite loop checks the same fixed tool names (npm tar diff) with command -v.
    • The help if behaves the same as the old case.

    No input from outside the script reaches a command.

No instruction surface is deleted or softened, so the protected-class register was not needed. No change in this PR can cause a charge, and none spends extra credits.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14787, simplifying the playwright demo-video and update.sh scripts

No findings. I read every hunk of all 5 changed files and checked each edit against the base code for behaviour equivalence. I ran no tests, linters or interpreters: this lane has no shell. The PR's verification results come from its author and I have not confirmed them.

Equivalence checks

  • quality_control.py
    • spans(): the run list gives the same spans as the old start/prev loop. That holds for empty input, gaps, duplicate indices and unsorted indices, and the :.2f formatting is the same.
    • band_top: the arithmetic runs in the same order ((H - …) * AH / H), so the floats come out the same, and H is never reassigned.
    • view(j): it looks up zf/cx/cy when it runs, not when it is defined. That is safe because none of them is reassigned after line 217. Each call returns a new list, so the in-place clamping of rect[0]/rect[1] still works.
    • Removed local z: nothing read it later in that loop.
    • mono and the generator unpacking: both give the same values as before.
  • record.mjs
    • earlierCapture: it can now be undefined instead of false, but it is only tested for truthiness (lines 58 and 229).
    • demo.mark: mark takes (name, extra = {}), so the old wrapper passing undefined and the new direct reference both hit the same default.
    • centerOf: it is pure, so computing it once changes nothing.
  • ripple_geometry.py: band gives the same outer and bbox values as the inline expressions it replaces.
  • update.sh
    • Exit trap: the single-quoted trap still reads $TMPDIR_RUN when the script exits.
    • Removed functions: nothing else in the plugin calls cleanup or require_tool, including update.test.sh.
    • Prerequisite loop: it still checks every tool, prints the same error message, and exits with 2.
    • --help: the new if does the same as the old case.

Closing issue #14701 criteria

  • Behaviour unchanged: met, by the reading above.
    • test_demo_video.py runs quality_control.py end to end and calls ring() directly.
    • update.test.sh covers --help.
    • record.mjs needs a live Playwright replay, which no CI test I found runs; its edits are trivially equivalent.
  • Only the listed files and a changelog fragment edited: met.
  • Size limit: met; the PR is well under 400 changed lines and 15 hand-edited files.
  • force-chrome-foreground.ps1 left unchanged: met.
  • Playwright fragment: met. It has bump: patch, a ### Changed heading, and the line "Internal simplification, no behavior change."
  • ci-status green: a CI check that I can't see from this lane.

No plugin manifest changed and no embedded instructions were found in the PR context. This was a first full review, not limited to blocking findings.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 79de521

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-14787-79de521a82f4013905da81bf56183e068cade59f, 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 bdd8c6c Nov 9, 2026
65 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14701-42645395312-1 branch November 9, 2026 19:59
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit bdd8c6cc345a1433118dca96c5faf16358df4a3a; 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 demo-video and playwright playwright plugin code

0 participants