Skip to content

refactor(ci): simplify the second half of enable-auto-merge.mjs - #14260

Merged
kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-14122-42527201176-1
Nov 8, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-14122-42527201176-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14122

Summary

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

Simplified the functions that start in the second half of .github/scripts/pr-merge/enable-auto-merge.mjs (pythonEvidence onward). Behavior is unchanged. A lastLine helper now reads a child process's last output line in pythonEvidence, pythonClose and pythonWholeReview. Inside main, new helpers replace code that appeared in more than one place: appendSummary (step-summary writes), unlabeledTimeline (UNLABELED_QUERY reads), a shared decide-options object, and readerStopped, the old wholeStopped, which the verifier read's rate-limit branch now reuses. Two repeated reason strings became module constants. The trusted-actors file is now read once per run instead of once per review and per pull request. pythonRoom starts in range 1, so it keeps its inline last-line parsing.

Not verified

  • enable-auto-merge.test.mjs and the other pr-merge node tests were not run: this lane runs no interpreter, so the PR's CI runs them
  • ci-status green on the PR: left to the PR's CI
  • tidy skipped: the change is under .github/, a listed shared path for the tidy cutoffs
  • Merge hold: enable-auto-merge.mjs is on the merge lane's hold-path floor, so a trusted person's approval of the head is expected before it merges

Fix

  • .github/scripts/pr-merge/enable-auto-merge.mjs: added a lastLine helper used by pythonEvidence, pythonClose and pythonWholeReview; pythonClose builds its argv in one expression; pythonWholeReview returns from inside its try; NO_TIME_LEFT and READER_RUNS_ARM constants replace repeated literals; main…

Verification

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

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

