forked from mtusi2026/mtusi2026lab2
Plan the grade 3 cycle of lab 3 on top of the carried-over lab 2 solution: run the API as several replicas of one compose service behind HAProxy as the only published entry point, stamp every API response with X-Instance-Id taken from the container hostname, require Idempotency-Key on message posts and keep the key and the message in one PostgreSQL transaction, and add explicit stop-one, restart and restore hooks. The design fixes the balancer settings and retry policy, the idempotency table, the lookup order under the chat row lock, the request fingerprint and the shutdown budget. Delta specs add the lab3-load-balancing and lab3-idempotent-messages capabilities and modify message posting, request identification, shutdown, container delivery, migrations, restart and the reproducible stand. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>