7.3 KiB
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 04-matrix-mvp-shared-agent-context-and-context-management-comma | 03 | execute | 2 |
|
|
true |
|
|
Purpose: Enable reproducible MVP deployment of the Matrix bot in a container alongside the separately-run platform-agent.
Output: Dockerfile, docker-compose.yml, updated .env.example.
<execution_context> @$HOME/.claude/get-shit-done/workflows/execute-plan.md @$HOME/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/phases/04-matrix-mvp-shared-agent-context-and-context-management-comma/04-CONTEXT.md @.planning/phases/04-matrix-mvp-shared-agent-context-and-context-management-comma/04-RESEARCH.md Task 1: Create Dockerfile and docker-compose.yml<read_first> - .env.example (full file — adding new vars) - external/platform-agent_api/lambda_agent_api/ (ls — verify files to copy) - pyproject.toml (verify uv is the package manager used) </read_first>
Dockerfile, docker-compose.yml, .env.example
1. Check if pyproject.toml uses uv or pip. The project uses `uv sync` per CLAUDE.md. However, in the Docker container we can use pip for simplicity since uv's lockfile-based install may need the lockfile present. Use pip for the base install of surfaces-bot deps, and install lambda_agent_api separately.Actually: the project uses uv. Use uv in Docker to be consistent:
- Install uv via pip (pip install uv)
- Run uv sync to install project deps
- Install lambda_agent_api with pip --ignore-requires-python
- Create Dockerfile:
FROM python:3.11-slim
WORKDIR /app
# Install uv
RUN pip install --no-cache-dir uv
# Copy dependency manifests first for layer caching
COPY pyproject.toml uv.lock* ./
# Install project dependencies via uv (no project install yet, just deps)
RUN uv sync --no-install-project --frozen 2>/dev/null || uv sync --no-install-project
# Copy project source
COPY . .
# Install the project itself
RUN uv sync --frozen 2>/dev/null || uv sync
# Install lambda_agent_api, bypassing Python version constraint
RUN pip install --no-cache-dir --ignore-requires-python /app/external/platform-agent_api
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
CMD ["python", "-m", "adapter.matrix.bot"]
- Create docker-compose.yml:
services:
matrix-bot:
build: .
env_file: .env
restart: unless-stopped
# platform-agent runs separately — not included in this compose file
-
Read current .env.example, then append new variables. Current file likely has MATRIX_* vars. Add:
- AGENT_WS_URL=ws://127.0.0.1:8000/agent_ws/
- AGENT_BASE_URL=http://127.0.0.1:8000
- MATRIX_PLATFORM_BACKEND=real
Read .env.example first to see what's there, then write the full updated file.
<threat_model>
Trust Boundaries
| Boundary | Description |
|---|---|
| container → host env | .env file mounts secrets into container |
| container → platform-agent | Network call to AGENT_WS_URL / AGENT_BASE_URL |
STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|---|---|---|---|---|
| T-04-03-01 | Information Disclosure | .env file with secrets mounted in container | mitigate | .env in .gitignore; .env.example committed with placeholder values only, never real secrets |
| T-04-03-02 | Tampering | lambda_agent_api installed from local path via --ignore-requires-python | accept | Local package under version control; no external supply chain risk |
| T-04-03-03 | Denial of Service | restart: unless-stopped could loop on crash | accept | Expected behavior; operator can docker compose stop |
| </threat_model> |
<success_criteria>
- Dockerfile, docker-compose.yml, .env.example all exist in project root
- Dockerfile builds without errors when platform-agent_api dir is present (docker build . exits 0)
- .env.example contains AGENT_BASE_URL, AGENT_WS_URL, MATRIX_PLATFORM_BACKEND
- docker-compose.yml service named matrix-bot uses env_file: .env </success_criteria>