Problem
Cancellation is implemented for queued and running jobs, but terminal-state correctness benefits from an explicit table-driven interleaving matrix.
Bounded scope
Add deterministic tests for cancel-before-lease, cancel-during-run, completion-versus-cancel, timeout-versus-cancel, and repeated cancel requests using local PostgreSQL/Redis fixtures.
Acceptance criteria
- Each interleaving has an explicit expected terminal state and event sequence.
- Every case proves at most one terminal lifecycle event and zero duplicate-terminal invariant violations.
- Repeated cancel requests are idempotent or have a documented deterministic rejection.
- Tests avoid timing sleeps where controllable synchronization can be used.
- Existing behavior changes only if a failing regression test demonstrates an invariant defect.
Non-goals
No distributed consensus, exactly-once claim, new scheduler, or production load benchmark.
Problem
Cancellation is implemented for queued and running jobs, but terminal-state correctness benefits from an explicit table-driven interleaving matrix.
Bounded scope
Add deterministic tests for cancel-before-lease, cancel-during-run, completion-versus-cancel, timeout-versus-cancel, and repeated cancel requests using local PostgreSQL/Redis fixtures.
Acceptance criteria
Non-goals
No distributed consensus, exactly-once claim, new scheduler, or production load benchmark.