Skip to content

refactor(pr-merge): simplify the first half of enable-auto-merge.mjs - #14241

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14121

Summary

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

Part 1 of 2 of simplifying .github/scripts/pr-merge/enable-auto-merge.mjs. It changes only functions that start in lines 1-1358 of the 2717-line file. Code that filtered the lanes App's comments, sorted them and took the newest was repeated in priorRefusal, newestPin and vetoNoted; it is now one newestAppComment helper. The hand-written split-and-strip-CR line handling in seven places now reuses gate-source's existing lines export (imported as bodyLines), through a small firstLine helper. refusalWrites renders only the comment body it needs, uses one toPerson flag where it compared rendered bodies, and calls the existing carries helper. Exported names, flags, outputs and printed text are unchanged.

Not verified

  • node --test for enable-auto-merge.test.mjs was not run: this lane's Bash runs only the named wrappers, so no node test runner was available. Left to the PR's CI.
  • tidy skipped: the only changed file is under .github/, a listed shared path for the tidy cutoffs
  • lint (eslint/prettier) not run locally: no linter wrapper in this lane; left to the PR's CI
  • the 229-line header comment was left as is: shortening it risks dropping contract detail that other files and tests cite

Fix

  • .github/scripts/pr-merge/enable-auto-merge.mjs: added firstLine (reuses gate-source lines) and newestAppComment helpers; priorRefusal, newestPin and vetoNoted now use newestAppComment, and the removed pinLine's callers use firstLine; vetoLabelOwned, sinceAt, recordLines, ghCallsPayload and…

Verification

The runner ran each check from the base copy against 2f8e790:

  • 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

#14121

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

Security review: PR #14241, head 2f8e790d

No security issues found.

Scope: I read the whole change to the one changed file, .github/scripts/pr-merge/enable-auto-merge.mjs. This file is a trusted path and a merge-hold control, so I checked each hunk for whether it weakens or narrows a hold. None does. Every hunk behaves exactly as the base code did:

  • firstLine and the other bodyLines uses: bodyLines is gate-source's lines (String(body ?? "").split("\n").map(l => l.replace(/\r$/, ""))). See gate-source.mjs#L55. The file already imported it before this change (enable-auto-merge.mjs#L241). [0], .at(-1) and .slice(0, 2) give the same results as the old split("\n", n) plus CR-strip code, including for null and undefined bodies. So the checks on the veto marker (vetoNoted, vetoLabelOwned), the pin (newestPin, pinned, pinMoved), the refusal marker (priorRefusal) and the whole-review record (recordLines) still match the same lines.
  • newestAppComment: it keeps the same author filter as before: __typename === "Bot" and login === bot. Only the lanes App's comments are still trusted for veto, pin and refusal state, so no other author's comment can plant one. For vetoNoted, !== undefined on the newest match is true exactly when the old .some() was.
  • refusalWrites: refusalBody is renderRefusal(wrappedFence, …) with the same defaults (#L976-L977). The old body === person test could only be true when clears === "person", because the lane and person bodies always have different text. So toPerson takes the same branches, and the person-escalation label writes are unchanged.
  • carries: it now applies String(label) before lowercasing, as the inline carried code it replaces already did.
  • describe: ${message} gives the same text as ${error?.message ?? error}, and the token-redaction regex is unchanged.

The instruction-surface and plugin-manifest checks do not apply: the diff changes no standing instruction and no manifest.

Embedded text: none in the PR context.

The review was not blocking only: this lane had reviewed no earlier head of this PR.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14241, a refactor of the first 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, and checked each rewrite against the code it replaces.

Did the refactor keep behaviour the same? Yes, for every hunk I checked by reading the code:

  • bodyLines is gate-source's lines (String(body ?? "").split("\n").map(strip \r)), and it was already imported (import { lines as bodyLines … }). This makes the following equivalent to the hand-written split-and-strip code they replace:
    • firstLine
    • sinceAt's .at(-1)
    • recordLines
    • ghCallsPayload
    • listingMissLines
    • priorRefusal's .slice(0, 2), which matches the old split("\n", 2).
  • newestAppComment keeps the old filter/sort/.at(-1) and checks author and login before it calls test, so a nullish comment never reaches c.body. vetoNoted's !== undefined gives the same truth value as the old .some(). It adds a sort, which costs almost nothing.
  • describe: ${message} is String(error?.message ?? error), the same value the template literal produced.
  • carries now wraps label in String(...). That changes nothing for the callers, which pass VETO_LABEL or the resolved label. It also matches the inline check it replaces in refusalWrites.
  • refusalWrites: toPerson replaces the old body === person comparison. The two are equivalent because the person body and the lane body can never be equal: renderRefusal writes different who text and an ATTEND_QUEUE_MARKER line only in the person body. refusalBody is still exported, so callers outside this file are unaffected.

Closing issue #14121, acceptance criteria:

  • Behaviour unchanged: met, as above. I did not run anything. The author says the test run was left to CI; that is unverified. Existing tests in enable-auto-merge.test.mjs cover these helpers; the PR body cites the describe assertions as one example.
  • Only the listed file is edited: met. The diff touches only enable-auto-merge.mjs.
  • Within 400 changed lines and 15 hand-edited files: met, at about 50 changed lines in one file.
  • Only functions that start in lines 1–1358 are changed: met. The last changed hunk is at line 1193 of the head file.
  • ci-status is green: cannot be judged from here; it is left to CI.

The PR context contained no embedded instructions. There were no prior findings and no settled threads.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 2f8e790

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-14241-2f8e790d6aa0e01782069f187d568c6817245f41, 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 3f5f99b Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14121-42514659512-1 branch November 8, 2026 21:10
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 3f5f99b1342781b32ba5dcc8d03082d5b317dffc; 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 enable-auto-merge.mjs .github script (part 1 of 2)

0 participants