Repository navigation
fix(pr-feedback-dispatch): defer a verify verdict the kill switch stops - #11221
Conversation
post-verify-notes skipped its work and went green while the lanes kill switch was on, so a pr-verify verdict that finished during a trip was dropped: a PASS kept a stale pr-verify-failed label, and a FAIL posted no notes and no hold label. The job now fails at a "Stop on the kill switch" step before any read, as pr-verify does. That failed first attempt is the record of the pending verdict. The lost-run reconciler, which reads nothing while the switch is on, gains a Verdict kind: a pr-feedback-dispatch run at attempt 1 whose only failed job is post-verify-notes, failed only at that step, has its failed jobs re-run once, and verify-notes.mjs posts what is missing. The re-run's dispatch job sends no round, since the lanes trust a dispatcher only at attempt 1 or re-run by a listed human. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ict-on-kill-switch
The dispatch job's gate now reads github.run_attempt and github.triggering_actor, so the gate evaluator's contexts carry both, and a case pins that the reconciler's re-run of a stopped verdict, by github-actions[bot] at attempt 2, dispatches nothing while a person's re-run still does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ict-on-kill-switch
The reconciler's re-run of a kill-switch-stopped post-verify-notes job posts a FAIL's notes, or finds a PASS's stale fail-note threads, on a lanes App PR, but sends no round: check-trusted-trigger trusts a dispatcher only at attempt 1 or re-run by a listed human. That re-run now uploads a pr-feedback-deferred-<head>-<fail|pass>-<ms> record naming the head, the verdict and the pr-verify run's creation time. The half-hourly tick, an attempt-1 dispatcher, reads it in recoverLost's existing run listing (recoverDeferred) and sends the round through dispatchFeedback as main() would have: a FAIL with notesSince set to the pr-verify run's creation, a PASS as a pass-only round. A pr-unblock run for the PR created after the record holds it, so each verdict is sent once. No new trust path or token scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ctless runs Review of #11221: - post-verify-notes fails at the kill switch only for a pr-verify run that succeeded. Every pr-verify run fails at its own kill step while the switch is on and holds no verdict; the reconciler's Lane kind already re-runs it, so recording it here only queued empty re-runs. - recoverDeferred reads the record by exact name for each open lanes App head (pr-feedback-deferred-<head>-<fail|pass>) instead of the 24 h run listing, whose single page a busy window or a re-run's old created_at pushed the record off. It checks the uploading run is a github-actions[bot] re-run of pr-feedback-dispatch.yml on main, since any workflow can upload that name. - notesSince is the record's upload time, when the notes reached the PR. - A record whose read fails is logged and skipped; lost-run recovery still runs. The tick lists open PRs once for every sweep. - A test runs the workflow's name builder against DEFERRED_RECORD. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ict-on-kill-switch
Codex Review SummaryThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
claude-security-review reviewed Incremental security review of The change reflows the I checked the comment's claim against the code. The zizmor suppression is advisory-lane noise, and the trust boundary doesn't rest on it. The trusted-path match on this workflow is not a finding. No token scope, trusted-actor list, kill-switch logic or merge hold changes in this increment. critical-findings: 0 |
|
claude-review reviewed Incremental review of The change to the
Trusted-path scrutiny: the step only names a one-day artifact and does no privileged action. I found no new security issue. Nothing adds spend, so there is no hold. |
…ts condition zizmor bot-conditions flags a github.triggering_actor name comparison in an if: as spoofable. The step now reads the actor from env and exits quietly unless it is the reconciler's github-actions[bot] re-run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p, not its condition" This reverts commit 208c864.
…ust check zizmor bot-conditions flags the github.triggering_actor name test as spoofable. It only saves a write: recoverDeferred re-reads the uploading run and drops one not triggered by github-actions[bot]. The step keeps the test in its condition with a cited ignore rather than hiding it in shell. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ict-on-kill-switch
No related issue: a pr-verify verdict that finished during the 09:23-09:37Z kill-switch trip was dropped (#11186 kept a stale pr-verify-failed label)
Summary
While the lanes kill switch was on,
pr-feedback-dispatch.yml'spost-verify-notesjob skipped its work and still went green. A pr-verify verdict that finished during a trip was therefore dropped, not deferred: a PASS kept a stalepr-verify-failedlabel, and a FAIL posted no notes and added no hold label, which the merge gate depends on.Fix
This reuses the existing lost-run reconciler (
maintenance-reconcile-lost-runs) and the record pr-verify already uses on the kill switch. No new store or workflow is added.post-verify-notesnow fails at aStop on the kill switchstep, before any read, aspr-verify.ymldoes on the switch. That failed first attempt is the record of the pending verdict. It costs no API call and no artifact.reconcile.mjsgains a Verdict kind. It picks apr-feedback-dispatch.ymlrun that meets all of these:post-verify-notes;VERDICT_STOP_STEP.The reconciler re-runs that run's failed jobs once, over the full lookback, and the re-run takes no place under
MAX_IN_FLIGHT.verify-notes.mjsposts only what is missing, so a re-run never posts twice.Safety limits kept. The reconciler reads nothing while the switch is on (
KILL_SWITCH), and the attempt number is the once-only record. A job that failed at any other step, such as a refused dequeue or a verdict name no reader takes, is left for a person.The
dispatchjob's gate skips a pr-verify run re-run bygithub-actions[bot]at attempt 2 or later. check-trusted-trigger trusts a dispatcher only at attempt 1 or when a listed human re-ran it, so without this skip the re-run would send a round the lanes refuse.Only a verdict-bearing upstream is recorded. The Stop step fails only when the pr-verify run succeeded. While the switch is on, every pr-verify run fails at its own kill step and holds no verdict (pr-verify.yml:110-117; a FAIL verdict does not fail the run, only "Fail without a verdict" does). The reconciler's Lane kind already re-runs such a run, and that completion starts this workflow again.
Lanes App rounds. On a lanes App PR, the re-run uploads a
pr-feedback-deferred-<head>-<fail|pass>record. On a later idle tick,recoverLostcallsrecoverDeferredfirst:github-actions[bot]re-run ofpr-feedback-dispatch.ymlon main, because any workflow can upload that name.dispatchFeedback, asmain()would for an on-time verdict. A FAIL gets a normal round, withnotesSinceset to the record's upload time (when the notes reached the PR). A PASS gets a pass-only round that resolves the stale fail-note threads.No new trust. The tick is an attempt-1 dispatcher, and its dispatch record names the head's newest review run as the upstream, as the existing sweeps do. No trust path or token scope is added, and check-trusted-trigger's attempt rule is unchanged. The record keeps for 1 day (
artifact-retention.jsonentry added).Limits
LOOKBACK_HOURS(24 h) still drops the verdicts created before the window. The Switch kind avoids this because it reads each PR's newest run with no lookback.staleVerifyNotesresolves only notes from other heads.recoverLostfollows.Verification
Red: before the fix,
reconcile.test.mjsfailed one case: "a verdict the kill switch kept from its PR is applied once the switch lifts". The file ran 1 fail and 105 pass.Green: after the merge of main,
reconcile.test.mjsruns 107 pass, 0 fail. The wholemaintenance-reconcile-lost-runspackage runs 133 pass, 0 fail.Red, review fixes: before the fixes,
feedback-dispatch.test.mjsfailed 4 cases (162 pass):workflow-gates.test.mjsfailed 2 (30 pass):DEFERRED_RECORD.Green:
feedback-dispatch.test.mjs166 pass,workflow-gates.test.mjs32 pass,reconcile.test.mjs107 pass. The forged-upload cases send nothing: another workflow, a pull_request run, attempt 1, a person's re-run, another repository, an expired record.Unchanged suites:
check-trusted-trigger.test.mjs370 pass,callers.test.mjs205 pass.Retention:
scripts/check-artifact-retention.sh --checkpasses.New reconcile cases:
Check the kill switchandDownload the verdict, withexit 1.workflow-gates.test.mjs: 30 pass. It pins that the reconciler's attempt-2 re-run bygithub-actions[bot]dispatches nothing and a person's re-run still does.Other suites:
log-api-budget.test.mjs47 pass.actionlint is clean on
pr-feedback-dispatch.yml.check-affected:
CHECK_DATA_ROOT=$PWD bash scripts/check-affected.sh --testsprintedcheck-affected: 10 passed, 6 skipped over 7 changed files since b6dcb4aa.Metrics
GITHUB_TOKEN reads per tick and per reconciler pass. They are counted from the code paths, not measured on GitHub.
github-actions[bot]re-runs in the 24 h window.pr-feedback-dispatchruns in the 24 h window.recoverLost)dispatchFeedbackdispatchFeedbackRelated
pr-verify-failedlabel..github/workflows/pr-verify.yml'sReport the kill switchstep, the same fail-and-reconcile pattern.🤖 Generated with Claude Code