Skip to content

refactor(pr-merge): simplify merge-holds.mjs - #14164

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14125

Summary

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

Shortened .github/scripts/pr-merge/merge-holds.mjs by 20 lines (49 added, 69 removed) with every output, exit code, export and CLI flag unchanged. The private paging helper listed is folded into pages through an optional key. main now parses the evidence file once instead of three times, so the private evidenceOf is gone. Nine copies of the commit-SHA regex and three of the owner/name regex became the isSha and isRepo predicates. The repeated approval sentence in six hold messages became the APPROVAL_LIFTS and APPROVAL_CARRIES constants, and a misplaced doc comment (reviewKey's, sitting inside autoDismissed's) is back beside its function. No helpers were moved between files: the module must import no other repository file, because ci-status runs it alone from the base commit (merge-holds.mjs header). Note: this file is on the trust hold-path floor (HOLD_PATH_CLASSES), so the pull request holds until a person on the trusted-actor list approves it.

Not verified

  • node --test for .github/scripts/pr-merge/merge-holds.test.mjs and the suites that import merge-holds.mjs (enable-auto-merge.test.mjs, resolve-pr.test.mjs and others), plus test_merge_holds_sync.py: this lane can run only the named wrappers, so these are left to the PR's CI
  • JS lint and format over the changed file: no wrapper for a JS linter is available in this lane; left to the PR's CI
  • tidy: not run, because the change is under .github/, a listed shared path for the tidy cutoffs
  • cant-fail-scan: not applicable, no test file changed
  • ci-status green on the PR: a PR check, left to the PR's CI

Fix

  • .github/scripts/pr-merge/merge-holds.mjs: folded listed into pages(github, path, key = null), keeping both error messages; main parses the evidence file once into evidence and passes it to passRefusalOf and evidenceHold, removing evidenceOf; added isSha and isRepo predicates for the…

Verification

The runner ran each check from the base copy against 662cef0:

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

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 1 fragment valid (no plugin changed, so no fragment needed)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changed-skills: no changed skills, nothing to gate
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 8 passed, 8 skipped over 1 changed file (run again after the last edit, same result)
  • git-read diff --numstat HEAD: 1 file, 49 added and 69 removed
  • fresh-context review subagent over the whole diff: found no difference reachable from the command line; it named one theoretical difference reachable only by calling the exported main() directly (linkFile === 0 would read stdin), so that edit was reverted and the original linkFile ? guard restored
  • Grep over the repository: no test reads the removed private names (listed, evidenceOf); test_merge_holds_sync.py reads this module's imports and generated blocks, and neither changed; the changed message text is checked only at runtime (merge-holds.test.mjs, scripts/ci-lanes-pr-hold.test.sh),…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42496720484

Left out: the items under Not verified.

Related

#14125

Merge-Risk: max=HIGH demote=true head=662cef02edb076d7a96a1c7a2561863600008084 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 662cef02edb076d7a96a1c7a2561863600008084: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14164, refactor(pr-merge): simplify merge-holds.mjs

No security issues found. I read every hunk of the one changed file, .github/scripts/pr-merge/merge-holds.mjs. It matches a trusted path and is a merge-hold control, so I checked whether any hold is now weaker. None is.

What I checked against the code at head:

  • Evidence file handling (main, L1771-L1808). The old code read the file up to three times, through passRefusalOf, evidenceOf and a re-read for refusal. The new code parses it once into evidence, or leaves it undefined when the file is absent or doesn't parse. The holds still behave the same:
    • passRefusalOf(undefined | null, head) still returns null (L1518-L1520), as before.
    • evidenceHold rejects non-objects before it uses in, so it can't throw (L1496-L1506). Removing evidenceOf's try/catch therefore drops no fallback.
    • evidenceHold(undefined) returns "its pr-verify FAILs could not be read", the same message as the old no-file and unreadable-file branches. A missing or broken evidence file still holds the merge.
    • const { refusal } = evidence runs only when evidenceHold returned null, which requires an object.
    • Parsing once also removes the old gap between the separate reads of the same file.
  • pages(github, path, key) replacing listed. It pages the same way (per_page=100, stops on a short page) and throws the same errors when no list comes back. Existing two-argument callers keep key = null, so they behave as before.
  • isSha / isRepo. The regexes match the copies they replace, including the String() coercion. parents.filter(isSha) only uses the first argument. The head, base, commitId and dismissal_commit_id checks and verdictHold's repository check are as strict as before.
  • Hold message constants. APPROVAL_LIFTS and APPROVAL_CARRIES produce exactly the old message text. They are module-level consts used only inside functions, so there is no use-before-definition problem. Moving reviewKey is just as safe.
  • No new imports. The module still imports no other repository file, which ci-status's base-commit run depends on.

Owner threat model: the diff removes or narrows no friction hold and no provenance hold. The hold path, trusted-actor widening, verifier, pin and cost holds all hold under the same conditions as before.

Prior findings: none (0 earlier heads reviewed, not blocking only). Embedded text in the PR context: none that directs this lane.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: refactor(pr-merge): simplify merge-holds.mjs

No findings. I read every hunk of the one changed file, .github/scripts/pr-merge/merge-holds.mjs. Because the file is on a trusted path, I read the whole change and the unchanged code it calls (evidenceHold, passRefusalOf and the callers of pages).

What I checked for unchanged behavior

  • Evidence-file handling in main. The file is now parsed once into evidence, and that value goes to passRefusalOf and evidenceHold. The old code had three try blocks around these calls. Dropping them is safe because neither function can throw on any JSON value or on undefined:
    • passRefusalOf uses optional chaining.
    • evidenceHold rejects null, non-object and array values before it uses in.
    • A missing file, unreadable file or bad JSON still gives refused = null and failed = "its pr-verify FAILs could not be read", the same as before.
    • const { refusal } = evidence runs only when evidenceHold returned null, which means evidence is a plain object.
  • listed folded into pages(github, path, key = null).
    • Existing two-argument callers keep the old array check and the old is not a list error.
    • Keyed callers keep the old has no <key> list error and stop paging on the same condition.
    • pages is a hoisted function declaration, so noticedHead calling it from earlier in the file is fine.
  • isSha and isRepo. They use the same regexes and the same String() coercion, and they are defined at module top level before any use. parents.filter(isSha) ignores the extra index argument.
  • APPROVAL_LIFTS and APPROVAL_CARRIES. Each message built from them matches the old literal character for character in all six hold messages and in pinHold. They are only used inside function bodies, so they cannot be read before they are defined.
  • Moving reviewKey. It is a const arrow function and stays above its first use (autoDismissed, liftsOf).
  • Removed comment. It belonged to evidenceOf, which this PR removes.
  • Tests. I found no test that reads this module's source text and would see the removed names or the regex literals.

Closing issue #14125, acceptance criteria

  • Behavior is unchanged…: met as far as I can tell from reading the code. The changed hold messages are checked at runtime by merge-holds.test.mjs, so a broken message could fail a test. I did not run any tests; the PR body's verification is author-claimed and I have not confirmed it.
  • The diff edits only the listed files…: met (one file).
  • Within 400 changed lines and 15 files: met (49 added, 69 removed).
  • ci-status is green: not verifiable from this lane; it is left to the PR's checks.

I found no embedded instructions in the PR context. This review covered the full diff; earlier heads reviewed: 0.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 662cef0

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-14164-662cef02edb076d7a96a1c7a2561863600008084, 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 f97dded Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14125-42496720484-1 branch November 8, 2026 17:03
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit f97dded77d96a94ddaf434e697e658e38552a755; 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: merge-holds.mjs

0 participants