Summary
The recent fix that packages migrations/ and static/ into the wheel (branch
fix/package-static-assets-in-wheel) is correct, but nothing in the test suite guards it.
If the packaging config is reverted or drifts, every test still passes and a broken wheel ships —
which is exactly how the original bug went unnoticed.
Background — the bug that was fixed
Two failures existed only in a real (non-editable) wheel install, never in a checkout or the
Docker deploy (which uses pip install -e):
- Migrations —
store.MIGRATIONS_DIR resolved via Path(__file__).parents[3] / "migrations" / "core".
In a checkout that is <repo>/migrations/core ✅. In a wheel, store.py lands in site-packages/,
so parents[3] points at the venv root → the directory doesn't exist → glob() returns [] →
the server boots on an empty schema with no error at all.
- Static assets —
mcp_http._STATIC_DIR = Path(__file__).parent / "static", but static/ was never
listed in pyproject.toml, so it wasn't in the wheel → StaticFiles(directory=…) raises
"Directory does not exist" when building the app.
Why the test suite cannot catch this
Tests install the package editable (dev.py: --with-editable packages/agami-core[model,server]),
so the data dirs resolve into the source tree, which exists regardless of what pyproject.toml
packages:
Summary
The recent fix that packages
migrations/andstatic/into the wheel (branchfix/package-static-assets-in-wheel) is correct, but nothing in the test suite guards it.If the packaging config is reverted or drifts, every test still passes and a broken wheel ships —
which is exactly how the original bug went unnoticed.
Background — the bug that was fixed
Two failures existed only in a real (non-editable) wheel install, never in a checkout or the
Docker deploy (which uses
pip install -e):store.MIGRATIONS_DIRresolved viaPath(__file__).parents[3] / "migrations" / "core".In a checkout that is
<repo>/migrations/core✅. In a wheel,store.pylands insite-packages/,so
parents[3]points at the venv root → the directory doesn't exist →glob()returns[]→the server boots on an empty schema with no error at all.
mcp_http._STATIC_DIR = Path(__file__).parent / "static", butstatic/was neverlisted in
pyproject.toml, so it wasn't in the wheel →StaticFiles(directory=…)raises"Directory does not exist" when building the app.
Why the test suite cannot catch this
Tests install the package editable (
dev.py:--with-editable packages/agami-core[model,server]),so the data dirs resolve into the source tree, which exists regardless of what
pyproject.tomlpackages: