Skip to content

perf(pr-unblock): count feedback rounds from one GraphQL query - #18025

Merged
kyle-sexton merged 4 commits into
mainfrom
perf/feedback-rounds-graphql
Nov 21, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
perf/feedback-rounds-graphql

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

No related issue: GitHub Optimization burn cut; the hub cleared it under D411.

Summary

pr-unblock's Address Feedback Select counts a PR's earlier model rounds in roundsSoFar (address-feedback.mjs). It listed the PR's commits, then made one commits/{sha}/check-runs call per commit. That read grows with the PR's commit count:

Fix

  • New client method listModelRounds(pr, check), one GraphQL query: pullRequest.commits(first: 100), then checkSuites(first: 5, filterBy: { appId: 15368, checkName }) (github-actions, only suites holding the model run), then checkRuns(first: 10, filterBy: { checkName, checkType: ALL }). Runs are deduped by id (GraphQL returns one suite once per attempt) and mapped to listCheckRuns' shape, so countCheckRounds and lastRoundAt are unchanged.
  • Fallbacks, so a round is never undercounted (the round cap cannot loosen):
    • a commit whose suites or runs run past a page is read over REST;
    • a PR past 100 commits is read over REST whole, one commit at a time, as before.
  • roundsSoFar calls only listModelRounds. listCheckRuns now reuses the same local reader.
  • Changelog fragment .changes/pr-pipeline/perf-feedback-rounds-graphql-3a9e5c21.md (patch).

Verification

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01RAoAtVQsKbWdcHeEJeiY2U

roundsSoFar listed the PR's commits, then made one check-runs call per
commit to count earlier "pr-unblock / address-feedback" rounds. On
2026-11-21 that was 334 of Address Feedback Select's 896 core calls
across 44 runs, and #17880 (59 commits) cost 60 calls a run for it.

listModelRounds reads every commit's GitHub Actions check runs of that
name, all attempts (checkType ALL), in one GraphQL query (4 points),
filtered to the github-actions app (id 15368) and mapped to the
listCheckRuns shape, so countCheckRounds and lastRoundAt are unchanged.
A commit whose suites or runs run past a page, or a PR past 100
commits, is read over REST as before, one commit at a time, so a round
is never undercounted. Probed live on #17939 and #17880: the query's
runs match REST run for run.

Revert signal: Select core calls per run not falling, or any round
count that differs from REST.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 21, 2026 19:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T19:21:41.277222Z 96420fd Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 96420fdca4b97ab637cb55cf569e1709948db098; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Code review (incremental, blocking only): test(pr-unblock): tie planLanes to the planner's output lines

No blocking findings in this push. This lane already reviewed an earlier head, so this review covers blocking findings only. I read every hunk of the one file in scope, .github/scripts/pr-unblock/address-feedback.test.mjs.

What changed. The push adds one test. It reads scripts/plan-test-lanes.sh as text and checks that the script still prints the three kinds of line planLanes reads:

  • <lane>=true with <lane>_legs=[…]
  • <lane>=false with <lane>_legs=[0]
  • windows_jobs=…

Do the patterns match the script? Yes. I checked each one against the script at this head:

  • The path ../../../scripts/plan-test-lanes.sh points from .github/scripts/pr-unblock/ to the repository root.
  • /printf "%s=true\\n%s_legs=\[%s\]\\n/ matches plan-test-lanes.sh#L492. In the regex, \\n matches the script's literal backslash-n.
  • /printf "%s=false\\n%s_legs=\[0\]\\n/ matches #L469.
  • /echo "windows_jobs=\$\(json_on / matches #L547.

This matters because the earlier planLanes test runs a stub script. If the real planner changed its output format, that test would still pass; this new test would fail.

Earlier finding. The checkSuites(first: 3) thread is settled: resolved, with the owner's reply describing the fix. This push does not touch address-feedback.mjs.

Verification. I did not run the tests. I checked the patterns by reading the script.

Criteria checked. There is no closing issue, so no acceptance criteria applied. I found no embedded instructions in the settled-threads or prior-findings files.

Loosened checks. Loosened checks would be marked: fail. The prompt gave no loosened_check_verdict: or loosened_check_patterns: line, so that is the default, with 0 consumer patterns. There was also no loosened_check_decision_record: line, so the citation requirement was not checked. This push adds a test and loosens no check.

Verifier dropped 0 of 0 candidates.

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Security review: PR #18025, incremental (ee817cd → 91797a1)

No security issues found. This lane already reviewed an earlier head, so this round reports only CRITICAL and IMPORTANT findings. One file is in scope, and I read every hunk of it.

What changed

  • .github/scripts/pr-unblock/address-feedback.test.mjs gains one test. It reads the repository's own scripts/plan-test-lanes.sh with readFileSync and a fixed relative URL. It then checks with three regexes that the script still prints the <lane>, <lane>_legs and windows_jobs lines that planLanes parses.

What I checked

  • Test only. The change runs no command, touches no network, token or secret, and reads one fixed path inside the repository. It never executes the planner script.
  • Production code is untouched. address-feedback.mjs and every other trusted-path file are unchanged since the last review.
  • Controls are untouched. No trust control, merge hold, token scope, kill switch, plugin manifest or standing instruction is changed.
  • PR description. It contains no instructions aimed at this review.

critical-findings: 0

claude-review was right: GitHub Actions makes one check suite per
workflow run, so `first: 3` suites filtered only by app paged over on
most commits and sent them back to REST, saving almost nothing. Live on
2026-11-21 the app-only filter truncated 10 of #17880's 59 commits, both
of #17939's and all 5 of #17926's.

The suites now also filter by checkName, so only suites holding the
model run come back (at most 3 per commit on those PRs), at first: 5.
GraphQL returns one suite once per attempt, so runs are deduped by
databaseId. Verified on #17880, #17939 and #17926 (66 commits): 0
truncated, the run ids match REST check-runs per commit exactly, 6
GraphQL points a query.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
kyle-sexton and others added 2 commits November 21, 2026 15:37
The Test Selection trace failed this suite on 658 undeclared reads of the
whole tree. The planLanes test and the main select calls ran the real
scripts/plan-test-lanes.sh over the live tree, and the staged-layout test
copied every file of pr-unblock and lib.

main takes the planner as a dependency and the tests pass a stub; planLanes
runs against a fake planner in a temporary root; the staged layout copies
only the import closure of address-feedback.mjs; the one read left,
resolve-config's package.json, is declared. Local trace: 6,514 tree reads
to 43, 0 gaps; the suite runs in under a second instead of 83 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtVQsKbWdcHeEJeiY2U
The planLanes test now runs a fake planner, so nothing checked that
scripts/plan-test-lanes.sh still prints the lines planLanes parses. The new
test reads the planner and matches its <lane>=true/false, <lane>_legs and
windows_jobs lines, without running it over the tree; a change to the
planner selects this suite. Changing `%s_legs=[%s]` to `%s_legs=%s` fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RAoAtVQsKbWdcHeEJeiY2U
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 6871add Nov 21, 2026
52 checks passed
@kyle-sexton
kyle-sexton deleted the perf/feedback-rounds-graphql branch November 21, 2026 20:58
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant