Commit a623142
committed
fix(queue): guard the verdict derivation instead of the pass, so the webhook path is covered (#10227)
#10204 split the verdict-stability backoff (#10184) across two kinds of place and only got one
right. The record half sits at the single ledger write every verdict passes through -- correct, and
its own comment says why. The skip half sat at the ENTRY of the whole publish-and-maintain pass, so
it suppressed everything the pass OWED, not just the redundant re-derivation.
That made the escape hatch an allowlist. Every bounded retry chain had to remember to add itself,
and the default for anything unlisted was "suppress me" -- so the webhook path could never be
guarded at all: adding it truncated #10061's recapture chain from MAX_CAPTURE_RETRY_ATTEMPTS (5) to
VERDICT_BACKOFF_MIN_REPEATS (3), reproduced here before the fix. The webhook path is where the churn
actually is. Measured on the Orb over 24h: upstream_state_change carries 348 decision records across
99 heads (3.52 records_per_head), while every other reason sits at 1.08-1.32. The sweep-only guard
fired 11 times in the same window.
The skip now sits at the one point a pass derives a verdict, inside maybePublishPrPublicSurface --
the same KIND of place the record half already occupies. Everything the pass owes runs above it and
cannot be truncated by construction; the pending gate check-run, the AI review, the gate evaluation,
the publish and the maintenance ledger write all sit below it. Both entry points reach a verdict only
through that function, so neither has to opt in and the webhook path is covered without a second
call site.
The recapture chain was the one obligation living below that line, inside the comment publish, so it
is extracted (runVisualCaptureObligation) and run explicitly on the backed-off path. Its files
resolver is threaded as a thunk rather than a resolved list so a backed-off pass on a repo with
screenshots off pays for no diff fetch. The normal publish path is unchanged: same call, same place,
same order.
explicitlyRequested shrinks to one value, webhook.forceAiReview, and it means exactly one thing --
a human asked for this pass (an operator re-gate, or a consumed "Re-run LoopOver review" click).
previewPollAttempt needed an exemption only because the old guard sat above the recapture chain.
Two behaviours #10229 established are deliberately reversed, both pinned by name in
verdict-stability-wire.test.ts rather than left to be rediscovered:
* A poll tick is now backed off. It is machine-paced, not human-asked, and its chain runs above
the guard, so it has no business in a hatch whose meaning is "a human asked for this".
* A backed-off pass charges the regate repair budget again. onReachedReadiness's documented rule is
"count executions, not deferrals", and a pass that clears readiness, decides type labels and
advances the capture chain is an execution. It is also the anti-starvation direction: a repair on
a permanently settled hold would otherwise reselect every sweep tick forever without exhausting.
scripts/check-verdict-backoff-chokepoint.ts keeps the structure honest -- one call site, inside the
choke point, above the derivation, and every publish-and-maintain entry point routing through it. The
fourth rule is the one the issue asked for: a NEW entry point that derives a verdict some other way
fails the build instead of silently leaving the backoff behind.
Closes #102271 parent 7b6e2e2 commit a623142
6 files changed
Lines changed: 1087 additions & 244 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
149 | 150 | | |
150 | 151 | | |
151 | 152 | | |
152 | | - | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
0 commit comments