Repository navigation
perf(pr-pipeline): defer Check Intent on a short token window and recover deferred runs after each reset - #18262
Conversation
…er it after the reset Check Intent's second check-kill-switch gate (defer, after the resolver and the trigger gate) defers a first attempt while the GITHUB_TOKEN window is projected to run short; its Note the deferral step prints cause=defer reset=<epoch>. The lost-run reconciler reads that step as a hold, waits until a minute past the reset, and re-runs the run in the DEFER_MAX band beside the hosted reviews. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…token reset The hourly tick reads GET /rate_limit (not counted against the core pool) and waits until 90 s past the window's reset (reconcile.mjs's 60 s grace plus 30 s for the runner's clock), or runs at once when the window began at most 11 minutes ago, so every pass re-runs deferred reviews and Check Intent runs at the start of the next window wherever the reset has drifted. Past 11 minutes the next reset is at most 49 minutes ahead, which the job's 65-minute timeout holds with the pass. The post-reset pass is not paced: it spends the fresh window, and a paced recovery pass would leave deferred runs waiting another hour. A tick whose reset read fails runs at once and is paced as before. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fter each token reset Replaces the in-run wait: check-trusted-trigger trusts a reconciler record only for a re-run that starts within WINDOW_MS (10 minutes) of the reconciler run's start (check-trusted-trigger.mjs:35, :1167), so a pass cannot wait out the reset inside its run. The schedule ticks at 4,19,34,49. reset-tick.mjs reads GET /rate_limit (not counted against the core pool): a tick at most 30 minutes into the window is due, once 90 s in (reconcile.mjs's 60 s grace plus 30 s for the runner's clock), and names pass-after; recent-pass.mjs skips a due tick when a full pass already started after pass-after, comparing run_started_at so a pass that straddled the reset does not count. Any other tick stops before the kill switch. A failed read runs the pass unless one finished in the last hour. The 30-minute band, two tick periods, keeps the window's pass when one tick is late or dropped. The post-reset pass is not paced: it spends the fresh window, and a paced recovery pass would leave deferred runs waiting another hour. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac366259d7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Lane run report
Run 45083274070, attempt 1
Failed GitHub API callsNo failed call recorded by the run job's scripts. |
|
claude-security-review reviewed Security review (incremental, blocking only): no security issues foundThis lane already reviewed an earlier head, so this review was blocking only: it looked for CRITICAL and IMPORTANT findings only. I read every hunk of the 3 files changed since
None of them matches a trusted-path glob. What changed: What I checked:
Spend: none beyond what the earlier review covered. This push changes no schedules, runners or billing settings. critical-findings: 0 |
|
claude-review reviewed Code review: PR #18262 (incremental, blocking only)This lane already reviewed an earlier head, so this pass reports only blocking findings. I read every hunk of the 3 files in the incremental diff: The earlier blocking finding is fixed at this head.
Restated summary finding (loosened check, "Fail a change that loosens a check", item 4: an allowlist entry added). This finding had no line anchor, so it is restated each round. Its line is not in this round's incremental diff, so it has no inline comment.
Spend (not a hold, not counted): each hour adds short reconciler ticks, each making one Loosened checks. The prompt has no loosened-check verdict or patterns lines, so I used Loosened checks would be marked: fail (default; no lane settings); patterns: 0 Other criteria: No plugin manifest changed in this round. The settled threads and prior findings contain no instructions aimed at this lane. I ran nothing; any test results in the PR are claimed by the author and I did not verify them. Verifier dropped 0 of 1 candidates. |
…fetches Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… window's pass pass-after was the window start plus the 90 s grace, so a tick that started inside the grace and waited it out had run_started_at before pass-after, and the next tick in the same window ran a second full pass. pass-after is now the window start: a scheduled pass that starts after it always waits out the grace before it re-runs anything. Refs: #17460 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Post-merge mutation testingKilled 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Closes #17460
Summary
Builds the three items the 2026-11-22 decision left for the lane:
pr-review-hosted.yml:108-126,pr-review-security-hosted.yml:113-128). Check Intent now does:pr-verify.ymlCheck the token budgetandNote the deferralmaintenance-reconcile-lost-runs.ymlcron4,19,34,49,reset-tick.mjs,recent-pass.mjs. Deferred Check Intent runs share theDEFER_MAXband (12) with deferred reviews (reconcile.mjstakeDeferred)reconcile.test.mjs(5 new),reset-tick.test.mjs,recent-pass.test.mjs(3 new),check-kill-switch.test.mjs,pr-verify/workflow.test.mjsThe quiet-host re-measure and the before/after calls per hour are host work, per that decision comment.
Fix
Check Intent deferral
check-kill-switchgate (defer: "true",defer-job: check-intent,resolved-config), plus the step that writes the defer config. This is the same shapepr-review-hosted.ymluses.value: "false"andrepo-value: "false". The first gate, at the top of the job, already read both switches and fails the run on either. The second gate decides on the budget alone, so it makes no second switch read.defer-run-minutes-check-intent, so the horizon isdefer-run-minutes(15). The measured pr-verify durations are p99 5 minutes and max 13 minutes, over the 200 newest successful runs. No new key or threshold.Note the deferralprintscause=defer reset=<epoch>. The reconciler'sfaultHeldreads that step as a hold and waits until a minute past the reset. It then re-runs the run once, recorded, in theDEFER_MAXband. A re-run attempt never defers.check-kill-switch/README.md).Recovery pass after each reset
check-trusted-trigger.mjs:1167trusts a reconciler record only for a re-run that starts withinWINDOW_MS(10 minutes,:35) of the reconciler run'srun_started_at. That limit is not changed here.4,19,34,49.reset-tick.mjsreadsGET /rate_limit, which does not count against the REST API rate limit. A tick at most 30 minutes into the window is due, once 90 s in. That isRATE_RESET_GRACE_MS(60 s) plus 30 s of clock slack.recent-pass.mjsskips a due tick when a full pass already started after the window's start (a scheduled pass always waits out the grace before it re-runs anything). It comparesrun_started_at, so a pass that began before the reset and finished after it does not count. The 30-minute band is two tick periods, so one late or dropped tick does not lose the window's pass.pr-unblock-dispatch.ymlkeeps9,39. Its test now checks that each reconciler tick is followed by a dispatcher tick within 30 minutes, which is the done-when of perf(pr-pipeline): dispatch fix-ci when the reconciler's re-run fails, not on the next push to main #9496. It still checks five minutes after:04and:34. ADR 0071 and the pr-pipeline README now name those ticks.Known limits and costs
setup-pinned-nodemake none by their own docs. Its job-end api-budget notice will show the count.newestTrustedArtifactscans at most 10 trusted runs (rotation.mjs:43). Each pass now steps over about 3 skipped ticks, at one artifact listing each, to reach the last carry. The carry falls out of reach after about 2.5 hours with no full pass, where today it takes about 10. The next pass then reads everything once.DEFER_MAXcaps re-runs per pass, not runs in flight. With one pass per window, and deferred runs finishing in minutes (reviews p90 10.4 minutes, Check Intent max 13), the two match. They would not if a failed reset read let a second pass into the same window.clean.Verification
node --test: 1583 pass, 0 fail. The run covered pace, the reconciler suite (reconcile, reset-tick, recent-pass, jobs-batch, infra-failure, component-status), check-kill-switch, projection, check-trusted-trigger, pr-unblockworkflow-gates, resolve-configcallers, and all of.github/scripts/pr-verify/*.test.mjs.bash scripts/ci-rerun-ci-status.test.sh: PASS=325 FAIL=0.actionlintandzizmor --offlineare clean on both workflows.check-changelog-fragments.sh --checkpasses, andmarkdownlint-cli2passes on the changed markdown.agreefails the neutral-stop test ("Write the prompt and schema runs on a budget stop").updated_at.check-trusted-trigger.mjsWINDOW_MS.Related
DEFER_MAXband.🤖 Generated with Claude Code