Files
ArtyomandClaude Opus 5.5 d3ee257df1 Archive the lab 3 review gaps change
The deltas are synced to openspec/specs: the order of checks on posting
a message (401, then 400 for the request shape without touching the
chat, then 404 for access, then 400 for the text); three detection runs
with a 0.25 s measurement slack and the replica states after each stop
in failover-each; the upper bound of the track 1 grid with a ceiling on
the first grid point stated as a lower bound; control runs of the pool,
the LB queue and the placement.

Before archiving, on the running stand: make test passes, failover
recovers the first write in 2.78 s with 0 failed attempts, persistence
passes; make check, make lint and 243 own tests pass. All level 3 and 4
records were taken on b1c80ee, after the lab 2 carry over.

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

21 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 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`, ключ не занят