A queue that can't double-book
Every (medicine, target, configuration) is one row in a Postgres queue. Workers claim with FOR UPDATE SKIP LOCKED, hold a lease that a heartbeat extends, and complete in one statement that only succeeds if they still hold it. A result can't be written twice, and a vanished worker's job returns to the queue.

