Skip to content

refactor(maintenance-audit-lane-runs): share the budgeted REST call through collect.mjs - #15442

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-15438-43106096039-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #15438

Summary

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

collect.mjs now exports budgetedCall(env, budget) beside createBudget. It combines the two inline call closures: a GET answered 404 and any 204 return null, and the thrown error carries status. file-findings.mjs and triage-sweep.mjs now call it, and their own guardedFetch definitions and rateLimitLatch imports are gone, so the guarded fetch and the budgeted call exist only in collect.mjs. Requests, headers, error and budget messages, and exit codes are unchanged. The two union points: file-findings sends no call that answers 204, and every catch in triage-sweep reads only error.message.

Not verified

  • The node suite of .github/scripts/maintenance-audit-lane-runs/ (including file-findings.test.mjs and triage-sweep.test.mjs) and .github/actions/resolve-config/callers.test.mjs were not run: this lane allows no interpreter. Left to the PR's CI.
  • test_merge_holds_sync.py and test_babysit_risk.py were not run: no interpreter in this lane. Left to the PR's CI.
  • python3 -I scripts/sync-hold-floor.py --check was not run: no interpreter in this lane. The change does not touch the hold floor. Left to the PR's CI.
  • ci-status green is checked on the PR. Left to the PR's CI.
  • Tidy was not run: the whole change is under .github/, a listed shared path.
  • The node build, test and lint run of the touched files was skipped (no interpreter in this lane). Left to the PR's CI.
  • Changes are left uncommitted in the working tree, as the runner's instructions require, for the runner to turn into a patch.

Fix

  • .github/scripts/maintenance-audit-lane-runs/collect.mjs: add the exported budgetedCall(env, budget), built over the existing guardedFetch
  • .github/scripts/maintenance-audit-lane-runs/file-findings.mjs: use budgetedCall; drop the local guardedFetch and the rateLimitLatch import
  • .github/scripts/maintenance-audit-lane-runs/triage-sweep.mjs: use budgetedCall; drop the local guardedFetch and the rateLimitLatch import

Verification

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

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

The run reports:

  • check-changelog-fragments: all 15 fragments valid (no plugin changed, so none is owed)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 8 passed, 8 skipped, over the 3 changed files
  • grep for guardedFetch|rateLimitLatch in maintenance-audit-lane-runs/: only collect.mjs defines and uses them
  • grep for collect.mjs/file-findings.mjs/triage-sweep.mjs line citations across the repo: none to update
  • grep of *.test.mjs under .github for source-text reads of these files or of guardedFetch: none (issues.test.mjs reads a different collect.mjs, in maintenance-monitor-signals)
  • fresh-context review subagent over the diff: no findings. The closure matches both originals in URL, headers and body; no circular import; no test depends on the change
  • git-read diff --stat: 3 files, 26 insertions, 43 deletions
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/43106096039

Left out: the items under Not verified.

Related

#15438

Merge-Risk: max=MEDIUM demote=false head=fdd6974ff7b358a1f27b5c5d71d14d029a5514d0 rubric=8.4.4 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Copy link
Copy Markdown
Contributor

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

Security review: no security issues found

I read every hunk of all 3 changed files, plus the head collect.mjs around the new export. This was a complete review.

What the PR does: it moves the budgeted REST call into one shared function. budgetedCall(env, budget) is now exported from .github/scripts/maintenance-audit-lane-runs/collect.mjs (L49-L66). file-findings.mjs and triage-sweep.mjs used to each build this call inline. Now they import it, and their local copies of guardedFetch and rateLimitLatch are removed.

