docs: sync all markdown with current architecture

Remove session management concepts (no create_session/close_session/
DELETE /sessions — Master handles container lifecycle automatically).
Update PlatformClient contract, ChatContext, project structure tree,
and FSM diagrams across all docs to match the implemented core/.

- README.md: fix core/ structure tree + PlatformClient snippet
- docs/surface-protocol.md: remove session.py/_template.py, fix
  ChatContext (drop session_id), fix PlatformClient contract, fix
  "free features" list
- docs/telegram-prototype.md: remove "создаёт сессию на платформе"
- docs/matrix-prototype.md: same + remove !sessions, fix FSM
  (SessionCreated → ChatCreated), fix status block
- docs/user-flow.md: rewrite sequence diagram to POST /users/{id}/
  chats/{id}/messages; update FSM states
This commit is contained in:
Mikhail Putilovskij 2026-03-29 00:55:24 +03:00
parent 36730ae716
commit 4f5c5679d5
5 changed files with 52 additions and 53 deletions

View file

@ -11,7 +11,7 @@
sequenceDiagram
actor User
participant Bot as Telegram/Matrix Bot
participant Platform as Lambda Platform
participant Platform as Lambda Platform (Master)
User->>Bot: /start
Bot->>Platform: GET /users/{tg_id}?platform=telegram
@ -23,20 +23,13 @@ sequenceDiagram
Bot->>User: Добро пожаловать обратно
end
User->>Bot: Любое сообщение
Bot->>Platform: POST /sessions (создаём сессию)
Platform-->>Bot: {session_id, agent_id}
loop Диалог
User->>Bot: Сообщение
Bot->>Platform: POST /sessions/{id}/messages
Platform-->>Bot: {response}
loop Диалог (бот не управляет сессиями — Master делает это автоматически)
User->>Bot: Сообщение в чат C1/C2/...
Bot->>Platform: POST /users/{user_id}/chats/{chat_id}/messages
Note over Platform: Master поднимает контейнер,<br/>монтирует нужный чат, запускает агента
Platform-->>Bot: {message_id, response, tokens_used}
Bot->>User: Ответ агента
end
User->>Bot: /end или таймаут
Bot->>Platform: DELETE /sessions/{id}
Bot->>User: Сессия завершена
```
---
@ -45,15 +38,19 @@ sequenceDiagram
```mermaid
stateDiagram-v2
[*] --> Idle: /start
[*] --> Unauthenticated: первый контакт
Idle --> InSession: любое сообщение
InSession --> InSession: сообщение пользователя
InSession --> Idle: /end
Unauthenticated --> Idle: /start (auth confirmed)
Idle --> WaitingResponse: сообщение пользователя
WaitingResponse --> Idle: ответ получен
WaitingResponse --> Error: ошибка платформы
Idle --> Idle: /new (создан новый чат)
Idle --> ConfirmAction: агент запрашивает подтверждение
ConfirmAction --> Idle: подтверждено / отменено
InSession --> Error: ошибка платформы
Error --> Idle: /start
Error --> InSession: retry
```
---