diff --git a/.planning/HANDOFF.json b/.planning/HANDOFF.json index 853265c..e1e552c 100644 --- a/.planning/HANDOFF.json +++ b/.planning/HANDOFF.json @@ -1,100 +1,86 @@ { "version": "1.0", - "timestamp": "2026-04-27T18:44:51.832Z", + "timestamp": "2026-04-28T18:39:43.064Z", "phase": "05", - "phase_name": "deployment", - "phase_dir": null, - "plan": 0, + "phase_name": "MVP Deployment", + "phase_dir": ".planning/phases/05-mvp-deployment", + "plan": 4, "task": 0, "total_tasks": 0, - "status": "pre-planning", + "status": "paused", "completed_tasks": [ { "id": 1, - "name": "Research platform repos (agent, agent_api, master)", + "name": "Finalize multi-agent surface image handoff", "status": "done", - "commit": null + "commit": "5b53788" }, { "id": 2, - "name": "Clarify deployment topology with platform team", + "name": "Publish Docker image for the Matrix surface", "status": "done", - "commit": null + "artifact": "mput1/surfaces-bot:latest", + "digest": "sha256:26ba3a49290ab7c1cf0fa97f3de3fefdc70b59df7e6f1e0c2255728f8e2369be" }, { "id": 3, - "name": "Create docs/deploy-architecture.md", + "name": "Verify multi-agent file-volume routing contract", "status": "done", - "commit": null + "evidence": "tests cover /agents/17/incoming and /agents/17/output routing" } ], "remaining_tasks": [ - {"id": 4, "name": "Merge feat/matrix-direct-agent-prototype → main", "status": "not_started"}, - {"id": 5, "name": "Plan Phase 05 (deployment)", "status": "not_started"}, - {"id": 6, "name": "Execute Phase 05", "status": "not_started"} + { + "id": 1, + "name": "Platform team integrates the published surface image into their 25-30 agent deployment", + "status": "external" + }, + { + "id": 2, + "name": "Run a real platform smoke test with production Matrix credentials, matrix-agents.yaml, and shared /agents volume", + "status": "not_started" + } ], "blockers": [ { - "description": "agent_api #9-clientside-tool-call убирает attachments и MsgEventSendFile — если смержат до деплоя, сломает file transfer", + "description": "Full production verification depends on the platform team's real 25-30 agent orchestration and volume mounts.", "type": "external", - "workaround": "Используем master пока #9 не merged. Уточнить у Азамата сроки." - }, - { - "description": "AGENT_ID и COMPOSIO_API_KEY значения для каждого агента — нужны от платформы", - "type": "human_action", - "workaround": "Запросить у Азамата перед деплоем" + "workaround": "Use docker-compose.fullstack.yml only as local E2E harness; production uses mput1/surfaces-bot:latest plus platform-managed agents." } ], "human_actions_pending": [ { - "action": "Получить значения AGENT_ID и COMPOSIO_API_KEY для каждого агента от платформы", - "context": "Composio смержен в main platform-agent, теперь обязателен", + "action": "Send platform the image tag, digest, deploy docs, and matrix-agents.yaml contract", + "context": "The bot is published as a single surface container; platform supplies agents, base_url values, and /agents/N volume mounts.", "blocking": true }, { - "action": "Уточнить у Азамата сроки мержа agent_api #9 (убирает attachments/MsgEventSendFile)", - "context": "Мы строим file transfer на этих фичах из master", - "blocking": false - }, - { - "action": "Уточнить: chat_id=0 для всех или используем разные chat_id для C1/C2/C3", - "context": "Платформа показала пример с одним AgentApi на агента без явного chat_id", - "blocking": false + "action": "Platform prepares production config/matrix-agents.yaml", + "context": "Each external agent needs agent_id, base_url, and workspace_path such as /agents/17.", + "blocking": true } ], "decisions": [ { - "decision": "Один инстанс Matrix-бота на всех пользователей, один агент-контейнер на пользователя", - "rationale": "Подтверждено платформой. Reverse proxy на lambda.coredump.ru:7000 роутит по пути /agent_N/", - "phase": "pre-05" + "decision": "Ship one generic Matrix surface image, not a compose stack with 25-30 agents.", + "rationale": "The platform owns agent lifecycle/orchestration; the surface only needs base_url and workspace_path per agent.", + "phase": "05" }, { - "decision": "Файлы через shared volume /agents/, не через API", - "rationale": "Surface и агент видят один volume. Surface пишет файл → передаёт путь в attachments. Агент эмитит MsgEventSendFile → Surface читает файл и шлёт в Matrix", - "phase": "pre-05" + "decision": "Make SURFACES_BOT_IMAGE explicit and document the published mput1/surfaces-bot image.", + "rationale": "Docker Hub push access is namespace-specific; hardcoding mrkan0 caused insufficient_scope.", + "phase": "05" }, { - "decision": "Используем agent_api master (с attachments и MsgEventSendFile), не ветку #9", - "rationale": "master стабильный, #9 в разработке и убирает нужные нам фичи", - "phase": "pre-05" - }, - { - "decision": "Конфиг: два словаря — user_id→agent_id и agent_id→{base_url, workspace_path}", - "rationale": "Платформа подтвердила статический маппинг для MVP без Master", - "phase": "pre-05" - }, - { - "decision": "Master (platform-master feat/storage) не используем для MVP", - "rationale": "Ещё в разработке. Используем статический конфиг. При готовности Master — мигрируем.", - "phase": "pre-05" + "decision": "Keep docker-compose.fullstack.yml as internal E2E only.", + "rationale": "It validates the bot plus one local agent, but is not a model of production multi-agent orchestration.", + "phase": "05" } ], "uncommitted_files": [ - "docs/deploy-architecture.md", - "docs/superpowers/plans/2026-04-24-matrix-multi-agent-routing-and-restart-state.md", - "config/matrix-agents.yaml", - ".planning/STATE.md" + ".planning/HANDOFF.json", + ".planning/phases/05-mvp-deployment/.continue-here.md" ], - "next_action": "Запустить /gsd-plan-phase 05 для планирования фазы деплоя. Прочитать docs/deploy-architecture.md перед планированием.", - "context_notes": "Phase 04 полностью завершена, ветка feat/matrix-direct-agent-prototype готова к merge. Этот сеанс был посвящён архитектуре деплоя — исследовали платформу, обсуждали с командой. Всё что знаем про деплой — в docs/deploy-architecture.md. Phase 05 = деплой: обновить конфиг, sdk/real.py, добавить file transfer в Matrix адаптер, написать docker-compose." + "next_action": "Resume by coordinating platform integration: confirm they use mput1/surfaces-bot:latest, mount /agents, provide config/matrix-agents.yaml, then run a real Matrix smoke test.", + "context_notes": "Phase 05 implementation and handoff commit 5b53788 are pushed. The Docker image was successfully built and pushed by the user as mput1/surfaces-bot:latest with digest sha256:26ba3a49290ab7c1cf0fa97f3de3fefdc70b59df7e6f1e0c2255728f8e2369be. Existing unrelated .planning dirt and a local jpg remain in the worktree and were intentionally not included in the handoff commit." } diff --git a/.planning/phases/05-mvp-deployment/.continue-here.md b/.planning/phases/05-mvp-deployment/.continue-here.md new file mode 100644 index 0000000..f1013f0 --- /dev/null +++ b/.planning/phases/05-mvp-deployment/.continue-here.md @@ -0,0 +1,61 @@ +--- +phase: 05-mvp-deployment +task: 0 +total_tasks: 0 +status: paused_after_handoff +last_updated: 2026-04-28T18:39:43.064Z +--- + + +Phase 05 implementation and deployment handoff are complete. The latest handoff commit is `5b53788` on `feat/deploy`, pushed to origin. The Matrix surface image was built and published as `mput1/surfaces-bot:latest` with digest `sha256:26ba3a49290ab7c1cf0fa97f3de3fefdc70b59df7e6f1e0c2255728f8e2369be`. + +The production model is one generic Matrix surface container connected to 25-30 externally managed platform agents. The surface does not start or manage agent containers. + + + + +- Finalized `docker-compose.prod.yml` as a bot-only handoff using required `SURFACES_BOT_IMAGE`. +- Kept `docker-compose.fullstack.yml` as internal E2E harness with one local `platform-agent` and local `agent_api` build context. +- Updated `Dockerfile` so production installs `platform/agent_api` from Git and no longer depends on local `external/`. +- Updated `.dockerignore` to keep `external/`, `.planning/`, tests, local runtime state, and real `config/matrix-agents.yaml` out of the image context. +- Updated `README.md`, `.env.example`, `docs/deploy-architecture.md`, and `config/matrix-agents.example.yaml` with the multi-agent contract. +- Added deploy contract tests and file-volume routing tests covering `/agents/17/incoming` and `/agents/17/output`. +- Verified handoff slice: `74 passed`, ruff clean, compose render clean, `git diff --check` clean. +- User built and pushed `mput1/surfaces-bot:latest` successfully. + + + + +- Send platform the published image tag/digest and the deploy contract: + - `mput1/surfaces-bot:latest` + - `sha256:26ba3a49290ab7c1cf0fa97f3de3fefdc70b59df7e6f1e0c2255728f8e2369be` + - one surface container, external 25-30 agents, routing through `config/matrix-agents.yaml` +- Platform must provide real `config/matrix-agents.yaml` with `agent_id`, `base_url`, and `workspace_path` for each agent. +- Platform must mount shared storage so bot-side `/agents/N` is the same storage each `agent_N` sees as `/workspace`. +- Run a real Matrix smoke test against platform-managed agents after the platform deploys the image. + + + + +- Ship one generic Matrix surface image instead of attempting to model 25-30 agent services in our production compose. +- Keep agent lifecycle, scaling, and orchestration owned by the platform. +- Use `SURFACES_BOT_IMAGE=mput1/surfaces-bot:latest` as the documented image for handoff. +- Preserve `docker-compose.fullstack.yml` only as a local/internal E2E harness, not as production topology. +- Treat file exchange as a shared-volume contract: user files go to `{workspace_path}/incoming/...`; agent output is read from `{workspace_path}/output/...`. + + + + +- Full production verification is external: it requires the platform team's real 25-30 agent orchestration, reverse proxy routes, Matrix credentials, and volume mounts. +- Existing unrelated `.planning` changes and a local jpg remain in the worktree; they predate this pause and were not part of the deploy handoff commit. + + + +If resuming, do not re-open the old single-chat / DM-first deployment direction. The accepted model is Space+rooms, per-room `platform_chat_id`, one Matrix surface image, and external per-agent routing via `matrix-agents.yaml`. + +The likely next conversation with platform should be operational, not implementation-heavy: confirm they pull `mput1/surfaces-bot:latest`, mount `/agents`, provide `matrix-agents.yaml`, and run one user-to-agent file round trip. + + + +Start by sending platform the image tag/digest and the concise deployment checklist. Then coordinate the first real smoke test: one Matrix user mapped to one agent, text message, incoming file to `/agents/N/incoming`, outgoing file from `/agents/N/output`. +