Skip to content

fix(pr-pipeline): close more outage-posture script gaps in pr-unblock, work-resolve-issue and intake-triage - #12401

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-12292-41465572399-1
Nov 2, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-12292-41465572399-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #12292

Summary

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

This change fixes more of the open script rows in the Remaining table of docs/outage-posture-audit.md, each with a test. pr-unblock: budgetedFetch never resends a rate-limited write, and its run-wide reset wait drops from 6 minutes to 60 s (element 1). The lane's scripts now send their reads one at a time instead of through Promise.all (element 6). work-resolve-issue: a PR create that failed on the network is read back and never sent a second time (element 1). intake-triage: a failed visibility read in admit.mjs now throws instead of counting the repository as private (element 4). I left a row open when its fix would change a workflow file, how a lane is started again (pr-verify's reconciler re-run, intake-triage's lack of a cron), or rate-guard behavior that every lane shares; it is listed in remaining. The 60 s budget matches the one an earlier part 2 PR gave retry-fetch.mjs. The GraphQL read test reuses retryServerErrors' graphqlQuery, so the 5xx and rate-limit paths agree on what a read is.

Remaining work

  • shared, element 1: check-trusted-trigger.mjs waits on the rate latch instead of refusing
  • shared, elements 1 and 2: rate-guard.mjs waits out a short reset and holds instead of failing the step
  • shared, element 2: api-budget.bash prints a notice instead of ::error:: when the caller holds
  • work-resolve-issue, elements 2 and 4: report-outcome.mjs --find-prior red on a failed read, a failed labeler read holding the PR, and stop-routes.json retry-spent
  • work-resolve-issue and pr-refine, elements 1, 2 and 6: handoff-evidence.sh fixed delays with no jitter, exit 1 on a failed read, and no etag on the repeated job-listing poll
  • intake-triage, element 2: apply-verdict.mjs holding green on a read error needs a re-trigger, since the lane has no cron
  • work-unblock, elements 2, 3 and 6: label-unblocked.mjs failed-listing hold (changes sweepSince's window), stored breaker records, and no etag on the sweep
  • pr-refine, elements 3 and 4: fix-docs-dispatch.mjs counting a red outage run as done, and report-check-run decide.mjs posting failure on no verdict
  • pr-review, pr-review-security and pr-verify, elements 3 and 5: maintenance-reconcile-lost-runs reconcile.mjs status-page gate and one-time re-run record
  • pr-verify, elements 2 and 6: resolve-pr.mjs completeness throws go red (tied to the reconciler re-run in pr-verify.yml), and no etag on check-trusted-trigger.mjs's re-run record poll
  • pr-unblock, elements 2, 3 and 4: dispatch.mjs non-5xx read failure exits 1, limit-stop.mjs per-head cap as a stored breaker, escalation-routes.json filing a fail route on a job fault
  • pr-merge, elements 1 and 2: enable-auto-merge.mjs throwing on 1000 open pull requests, and request-lane-token action.yml's sleep of up to 480 s

Not verified

  • Node test suites for the touched files (request-budget, gate-source, feedback-dispatch, address-feedback, report-outcome, admit, label-unblocked) were not executed here: this lane runs no interpreter. They are left to the PR's CI.
  • Tidy skipped: the change is under .github/, a listed shared path, and exceeds the 10-file cutoff.
  • Script rows left open (listed in remaining). Some need a workflow or re-trigger change, or a design choice this run should not make, such as holding green on a failed read where the red run is what starts the retry, or changing the rate guard that every lane shares.

Fix

  • .github/scripts/pr-unblock/request-budget.mjs: after a rate limit, only a GET or a GraphQL query is waited on and resent; any other write goes back at once marked rateLimited with an ::error line. Default maxWaitMs is now 60 s, and the budget counts the time to the reset without the extra 1 s margin
  • .github/scripts/pr-unblock/request-budget.test.mjs: tests that a rate-limited POST, PATCH or GraphQL mutation is not resent, that a rate-limited GraphQL query is, and that a reset more than a minute away is not waited on. Existing tests adjusted to the 60 s default.
  • .github/actions/check-trusted-trigger/check-trusted-trigger.mjs: exports graphqlQuery so request-budget.mjs uses the same read test as retryServerErrors.
  • .github/scripts/pr-unblock/gate-source.mjs: reviewReader reads review comments, then reviews, one after the other.
  • .github/scripts/pr-unblock/gate-source.test.mjs: test that the two reads run one after the other and that a failed first read sends no second.
  • .github/scripts/pr-unblock/feedback-dispatch.mjs: requestEvidence and reviewRunAt read one at a time.
  • .github/scripts/pr-unblock/feedback-dispatch.test.mjs: test that reviewRunAt lists each workflow one after the other.
  • .github/scripts/pr-unblock/address-feedback.mjs: readTriggers, select, the check-runs read and currentThreads read one at a time.
  • .github/scripts/pr-unblock/address-feedback.test.mjs: test that currentThreads' four reads run one after the other.
  • .github/scripts/pr-unblock/fix-ci-context.mjs: reviewFindings reads one at a time.
  • .github/scripts/pr-unblock/review-dependency.mjs: the check runs of each commit are read one at a time.
  • .github/scripts/work-resolve-issue/report-outcome.mjs: after a network-failed PR create, the PR is read back; when none is found, the run fails instead of sending the create again.
  • .github/scripts/work-resolve-issue/report-outcome.test.mjs: the dropped-create test now asserts one POST in both cases, exit 0 when the PR landed and exit 1 when it did not.
  • .github/scripts/intake-triage/admit.mjs: a failed GET /repos/{repo} visibility read throws, like the other admission reads, instead of counting the repository as private.
  • .github/scripts/intake-triage/admit.test.mjs: the visibility test asserts that a failed read rejects, and fakeGitHub answers the visibility read as private.
  • .github/scripts/work-unblock/label-unblocked.test.mjs: the world() fake answers admissionFacts' visibility read as private, since that read no longer swallows errors.
  • docs/outage-posture-audit.md: Remaining section lists this change's fixes, narrows the work-resolve-issue, intake-triage and pr-unblock script rows to what is still open, and names intake-triage element 2 as not script-only.

Verification

The runner ran each check from the base copy against 0936a86:

  • 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 12 fragments 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
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 10 passed, 5 skipped over 17 changed files, before and after the review fixes
  • fresh-context subagent review of the whole diff: no correctness bugs. It traced every request-budget test's clock and wait numbers and the test fakes that reach the visibility read. Its findings were fixed: the doc claimed pr-unblock element 6 done while other pr-unblock files still used Promise.all
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41465572399

Left out: the items under Not verified.

Related

#12292

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 0936a86a51fa39a3810b903ffbfd2e803a85f461: read 17 of 17 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12401

I found no security issues. I read every hunk of all 17 changed files in .claude-lane/pr.diff and checked each change against the trust-control and merge-hold lenses.

critical-findings: 0

Trust controls and trusted paths

  • Trusted-trigger check (.github/actions/check-trusted-trigger/check-trusted-trigger.mjs). The only change makes the existing graphqlQuery predicate an export. Its body is unchanged, and nothing that decides who passes the trusted-trigger check is touched. This widens nothing. (https://github.com/melodic-software/claude-code-plugins/blob/0936a86a51fa39a3810b903ffbfd2e803a85f461/.github/actions/check-trusted-trigger/check-trusted-trigger.mjs#L154)

  • Merge-hold module gate-source.mjs. reviewReader now runs its two reads one after the other instead of through Promise.all. A failed first read still rejects, so prHold's existing "holds when the review comments or the reviews read fails" path still applies, and the new test covers it. The hold is unchanged.

  • request-budget.mjs. After a rate limit, only a GET or a GraphQL query (as graphqlQuery judges it) is waited on and resent. Every other method is returned at once, marked rateLimited. A lowercase or unexpected method falls into the "not resent" branch, which errs on the safe side. Nothing about token scope, the rate latch's refusal of later calls, or the fail-closed behaviour changes.

  • report-outcome.mjs (work-resolve-issue). After a create that failed on the network, the run now fails instead of sending the PR create a second time. This removes a duplicate write and widens nothing.

  • admit.mjs (intake-triage admission). A failed visibility read now throws instead of counting the repository as private. I checked both callers:

    • In admit() (https://github.com/melodic-software/claude-code-plugins/blob/0936a86a51fa39a3810b903ffbfd2e803a85f461/.github/scripts/intake-triage/admit.mjs#L2280), the error propagates before decide(), so no verdict is written.
    • In work-unblock's admissionDecision (https://github.com/melodic-software/claude-code-plugins/blob/0936a86a51fa39a3810b903ffbfd2e803a85f461/.github/scripts/work-unblock/label-unblocked.mjs#L884), the throw reaches neither admitMarked's nor the sweep's admit() branch.

    So a failed read can no longer lead to an admit with the stricter private-repo charge checks applied, and it cannot lead to a permissive one either. This is fail-closed.

Other changes

  • Serial reads in address-feedback.mjs, feedback-dispatch.mjs, fix-ci-context.mjs and review-dependency.mjs. Each Promise.all becomes sequential awaits with the same inputs and results. Which threads are kept, which triggers are trusted and how rounds are counted are all unchanged.
  • Tests and docs/outage-posture-audit.md. These change no control.

Other notes

  • No plugin manifest is changed.
  • No instruction surface is deleted or softened.
  • The PR context contains no embedded directives aimed at this lane.
  • Spend: the run-wide rate-limit wait budget drops from 6 minutes to 60 s, which spends less runner time. No billing change.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 0936a86a51fa39a3810b903ffbfd2e803a85f461: read 17 of 17 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #12401: no findings

I read all 17 changed files in full in .claude-lane/pr.diff. I also checked the code each change depends on: the report-outcome.mjs open-pr block, the admissionFacts callers in admit.mjs and label-unblocked.mjs, graphqlQuery in check-trusted-trigger.mjs, reviewRunAt, the budgetedFetch callers and their rateLimited handling, and the request-budget tests this PR did not change.

What I checked

  • request-budget.mjs (element 1). A rate-limited write now comes back at once, marked rateLimited. Only a GET, or a POST that graphqlQuery accepts as a read, is resent. That matches the read test retryServerErrors uses for 5xx answers. Every caller sends upper-case method names (dispatch.mjs, feedback-dispatch.mjs), and the callers already handle error.rateLimited (dispatch.mjs, fix-ci-dispatch.mjs, fix-docs-dispatch.mjs, feedback-dispatch.mjs), so a write that is no longer resent goes down an existing defer path.
    • The budget now counts the time to the reset and leaves out the 1 s margin. That keeps the boundary cases working under the new 60 s default: "a secondary limit with no retry-after waits one minute" (reset = 60 000 is not over 60 000) and "a second rate limit after the wait" (clock(RESET - 60)) still wait as before.
    • The other rate-limit tests in pr-unblock still hold: dispatch.test.mjs's 19-minute reset, and feedback-dispatch.test.mjs's annotation test, which never waits.
  • Serial reads (element 6). Promise.all no longer appears in any non-test file under .github/scripts/pr-unblock/, so the doc's claim that the lane's scripts read one at a time holds there. In readTriggers, pull ?? (await api.getPull(pr)) keeps the old short-circuit, and its try still turns a failed read into null.
  • report-outcome.mjs. After a create that failed on the network, a read-back that finds no PR throws. The outer catch logs ::error for it, and the updated test expects exit 1 and a single POST in both cases.
  • admit.mjs. A failed visibility read now throws, like blockersOf, specOf and the other reads in admissionFacts. label-unblocked.mjs's admissionDecision already lets those reads throw, so this adds no new failure mode there. The test fakes in admit.test.mjs and label-unblocked.test.mjs now answer the read as private.
  • Test fixtures. The new tests use helpers that exist in their files (fakeApi, asked, OLD_REVIEW, REQUEST, HEAD, REPOSITORY), and the reviewRunAt fixture passes its head_sha, event, head_repository and conclusion filter.

Not verified: I ran no tests (this lane has no shell). The PR's Verification section and its "Node test suites … were not executed" note are the author's own statements, which I have not checked.

Criteria sources

  • No closing issue: the PR says Refs: #12292, so there are no acceptance criteria to check.
  • Path-scoped rules: .claude/rules/cost-claims.md matches docs/outage-posture-audit.md, and the doc's changes state no price or cost figure.
  • The PR changes no plugin manifest.
  • No earlier findings from this lane (round 0 of 3).

Not counted (a formatter catches it): address-feedback.mjs has const rounds =Math.max( with no space after =.

Spend: the run-wide wait budget for rate-limit resets drops from 6 minutes to 60 s, so a pr-unblock run spends less runner time waiting.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 352b674 Nov 2, 2026
50 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-12292-41465572399-1 branch November 2, 2026 15: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.

1 participant