Trust-boundary checks:

  • Token handling is unchanged. The bearer token still comes from env.GITHUB_TOKEN and is sent only to env.GITHUB_API_URL plus a path the script builds. No new place receives the token, and the error messages don't include the token or response bodies.

  • The rate guard still applies. The shared function goes through collect.mjs's own guardedFetch (L14). That wraps rateLimitLatch the same way the removed local copies did, so no GitHub call skips the guard.

  • The call budget still applies. budget.spend() still runs before every request, and each caller keeps its own CALL_BUDGET default (50 and 120).

  • The behavior changes are harmless.

    • file-findings now returns null on a 204 instead of trying to parse an empty body.
    • triage-sweep's errors now carry a status field.

    Neither change affects authorization, trust decisions or merge holds. triage-sweep still imports UNTRUSTED_LABELS from merge-holds.mjs, which this PR doesn't change.

  • No trust controls are touched. None of the 3 files matches a TRUSTED PATHS glob, no workflow, permissions: block or token request changes, and no plugin manifest changes.

Embedded text: none. The PR description and closing-issue context contain no directives aimed at this lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15442 (budgetedCall shared through collect.mjs)

No findings. I read every hunk in all 3 changed files.

What changed. collect.mjs now exports budgetedCall(env, budget). It is built on the module's existing guardedFetch, which reads globalThis.fetch when each call runs, so the test stubs are still guarded. file-findings.mjs and triage-sweep.mjs now use it. Their own copies of guardedFetch, their rateLimitLatch imports and their inline call functions are removed. Both scripts now share the single rateLimitLatch instance from rate-guard.mjs, and before this change each script ran as its own process with one latch anyway, so nothing changes there.

Checked against closing issue #15438:

  • "The budgeted call and guardedFetch exist once, in collect.mjs, and both scripts use them": met. A grep of the directory finds guardedFetch and rateLimitLatch only in collect.mjs, at lines 10, 14, 52 and 181.
  • "Behavior is unchanged": met. The new function sends the same URL, headers, body and 404 handling as both originals. There are only two differences, and both are the ones the issue asked for:
    • triage-sweep's errors now also carry status. No code in triage-sweep.mjs reads error.status; the grep found .status only on job and run objects.
    • file-findings now returns null on a 204. The issue notes that file-findings sends no request that answers 204.
  • "The diff edits only the listed files" and "stays within 400 changed lines and 15 hand-edited files": met. The diff touches 3 listed files, +26/−43.
  • Tests and CI: sync-hold-floor --check, test_merge_holds_sync.py, test_babysit_risk.py, callers.test.mjs, the node suite and ci-status. I did not run any of these, and the PR's Not verified section says the author did not either; they are left to the PR's CI. If they break, the existing file-findings.test.mjs and triage-sweep.test.mjs, which stub fetch, would fail.

Trusted paths: none of the changed files match the trusted-path globs. rate-guard.mjs is on the list, but this PR does not change it; it only changes where it is imported from.

Embedded text: none found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for fdd6974

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-15442-fdd6974ff7b358a1f27b5c5d71d14d029a5514d0, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit a80800f Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-15438-43106096039-1 branch November 11, 2026 22:29
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 0, survived 7, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 0%; mutation score 0%.

File Killed Survived Timeout No coverage Invalid Not run
.github/scripts/maintenance-audit-lane-runs/collect.mjs 0 7 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
.github/scripts/maintenance-audit-lane-runs/collect.mjs:51 SBR productive input-gap
.github/scripts/maintenance-audit-lane-runs/collect.mjs:56 other productive input-gap
.github/scripts/maintenance-audit-lane-runs/collect.mjs:58 SBR productive input-gap
.github/scripts/maintenance-audit-lane-runs/collect.mjs:60 other productive input-gap
.github/scripts/maintenance-audit-lane-runs/collect.mjs:62 LCR productive input-gap
.github/scripts/maintenance-audit-lane-runs/collect.mjs:63 SBR productive input-gap
.github/scripts/maintenance-audit-lane-runs/collect.mjs:64 ROR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit a80800f6bfaef996935dd212aadae74f20fd4c48; 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.

Share the budgeted REST call of file-findings and triage-sweep

0 participants