Skip to content

refactor(ci): simplify pr-refine, pr-require-checks and pr-review scripts - #14274

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14127

Summary

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

Applied the four /simplify checks to the 11 listed scripts and made small edits in five of them, with behavior unchanged. write-verdict.mjs no longer runs buildVerdict (validation and the credential scan) a second time per chunk just to print the notice counts: it counts them straight from the outputs that buildChunkedVerdict already validated. It also passes its arguments inline instead of through a single-use rest object. The other edits remove repeated expressions: $HOME/.local/bin in install-lefthook.sh, the double path.split and the remove loop in write-diff.py, TRUNCATED === "true" in write-pass-plan.mjs, and the waited.run alias, the triple env\[key\] read and a dead = \[\] initializer in wait-refine.mjs. I left verify-answers.mjs, who.mjs, log-pass-records.mjs, plan-passes.mjs, split-diff.py and take-shared-text.sh unchanged because they are already tight. In plan-passes.mjs I kept the explicit index tie-break in the sort: removing it would rely on sort stability and could reorder passes whose order is undefined.

Not verified

  • Test suites (node --test on the *.test.mjs files, the Python tests) were not run here, because this lane allows no interpreter; they are left to the PR's CI
  • tidy skipped: every change is under .github/, a listed shared path for the tidy cutoffs
  • build/lint of the touched JS, Python and shell files (eslint, ruff, shellcheck) was not run here because the lane allows no interpreter or linter; left to the PR's CI
  • ci-status green on the PR: checked by the PR's CI

Fix

  • .github/scripts/pr-review-main/write-verdict.mjs: the per-chunk notice counts findings and CRITICAL findings from the already-validated outputs instead of re-running buildVerdict; buildChunkedVerdict's arguments are passed inline instead of through a rest object
  • .github/scripts/pr-review/wait-refine.mjs: readEnv's bound() reads env[key] once into a local; the dispatcher loop uses run.id instead of a waited.run alias; let runs drops a dead = \[\] initializer
  • .github/scripts/pr-review-main/write-diff.py: named() splits the path once; the shown-moves update is two comprehensions instead of a remove loop
  • .github/scripts/pr-refine/write-pass-plan.mjs: TRUNCATED === "true" is computed once as truncated
  • .github/scripts/pr-require-checks/install-lefthook.sh: $HOME/.local/bin is held in a bin variable

Verification

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

  • 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

#14127

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

Security review: PR #14274 (2a16b4c)

I found no security issues. I read every hunk of all 5 changed files.

critical-findings: 0

Two changed files match the .github/scripts/pr-review-main/** trusted-path glob. I read each one's whole change and what it gates:

  • .github/scripts/pr-review-main/write-verdict.mjs: The per-chunk notice used to call buildVerdict a second time. It now counts directly from c.output.findings. That call ran after the verdict file and GITHUB_OUTPUT were already written, so it was a second, redundant check and gated nothing. At L251-L260, buildChunkedVerdict still sends every chunk's output through buildVerdict. That covers the schema check, the bounded findings list and the findSecret credential scan at L151-L155, and it throws before anything is written. As a result, c.output.findings is already a validated array when the notice reads it. The notice prints only numbers, never model text. The arguments passed inline are the same as the old rest object, so validation and the gate's counts are unchanged.
  • .github/scripts/pr-review-main/write-diff.py: The named() path split and the loop update in write_diff work the same as before. moves is reassigned in the same function scope, so there is no closure or scoping change. The set of files printed whole (whole) grows the same way, so no part of the diff is dropped from what the review reads.

Other files:

  • .github/scripts/pr-require-checks/install-lefthook.sh: This only adds a bin variable. The SHA-256 pin check (sha256sum -c) still runs on the copied binary before chmod +x and before it is executed, and the download URL and version pin are unchanged.
  • .github/scripts/pr-review/wait-refine.mjs: completed() re-reads actions/runs/${run.id}, so waited.run.id was always equal to run.id. Using run.id directly does not change which dispatcher's artifacts get trusted, and the refine-run identity check at L143 is unchanged. The bound() local and the dropped = [] initializer don't change behavior.
  • .github/scripts/pr-refine/write-pass-plan.mjs: This only hoists TRUNCATED === "true" into a variable. The behavior is the same.

No trust control, merge hold, token scope or kill switch is widened. The PR context contains no embedded instructions aimed at this lane. The diff touches no plugin manifest and no standing instruction.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14274, no findings

I read every hunk of all 5 changed files and the code each change touches. Each edit keeps behavior the same:

  • write-verdict.mjs: The per-chunk notice now counts straight from c.output.findings. That matches the old second buildVerdict call. buildChunkedVerdict (L178-188) has already validated every chunk's output and thrown on anything malformed, and buildVerdict copies severity through unchanged, so the counts of all findings and of CRITICAL findings are equal. The arguments passed inline are the same set the old rest object held. buildVerdict is still used by buildChunkedVerdict. Existing assertions at write-verdict.test.mjs:215-217 cover the notice text.
  • wait-refine.mjs: completed() re-reads the run with api.get(\actions/runs/${run.id}`)(L91), sowaited.run.id === run.idand dropping thedispatcheralias keeps the same ids.let runs;is safe because thefor (;;)loop assigns it before any read.bound()readsenv[key]` once into a local, with the same logic.
  • write-diff.py: The filter-and-flatten does the same as the old remove loop, duplicate tuples included: shown holds each copy, so the old loop also removed them all and added both to whole. Rebinding moves inside write_diff is fine because nothing else holds that list.
  • write-pass-plan.mjs and install-lefthook.sh: These only hoist a repeated expression into a variable (truncated, bin), and the value is the same at every place it is used.

Closing issue #14127:

  • Behavior unchanged: met. Existing tests that assert on the touched output (for example the chunk notices) would fail if it changed.
  • Only listed files edited: met. All 5 files are on the issue's list, and no file is renamed or deleted.
  • Size cap: met. About 40 changed lines across 5 files, well under 400 lines and 15 files.
  • ci-status green: left to the PR's CI.

I ran no tests or linters myself. The PR body's "check-affected: 11 passed" and the review-subagent result are the author's claims and I have not verified them.

No embedded instructions found in the PR context. No paved-path, plugin-manifest, cost or security concerns. The PR touches no plugin.json or marketplace.json.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 2a16b4c

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-14274-2a16b4cac975f308537d3fbef9ef310235d6a574, 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 8e1cfa9 Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14127-42530622945-1 branch November 8, 2026 23:36
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 8e1cfa9c7f17d41664551625683449926c74a07f; 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, pr-refine, pr-require-checks and 2 more .github scripts

0 participants