# 2026-11-13T13:23:18Z python3 student-tests/outbox_gap.py --output evidence/outbox-gap.json
[   6.31s] A: relay stopped, upload 202 {"attachment_id": "41a53cd8-7e57-44b8-9c9f-12320b323750", "outbox": [{"id": 105, "attempt": "1", "available_at": "2026-11-13T13:23:19.956776Z", "created_at": "2026-11-13T13:23:19.956776Z", "published_at": null, "publish_count": 0}], "queue": {"messages": 0, "messages_ready": 0, "messages_unacknowledged": 0, "consumers": 4}}
[  12.77s] A: relay started -> ready, same single job {"attachment_id": "41a53cd8-7e57-44b8-9c9f-12320b323750", "events": ["enqueued", "claimed", "ready", "staging_deleted"], "outbox": [{"id": 105, "attempt": "1", "available_at": "2026-11-13T13:23:19.956776Z", "created_at": "2026-11-13T13:23:19.956776Z", "published_at": "2026-11-13T13:23:26.328881Z", "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}}
[  23.48s] B: relay crashed between COMMIT and publish -> restarted -> ready {"attachment_id": "a2401b04-a5db-4026-adc4-01d5040fdd2c", "relay_restart_count": [[0], [1]], "events": ["enqueued", "claimed", "ready", "staging_deleted"], "outbox": [{"id": 106, "attempt": "1", "available_at": "2026-11-13T13:23:38.382769Z", "created_at": "2026-11-13T13:23:38.382769Z", "published_at": "2026-11-13T13:23:40.445416Z", "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}}
[  32.98s] C: published twice (crash before marking) -> duplicate is a no-op {"attachment_id": "85b3ce6d-b06a-49ab-bc80-07be18cfd5d9", "relay_restart_count": [1], "events": ["enqueued", "claimed", "ready", "staging_deleted", "duplicate_ignored"], "outbox": [{"id": 107, "attempt": "1", "available_at": "2026-11-13T13:23:48.361567Z", "created_at": "2026-11-13T13:23:48.361567Z", "published_at": "2026-11-13T13:23:49.734047Z", "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}}
[  49.85s] D: API died after COMMIT before 202 -> work still completed {"attachment_id": "5778567a-0d6c-4322-b0e0-31a17a40994f", "client_saw": "missing X-Instance-Id", "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}}
[  50.15s] E: API died after staging before COMMIT {"attachment_id": "5b7070f4-ece0-49d9-bef4-1d704222955f", "client_saw": "missing X-Instance-Id", "status": "pending", "jobs": 0, "api_get": 404}
[  58.86s] E: janitor removed pending row and staging object {"attachment_id": "5b7070f4-ece0-49d9-bef4-1d704222955f", "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}
[  74.96s] relay and api restored to .env configuration 
PASS: outbox closes COMMIT/publish gap; API crash windows handled
exit=0
