3a053e3af8
Review tasks and review work items were prepended (appendleft) to the role dispatch queue, so whenever a reviewer had more than one review waiting, the newest submission was always claimed first. Under a sustained flow of submissions the oldest review could be postponed indefinitely because every new arrival jumped ahead of it. Observed on a real run: with two reviews waiting on the same manager seat, the one created 30 seconds later was reviewed first while the earlier one waited another seven minutes. The prepend was redundant for its stated purpose: review-before-regular- work priority is already enforced at pop time, where _pop_next_queue_entry pulls the first review entry found anywhere in the queue. Its only net effect was inverting the order among reviews. The role serial queue (FIFO, on by default) could not compensate: its enqueue hook only fires on phase transitions, and review work items are inserted directly in READY, so they never enter the serial queue. Fix: append review entries like everything else. Reviews now drain in arrival order among themselves while still preempting regular work, including on the blocked-manager soft-wake path. Tests: three regressions (pop drains a review backlog oldest-first; enqueue_runnable_work_items preserves arrival order across batches — the observed inversion scenario; same contract for the review-Task path). The pre-existing queue-layout assertion that encoded the old prepend behavior now asserts the pop-time preemption contract instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>