Prune stale review-queue entries before a human hits them #4

Merged
Breadway merged 1 commit from fix/prune-stale-review-queue into main 2026-09-11 23:11:19 +08:00
Owner

Summary

  • Almost every review-queue entry was failing on approve, repeatedly. Root cause: eligibility was only checked at insert time and at approval time, with nothing re-checking a pending row in between, so the continuously-running search/upgrade cycles could satisfy the underlying episode/movie through an unrelated release while a low-confidence entry for it sat pending, and it would only surface as a confusing 409/422 whenever a human finally reviewed the queue.
  • Extracts the approval-time eligibility check into resolve_review_eligibility, shared between prepare_review_approval and a new prune_stale_review_queue.
  • prune_stale_review_queue runs on the existing hourly reconcile ticker and auto-rejects any pending row the pipeline has since outrun, tagging it with stale_reason (new nullable column) so it's distinguishable in the DB from a genuine human rejection.

Closes ARR-3

Test plan

  • cargo test -p breadarrd (316 passed)
  • cargo clippy -p breadarrd --all-targets (clean)
  • New regression tests: prune_stale_review_queue_rejects_a_row_whose_movie_was_satisfied_elsewhere, prune_stale_review_queue_leaves_an_eligible_row_pending
## Summary - Almost every review-queue entry was failing on approve, repeatedly. Root cause: eligibility was only checked at insert time and at approval time, with nothing re-checking a pending row in between, so the continuously-running search/upgrade cycles could satisfy the underlying episode/movie through an unrelated release while a low-confidence entry for it sat pending, and it would only surface as a confusing 409/422 whenever a human finally reviewed the queue. - Extracts the approval-time eligibility check into `resolve_review_eligibility`, shared between `prepare_review_approval` and a new `prune_stale_review_queue`. - `prune_stale_review_queue` runs on the existing hourly reconcile ticker and auto-rejects any pending row the pipeline has since outrun, tagging it with `stale_reason` (new nullable column) so it's distinguishable in the DB from a genuine human rejection. Closes ARR-3 ## Test plan - [x] `cargo test -p breadarrd` (316 passed) - [x] `cargo clippy -p breadarrd --all-targets` (clean) - [x] New regression tests: `prune_stale_review_queue_rejects_a_row_whose_movie_was_satisfied_elsewhere`, `prune_stale_review_queue_leaves_an_eligible_row_pending`
Prune stale review-queue entries before a human hits them
Some checks failed
check / check (pull_request) Failing after 0s
check / check (push) Failing after 54s
10f01ce75b
Eligibility for a review-queue row was only ever checked at insert
time and again at approval time, with nothing re-checking it in
between. The search/upgrade cycles run continuously and can satisfy
an episode/movie through an unrelated, higher-confidence release
while a low-confidence entry for the same target sits pending, so
by the time someone reviews the queue most rows have gone stale and
fail approval with a 409/422 that looks like a source problem.

Extracts the approval-time eligibility check into
resolve_review_eligibility, shared with a new prune_stale_review_queue
that re-runs it against every pending row on the existing hourly
reconcile ticker and auto-rejects anything the pipeline has since
outrun, tagging it with a stale_reason so it's distinguishable from a
genuine human rejection.

Closes ARR-3
Breadway deleted branch fix/prune-stale-review-queue 2026-09-11 23:11:19 +08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/breadarr!4
No description provided.