agent queue: re-run the check only after an accepted verification

The verify job re-ran the pull request check after any /verified
comment, including refused ones: the author's own, a non-verifier's, a
stale or unknown head or a malformed SHA. decide now marks only an
accepted verification of the current head, and the job re-runs the check
only when should-rerun confirms it. A test checks that what re-runs the
check is exactly what the check counts.

Replay decides a comment listed twice only once. Tests cover duplicate
and out-of-order listings, and every arrival order of a five-claim burst
grants exactly one of two overlapping claims.

Fixes #210, fixes #211

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
This commit is contained in:
elforeign committed 2026-11-24 00:56:00 -06:00
1 parent e37c8566c6
commit 9fda5aab18
8 files changed
+96 -5

No files matched your search

+4
View File
@@ -38,6 +38,7 @@ def main(argv):
s.add_argument("--recent-commands", action="store_true", help="include comments from the last lease_hours for replay")
s = sub.add_parser("replay"); s.add_argument("--state", required=True)
s = sub.add_parser("decide"); s.add_argument("--event", required=True); s.add_argument("--state", required=True)
s = sub.add_parser("should-rerun"); s.add_argument("--actions", required=True)
s = sub.add_parser("apply"); s.add_argument("--repo", required=True); s.add_argument("--actions", required=True)
s = sub.add_parser("audit"); s.add_argument("--state", required=True)
s = sub.add_parser("summary"); s.add_argument("--state", required=True); s.add_argument("--text", action="store_true")
@@ -79,6 +80,9 @@ def main(argv):
_out(decide(_load(a.event), _load(a.state), cfg))
elif a.cmd == "replay":
_out(replay.replay(_load(a.state), cfg, _now(a.now)))
elif a.cmd == "should-rerun":
# exit 0 only for an accepted /verified of the current head
return 0 if decide_mod.rerun_check(_load(a.actions)) else 1
elif a.cmd == "apply":
ghio.apply_actions(a.repo, _load(a.actions))
elif a.cmd == "audit":