python student-tests/retry_replay.py
A. transient errors twice, then success: ready at attempt 3
   pauses before attempts: #2: 1.98 s, #3: 2.19 s  (backoff 2^n with random jitter in [d/2, d])
   events: queued(1) -> claimed(1) -> retry_scheduled(1) -> claimed(2) -> retry_scheduled(2) -> claimed(3) -> ready(3)
B. transient error every time: 5 attempts -> failed, error_code=retry_exhausted (last error storage_unavailable)
   pauses: #2: 1.96 s, #3: 2.31 s, #4: 5.86 s, #5: 13.62 s
   DLQ attachments.dead: 30 -> 31; registry: python -m messenger.jobs failed lists it; content -> 409, attach -> 409
C. permanent error: broken JPEG scan -> failed at attempt 1, error_code=invalid_image (no retries)
D. replay of the failed job: {'result': 'queued', 'attempt': 6, 'previous_error': 'retry_exhausted'} -> ready at attempt 6; audit: operator:student-test: replay оператора: было retry_exhausted (последняя ошибка storage_unavailable); новая попытка 6, ещё 5 попыток
   replay of the now ready job: {'result': 'noop', 'reason': 'ready'} — no new message, variants unchanged (3 rows), status ready
   replay of the permanent failure: {'result': 'queued', 'attempt': 2, 'previous_error': 'invalid_image'} -> failed again with invalid_image
PASS: bounded retries with backoff and jitter; permanent errors fail at once; final failures go to the DLQ and the failed registry; replay re-runs only failed jobs and is audited
