We re-ran our dispatcher on a past day's roster to reproduce a complaint, and it assigned a different worker than production had. Same jobs, same shifts, same input.
Two reasons, and both of them were ours.
The first: the cooldown check asked whether a worker was locked right now, rather than at the job's own moment. In production that distinction never surfaced, because "now" and "the job's time" sat seconds apart. In a replay they sit days apart. A worker who was resting during the original run looked perfectly available during the rerun.
The second one was uglier. Two shifts tied on the leading field of the ordering (same current load, same start time), and the winner was whichever candidate the iteration happened to hand us first. Nothing in the data decided that. The run order did.
So we moved the line between what is fixed and what you can configure.
Eligibility became code that no policy can reach: the shift must be at the job's location, it must cover the job's time, and the worker must not be locked at that time. Load comes from a mapping the caller passes in, so an unknown worker counts as zero, and the library never increments it, because counting assignments is the caller's job and not hidden state we keep. Spare capacity is load subtracted from capacity, floored at zero, and a candidate with none gets dropped before anything is sorted.
A policy now has exactly one method: it returns a sort key for a candidate that already survived. It can prefer the least loaded worker, or the earliest start. It cannot admit a shift the filter rejected, and it cannot remove one the filter passed.
And every key we ship ends in the worker name. The name does not mean anything by itself, it is there because a tie has to be settled by something the key carries, rather than by the order the list arrived in.
That is the change that made a replay count as evidence instead of a second opinion. It lives in our open-source shift-planner.
If you run a scheduler, something already settles your exact ties today: either a field in the key, or luck.