Archive the asynchronous attachments change

Grade 3 of lab 5 is closed. Upload answers 202 queued only after the
original is staged in the private bucket and the attachment, its job
and the outbox row are committed together; a separate relay publishes
the outbox to a durable quorum queue with publisher confirms and
returns expired leases; a separate FastStream worker claims a job
under a lease, publishes the original and the 256 px JPEG thumbnail,
commits fenced by the lease token and acks only after the commit.
Transient errors retry up to JOB_MAX_ATTEMPTS and end in
retry_exhausted, undecodable images fail at once with invalid_image,
and a redelivered job changes nothing. The defence demonstration
(worker down, upload, message, API, relay and broker restarts, worker
up, ready) and the lab 4 minimum pass on a stand raised from empty
volumes.

The lab5-attachment-pipeline and lab5-job-delivery capabilities join
the main specs, and the upload, content, message and restart
requirements of lab 1, lab 3 and lab 4 are updated in place.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Artyom
2026-10-29 01:31:34 +03:00
co-authored by Claude Opus 5.5
parent a55bc716c4
commit adb29a2afc
16 changed files with 226 additions and 17 deletions
+2 -2
View File
@@ -75,10 +75,10 @@
### Requirement: Рестарт стенда
Хук `scripts/restart.sh` SHALL перезапускать балансировщик, все реплики API, PostgreSQL, Valkey и S3-сервер с сохранением volumes, без удаления и повторного заполнения данных, и SHALL завершаться кодом 0 не позднее 90 секунд, когда стенд, включая S3, снова готов: первое же чтение метаданных и байтов вложения после хука SHALL проходить без повторов.
Хук `scripts/restart.sh` SHALL перезапускать балансировщик, все реплики API, relay, worker, PostgreSQL, Valkey, S3-сервер и брокер с сохранением volumes, без удаления и повторного заполнения данных, и SHALL завершаться кодом 0 не позднее 90 секунд, когда стенд, включая S3, снова готов: первое же чтение метаданных и байтов вложения после хука SHALL проходить без повторов.
#### Scenario: Полный рестарт сохраняет сессию
- **WHEN** выполняется `make test-persistence ACTION_SCRIPT=scripts/restart.sh`
- **THEN** тест печатает `PASS: persistence preserved confirmed data and existing session`, а `StartedAt` контейнеров `lb`, `api`, `postgres`, `valkey` и `s3` после прогона позже, чем до него
- **THEN** тест печатает `PASS: persistence preserved confirmed data and existing session`, а `StartedAt` контейнеров `lb`, `api`, `relay`, `worker`, `postgres`, `valkey`, `s3` и `broker` после прогона позже, чем до него