Skip to content

refactor(pr-unblock): simplify feedback-dispatch.mjs - #14169

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14133

Summary

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

Simplified .github/scripts/pr-unblock/feedback-dispatch.mjs (49 lines added, 94 removed) with behavior unchanged. Duplicated code now goes through shared helpers in the same file: one pager handles every REST listing, and small helpers cover the repeated run-since lookup, hold-label filter, slot check, newest-started pick and ISO time format. recoverDeferred now calls dispatchAtHead, and sweepPulls drops a parameter no caller passed. Every request URL, call order, log line, error message, page cap and exported name is the same as before. No code moved between files.

Not verified

  • node --test runs of feedback-dispatch.test.mjs, count-requests.test.mjs and resolve-config/feedback-dispatch.test.mjs: this lane cannot run node, so the suites are left to the PR's CI
  • tidy: skipped because the change is under .github/, a listed shared path for the tidy cutoffs
  • no changelog fragment: the change is to a repository CI script, not a plugin, and check-changelog-fragments passes without one
  • ci-status green on the PR: a PR CI check, left to the PR's CI

Fix

  • .github/scripts/pr-unblock/feedback-dispatch.mjs: added module helpers newestStarted, isoSeconds, heldLabels, slotEnabled and runSince, which replace four copies of the 'run of the activity for this PR created since X' lookup and two copies each of the hold-label filter, slot-enabled check,…

Verification

The runner ran each check from the base copy against 57e99f7:

  • 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 (run before and after the final edit)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 8 passed, 8 skipped over 1 changed file
  • git-read diff --numstat HEAD: 49 added, 94 removed, 1 file (within 400 lines / 15 files)
  • fresh-context review subagent compared the diff hunk by hunk against HEAD: no behavior change in URLs, call order, log or error text, try/catch coverage, spread precedence or exports. Its one edge case (methods no longer async would throw synchronously on a bad input) was fixed by restoring async…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42496857281

Left out: the items under Not verified.

Related

#14133

Merge-Risk: unrated reason=pending

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 57e99f7b9f3f08d012f0a5b722dc55937284cfc0: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14169 (refactor(pr-unblock): simplify feedback-dispatch.mjs)

No security issues found.

Scope. One changed file, .github/scripts/pr-unblock/feedback-dispatch.mjs. It matches the trusted paths, so I read every hunk in .claude-lane/pr.diff and also read what the refactored code now calls (dispatchAtHead, reviewRunAt).

What I checked. The PR says the change is a refactor with no change in behavior. I compared each hunk against the base to confirm that, focusing on the controls this file feeds: the dispatch and sweep gates, hold labels, slot enablement and run dedup.

  • Hold-label filter (heldLabels). It is the same expression as before, (pull.labels ?? []).map(name).filter(settings.holdLabels.includes), and is used at both former sites (dispatchFeedback and sweepStale). No hold is weakened.
  • Slot check (slotEnabled). It is the same predicate (slot.name === name && slot.enabled === true). dispatchFeedback still requires both activity and replyActivity. sweepStale still requires activity plus selected.applies === true, and lane.enabled !== true still fails closed.
  • Run-since dedup (runSince). It keeps the same display_title === runTitle(...) match and the same !(Date.parse(created_at) < since) comparison. A run whose creation time can't be read still counts as sent, so it fails closed on the side of not re-dispatching, as before. That covers all four former copies: sweepStale, sweepUnsent, sweepFixRequest and recoverDeferred.
  • recoverDeferred now calls dispatchAtHead. dispatchAtHead does the same reviewRunAt lookup, logs the same skip when there is no completed review run, and returns the same upstreamRunId.
    • Spread order is unchanged: before, it was {...rest, api, …, upstream, notesSince, passOnly}; now it is {...rest, ...options, api, …, upstream}. options holds only notesSince and passOnly, so rest still can't override api, repository, appSenderId, settings or upstream, and the two options still override rest.
  • sweepPulls parameter dropped. No caller passed it. The walk still covers only open PRs whose user.id === appSenderId, so the author filter on the recovery sweep is unchanged.
  • REST pager (pages, workflowRuns). The URLs, per_page, page caps (50 or 10), error text and the workflow_runs ?? [] extraction are unchanged. There is no new input interpolation; encodeURIComponent(base) is kept.
  • isoSeconds. It is the same toISOString().replace(/\.\d{3}Z$/, "Z") transform.

Trust controls. Nothing widens or narrows any of them. The trusted-trigger check, lane token scope, kill switch, the token broker's signer and merge holds are all untouched, and nothing new reaches a credentialed lane.

Other notes.

  • The PR context contains no embedded text that tries to steer the review.
  • There are no plugin manifest changes.
  • Prior findings: none; this is not a blocking-only review.
  • Spend: nothing new; the dispatch and listing call counts and caps are the same.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: #14169 refactor(pr-unblock): simplify feedback-dispatch.mjs

No findings. I read every hunk of the one changed file, .github/scripts/pr-unblock/feedback-dispatch.mjs. It is on the trusted-path list, so I read the whole change and the head-file callers of each new helper.

Behavior check, hunk by hunk. These checks come from reading the code. I could not run node.

  • runSince replaces four copies of the "run of the activity for this PR created since X" lookup, in sweepStale, sweepUnsent, sweepFixRequest and recoverDeferred. It keeps the same display_title match and the same NaN-tolerant !(created < since) test. Every caller's context provides api and settings: sweepUnsent and sweepFixRequest destructure context, and recoverDeferred now builds a context.
  • recoverDeferred now calls dispatchAtHead, and the behavior matches the old inline code:
    • It makes the same reviewRunAt call and logs the same "has no completed review run" line.
    • A null return still continues the loop, because dispatched === null.
    • In the spread, notesSince/passOnly still override rest, now via ...options after ...rest.
    • upstreamRunId is still added to the result.
    • feedback-dispatch.mjs#L1189-L1198
  • openPulls(context) now gets an extra log key, which its destructuring ignores.
  • sweepPulls drops its pulls parameter. Its only caller, L1329, passes two arguments.
  • The widened pages(url, max, tooMany, rowsOf) keeps the old behavior:
    • Its defaults reproduce the old ${url} has more than 50 pages message for existing callers.
    • listIssueComments, listOpenPulls and listStatuses keep their caps (50/10/10) and their error text.
    • listFinishedRunsSince builds an identical ...runs?${query}&page=N URL, and rowsOf picks out workflow_runs ?? [] as before.
    • The methods are still async, so a bad input rejects a promise rather than throwing synchronously.
  • newestStarted, isoSeconds, heldLabels, slotEnabled and workflowRuns are direct extractions with the same expressions. releaseState now calls releases(...) once instead of twice on the same value.

Closing issue #14133 acceptance criteria

  • Behavior unchanged, exports and names unchanged: met, by reading. Existing tests in feedback-dispatch.test.mjs cover the recoverDeferred and sweep result shapes, for example upstreamRunId: 13 at L2154 and L3060.
  • Only the listed file is edited: met.
  • Within 400 lines and 15 files: met. The diff adds 49 lines and removes 94 in one file.
  • ci-status green: I can't check this from here. It is up to the PR's CI.

The author's node test runs are listed under "Not verified" in the PR, and I did not run them either. This PR changes no plugin manifests and spends nothing.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 57e99f7

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-14169-57e99f7b9f3f08d012f0a5b722dc55937284cfc0, 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 5d39771 Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14133-42496857281-1 branch November 8, 2026 17:05
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 5d39771c9439d3343573b113534af26a06b8c4ca; 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 .github: feedback-dispatch.mjs

0 participants