Skip to content

refactor(pr-unblock): simplify dependency-classify, dependency-dispatch and dispatch-record - #14170

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14131-42496738592-1
Nov 8, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14131

Summary

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

Made the three pr-unblock scripts smaller without changing what they do: duplicated expressions are folded into local helpers (isObject in parseJson, allKeys for the key union, byKey for the sorted record entries), a few redundant checks are gone (the lock install-script loop now reuses the key list it has already checked equal, and isDependabotCommit compares the author directly), and the candidate filter is a single pass. A fresh-context reviewer found edge-case behavior changes in an earlier draft of commitsRefusal, pruneRecord, readRecord and serializeRecord; those rewrites were reverted or rewritten so every input gives the same result as before.

Not verified

  • The node test suites (dependency-classify.test.mjs, dependency-dispatch.test.mjs, dispatch.test.mjs, install-script-pin.test.mjs and the other importers) were not run: this lane cannot run node; left to the PR's CI.
  • ci-status green on the PR: a PR CI check, left to the PR's CI.
  • Tidy pass skipped: the change sits under .github/, a listed shared path in the tidy cutoffs.
  • The fresh-context reviewer's contrived fixContentRefusal note (an object whose toString returns different values on successive calls) was not acted on; path is a filename string at every caller.
  • Changes left uncommitted in the working tree, as the runner instructs; the runner turns them into the patch.

Fix

  • .github/scripts/pr-unblock/dependency-classify.mjs: inlined isDependabotCommit (dropping the private signed/isAuthor helpers); used == null in subjectMajor and contentStep; pinSwapRefusal finds the workflow path once; parseJson reuses isObject; new allKeys helper replaces two copies of the sorted…
  • .github/scripts/pr-unblock/dependency-dispatch.mjs: merged the two candidate filters into one with the same checks in the same order.
  • .github/scripts/pr-unblock/dispatch-record.mjs: serializeRecord sorts through a byKey helper (filtering empty entries before sorting, as before); readRecord has one read path with the same empty result for a missing path or unreadable file.

Verification

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

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

The run reports:

  • check-changelog-fragments: all 7 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 8 passed, 8 skipped over 3 changed files
  • fresh-context subagent review of the whole diff against behavior preservation: flagged commitsRefusal (holes, early stop, non-array iterables), serializeRecord (sorting before filtering), pruneRecord (non-Set values) and an empty catch in readRecord; all four were reverted or rewritten, the…
  • rate-guard.test.mjs's raw-fetch scan: the fetch( call in dependency-classify.mjs is unchanged, so its UNGUARDED entry still applies (read, not run)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42496738592

Left out: the items under Not verified.

Related

#14131

Merge-Risk: max=HIGH demote=true head=e68ff054b38cd12fd21d467aa32d52a9091a02f6 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Security review: no security issues found

I read every hunk of all 3 changed files. .github/scripts/pr-unblock/dependency-classify.mjs and dispatch-record.mjs are trusted paths, so I read their whole change and the code it gates: the Dependabot content-refusal checks and the dispatch record. I checked each rewrite against the base code to see whether it now lets through anything the base refused. None does.

  • lockRefusal: the install-script loop now goes over keys (the head's packages keys) instead of the union of both sides' keys. The function has already returned lock-packages unless both packages values are objects (L546). It has also returned lock-packages-changed unless the two key sets are equal (L547-L548). So keys is the union, and dropping the isObject fallbacks can neither throw nor skip an entry. The hasInstallScript check still runs on every package.
  • isDependabotCommit: compares the same name and email against DEPENDABOT_AUTHOR with strict equality, as before.
  • pinSwapRefusal: replacing some then find with find plus if (!where) is equivalent. paths holds only truthy strings, so find returns a non-empty string exactly when some would have been true. Every workflow or action file still reaches the patch check.
  • subjectMajor and contentStep: == null is equivalent to the old === null || === undefined for values parsed from JSON or the API. contentStep still returns dependabot-config-unreadable for a missing config.
  • parseJson, allKeys, fixContentRefusal: hoisted helpers with the same results; the package.json key comparison is unchanged.
  • dependency-dispatch.mjs: the two candidate filters are merged into one with the same conditions, so the Dependabot databaseId check still applies to every candidate.
  • dispatch-record.mjs: byKey keeps the filter-then-sort order. When the path is missing or the file can't be read, readRecord now passes "" to parseRecord. JSON.parse("") throws there, so it returns emptyRecord(), the same result as before.

No merge hold, trust control, token scope or untrusted-text path is widened. No instructions were deleted and no plugin manifest changed.

The PR context contains no embedded instructions aimed at this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14170, a behavior-preserving refactor of three pr-unblock scripts

No findings. I read every hunk of all 3 changed files and checked each rewrite against the base code it replaces.

.github/scripts/pr-unblock/dependency-classify.mjs

  • subjectMajor and contentStep: x == null is the same check as x === null || x === undefined for these inputs.
  • isDependabotCommit: inlining the private signed/isAuthor helpers compares the same two fields. Neither helper was exported, and nothing else in pr-unblock/ refers to them.
  • pinSwapRefusal: paths is filtered with Boolean, so find returns a non-empty string or undefined, and if (!where) continue means the same as the old some guard. ACTION has no /g flag, so calling test once per path instead of twice changes no lastIndex state.
  • isObject and allKeys: moving isObject above parseJson changes nothing, since it is only read when the function is called. allKeys is the same sorted key union as the two copies it replaces.
  • lockRefusal: the old fallback to {} for was/is could never be reached. Line 546 has already returned lock-packages when either side is not an object, and line 548 has already proved that both sides have the same sorted key list. So looping over keys and indexing old.packages and now.packages directly gives the same result.
  • fixContentRefusal: computing String(path ?? "") once is equivalent for every string caller.

.github/scripts/pr-unblock/dependency-dispatch.mjs: the two .filter calls are merged into one && chain that runs the same checks in the same order.

.github/scripts/pr-unblock/dispatch-record.mjs

  • byKey sorts in place, but always on a new array (a spread or a filter result), and still filters before it sorts, as the old code did.
  • readRecord: a missing path or a failed read now goes through parseRecord(""). JSON.parse("") throws, so that returns emptyRecord() with text: "", the same result as before.

Closing issue #14131 acceptance criteria

  • Behavior unchanged, same exported names, no file renamed or moved: met. My only evidence is reading the code; I ran nothing. The existing suites (dependency-classify.test.mjs, dependency-dispatch.test.mjs, the dispatch-record tests) would catch a regression in these paths. The PR author says those suites were not run in the lane and leaves them to CI.
  • Diff edits only the listed files: met. Only the 3 listed files changed.
  • Within 400 changed lines and 15 files: met.
  • ci-status green: not something this lane can check. It is left to the PR's CI.

The PR body's verification claims (changelog-fragment and changed-skill checks passed) come from the author and I have not confirmed them. The PR context contains no embedded instructions aimed at this lane. No plugin manifests changed, and this is the lane's first review of the PR, so nothing was already posted.

Hold: none. The change is in a trusted path (dependency-classify.mjs), which alone is not a hold class, and it costs nothing in billing or usage.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for e68ff05

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-14170-e68ff054b38cd12fd21d467aa32d52a9091a02f6, expires on 2026-12-08.

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 8, 2026
Merged via the queue into main with commit ad81db8 Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14131-42496738592-1 branch November 8, 2026 17:34
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 .github: pr-unblock (2 of 6)

0 participants