Skip to content

The agent that grows with you

fix(pm): keep bundled plugins' dashboard dist/ in the build snapshot

teknium19fa34cfb28a4
diff --git a/pm/workspace.py b/pm/workspace.py
index 9d7a6521620..241988c1bd5 100644
--- a/pm/workspace.py
+++ b/pm/workspace.py
@@ -85,8 +85,11 @@ def _copy_core_inputs(source: Path, destination: Path) -> None:
# uv.lock is not excluded: the root lock is never copied (only ``files`` are; lock_and_sync
# seeds or resolves it), and pm/uv.lock is the PM runtime's input (pm/runtime.py::_inputs).
excluded = {".git", ".venv", "venv", "node_modules", "__pycache__", "build", "dist", "release"}
+ # A root dist/ is build output, but below a package root it is shipped: the managed
+ # environment runs from this snapshot and serves bundled plugins' dashboard/dist/.
+ nested_excluded = excluded - {"dist"}
def ignore(directory, names):
- return [name for name in names if name in excluded or name.startswith(".")
+ return [name for name in names if name in nested_excluded or name.startswith(".")
or name.endswith(".egg-info") or (Path(directory) / name).is_symlink()]
for entry in source.iterdir():
diff --git a/tests/pm/test_workspace_build_inputs.py b/tests/pm/test_workspace_build_inputs.py
index 468a7b0d046..51122a036fc 100644
--- a/tests/pm/test_workspace_build_inputs.py
+++ b/tests/pm/test_workspace_build_inputs.py
@@ -261,3 +261,24 @@ def test_member_uv_lock_travels_with_its_member(tmp_path):
assert (destination / "pm/uv.lock").read_text(encoding="utf-8") == "version = 1\n# member lock\n"
assert not (destination / "uv.lock").exists(), "the root lock is seeded by lock_and_sync, not copied"
+
+
+def test_nested_dist_travels_but_root_dist_stays_out(tmp_path):
+ """Bundled dashboard plugins ship a tracked dashboard/dist/ the snapshot's code serves."""
+ core = tmp_path / "core"
+ bundle = core / "plugins" / "kanban" / "dashboard" / "dist"
+ bundle.mkdir(parents=True)
+ (core / "dist").mkdir()
+ (core / "pyproject.toml").write_text(
+ '[project]\nname="core"\nversion="1"\nrequires-python=">=3.11"\n'
+ '[tool.setuptools.packages.find]\ninclude=["*"]\n',
+ encoding="utf-8",
+ )
+ (bundle / "index.js").write_text("ENTRY\n", encoding="utf-8")
+ (core / "dist" / "core-1.whl").write_text("OUTPUT\n", encoding="utf-8")
+
+ destination = tmp_path / "stage"
+ workspace._copy_core_inputs(core, destination)
+
+ assert (destination / "plugins/kanban/dashboard/dist/index.js").read_text(encoding="utf-8") == "ENTRY\n"
+ assert not (destination / "dist").exists(), "root build output never enters the snapshot"