Skip to content

refactor(pr-unblock): simplify fix-ci-context, fix-ci-dispatch and gate-recheck - #14277

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14134

Summary

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

Shortened three of the four listed pr-unblock scripts by 24 lines in all (56 added, 80 removed), with outputs, log text, exit codes, exports and env handling unchanged. fix-ci-dispatch.mjs now sends both of its dispatch paths through one in-file send helper. fix-ci-context.mjs reads all three base-config values through one fromBase helper, reuses the trusted-humans set it has already loaded instead of reading the file a second time, and drops a redundant length check. gate-recheck.mjs reuses address-feedback's SHA pattern. I left fix-docs-dispatch.mjs unchanged: it has only one dispatch block and no repeated reads, and nothing in it could be removed without either moving code between files (out of scope) or risking a behavior change.

Not verified

  • node --test for fix-ci-context, fix-ci-dispatch, fix-docs-dispatch and gate-recheck test files: this lane cannot run an interpreter, so the suites are left to the PR's CI
  • tidy: not run, because the change is under .github/, which is a listed shared path in the tidy cutoffs
  • ci-status green: left to the PR's CI
  • fix-docs-dispatch.mjs left unchanged: nothing in it could be removed without moving code between files (out of scope) or risking a behavior change

Fix

  • .github/scripts/pr-unblock/fix-ci-context.mjs: replaced loopFromBase and two repeated dynamic imports of resolve-config.mjs with one fromBase(reader, env) helper and a basePath(env) helper (it also stands in for four copies of env.BASE_PATH || ".base"); readSpec reuses the trustedHumans set main…
  • .github/scripts/pr-unblock/fix-ci-dispatch.mjs: merged the two copied dispatchWorkflow try/catch blocks into one send(node, cause) helper; cause is a thunk, so failureCause still runs inside the same try at the same point as before. Moved lanesState under the comment that describes it (the comment…
  • .github/scripts/pr-unblock/gate-recheck.mjs: the HEAD_SHA check uses the SHA regex address-feedback.mjs exports (the same pattern) instead of its own inline copy.

Verification

The runner ran each check from the base copy against 6bb79b1:

  • 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

#14134

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

Security review: PR #14277 (pr-unblock refactor)

I found no security issues.

I read every hunk of all 3 changed files. fix-ci-context.mjs matches a trusted path, so I read its whole change and what it feeds.

.github/scripts/pr-unblock/fix-ci-context.mjs

  • fromBase(reader, env). It replaces three separate dynamic imports of the base checkout's resolve-config.mjs and still loads the same module URL. reader is only ever one of three string literals in this file (loopFromBase, ownedBranchesFromBase, issueLaneWebHostsFromBase), so no outside input picks which export runs. The BASE_PATH || ".base" fallback is the same as before.
  • ownedBranchesOf / webHostsOf. The branches are inverted but behave the same: the OWNED_BRANCHES JSON-list validation is unchanged.
  • readSpec reusing trustedHumans. It now passes the set main already loaded from the same trustedActors path, instead of reading the file a second time. linkedIssues in .github/scripts/pr-verify/resolve-pr.mjs only calls humans.has(...) on it (for example at L197 and L951), so the set is never changed and the spec-trust filter admits nobody new.
  • logExcerpt. Calling slice(-MAX_EXCERPT) without the length check returns the same text.
  • Import move. ES module imports are hoisted, so moving the escalation-routes.mjs import has no runtime effect.

.github/scripts/pr-unblock/fix-ci-dispatch.mjs

  • The two copied dispatch blocks are now one send helper. The cap is still counted before each call (sent += 1 sits ahead of the try). The sent >= maxDispatch checks stay at both call sites. continue became return, and that was the last statement in each loop anyway. The RUN_ID validation and error handling are unchanged.
  • Moving lanesState and switching staleStop to failedState change nothing: failedState checks the same FAILURE/ERROR set, and the ACTIONS_BOT_ID creator check is unchanged. Nothing about who can trigger a dispatch, or how many, is wider.

.github/scripts/pr-unblock/gate-recheck.mjs

  • HEAD_SHA is now checked with the SHA regex exported from address-feedback.mjs. That regex is /^[0-9a-f]{40}$/ with no g flag (address-feedback.mjs#L74), the same pattern as the old inline copy, so .test is not stateful.

Trust controls: none are widened. These files sit in the pr-unblock lane. fix-ci-context.mjs is imported by merge-hold modules, but its hold-relevant reads (prHold, failingChecks, the trusted-human set) work as they did on the base. No token scope, trusted actor, kill switch or merge hold changes. No plugin manifests or instruction surfaces are touched.

PR context: it contains no embedded instructions to the review lane.

Spend: the change adds no extra lane runs or other spending.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 6bb79b1ec109df3ef5cdf3e5165548ea3089f7b9: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #14277, refactor(pr-unblock): simplify fix-ci-context, fix-ci-dispatch and gate-recheck

I read every hunk of all 3 changed files. I found nothing to block or flag.

Behavior-equivalence checks (read by me, not run)

  • fix-ci-context.mjs
    • Moving the escalation-routes.mjs import has no runtime effect, because ES module imports are hoisted.
    • logExcerpt: lines.join("\n").slice(-MAX_EXCERPT) gives the same result as the old length-guarded slice. A string no longer than the limit comes back whole either way.
    • fromBase(reader, env) makes the same dynamic import and passes the same { BASE_PATH } argument. That holds for each of loopFromBase, ownedBranchesFromBase and issueLaneWebHostsFromBase. Both ownedBranchesOf with its branches swapped and webHostsOf as a ternary keep the same validation and error text. No export changed: loopFromBase was never exported.
    • readSpec now reuses the trustedHumans set that main builds at line 359. The same trustedHumansFrom(trustedActors) call already ran there before readSpec could run, so a throw can't move into or out of readSpec's null-on-failure path. As far as this file shows, the set is only passed through and never mutated.
  • fix-ci-dispatch.mjs
    • Moving lanesState is safe because function declarations are hoisted.
    • failedState(stop?.state) is the same test as the old explicit FAILURE/ERROR check. failedState is a module-level const that is only read at call time, so it can't hit a temporal dead zone.
    • The send helper keeps sent += 1 before the try. It increments the same let failed and dispatched. Its early return stands in for continue in a spot where continue was the last statement of the loop body. Because cause is a thunk, failureCause(...) still runs inside the try after the push, as before. The log text is the same byte for byte in both paths.
  • gate-recheck.mjs: the SHA that address-feedback.mjs exports is /^[0-9a-f]{40}$/ with no g flag (address-feedback.mjs#L74). That is the same pattern, and .test doesn't keep state between calls.

Closing issue #14134: acceptance criteria

  • Behavior unchanged: met, by my reading above. Each changed file has a test suite (fix-ci-context.test.mjs, fix-ci-dispatch.test.mjs, gate-recheck.test.mjs) that would catch a regression in these paths. I did not run them.
  • Only listed files edited: met. All three changed files are on the issue's list.
  • Within 400 lines and 15 files: met, at about 56 lines added, 80 removed, across 3 files.
  • ci-status green: not verified. That is left to the PR's CI. The test plan in the PR body is the author's claim and I did not check it.

This lane has no prior findings and no settled threads on this PR. No plugin manifest changed. Nothing in the diff spends money or credits.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 6bb79b1

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-14277-6bb79b1ec109df3ef5cdf3e5165548ea3089f7b9, 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 87ad0bb Nov 8, 2026
66 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14134-42530372032-1 branch November 8, 2026 23:40
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 87ad0bb422ae973f627b97bd70097416676fd37b; 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-unblock .github script (4 of 6)

0 participants