Context
The hunt_job table currently records enqueue and claim metadata and is described as supporting multi-worker claim in a later step. Retro-hunting needs operational controls when a worker crashes, a rule is invalid, or a tenant cancels a long-running job.
Proposal
Implement an explicit hunt-job state machine with lease expiry, heartbeat/renewal, retry budget, backoff, cancellation, terminal failure, dead-letter reason, and progress counters.
Acceptance criteria
- A crashed worker's job becomes claimable after a bounded lease timeout.
- Retries and terminal failures are idempotent and queryable.
- Cancellation prevents new work and reports already-processed results.
- The API/CLI exposes progress, last error, claimed worker, and retry state.
References
Context
The
hunt_jobtable currently records enqueue and claim metadata and is described as supporting multi-worker claim in a later step. Retro-hunting needs operational controls when a worker crashes, a rule is invalid, or a tenant cancels a long-running job.Proposal
Implement an explicit hunt-job state machine with lease expiry, heartbeat/renewal, retry budget, backoff, cancellation, terminal failure, dead-letter reason, and progress counters.
Acceptance criteria
References