Skip to content

refactor(ci): run seven pr-unblock entry points through lib run-main.mjs - #15576

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15454-43213987836-1
Nov 12, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #15454

Summary

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

The seven remaining .github/scripts/pr-unblock scripts (gate-recheck, lane-hold, publish-feedback, resolve-threads, verify-notes, dispatch, refine-event-dispatch) now call runAsScript(import.meta.url, label, () => main(process.env)) from ../lib/run-main.mjs instead of each carrying its own 11-line entry tail, and their now-unused node:url import is gone. Each keeps its old label (dispatch.mjs 'pr-unblock dispatch', refine-event-dispatch.mjs 'refine event dispatch', the rest their file name), the same main(process.env) call and the same exit codes, and importing a module still runs nothing. The new import adds no runtime file requirement: all seven already reach ../lib/run-main.mjs through address-feedback.mjs, workflows run them from a full .base checkout, and collect-base-activity copies the whole base lib/ beside a staged script.

Not verified

  • Node suite of .github/scripts/pr-unblock/, .github/scripts/lib/run-main.test.mjs and .github/actions/resolve-config/callers.test.mjs not run: this lane cannot run node; left to the PR's CI
  • test_merge_holds_sync.py and test_babysit_risk.py not run: this lane cannot run python; left to the PR's CI
  • python3 -I scripts/sync-hold-floor.py --check not run: this lane cannot run an interpreter. The diff adds, removes and renames no file and edits no floor file (lib/run-main.mjs's floor row landed in part 1), so its inputs are unchanged; left to the PR's CI
  • ci-status green: a PR check, left to the PR's CI
  • tidy not run: every changed file is under .github/, a listed shared path for the tidy lane
  • verify (build, tests) and lint of the touched .mjs files not run here: no node in this lane; left to the PR's CI

Fix

  • .github/scripts/pr-unblock/gate-recheck.mjs: entry tail replaced by runAsScript(import.meta.url, "gate-recheck", ...); node:url import dropped
  • .github/scripts/pr-unblock/lane-hold.mjs: entry tail replaced by runAsScript(import.meta.url, "lane-hold", ...); node:url import dropped
  • .github/scripts/pr-unblock/publish-feedback.mjs: entry tail replaced by runAsScript(import.meta.url, "publish-feedback", ...); node:url import dropped
  • .github/scripts/pr-unblock/resolve-threads.mjs: entry tail replaced by runAsScript(import.meta.url, "resolve-threads", ...); node:url import dropped
  • .github/scripts/pr-unblock/verify-notes.mjs: entry tail replaced by runAsScript(import.meta.url, "verify-notes", ...); node:url import dropped
  • .github/scripts/pr-unblock/dispatch.mjs: entry tail replaced by runAsScript(import.meta.url, "pr-unblock dispatch", ...); node:url import dropped
  • .github/scripts/pr-unblock/refine-event-dispatch.mjs: entry tail replaced by runAsScript(import.meta.url, "refine event dispatch", ...); node:url import dropped

Verification

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

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

The run reports:

  • check-changelog-fragments: passed (All 2 changelog fragment(s) under .changes/ are valid); the change touches no plugin, so no fragment is owed
  • check-changed-skills: passed (no changed skills under plugins/*/skills/)
  • check-affected: passed (8 passed, 8 skipped over 7 changed files; CI-only checks listed as left to CI)
  • git-read diff --numstat HEAD: 7 files, 14 added and 85 removed lines (99 changed), only the seven listed files
  • Grep: pathToFileURL no longer appears in any of the seven files; each main is export async function main, so a synchronous throw still becomes a rejection and prints ::error::<label> failed
  • Grep: no test asserts on the removed tails or the old labels; workflow-gates.test.mjs mainBody is only applied to modules that read GITHUB_EVENT_PATH/GITHUB_HEAD_REF/GITHUB_REF_NAME, and neither dispatch.mjs nor refine-event-dispatch.mjs does
  • Read of workflows: every direct run of these scripts (pr-unblock.yml, pr-refine.yml, pr-feedback-dispatch.yml, pr-unblock-dispatch.yml, pr-run-activity-write.yml:1394) uses a full .base checkout; collect-base-activity/action.yml copies base .github/scripts/lib/ to $RUNNER_TEMP/lib; the…
  • Fresh-context subagent review of the whole diff: no problems found (labels match, no circular-import firing, no missing lib on any run path)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43213987836

Left out: the items under Not verified.

Related

#15454

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

Security review: PR #15576

I found no security issues.

Scope. I read every hunk of all 7 changed files under .github/scripts/pr-unblock/. Three of them are on the trusted-path list: publish-feedback.mjs, resolve-threads.mjs and verify-notes.mjs. For those I read the whole change and the helper it now delegates to, .github/scripts/lib/run-main.mjs.

What changed. Each script had its own 11-line entry tail. That tail is now one call: runAsScript(import.meta.url, "<label>", () => main(process.env)). The node:url import, now unused, is removed. I checked the result against the base code:

  • Same entry-point check. The helper runs nothing unless process.argv[1] is set and the module's URL equals pathToFileURL(process.argv[1]).href. This matches the removed condition. Importing a module (in tests, or when refine-event-dispatch.mjs imports dispatch.mjs) still runs nothing.
  • Same exit codes. A resolved code goes to process.exitCode. A rejection prints ::error::<label> failed: <message> and sets exit code 1. Each label matches the one it replaces, so failures still fail the step.
  • Errors are still caught. All seven main functions are export async function main, which I confirmed by grep. A synchronous throw inside main therefore still becomes a rejection, which the helper catches.
  • A missing import fails safe. If ../lib/run-main.mjs were absent where a script runs, the import would fail at module load. The step would then exit non-zero, so nothing that gates on these scripts is skipped.

Trust controls. No change to the trusted-trigger check, the lane token scope, the kill switch or any merge hold. Every import of check-trusted-trigger.mjs, rate-guard.mjs and address-feedback.mjs is unchanged. Only the entry tail moved.

PR context. The description matches the diff. It contains no embedded instructions to the review lane.

Spend. None: the change runs no new lanes and adds no runs.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15576, seven pr-unblock entry points now go through lib/run-main.mjs

No findings. I read every hunk of all 7 changed files.

Behaviour is the same. I compared the removed tails with runAsScript:

  • Entry check: the guard process.argv[1] && metaUrl === pathToFileURL(argv[1]).href is the same, so importing a module from a test still runs nothing.
  • Exit codes: a resolved value still goes to process.exitCode, and a rejection still prints ::error::<label> failed: <message> and sets exit code 1.
  • Labels: each script keeps its old label: pr-unblock dispatch, gate-recheck, lane-hold, publish-feedback, refine event dispatch, resolve-threads and verify-notes.
  • Error timing: all seven main functions are export async function, so an error thrown inside main still arrives as a rejection, not a synchronous throw from runAsScript.
  • Unused import: none of the seven files still uses pathToFileURL, so dropping the node:url import is correct.
  • Circular import: refine-event-dispatch.mjs imports dispatch.mjs. When that happens, dispatch.mjs's own runAsScript call compares its own import.meta.url with the entry script and does nothing, so dispatch.mjs's main does not run.

Run paths still find the helper. Every workflow that runs one of these scripts directly runs it from a full .base checkout: pr-unblock-dispatch.yml:308/447, pr-unblock.yml:327/1060, pr-refine.yml:352, pr-feedback-dispatch.yml:248 and pr-run-activity-write.yml:1394. So ../lib/run-main.mjs is on disk wherever they run. Most of the seven already load it through address-feedback.mjs.

Closing issue #15454, acceptance criteria:

  • "None of the seven scripts keeps its own entry tail; each uses lib/run-main.mjs": met.
  • "Behavior is unchanged": met, by reading the code as above. run-main.test.mjs tests the helper's own entry check, error line and exit code. The per-script label is a literal at each call site, and I checked all seven against the old tails.
  • "The diff edits only the listed files": met, only the seven listed files changed.
  • "Within 400 changed lines and 15 files": met, 7 files with 14 lines added and 85 removed.
  • sync-hold-floor.py --check, the named Python and Node suites, and ci-status: not checked by me. I had no shell in this run. The PR says these were left to CI, and its other test claims are the author's and unchecked.

The PR context file has no embedded instructions aimed at this lane. No plugin manifest changed. This is a first review, not blocking-only.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for fc3d095

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-15576-fc3d095d8b805cb222c411282a7fcd8c17608d5f, expires on 2026-12-12.

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 12, 2026
Merged via the queue into main with commit 4deea00 Nov 12, 2026
68 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15454-43213987836-1 branch November 12, 2026 12:36
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

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

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/pr-unblock/dispatch.mjs 0 1 0 0 0 0
.github/scripts/pr-unblock/gate-recheck.mjs 0 1 0 0 0 0
.github/scripts/pr-unblock/lane-hold.mjs 0 1 0 0 0 0
.github/scripts/pr-unblock/publish-feedback.mjs 0 0 0 0 0 1
.github/scripts/pr-unblock/refine-event-dispatch.mjs 0 1 0 0 0 0
.github/scripts/pr-unblock/resolve-threads.mjs 0 0 0 0 0 1
.github/scripts/pr-unblock/verify-notes.mjs 0 0 0 0 0 1

Surviving mutants

Location Operator Disposition Cause
.github/scripts/pr-unblock/dispatch.mjs:937 SBR unclassified none
.github/scripts/pr-unblock/gate-recheck.mjs:83 SBR unclassified none
.github/scripts/pr-unblock/lane-hold.mjs:98 SBR unclassified none
.github/scripts/pr-unblock/refine-event-dispatch.mjs:103 SBR unclassified none

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 4deea0062286e854752c00920fcc607faafaebb3; 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.

Run lane script entry points through one lib helper (part 2 of 2)

0 participants