The run reports:

  • check-changelog-fragments: passed (All 1 changelog fragment(s) under .changes/ are valid)
  • check-changed-skills: passed (no changed skills under plugins/*/skills/)
  • check-affected: 8 passed, 8 skipped over 1 changed file
  • fresh-context review subagent over the whole diff: no behavior difference found; it noted that pythonClose's holds now has to be an array (the only caller and the tests pass arrays) and that the trusted-actors file is read once per run, which could differ only if the file changed mid-run
  • git-read diff --numstat HEAD: 53 added, 54 removed, in 1 file (range 2 of 2 only)
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42527201176

Left out: the items under Not verified.

Related

#14122

Merge-Risk: max=HIGH demote=true head=1e596c5412cc092f24b5fcaf34060aa6dace124f 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 needs no new review of 1e596c5412cc092f24b5fcaf34060aa6dace124f: no file of this pull request changed since the review of e183cef.

Security review of #14260: no security issues found.

critical-findings: 0

I read the whole change to .github/scripts/pr-merge/enable-auto-merge.mjs, the PR's only changed file. It is on the trusted-path list and is a merge-hold control, so I checked whether the refactor weakens any hold. It does not. Each change behaves the same as the code it replaces:

  • lastLine: this helper does exactly what the inline String(x).trim().split("\n").at(-1) reads did. Its uses in pythonEvidence, pythonClose and pythonWholeReview keep the same done.status checks, the same order, and the same throw or return paths.
  • pythonClose argv: the arguments are the same and in the same order: the --hold-label pairs come before number and head. holds.flatMap needs an array, and the only caller (L2469) passes ["do-not-merge", humanGated]. Any other input would throw, so it fails closed and arms nothing.
  • pythonWholeReview: returning from inside the try gives the same result. A parse failure still throws.
  • readerStopped in the verifier read (L2396): its body (L1965-L1973) sets stopped, calls latch.reload?.() and sets laneHeld, the same three steps the removed inline branch took. The rate-limit stop still disarms or holds every later lanes App pull request.
  • trustedHumans(env) read once (L2224): the function never throws; an unreadable list gives an empty Set (L628-L635). It reads the .base/ trusted-actor file, so the PR's own head never supplies that list. The Set is now shared across pull requests, so I checked that nothing changes it:
    • approvedBy, costDecision, headLifters/pathLifters, liftersOf and liftBlocked/liftBlocker only call humans.has.
    • Every .add/.delete in merge-holds.mjs acts on a local collection.
    • No pull request can add a trusted person for a later one.
  • judging, unlabeledTimeline, appendSummary, NO_TIME_LEFT, READER_RUNS_ARM: the options, query variables and strings are identical to what they replace, and the step-summary error handling is unchanged.

Other checks:

  • Trust controls: no widening of who is trusted, of token scope, or of what untrusted text reaches a lane. No kill-switch change and no merge-hold change.
  • Owner friction holds: none removed.
  • Plugin manifests: none touched.
  • Instruction surfaces: none touched.
  • PR context: no embedded directives aimed at this lane.
  • This is the lane's first review of this PR; prior findings: none, so the review was not limited to blocking findings.

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

claude-review needs no new review of 1e596c5412cc092f24b5fcaf34060aa6dace124f: no file of this pull request changed since the review of e183cef.

Code review: #14260, refactor(ci): simplify the second half of enable-auto-merge.mjs

No findings. I read every hunk of the one changed file, .github/scripts/pr-merge/enable-auto-merge.mjs. It is on a trusted path, so I read its whole change and checked each refactor against the unchanged code it calls. Every change I checked behaves the same as before:

  • lastLine helper (L1355): it does exactly what the inline String(x).trim().split("\n").at(-1) did. The ?? "" fallbacks on stderr are kept, and stdout is still wrapped in String(...).
  • pythonClose argv: the order is unchanged (flags, then the --hold-label pairs, then number and head). flatMap needs holds to be an array. The only caller (L2469) passes an array literal, so that is fine.
  • pythonWholeReview: returning from inside the try gives the same result and the same thrown error.
  • readerStopped (L1965-L1973): it sets stopped, calls latch.reload?.() and sets laneHeld exactly as the inlined block in the verifier read did. The roomHeld, action and decided updates that follow still read the new laneHeld.
  • humans moved out of the per-PR loop: trustedHumans (L628-L635) catches its own errors and never throws, so reading it once before the loop cannot change error handling. The only possible difference is the trusted-actors file changing during a run, which the PR already notes. No other humans binding in main clashes with the new const.
  • Shared judging object: decide only destructures its options and never changes them, and slug, humanGated, holdPaths and pathHolds are all const. Sharing one object is therefore safe.
  • unlabeledTimeline, appendSummary, NO_TIME_LEFT, READER_RUNS_ARM: these are straight replacements. The query variables, the summary text, the GITHUB_STEP_SUMMARY guard and the reason strings are all unchanged.

Closing issue #14122, acceptance criteria:

  • Behavior unchanged, same exported names: met as far as I can tell from reading the code. No export was added, renamed or removed. Existing tests in enable-auto-merge.test.mjs cover these paths. I ran nothing: the PR's statement that the pr-merge node tests were not run, with CI left to run them, is the author's claim and is unverified.
  • Diff edits only the listed file: met. One file changed.
  • Within 400 changed lines: met (about 53 added and 54 removed).
  • ci-status green: not something I can check from this lane; left to CI.
  • Only functions starting in range 2 of 2 are changed: met. The edits are in pythonEvidence onward and in main. lastLine is added just before pythonEvidence, and pythonRoom is left alone.

There is no embedded instruction text in the PR context. No security lane concerns are raised here.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head e183cef4bba57b025b4b41e839099f19e25d82c9. 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 pr-unblock lane stopped fix-ci on this pull request: the lane could fix a failing check only by weakening a test, which is refused, so it runs one fresh fixer round on this head that must keep the test's assertions. The lane sets no label: the run ends in a failing pr-unblock/fix-ci status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=14260 -f activity=fix-ci

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 8, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 1e596c5

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-14260-1e596c5412cc092f24b5fcaf34060aa6dace124f, expires on 2026-12-08.

One comment per pull request, updated in place for each new head.

Merged via the queue into main with commit 5b30a1f Nov 8, 2026
63 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-14122-42527201176-1 branch November 8, 2026 23: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 the enable-auto-merge.mjs .github script (part 2 of 2)

1 participant