Skip to content

refactor(pr-merge): simplify merge-risk-line, refire-refused, rotation, superseded and sweep-summary - #14233

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14126

Summary

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

Applied behavior-preserving simplifications to five of the ten listed pr-merge scripts: one shared unrated() helper and one unreadable try block in merge-risk-line.mjs, dropping catches that within() already covers; a treeOf() helper for the head-tree read that refire-refused.mjs did twice; a duplicated comment line removed and a misplaced doc comment moved in rotation.mjs; one repo binding in superseded.mjs; and a one-line null check in sweep-summary.mjs. The other five files (on-main.fixture.mjs, post-unarmed-status.mjs, rate-stop.bash, release-eval-hold.mjs, retry-call.bash) were reviewed and left as they are: each is already minimal, and the only duplication left in them is across files (escapeCommand, REPO checks), which the issue puts out of scope for this chunk.

Not verified

  • node --test for .github/scripts/pr-merge was not run: this lane's Bash cannot run an interpreter, so the test suite is left to the PR's CI
  • tidy skipped: the change sits under .github/, a listed shared path, so the tidy entry was not run
  • ci-status green is a PR CI check, left to the PR's CI
  • no changelog fragment added: .github/scripts is not a plugin, so it has no release record

Fix

  • .github/scripts/pr-merge/merge-risk-line.mjs: unrated() hoisted to module scope and used for the unreadable and over-budget fallbacks; readRating's two unreadable try/catch blocks merged into one; the async IIFE around readRating dropped; the redundant .catch on the body write removed, since…
  • .github/scripts/pr-merge/refire-refused.mjs: new treeOf() helper replaces the identical head-commit tree read and error in transientRefusal and headTree
  • .github/scripts/pr-merge/rotation.mjs: duplicated comment line on ghDownload removed; the newestTrustedRun doc comment moved from above runOrder to above newestTrustedRun
  • .github/scripts/pr-merge/superseded.mjs: env.GITHUB_REPOSITORY bound once to repo and reused in the validation and both API paths
  • .github/scripts/pr-merge/sweep-summary.mjs: normalizeReason's null/undefined/false check written as reason == null || reason === false

Verification

The runner ran each check from the base copy against 491adf4:

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

The run reports:

Left out: the items under Not verified.

Related

#14126

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

Security review: PR #14233

I found no security issues. All five changed files match TRUSTED PATHS:, so I read every hunk of each, plus the code each one gates. superseded.mjs is also one of the merge-hold trust controls. None of the changes widens a trust control, and none weakens a merge hold.

  • merge-risk-line.mjs
    • unrated() moved to module scope. It still only calls unratedLine, and no name collides with it.
    • readRating now has one try around the listing, the run reads and download(). Before, a throw in either part returned unrated("unreadable"); it still does. A bad rating still returns invalid.
    • In recordMergeRisk, the async wrapper around readRating was removed. readRating is an async function, so any throw still comes back as a rejection.
    • The .catch(() => "write-failed") on the body write was removed. That is safe: within() at merge-risk-line.mjs#L179-L182 already does Promise.resolve(promise).catch(() => fallback), and its fallback here is "write-failed".
    • Both checks before any write are unchanged: appOnlyBody and the comparison of the live body with the listed one.
  • refire-refused.mjs: the new treeOf() helper does the same work as the two copies it replaces: the same API path, the same SHA check and the same error. headTree still checks the PR's state, head, ref and base before it reads the tree.
  • superseded.mjs (merge hold): env.GITHUB_REPOSITORY is now stored once in repo. The REPOSITORY check runs on that value before either API path uses it. Before, the paths read env.GITHUB_REPOSITORY after the same check. The trusted list, ranks and eligible() filter are unchanged.
  • rotation.mjs: only comments and the order of declarations changed. runOrder is defined before anything calls it.
  • sweep-summary.mjs: reason == null || reason === false covers exactly the null, undefined and false cases the old check listed.

The PR context file contains no embedded instructions to this review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of all 5 changed files. They are all under .github/scripts/pr-merge/, and merge-risk-line.mjs, refire-refused.mjs, rotation.mjs, superseded.mjs and sweep-summary.mjs are on the trusted-path list. I checked each change against the closing issue #14126's criterion that behavior stays unchanged and found no behavior change.

  • merge-risk-line.mjs
    • The unrated() helper moved to module scope. No other unrated name exists at module scope, and both unreadable and over-budget are in REASONS, so the helper still builds the same objects. unrated("over-budget") is still built eagerly inside the outer try, as over was before.
    • The two readRating try blocks are now one. Both old blocks returned unrated("unreadable") from their catch, and the early return for a missing artifact still sits inside the try. The result is the same.
    • The async IIFE around readRating was dropped. readRating is an async function, so a parameter-destructuring error still becomes a rejection, and the .catch(() => unrated("unreadable")) kept here stops within's over-budget fallback from replacing it.
    • The .catch(() => "write-failed") on the body write was removed. within (unchanged, L179-L182) already resolves a rejection to its fallback, which is "write-failed" here.
  • refire-refused.mjs: the new treeOf() gives the same request, the same SHA check and the same error text as both code paths it replaces. It is a function declaration, so it is hoisted, and it clashes with no other name in this file. A treeOf in merge-holds.test.mjs is a separate module.
  • rotation.mjs: only comments moved and runOrder was reordered. No code changed.
  • superseded.mjs: repo is the same value as env.GITHUB_REPOSITORY once it passes the REPOSITORY test, so the request paths do not change.
  • sweep-summary.mjs: reason == null || reason === false matches exactly the same inputs as the old three-way check.

Closing issue #14126

  • The diff edits only listed files.
  • It is about 40 lines across 5 files, within the 400-line and 15-file limits.
  • No exported names, flags or messages changed.
  • "ci-status is green" is left to the PR's CI. The PR body says node --test was not run, which is author-claimed and unverified. I did not run any tests either, because this lane has no shell.

No embedded instructions in the PR context. No settled threads and no prior findings (first review, not blocking only). No plugin manifests changed.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 491adf4702eecfed0a90cb2ef11467466200a649. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 491adf4

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-14233-491adf4702eecfed0a90cb2ef11467466200a649, 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 6805c92 Nov 8, 2026
68 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14126-42514666483-1 branch November 8, 2026 21:08
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 6805c92275afdea3ea4fab189cfad6797a635c85; 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 pr-merge .github script (2 of 2)

0 participants