# Todo 1 Project Foundation Plan **Status:** done ## Result `uv run pytest` starts from `pyproject.toml`, loads tests from `tests/`, and fails on missing implementation modules: - `agent_lab.domain.events` - `agent_lab.application.contracts` - `agent_lab.application.event_agent` This is the accepted red-test baseline for the next todo. ## Goal Establish the Python project skeleton and red-test baseline for the Agent Lab MVP. ## Scope This todo covers only: - uv-managed Python package metadata. - Initial DDD-oriented package directories. - Tests that describe parser, EventAgent, and runtime-routing behavior. - A red test run that proves implementation is still missing. This todo does not implement the parser, agents, FastAPI app, WebSocket endpoint, or UI. ## Files - Create or keep: `pyproject.toml` - Create or keep: `uv.lock` - Create: `src/agent_lab/__init__.py` - Create: `src/agent_lab/domain/__init__.py` - Create: `src/agent_lab/application/__init__.py` - Create: `src/agent_lab/infrastructure/__init__.py` - Create: `src/agent_lab/presentation/__init__.py` - Create or keep: `tests/test_openai_stream_parser.py` - Create or keep: `tests/test_event_agent.py` - Create or keep: `tests/test_debug_runtime.py` - Update: `docs/plans/todos.md` ## Steps 1. Confirm current uncommitted files with `git status --porcelain=v2 --branch`. 2. Ensure `pyproject.toml` declares the package, Python version, FastAPI/httpx/pydantic-settings/uvicorn dependencies, and pytest config. 3. Ensure the `src/agent_lab/` package directories exist with `__init__.py` files. 4. Ensure tests cover these behaviors: - OpenAI Chat Completions stream chunks produce message deltas, usage, and tool-call events. - EventAgent converts an enabled event/tool into a `tool` reply message. - Runtime routes ChatAgent events through EventAgent and resumes ChatAgent with the tool reply. 5. Run `uv run pytest`. 6. Accept Todo 1 only if the tests fail because implementation modules or methods are missing. If failures are syntax errors, bad test imports unrelated to missing implementation, or malformed pyproject config, fix Todo 1 before moving on. 7. Update `docs/plans/todos.md`: set Todo 1 to `done` if accepted, otherwise keep it `in_progress` with a note. ## Verification Run: ```bash uv run pytest ``` Expected Todo 1 result: - pytest starts successfully from `pyproject.toml`. - tests are discovered. - failures point to missing implementation for `agent_lab` modules or classes.