فهرست منبع

docs: plan static package data

zhenyu.hu 3 هفته پیش
والد
کامیت
2a7e207522
2فایلهای تغییر یافته به همراه61 افزوده شده و 1 حذف شده
  1. 60 0
      docs/plans/todo-15-static-package-data.md
  2. 1 1
      docs/plans/todos.md

+ 60 - 0
docs/plans/todo-15-static-package-data.md

@@ -0,0 +1,60 @@
+# Todo 15 Static Package Data Plan
+
+**Status:** in_progress
+
+## Goal
+
+Include the static debug UI assets in installed package builds.
+
+## Why
+
+The FastAPI app serves `index.html`, `app.js`, and `styles.css` from `agent_lab.presentation.static`. Local source runs work because those files are present in the checkout. A built wheel needs explicit setuptools package-data configuration so installed console usage can still serve the UI.
+
+## Scope
+
+This todo covers:
+
+- Add package-data configuration for static HTML, JS, and CSS files.
+- Add a focused test that prevents removing this packaging rule.
+- Build the package and inspect the wheel contents.
+
+This todo does not cover:
+
+- Changing runtime static path lookup.
+- Adding new frontend assets.
+- Production server entrypoint behavior.
+
+## Files
+
+- Modify: `pyproject.toml`
+- Add/modify: `tests/test_packaging.py`
+- Modify: `docs/plans/todos.md`
+- Modify: this plan
+
+## Steps
+
+1. Add a failing test that reads `pyproject.toml` and asserts `agent_lab.presentation` includes `static/*.html`, `static/*.js`, and `static/*.css` package data.
+2. Add `[tool.setuptools.package-data]` to `pyproject.toml`.
+3. Run:
+
+```bash
+uv run pytest tests/test_packaging.py
+uv run pytest
+```
+
+4. Build and inspect package contents:
+
+```bash
+uv build
+unzip -l dist/agent_lab-0.1.0-py3-none-any.whl | rg "agent_lab/presentation/static/(index.html|app.js|styles.css)"
+```
+
+5. Update this plan and `docs/plans/todos.md`, then commit.
+
+## Verification
+
+Expected result:
+
+- Packaging test passes.
+- Full suite passes.
+- Built wheel contains the three static UI files.

+ 1 - 1
docs/plans/todos.md

@@ -41,5 +41,5 @@
 | 12 | done | `docs/plans/todo-12-round-stats.md` | Move round statistics to structured backend events for token counts, cached tokens, TTFT, elapsed time, and per-turn summaries. | `uv run pytest tests/test_debug_runtime.py tests/test_websocket_api.py`; `uv run pytest`. |
 | 13 | done | `docs/plans/todo-13-real-queue-websocket-loop.md` | Make runtime queues real producer/consumer boundaries and let WebSocket run separate upstream/downstream tasks. | `uv run pytest tests/test_debug_runtime.py tests/test_websocket_api.py`; `uv run pytest`. |
 | 14 | done | `docs/plans/todo-14-message-role-validation.md` | Reject provider-invalid API message roles and malformed tool replies before network calls. | `uv run pytest tests/test_websocket_api.py tests/test_event_agent.py`; `uv run pytest`. |
-| 15 | pending | `docs/plans/todo-15-static-package-data.md` | Include static UI assets in installed package builds. | Build/package inspection proves `index.html`, JS, and CSS are present. |
+| 15 | in_progress | `docs/plans/todo-15-static-package-data.md` | Include static UI assets in installed package builds. | Build/package inspection proves `index.html`, JS, and CSS are present. |
 | 16 | pending | `docs/plans/todo-16-tool-error-isolation.md` | Convert EventAgent tool handler exceptions into structured tool-result errors instead of aborting the session. | Tests prove a failing tool returns an error payload and the WebSocket run stays structured. |