Commit 643383c
authored
The lost-click half of #9000, completing the issue (the skip-auditing half landed
earlier; its enforcement went in as #9583).
THE DEFECT. Three checkbox states looked identical to a maintainer: processed (panel
republished, box reset), deferred for CI (box stays ticked, honored later via the
#7626 pending marker), and DELIVERY LOST (box stays ticked, nothing recorded, nothing
will ever happen -- three such losses observed live on #8972, 2026-07-26). Only the
third is broken, and it is unrecoverable from our own state alone: the tick exists
only in the live comment body, because the webhook that would have told us about it
never became a job. Worse, the next panel republish -- whose renderer emits its
checkboxes unticked unconditionally -- would OVERWRITE the ticked box, erasing the
only evidence of the click on the exact pass best placed to honor it.
THE FIX, at zero additional API cost. createOrUpdateIssueCommentWithMarker already
fetches the existing comment for its marker search; it now returns that pre-overwrite
body. Every panel republish (webhook pass, re-gate sweep, backlog convergence) doubles
as the detector: a ticked rerun box in the body being replaced, with no recent
processing and no pending marker, IS a lost click. Recovery then:
- records github_app.pr_panel_retrigger_recovered (the named reason #9003 demands,
and the loop guard against re-detection),
- persists the #7626 pending marker, so the next review pass consumes it as
forceAiReview exactly like a deferred click, and
- enqueues an agent-regate-pr job immediately (with the #9499 prCreatedAt sort key)
-- a PR with a lost click is precisely the PR that cannot count on a natural pass.
No new sweep, no new persistence: the issue's "within one sweep interval" acceptance
is bounded by the republish cadence that already exists.
FALSE-POSITIVE PROOFING, the part that took the design care:
- A pass that IS the retrigger (forceAiReview) skips detection -- overwriting its
own tick is the receipt acknowledgement, not a loss.
- A recently-processed retrigger (actor-agnostic audit lookup, new
countAuditEventsForTargetSince -- hasAuditEventForDelivery is deliberately
actor+delivery-keyed, the wrong shape when the delivery never existed) means the
delivery raced the pass rather than being lost.
- A DEFERRED click is guarded by ordering, not luck: the retrigger handler now marks
the pending marker BEFORE its readiness check (consuming it right back on the
immediate path), so the CI-wait placeholder inside that very pass sees the marker
and stands down. A crash between mark and consume degrades to one extra forced
review -- the safe direction for an explicit user click.
The #7626 sibling test's "never creates a pending marker" assertion is updated to the
invariant it documents ("no pending INTENT survives the immediate path") rather than
its old mechanism (key absence), since consumption can leave the one-shot consumed
sentinel behind on adapters without a real delete.
TESTS. Eight in the new suite: the #8972 regression (natural pass recovers the tick:
event + marker + job with the sort key), full end-to-end (the recovery job's pass
consumes the marker, spends exactly one fresh AI review, and does not re-diagnose its
own republish), the raced-delivery guard, the deferred-click guard (CI genuinely
pending, marker untouched afterward), the no-head ghost PR (marker guard skipped, job
omits the optional sort key), unticked and first-publish no-ops, and the empty
event-type-list guard. Plus the three github-comments assertions extended to pin
previousBody, including that it is the POSTED body, not the re-render, on the
byte-identical skip path. Changed lines: 0 uncovered statements, 0 uncovered branches.
1 parent 6e9c34e commit 643383c
6 files changed
Lines changed: 520 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3564 | 3564 | | |
3565 | 3565 | | |
3566 | 3566 | | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
3567 | 3589 | | |
3568 | 3590 | | |
3569 | 3591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
171 | 177 | | |
172 | 178 | | |
173 | 179 | | |
174 | | - | |
| 180 | + | |
| 181 | + | |
175 | 182 | | |
176 | | - | |
| 183 | + | |
177 | 184 | | |
178 | 185 | | |
179 | 186 | | |
| |||
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
185 | | - | |
| 192 | + | |
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
4536 | 4537 | | |
4537 | 4538 | | |
4538 | 4539 | | |
4539 | | - | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
4540 | 4563 | | |
4541 | 4564 | | |
4542 | 4565 | | |
| |||
4759 | 4782 | | |
4760 | 4783 | | |
4761 | 4784 | | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
| 4805 | + | |
| 4806 | + | |
| 4807 | + | |
| 4808 | + | |
| 4809 | + | |
| 4810 | + | |
| 4811 | + | |
| 4812 | + | |
| 4813 | + | |
| 4814 | + | |
| 4815 | + | |
| 4816 | + | |
| 4817 | + | |
| 4818 | + | |
| 4819 | + | |
| 4820 | + | |
| 4821 | + | |
| 4822 | + | |
| 4823 | + | |
| 4824 | + | |
| 4825 | + | |
| 4826 | + | |
| 4827 | + | |
| 4828 | + | |
| 4829 | + | |
| 4830 | + | |
| 4831 | + | |
| 4832 | + | |
| 4833 | + | |
| 4834 | + | |
| 4835 | + | |
| 4836 | + | |
| 4837 | + | |
| 4838 | + | |
| 4839 | + | |
| 4840 | + | |
| 4841 | + | |
| 4842 | + | |
| 4843 | + | |
| 4844 | + | |
| 4845 | + | |
| 4846 | + | |
| 4847 | + | |
| 4848 | + | |
| 4849 | + | |
| 4850 | + | |
| 4851 | + | |
| 4852 | + | |
| 4853 | + | |
| 4854 | + | |
| 4855 | + | |
| 4856 | + | |
| 4857 | + | |
| 4858 | + | |
| 4859 | + | |
| 4860 | + | |
| 4861 | + | |
| 4862 | + | |
| 4863 | + | |
| 4864 | + | |
| 4865 | + | |
4762 | 4866 | | |
4763 | 4867 | | |
4764 | 4868 | | |
| |||
11166 | 11270 | | |
11167 | 11271 | | |
11168 | 11272 | | |
11169 | | - | |
| 11273 | + | |
11170 | 11274 | | |
11171 | 11275 | | |
11172 | 11276 | | |
11173 | 11277 | | |
11174 | 11278 | | |
11175 | 11279 | | |
11176 | 11280 | | |
| 11281 | + | |
| 11282 | + | |
| 11283 | + | |
| 11284 | + | |
| 11285 | + | |
| 11286 | + | |
| 11287 | + | |
| 11288 | + | |
| 11289 | + | |
| 11290 | + | |
| 11291 | + | |
| 11292 | + | |
| 11293 | + | |
| 11294 | + | |
| 11295 | + | |
11177 | 11296 | | |
11178 | 11297 | | |
11179 | 11298 | | |
| |||
12855 | 12974 | | |
12856 | 12975 | | |
12857 | 12976 | | |
| 12977 | + | |
| 12978 | + | |
| 12979 | + | |
| 12980 | + | |
| 12981 | + | |
| 12982 | + | |
| 12983 | + | |
| 12984 | + | |
| 12985 | + | |
| 12986 | + | |
| 12987 | + | |
| 12988 | + | |
| 12989 | + | |
| 12990 | + | |
| 12991 | + | |
| 12992 | + | |
| 12993 | + | |
12858 | 12994 | | |
12859 | 12995 | | |
12860 | 12996 | | |
| |||
14304 | 14440 | | |
14305 | 14441 | | |
14306 | 14442 | | |
| 14443 | + | |
| 14444 | + | |
| 14445 | + | |
| 14446 | + | |
| 14447 | + | |
| 14448 | + | |
| 14449 | + | |
14307 | 14450 | | |
14308 | 14451 | | |
14309 | 14452 | | |
| |||
14315 | 14458 | | |
14316 | 14459 | | |
14317 | 14460 | | |
14318 | | - | |
14319 | | - | |
14320 | | - | |
14321 | | - | |
| 14461 | + | |
| 14462 | + | |
| 14463 | + | |
14322 | 14464 | | |
14323 | 14465 | | |
14324 | 14466 | | |
| |||
14329 | 14471 | | |
14330 | 14472 | | |
14331 | 14473 | | |
| 14474 | + | |
| 14475 | + | |
| 14476 | + | |
14332 | 14477 | | |
14333 | 14478 | | |
14334 | 14479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
400 | 402 | | |
401 | 403 | | |
402 | 404 | | |
| |||
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
419 | | - | |
| 421 | + | |
420 | 422 | | |
421 | 423 | | |
422 | 424 | | |
| |||
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
442 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
443 | 447 | | |
444 | 448 | | |
445 | 449 | | |
| |||
0 commit comments