Files
ArtyomandClaude Opus 5.5 1210dd899c Carry over the agent context and openspec history from lab 4
Bring the Claude Code settings, the lint hook, the opsx commands and
skills, the architecture notes, the lab 1 to lab 4 specs and the
archived lab 1 to lab 4 changes into the lab 5 skeleton, so lab 5
continues the same spec history instead of starting from scratch. The
files come from the lab 4 solution commit d2744bc.

Rewrite AGENTS.md and the openspec context and rules for lab 5: upload
answers 202 queued after the original is in a private staging prefix
and the attachment, the job and the outbox row are committed in one
transaction, a separate relay publishes the outbox to RabbitMQ with
publisher confirms, a separate worker built from the same image
consumes the queue through FastStream with a manual ack after the
result commit, PostgreSQL stays the source of truth for job states,
Out of scope moves to labs 6-7, track 1 and broker HA, and the rules
add the failure windows between PostgreSQL and the broker, the effect
key and the lease to specs and designs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 00:32:37 +03:00

2.0 KiB

MODIFIED Requirements

Requirement: Порядок истории

История чата SHALL быть упорядочена по паре (created_at, id) по возрастанию. Время SHALL назначаться сервером в формате RFC 3339 UTC с суффиксом Z. Сервис SHALL гарантировать, что created_at внутри одного чата строго возрастает в порядке фиксации сообщений, в том числе при конкурентных вставках через разные процессы API, — иначе обход истории keyset-курсором теряет запись, зафиксированную позже с меньшей отметкой.

Scenario: Сообщения возвращаются в порядке приёма

  • WHEN в чат последовательно отправлены два сообщения от разных участников
  • THEN GET /api/v1/chats/{chat_id}/messages возвращает их в порядке отправки

Scenario: Конкурентная запись не ломает порядок

  • WHEN 10 клиентов параллельно отправляют по 10 сообщений в один чат
  • THEN история содержит ровно 100 сообщений с попарно различными id
  • AND created_at строго возрастает по всей истории

Scenario: Отметка не уходит назад при отставших часах процесса

  • WHEN процесс API назначает сообщению отметку меньше, чем у последнего зафиксированного сообщения чата
  • THEN сообщение получает отметку на одну микросекунду больше последней, и порядок истории сохраняется