python student-tests/outbox_crash.py
A. api_after_commit: the client got 502 instead of 202, but the attachment 68ccecb0-ae64-4a1d-a235-63219f66c403 and its outbox row were committed before the crash
   ready without creating a new job by hand; api restarted by Docker: ['48dc392933dc']
   outbox: row 130 published 2026-10-26T16:18:31.010950+00:00 by relay-c1b7e1ab5673
   events: queued -> claimed -> ready
B. relay_before_publish: upload -> 202 (780f7bd8-df89-4c70-84fa-9d90f35879fa); every relay that takes the row crashes before publishing
   crashed and restarted: ['48dc392933dc', 'c1b7e1ab5673']; after restart the row was published once -> ready
   outbox: row 131 published 2026-10-26T16:18:40.873234+00:00 by relay-48dc392933dc
   events: queued -> claimed -> ready
C. relay_after_publish: upload -> 202 (87559a9a-a61c-4a10-999c-516b5e1f481a); the broker confirms, the relay crashes before marking the row
   crashed and restarted: ['48dc392933dc', 'c1b7e1ab5673']; the same message was delivered again 1 time(s): duplicate_ignored
   outbox: row 132 published 2026-10-26T16:18:48.678466+00:00 by relay-48dc392933dc
   events: queued -> claimed -> ready -> duplicate_ignored
   still one set of variants: 3 rows, 3 objects
D. broker stopped: upload -> 202 (87e3efc2-e44b-4260-8129-7fadffec4811), after 5 s status queued, outbox row 133 not published yet (it waits in PostgreSQL)
   broker started: the relay published the row, ready 11.8 s later
   outbox: row 133 published 2026-10-26T16:19:07.785521+00:00 by relay-48dc392933dc
   events: queued -> claimed -> ready
PASS: a crash between COMMIT and publish (A, B) loses nothing — the outbox row is published later and the job becomes ready without manual action; a crash after publish (C) only causes a duplicate delivery, which the worker acknowledges without a second set of variants; while the broker is down (D) uploads are still accepted and the jobs wait in the outbox
