forked from mtusi2026/mtusi2026lab5
The messaging zone asks a new AttachmentStates port whether any listed attachment of the chat has failed and answers 409 conflict before the message is stored; queued and processing attachments can still be sent right after the upload. The check runs only on the first execution of a key, so a replay returns the original 201 even if the attachment failed later. main.py wires the port to the attachments directory, so neither zone reads the other's tables. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>