diff --git a/.planning/STATE.md b/.planning/STATE.md index 384ed33..e3451ae 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -2,8 +2,8 @@ gsd_state_version: 1.0 milestone: v1.0 milestone_name: — Production-ready surfaces -status: Ready to execute -last_updated: "2026-04-17T16:10:00.000Z" +status: Phase 04 multi-agent follow-up complete +last_updated: "2026-04-24T14:10:00Z" progress: total_phases: 5 completed_phases: 2 @@ -19,13 +19,21 @@ progress: See: .planning/PROJECT.md (updated 2026-04-02) **Core value:** Пользователь ведёт диалог с Lambda через любой мессенджер без изменения ядра -**Current focus:** Phase 04 complete — Matrix MVP implementation ready for testing +**Current focus:** Phase 04 multi-agent routing follow-up fully implemented; ready for live validation or Phase 05 planning ## Current Phase -**Phase 4** implementation complete: Matrix MVP +**Phase 4** implementation complete: Matrix MVP + multi-agent routing -Phase 4 is implemented. Next step is manual and automated testing of the Matrix MVP flow before deciding on follow-up work. +All 5 tasks of the multi-agent routing follow-up are committed on `feat/matrix-direct-agent-prototype`: + +- `7627012` / `242f4aa` / `9ccba16` — agent registry loader, RoutedPlatformClient facade, fail-fast on missing registry in real mode +- `a65227e` — dispatch chat_id contract alignment +- `74cf028` — `!agent` command, `selected_agent_id` persistence, unbound-room binding on first selection +- `7623039` — attachment normalization in core message handler +- `e733119` — stale room blocking, `agent_id` binding on `!new`, durable restart state tests + +135 Matrix tests pass. The branch is ready for review and merge. ## Decisions @@ -46,6 +54,12 @@ Phase 4 is implemented. Next step is manual and automated testing of the Matrix - [Phase 04]: Replaced AgentSessionClient with AgentApiWrapper and persistent agent connection lifecycle in Matrix runtime. - [Phase 04]: Added !save, !load, !reset, and !context commands with pending-state interception and local prototype session metadata. - [Phase 04]: Added Matrix-only Docker packaging for MVP deployment; platform services remain external to this compose setup. +- [Phase 04]: Replaced the Matrix prod path again with direct upstream `AgentApi` per request; removed the local runtime wrapper from the prod flow. +- [Phase 04]: Adopted `AGENT_BASE_URL` as the primary runtime contract and kept `AGENT_WS_URL` only as backward-compatible env fallback. +- [Phase 04 follow-up]: Kept shared PlatformClient unchanged; introduced Matrix-specific RoutedPlatformClient to avoid breaking Telegram adapter. +- [Phase 04 follow-up]: agent_routing_enabled flag on MatrixRuntime activates stale-room check only in real multi-agent mode (RoutedPlatformClient). +- [Phase 04 follow-up]: !new binds agent_id at room creation time using selected_agent_id from user metadata. +- [Phase 04 follow-up]: platform_chat_seq (PLATFORM_CHAT_SEQ_KEY) is stored in SQLiteStore and survives restart — confirmed by test. ## Blockers @@ -57,6 +71,7 @@ Phase 4 is implemented. Next step is manual and automated testing of the Matrix - Phase 01.1 inserted after Phase 01: Matrix restart reconciliation and dev reset workflow (URGENT) - Phase 4 added: Matrix MVP: shared agent context and context management command +- Phase 04 follow-up added inline: multi-agent routing (RoutedPlatformClient, !agent, stale room blocking, restart persistence) - New platform signal: upcoming proper `chat_id` support should enable file-level context separation and stronger context management in a future follow-up phase. ## Performance Metrics @@ -68,12 +83,14 @@ Phase 4 is implemented. Next step is manual and automated testing of the Matrix | 01 | 03 | 3 min | 2 | 5 | 2026-04-02T19:57:34Z | | 01 | 04 | 3 min | 2 | 7 | 2026-04-02T20:03:38Z | | 01 | 05 | 2 min | 2 | 7 | 2026-04-03T09:28:47Z | -| 01 | 06 | 4 min | 2 | 7 | 2026-04-03T09:35:39Z | +| 01 | 06 | 4 min | 2 | 7 | 2026-04-03T09:35:47Z | | 04 | 01 | 1 session | 1 wave | 8 | 2026-04-17 | | 04 | 02 | 1 session | 2 commits + summary | 8 | 2026-04-17 | | 04 | 03 | 1 session | 1 commit + summary | 4 | 2026-04-17 | +| 04 | follow-up | 1 session | 5 tasks | 10+ | 2026-04-24 | ## Session -- Last session: 2026-04-17T16:10:00Z -- Stopped at: Phase 4 implementation complete, ready for testing +- Last session: 2026-04-24T14:10:00Z +- Stopped at: Phase 04 multi-agent follow-up fully committed (e733119); 135 tests green; branch feat/matrix-direct-agent-prototype ready for review/merge +- Resume file: HANDOFF deleted; no pending tasks