- carry the lab 3 solution over from mtusi2026lab3-safronov (solution/bvt2301-safronov, ce89eba): src, migrations, student-tests, bench, openspec, .claude, infra/haproxy and infra/valkey, own scripts, Dockerfile, compose, pyproject and uv lock - merge Makefile, .gitignore and .dockerignore (the lab 3 versions only add lines to the skeleton, which is the same in lab 4) and .env.example (lab 4 skeleton names listed in the header) - rename the compose project to mtusi-lab4 and the image to :lab4 so the stand does not reuse the lab 3 containers and volumes - update AGENTS.md for lab 4: current lab, origin commit, contract and test files of the new skeleton Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
954 B
Markdown
20 lines
954 B
Markdown
# Spec Delta
|
||
|
||
## MODIFIED Requirements
|
||
|
||
### Requirement: Отправка сообщения
|
||
|
||
`POST /api/v1/chats/{chat_id}/messages` SHALL принимать тело
|
||
`{"text": ...}` с заголовком `Idempotency-Key` и при успехе отвечать
|
||
201 с объектом `Message`: `id`, `chat_id`, `sender_id`, `text`,
|
||
`created_at`, без других полей. `sender_id` SHALL быть текущим
|
||
пользователем, `text` SHALL совпадать с отправленным. Формат ключа,
|
||
повтор и конфликт описаны в capability `idempotency`.
|
||
|
||
#### Scenario: Участник отправляет сообщение
|
||
|
||
- **WHEN** Алиса отправляет `"Привет, мир 👋"` в свой чат с новым
|
||
`Idempotency-Key`
|
||
- **THEN** ответ 201, `sender_id` — Алиса, `chat_id` — этот чат, `text`
|
||
равен `"Привет, мир 👋"`
|