|
|
@@ -211,3 +211,43 @@ def test_uninstall_nonexistent_returns_zero(tmp_path):
|
|
|
packs_dir = tmp_path / "agentpacks"
|
|
|
packs_dir.mkdir()
|
|
|
assert uninstall(str(packs_dir), "does.not.exist") == 0
|
|
|
+
|
|
|
+
|
|
|
+# ─────────────────────────────────────────────────────────────────────────────
|
|
|
+# Built-in packs (FR-008) — regression guard: the 3 bundled research packs
|
|
|
+# must always load, validate, and compile.
|
|
|
+# ─────────────────────────────────────────────────────────────────────────────
|
|
|
+
|
|
|
+_BUNDLED_IDS = {
|
|
|
+ "research.top-journal-reviewer",
|
|
|
+ "research.literature-mapper",
|
|
|
+ "research.grant-planner",
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+def _bundled_pack_dirs():
|
|
|
+ import glob
|
|
|
+ repo_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
+ return sorted(glob.glob(os.path.join(repo_root, "agentexample", "agentpacks", "*", "manifest.yml")))
|
|
|
+
|
|
|
+
|
|
|
+def test_bundled_packs_present():
|
|
|
+ found = {load_manifest(os.path.dirname(p)).id for p in _bundled_pack_dirs()}
|
|
|
+ assert _BUNDLED_IDS.issubset(found), f"missing bundled packs: {_BUNDLED_IDS - found}"
|
|
|
+
|
|
|
+
|
|
|
+@pytest.mark.parametrize("manifest_path", _bundled_pack_dirs())
|
|
|
+def test_bundled_pack_valid_and_compiles(manifest_path):
|
|
|
+ """Each bundled pack: manifest validates, entrypoint exists, and the
|
|
|
+ entrypoint config compiles via from_config (it's a real runnable agent)."""
|
|
|
+ from lambdagent import from_config
|
|
|
+
|
|
|
+ pack_dir = os.path.dirname(manifest_path)
|
|
|
+ m = load_manifest(pack_dir)
|
|
|
+ assert os.path.isfile(m.entrypoint_path()), m.entrypoint
|
|
|
+ # Built-in research packs are local-first: no shell, no network.
|
|
|
+ assert m.permissions.shell is False
|
|
|
+ assert m.permissions.network is False
|
|
|
+ # The entrypoint must compile to a runnable term.
|
|
|
+ term = from_config(m.entrypoint_path())
|
|
|
+ assert term is not None
|