Skip to content

claim bot: an old Decided: no longer answers a newer Decision needed: (#22) - #23

Merged
zackees merged 2 commits into
masterfrom
fix/22-decided-order
Oct 30, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/22-decided-order

Conversation

@zackees

@zackees zackees commented Oct 30, 2026

Copy link
Copy Markdown
Member

Fixes #22

What was wrong

decided() acted on any maintainer Decided:/Decision: line without looking at the thread, and catch_up() replays commands whose comment event was lost in comment order. On obs-rust/obs-studio#3031 that produced, at 10:14Z:

Order Event
1 09:12 maintainer Decided: option 1 … (its event never ran)
2 09:48 claimant **Decision needed:** … → bot adds decision-needed + claim-blocked
3 sweep replays the 09:12 answer → removes both labels, posts "the decision is in"
4 sweep replays the 09:48 question → adds both labels again

A decision is open while the newest Decision needed: is newer than the newest maintainer Decided:/Decision:; the bot decided on comment kind alone.

The change (workflow/claims.py)

  • decision_comments(), question_newer_than(), decision_state() (open / answered / unknown) derive the state from the order of the two comment kinds.
  • decided() returns only ("react", id) when a Decision needed: is newer than the answer: no label change and no "the decision is in".
  • missed() no longer replays a superseded answer, which is what produced steps 3 and 4.
  • decide_sweep() now repairs the label from the history: it adds decision-needed for an open question, and clears it once an answer newer than the newest question is present — together with claim-blocked when the question was the block (the same outcome the event path gives). An escalated issue (human-review-needed) and a thread with no decision comments are left alone, so a hand-set label is never cleared on a guess.

Kept as it was

The #2057 rule stays: a claimant's plain progress comment clears claim-blocked and keeps decision-needed. Its test (test_claimant_progress_unblocks_but_keeps_the_decision) still pins it, so this PR does not silently revisit that decision. Whether progress should count while a decision is open is a separate call for the maintainer.

RED → GREEN

  • RED bb987ec — 4 new cases in tests/test_claims.py::DecisionOrderTest fail on master: the #3031 replay sequence, catch-up not replaying a superseded answer, the sweep re-adding a lost label for an open question, and the sweep clearing an answered one. Two cases pin existing behaviour (an answer after the question still clears it; a label with no decision comments is left alone) and pass on both sides.
  • GREEN 11f2504 — uv run -m unittest discover -s tests -t .: 212 tests, OK (105 in tests/test_claims.py); uvx ruff format --check workflow tests and uvx ruff check workflow tests clean.

No behaviour change outside the decision path; claim_bot.py is untouched.

…ed: (#22)

RED for #22. The #3031 sequence — a maintainer `Decided:` at
09:12, a claimant `Decision needed:` at 09:48 — shows the bot replaying the
older answer at 10:14: it removes `decision-needed`/`claim-blocked`, posts
"the decision is in", then sets both labels again from the newer question.

Four cases pin the order rule: replaying an answer older than the newest
question only reacts; an answer after the question still clears it; catch-up
does not replay a superseded answer; and the sweep re-adds a lost
`decision-needed` for an open question and clears an answered one, while
leaving a label with no decision comments alone.
GREEN for #22. `decided()` acted on any maintainer
`Decided:`/`Decision:` without looking at the thread, and `catch_up()`
replays commands whose event was lost in comment order — so the 09:12 answer
to #3031 was replayed at 10:14 over the 09:48 question: labels cleared, "the
decision is in" posted, then both labels set again from the newer question.

- `decision_comments()` / `question_newer_than()` / `decision_state()` derive
  the decision state from the order of the two comment kinds.
- `decided()` reacts and changes nothing when a `Decision needed:` is newer
  than the answer.
- `missed()` does not replay a superseded answer.
- `decide_sweep()` repairs the label: it adds `decision-needed` for an open
  question, and clears it (and the claim's block when the question was the
  block) once an answer newer than the newest question is in the history. It
  leaves an escalated issue and a thread with no decision comments alone, so
  a hand-set label is not silently cleared.

The claimant-progress rule from #2057 (a plain progress comment clears
`claim-blocked` and keeps `decision-needed`) is unchanged, and its test still
pins it.
@zackees
zackees merged commit 25bbcb9 into master Oct 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

claim bot: an older Decided: is taken as the answer to a newer Decision needed:, labels flap

1 participant