Production engineering
Reveal answer and reasoning
A dispatcher claim is temporary ownership of pending work, not evidence that delivery completed. A lease lets another actor reclaim an abandoned row after expiry, and a generation distinguishes the newer claim from an older acknowledgment. The external fixture stores those fields and checks owner, generation, status and expiry when marking the row sent. It is real SQLite coordination around a bounded classroom row, without a broker behind the delivery boundary.
The companion compares known lease data and times only, making the narrow policy visible without implementing a scheduler or a remote acknowledgment protocol.
Checking only a worker name is insufficient when that name can be reused for a later claim. An old operation from the same named owner could otherwise acknowledge a newer lease incorrectly. A generation or another unambiguous claim identity must participate in the persisted condition. Even that condition protects only the local acknowledgment: it cannot undo an external publication already performed by the old owner.
Lease expiry therefore creates possible replay, and clock jumps or process pauses need their own policy. The classroom wall clock and tiny deadline are explicit teaching choices, not a recommendation for cross-machine coordination. The current-generation acknowledgment can still fail after its deadline passes, so matching a previously returned owner and number is not timeless permission to settle work.
What a strong answer covers
- The model prints ownedTrue, expiredTrue, stale ackFalse and current ackTrue.
- Actual acknowledgments also check persisted status, generation and expiry.
- A reclaimed lease implies possible duplicate delivery, not an exactly-once effect.
Common pitfall
Treating a reusable owner name or a lease expiry as proof of current ownership and non-delivery.
Follow-up questions
- What happens when the same worker name is reused for a newer claim?
- How would an already completed remote delivery be reconciled after local lease loss?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.