Skip to content

refactor(pr-unblock): share one dispatch sender and RUN_ID through dispatch-record.mjs - #15437

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15435-43103146635-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #15435

Summary

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

sendDispatch and RUN_ID now each exist once, exported from .github/scripts/pr-unblock/dispatch-record.mjs. dispatch.mjs, fix-ci-dispatch.mjs, fix-docs-dispatch.mjs and dependency-dispatch.mjs call the shared sender instead of their own copies, and feedback-dispatch.mjs imports RUN_ID. The sender takes three options so every log line stays byte-identical: label goes in the success line, errorLabel goes in the error lines (only dispatch.mjs's sync-shared-copies call sets both), and note is a function called only after a success, which fix-ci uses to append (cause: ...). Callers still count failed, push to dispatched and write fix-docs's docsRuns record exactly as before. feedback-dispatch.mjs's own dispatch paths throw instead of logging, so they keep their own handling, as the issue's list of reimplementations implies.

Not verified

  • The node suite of .github/scripts/pr-unblock/, .github/actions/resolve-config/callers.test.mjs, test_merge_holds_sync.py and test_babysit_risk.py were not run: this lane cannot run node or python. Left to the PR's CI.
  • python3 -I scripts/sync-hold-floor.py --check was not run because this lane cannot run python. No floor row changes, since dispatch-record.mjs was already floored. Left to the PR's CI.
  • ci-status green is a PR check, left to the PR's CI.
  • tidy skipped: the change is under .github/, a listed shared path, so it is not tidied.
  • verify (build and tests) skipped: no node or python runner is available in this lane; CI runs the suites.
  • Changes are left uncommitted in the working tree as the runner instructs; the runner turns them into the patch.

Fix

  • .github/scripts/pr-unblock/dispatch-record.mjs: exports RUN_ID and the shared sendDispatch(api, log, { workflow, base, node, inputs, label, errorLabel, note }); header comment names the addition
  • .github/scripts/pr-unblock/dispatch.mjs: drops its local RUN_ID and sendDispatch and imports both; the sync-shared-copies call passes errorLabel so its error lines keep the activity prefix
  • .github/scripts/pr-unblock/fix-ci-dispatch.mjs: drops local RUN_ID; send() calls sendDispatch with label 'fix-ci ' and a note that appends ' (cause: ...)'
  • .github/scripts/pr-unblock/fix-docs-dispatch.mjs: drops local RUN_ID; the dispatch calls sendDispatch with label 'fix-docs ' and appends the run id to record.docsRuns on success
  • .github/scripts/pr-unblock/dependency-dispatch.mjs: drops local RUN_ID; the dispatch calls sendDispatch with label 'review-dependency '
  • .github/scripts/pr-unblock/feedback-dispatch.mjs: drops local RUN_ID and imports it from dispatch-record.mjs

Verification

The runner ran each check from the base copy against 80305c0:

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

The run reports:

  • grep for 'RUN_ID = ' and 'sendDispatch' across .github: within pr-unblock, RUN_ID is defined only in dispatch-record.mjs, and every sendDispatch call goes through the export
  • check-changelog-fragments: all 15 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 8 passed, 8 skipped over 6 changed files
  • fresh-context review subagent: no problems found; every call site's success and error lines, failed/dispatched counts and the fix-docs docsRuns write match the original, and the test assertions in dispatch.test.mjs, fix-ci-dispatch.test.mjs and resolve-config/feedback-dispatch.test.mjs still match
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43103146635

Left out: the items under Not verified.

Related

#15435

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

Security review: PR #15437 (head 80305c0)

No security issues found. I read every hunk of all 6 changed files.

The PR is a refactor. Four dispatchers each had their own copy of RUN_ID and their own inline dispatch try/catch. Those now use a single RUN_ID and sendDispatch, both exported from .github/scripts/pr-unblock/dispatch-record.mjs. dispatch-record.mjs and feedback-dispatch.mjs are on the trusted-path list, so I read their whole change and what it gates.

What I checked:

  • The workflow run id check is still enforced. The exported RUN_ID regex is the same /^[1-9][0-9]{0,14}$/ every caller used before, and it has no g flag, so .test() keeps no state between calls (dispatch-record.mjs#L73). sendDispatch still returns null when the call throws or the id fails that regex. Each caller still counts a null as failed and adds it to neither dispatched nor docsRuns. Dispatched runs can still only be bound to a recorded id that passed validation.
  • Dispatch target and inputs are unchanged. ref: refs/heads/${base}, workflow and each caller's inputs (pr-number, activity, dispatcher-run-id) are passed through exactly as before. No new input, and no PR-controlled text reaches the dispatch call.
  • The cap is unchanged. sent += 1 still runs before each dispatch call in fix-ci, fix-docs, dependency and shared-copies, so a dispatch that failed but may have started a run still counts against the cap.
  • note callback (fix-ci). It is called only after a successful dispatch and only builds a log suffix from cause(). It has no effect on control flow.
  • No trust control is touched. Nothing changes in the trusted-trigger check, lane token scope, kill switch, broker/resolve-config or merge-hold modules (merge-holds.mjs, enable-auto-merge.mjs and the others). feedback-dispatch.mjs only swaps its local RUN_ID for the identical import.

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

Spend: none beyond this review run.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15437 (no findings)

This refactor moves the dispatch sender sendDispatch and the run-id pattern RUN_ID into .github/scripts/pr-unblock/dispatch-record.mjs. I read every hunk of all 6 changed files. For each call site I compared the old code with the new one, looking at the success line, both error lines, the failed/dispatched bookkeeping and the record writes.

  • dispatch.mjs. The shared sender now prints label only in the success line and errorLabel only in the error lines. Only two calls exist in dispatch.mjs:

    So every line the old local sender printed comes out the same.

  • fix-ci. note() is called only after a run id passes RUN_ID, the same point where the old code called cause(). The line reads dispatched fix-ci #N head … workflow_run_id=… (cause: …) as before.

  • fix-docs. The old success line printed head. fix-docs-dispatch.mjs:397 sets head to node.headRefOid, which is what the shared sender prints, so the output is unchanged. The docsRuns write still happens only on success, and a failure still continues.

  • dependency-dispatch. The success line keeps the review-dependency prefix and the error lines still have none, as before.

  • RUN_ID imports. Every remaining RUN_ID use in dispatch.mjs (lines 691, 771) and feedback-dispatch.mjs (lines 421, 521, 822, 1068, 1225) is covered by the new imports. No local definitions are left in the six dispatcher files.

  • Edge case, not a finding. If a cause() callback threw, the old code had already pushed to dispatched; the new code does not push. None of the cause closures can throw in practice.

Closing issue #15435, acceptance criteria:

  • Single definition used by the dispatchers: met. sendDispatch and RUN_ID are defined once, in dispatch-record.mjs. feedback-dispatch.mjs imports only RUN_ID; its own dispatch paths throw instead of logging, which the PR body explains.
  • Behaviour unchanged: met, by my reading of the code. The existing tests named in the issue (dispatch.test.mjs, fix-ci-dispatch.test.mjs, fix-docs-dispatch.test.mjs, dependency-dispatch.test.mjs) assert these log lines, so a test would catch a change.
  • Diff limited to the listed files, and size limits: met. The diff touches only the 6 listed files, well under 400 lines.
  • Not checked by me. I have no shell, so I did not run sync-hold-floor.py --check, the node and python suites, or ci-status. The PR says it leaves these to CI. Any test output in the PR body is the author's claim and unverified.

I found no embedded instructions in the PR context. No hold applies: there is no cost or security change.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 80305c0

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-15437-80305c05dcab671da67c1fa1cedd75a8826889fc, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit 48010d2 Nov 11, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15435-43103146635-1 branch November 11, 2026 21:56
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

Share one workflow-dispatch sender across the pr-unblock dispatchers

0 participants