This is a proposed trial for a team already running unattended jobs. Start one coding session for a work item and make it go quiet. When its claim expires, have the orchestrator start a fresh replacement session for the same task. Then let the original session return with a finished patch and a passing check from its old run.
The question is whether the delivery system will accept that result. It’s easy to write a test for a worker that crashes cleanly. The awkward case is the worker that never found out it was replaced.
Write down what needs to hold
| Property | What to look for |
|---|---|
| One owner at a time | Simultaneous attempts to claim the item leave at most one current owner. |
| A late worker cannot finish the job | Publishing requires the current, unexpired claim at the point where shared state is updated. |
| Waiting for a decision stops execution | A waiting item cannot be claimed. Previous workers cannot publish while it waits. An authorised decision can make it eligible again. |
| Evidence is current | Acceptance checks the exact approved specification, verification policy and code/build identity in the result, and the claim it belongs to. |
| Eligible work can recover | If a claim expires and the work is still eligible, an available scheduler and worker can eventually pick it up. Record what has to remain available for that to be true. |
A small state model can explore the order of events, including a late renewal, a repeated notification or a decision arriving during recovery. Review which cases the model actually reaches. A rule about late workers can pass because the model never lets a worker come back late. Make sure a permissible completion is reachable too. Then deliberately remove the current-claim check in a trial model or test setup and make sure the check catches the late result.
Take the result back to the implementation
Keep the model revision, the limits of the run, assumptions about scheduling and recovery, and any sequence of events that exposed a failure. A decision about whether work can eventually recover depends on those assumptions. If the checker times out or gives an inconclusive answer, record that outcome and leave the requirement open.
Exercise the important cases against the real scheduler and storage layer as well. Use controlled timing to test what happens when two dispatches try to claim the same task or an old session tries to publish after a replacement. Also check that a result for an old revision is refused even while its worker still holds the claim. The model tells you about the states you described. The integration tests give you evidence about the code the team runs.
Keep the trial small enough to review. Record what it caught, how long it took, and what it would cost to keep it current. That gives the team something concrete to weigh before adopting it elsewhere.