Skip to content

perf(pr-pipeline): reserve the dearest lane audit unit mix, reuse first pages and list busiest first - #10441

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9339-40458120150-1
Oct 27, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9339

Summary

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

The lane sweep's collector now keeps 184 calls after listing, not 170. That is the real worst case: four slice A units, no slice D unit and four slice C units, plus the open pull request and issue reads. With 170 that mix ran out partway through its C units. The listing now reads each range's first page of 100, which also carries the count, and keeps those runs instead of making a per_page=1 count call and then reading page 1 again; halved ranges do the same. Workflows are listed busiest first, so a short budget leaves the smaller ones part-read.

Not verified

  • node --test .github/scripts/maintenance-audit-lane-runs/*.test.mjs was not run: this lane's Bash runs only the named wrappers, and check-affected runs without --tests. The tests were traced by hand (call counts and asserted values) by me and by the review subagent. The test run is left to the PR's
  • typos was skipped by check-affected (typos not installed), and the CI-only hygiene gates check-affected lists were not run here. They are left to the PR's CI.

Fix

  • .github/scripts/maintenance-audit-lane-runs/collect.mjs: DETAIL_RESERVE is 184, with a comment deriving it as 4 + 4 * 5 * 7 + 4 * 10. listRuns's count() becomes head(), a per_page=100 call whose runs list() keeps, including at a LIST_CAP split. Paging starts at page 2. Workflows are sorted by counte
  • .github/scripts/maintenance-audit-lane-runs/collect.test.mjs: fakeGh takes an optional workflow list. The whole-window test asserts there is no per_page=1 call, no page=1 call, and that every page call follows its range's first page. New tests cover the 4A/0D/4C mix (every unit written, collect-stat
  • docs/conventions/pr-pipeline/README.md: the lane sweep's collect bullet says busiest first, that the first page carries the count, and that 184 calls are kept for the open item reads and the units.
  • .changes/pr-pipeline/perf-9339-lane-audit-listing-5e8b13d6.md: new patch fragment for pr-pipeline (Fixed: the reserve; Changed: first-page reuse and busiest-first order).

Verification

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

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: All 3 changelog fragment(s) under .changes/ are valid.
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 9 passed, 5 skipped over 4 changed files. The first run failed markdown, changelog-fragments and changelog-parity because of a direct CHANGELOG.md edit (pr-pipeline is in fragment mode). I reverted that edit a
  • Fresh-context review subagent over the whole diff: no correctness bugs. It confirmed 184 is the maximum of 4 + 35a + 3d + 10c under selectUnits's limits, and traced all five changed or new listing tests by hand as holding. It found two docs wording errors (the reserve also covers the open item reads
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40458120150

Left out: the items under Not verified.

Related

#9339

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

Copy link
Copy Markdown
Contributor

claude-security-review reviewed eba8f300c3de2a9573f6cebd990e5615c0be4768: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

The change touches four files: .github/scripts/maintenance-audit-lane-runs/collect.mjs and its test, the pr-pipeline README, and a changelog fragment. None matches a trusted path, and none is a trust control. The diff does not touch these:

  • the trusted-actor list or the trusted-trigger check
  • lane token scope
  • the kill switch
  • the broker's rules
  • merge holds
  • the other .github/actions/ controls

No plugin manifest changes, so there are no manifest <field> lines. No standing instruction is deleted or softened, so the instruction-surface lens does not apply.

What the change does:

  • listRuns now reads each range's first page of 100 runs and keeps those runs, instead of making a per_page=1 count call and then re-reading page 1.
  • It lists workflows busiest first.
  • DETAIL_RESERVE goes from 170 to 184.

The collector makes read-only GitHub API calls under an existing call budget. I checked these paths and found nothing exploitable:

  • Request paths: repo, workflow ids and the timestamps all come from the API response or the runner's own context. The created= range is built from numeric timestamps.
  • Budget: list() still checks room() before every extra page and before every half of a split range. Dropping the room() && guard in front of list is safe, because that call now uses a first page already read and only pages and splits go on to spend calls. The raised reserve makes the cap safer, not weaker.
  • Authorization or trust filtering: nothing changes here. The trusted-actors filtering of pull requests and issues is untouched.
  • Secrets: the diff handles no tokens or credentials.

The PR context contains no embedded directives aimed at the reviewer.

Cost: this spends GitHub REST API calls and, downstream, prepaid lane model usage. It adds no paid plan, billing setting or billed resource, so there is no hold.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed eba8f300c3de2a9573f6cebd990e5615c0be4768: 0 finding(s), 0 as inline comments.

No findings. I read the full diff and the changed collect.mjs. I did not run the tests, because I have no shell here. I traced the call counts by hand against the code. The PR's own "Not verified" section says its author did not run them either.

  • Reserve of 184: this matches the maximum cost the collector can incur. It is 1 pulls read, up to 3 issues pages, 4 slice A units at 5 runs × 7 calls (a jobs read, then 3 × annotations and log), and 4 slice C units at 10 calls. That is 4 + 140 + 40. Mixes with D units come out cheaper: 4A+2D+2C is 170, and 4A+1D+3C is 177.
  • First-page reuse in listRuns:
    • A range with 100 or fewer runs now costs one call. Paging starts at page 2 and continues only while the previous page was full and under the 1,000-run cap.
    • In a cap split, the parent range's first page is kept, and the Map de-duplicates it against the halves.
    • list no longer needs a room() guard before the first page, because the head calls are already gated on room(). Every later page and every split still checks room().
  • Busiest-first sort: the sort is descending on first.total, with the path as tie-break. Partial entries for uncounted workflows still come first, which the updated tests assert.
  • New and updated tests:
    • Reserve-mix test: I traced it to exactly 5 + DETAIL_RESERVE = 189 calls (5 listing, 4 open reads, 140 for A units, 40 for C units). It imports DETAIL_RESERVE, so it fails if the reserve drops below the real worst case.
    • Part-read test: the budget of DETAIL_RESERVE + 6 gives "300 of 2500" (100 first-page runs from each of the whole window, its first half and the first quarter).
    • Busiest-first test: the 9-call budget gives pr-merge fully read at 450 runs and ci part-read at 200 of 250.
  • Closing issue perf(pr-pipeline): lane audit listing reserve, count-call reuse and busiest-first order #9339: all three items are met and each has a test. The reserve is covered by the 4A/0D/4C test, the count-call reuse by the no-per_page=1 and no-page=1 assertions, and the order by the busiest-first test.
  • Docs and changelog: the pr-pipeline fragment is a patch bump, which fits a fix plus an internal listing change. The README wording matches the code. Its rewrapped bullet has one short line ("and says so: a"), which is cosmetic.
  • Cost: the change only affects GitHub API call counts inside a workflow. It starts no paid plan or billing change, so there is no hold.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head eba8f300c3de2a9573f6cebd990e5615c0be4768.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 127c743 Oct 27, 2026
44 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9339-40458120150-1 branch October 27, 2026 07:46
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.

perf(pr-pipeline): lane audit listing reserve, count-call reuse and busiest-first order

0 participants