# 2026-11-13T18:08:43Z python3 student-tests/outbox_gap.py --output evidence/outbox-gap.json
[   5.58s] A: relay stopped, upload 202 {"attachment_id": "fc2ea4ee-a3c2-42c6-873d-b813ee626738", "outbox": [{"id": 34, "attempt": "1", "available_at": "2026-11-13T18:08:45.257829Z", "created_at": "2026-11-13T18:08:45.257829Z", "published_at": null, "publish_count": 0}], "queue": {"messages": 0, "messages_ready": 0, "messages_unacknowledged": 0, "consumers": 4}}
[  12.14s] A: relay started -> ready, same single job {"attachment_id": "fc2ea4ee-a3c2-42c6-873d-b813ee626738", "events": ["enqueued", "claimed", "ready", "staging_deleted"], "outbox": [{"id": 34, "attempt": "1", "available_at": "2026-11-13T18:08:45.257829Z", "created_at": "2026-11-13T18:08:45.257829Z", "published_at": "2026-11-13T18:08:51.598785Z", "publish_count": 1}], "jobs": 1, "invariants": {"variants": ["crop", "optimized", "thumbnail"], "variants_ok": true, "final_objects": 4, "final_objects_ok": true, "staging_left": false, "job_status": "ready", "attempt": 1}}
[  21.05s] B: relay crashed between COMMIT and publish -> restarted -> ready {"attachment_id": "fe8bf90c-da25-421a-8b78-157edf749a41", "relay_restart_count": [[0], [1]], "events": ["enqueued", "claimed", "ready", "staging_deleted"], "outbox": [{"id": 35, "attempt": "1", "available_at": "2026-11-13T18:09:02.520223Z", "created_at": "2026-11-13T18:09:02.520223Z", "published_at": "2026-11-13T18:09:03.849052Z", "publish_count": 1}], "invariants": {"variants": ["crop", "optimized", "thumbnail"], "variants_ok": true, "final_objects": 4, "final_objects_ok": true, "staging_left": false, "job_status": "ready", "attempt": 1}}
[  30.69s] C: published twice (crash before marking) -> duplicate is a no-op {"attachment_id": "93c21e96-2f17-4393-ae07-832a4ed7998b", "relay_restart_count": [1], "events": ["enqueued", "claimed", "ready", "staging_deleted", "duplicate_ignored"], "outbox": [{"id": 36, "attempt": "1", "available_at": "2026-11-13T18:09:11.699309Z", "created_at": "2026-11-13T18:09:11.699309Z", "published_at": "2026-11-13T18:09:13.034424Z", "publish_count": 1}], "invariants": {"variants": ["crop", "optimized", "thumbnail"], "variants_ok": true, "final_objects": 4, "final_objects_ok": true, "staging_left": false, "job_status": "ready", "attempt": 1}}
[  55.99s] D: API died after COMMIT before 202 -> work still completed {"attachment_id": "cef3cc48-5442-4a35-af41-f2b47ab32dd8", "client_saw": {"http": 502, "x_instance_id": null, "error_code": "unavailable"}, "events": ["enqueued", "claimed", "ready", "staging_deleted"], "invariants": {"variants": ["crop", "optimized", "thumbnail"], "variants_ok": true, "final_objects": 4, "final_objects_ok": true, "staging_left": false, "job_status": "ready", "attempt": 1}}
[  65.06s] E: API died after staging before COMMIT {"attachment_id": "6e0a7ed1-44c8-4485-923a-bd2fb20d00a7", "client_saw": {"http": 502, "x_instance_id": null, "error_code": "unavailable"}, "status": "pending", "jobs": 0, "api_get": 404}
[  74.28s] E: janitor removed pending row and staging object {"attachment_id": "6e0a7ed1-44c8-4485-923a-bd2fb20d00a7", "janitor_dry_run": {"abandoned_pending": 1, "orphan_objects": 0, "deleted_objects": 0, "deleted_rows": 0}, "janitor": {"abandoned_pending": 1, "orphan_objects": 0, "deleted_objects": 1, "deleted_rows": 1, "missing_objects": 0}, "row_gone": true}
[  89.69s] relay and api restored to .env configuration 
PASS: outbox closes COMMIT/publish gap; API crash windows handled
exit=0
