Files
mtusi2026lab3/openspec/changes/close-lab3-review-gaps/specs/lab3-idempotent-messages/spec.md
T
ArtyomandClaude Opus 5.5 be17939ddb Propose closing the lab 3 review gaps as an openspec change
An independent review of the grade 5 submission found that the level 4
measurements under load and the fault tests were taken on the code
before track 1 rewrote the message write, that the claim that the pool
and the balancer are not the bottleneck rests on reasoning alone, and
that the retrograde 8x1 result is not separated from running on other
vCPUs. Some evidence tooling also writes data of another compose
project or cannot reproduce a committed file.

The change records the order of checks on posting a message (401,
request shape 400, access 404, text 400), requires three detection runs
with the 0.25 s measurement tolerance, a docker ps of replicas after
each stop in failover-each, an upper bound of the rate grid, and control
runs that vary the pool, the balancer queue and the CPU placement one at
a time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
2026-10-29 23:12:16 +03:00

1.7 KiB
Raw Blame History

ADDED Requirements

Requirement: Порядок проверок отправки сообщения

POST /api/v1/chats/{chat_id}/messages SHALL проверять запрос в таком порядке: сессия (401), форма запроса — заголовок Idempotency-Key, malformed JSON, лишние поля и типы (400 invalid_request), доступ к чату (404 not_found), затем текст сообщения (400 invalid_request). Ответ постороннему SHALL NOT раскрывать, существует ли чат: 400 по форме запроса отдаётся без обращения к чату и одинаков для существующего и несуществующего чата, а ошибка текста постороннему SHALL быть 404.

Scenario: Посторонний без ключа

  • WHEN аутентифицированный посторонний отправляет в существующий чат запрос без Idempotency-Key
  • THEN ответ 400 с кодом invalid_request, такой же, как для несуществующего чата

Scenario: Посторонний с невалидным текстом

  • WHEN посторонний отправляет с корректным ключом текст из пробелов
  • THEN ответ 404 с кодом not_found, а не 400

Scenario: Участник с невалидным текстом

  • WHEN участник отправляет с корректным ключом текст из пробелов
  • THEN ответ 400 с кодом invalid_request, ключ не занят