Ship the bridge with the pack (moved from the agent core)
The core now keeps only the shared bridge contract (semif_agent/bridges/base.py) and the discovery registry (semif_agent/bridges/registry.py); a pack ships its own bridge under bridge/<name>.py and the registry imports it by convention from the pack's declared `bridges`. The bridge's hermetic test moves here too and runs via the agent repo's tests/test_packs.py (or standalone with conftest.py).
This commit is contained in:
1 parent
3a2806b661
commit
ace251a829
5 files changed
+2941
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
"""Make the agent checkout importable when running this pack's tests standalone.
|
||||
|
||||
A pack's bridge test imports `semif_agent` (the shared bridge contract and the
|
||||
discovery registry). The pack lives inside an agent checkout at `packs/<name>/`,
|
||||
so this adds the checkout root to `sys.path` — running the tests through the
|
||||
agent repo (`pytest tests/test_packs.py`) already provides it, but
|
||||
`cd packs/<name> && pytest` needs this.
|
||||
"""
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
for _parent in Path(__file__).resolve().parents:
|
||||
if (_parent / "semif_agent" / "__init__.py").is_file():
|
||||
if str(_parent) not in sys.path:
|
||||
sys.path.insert(0, str(_parent))
|
||||
break
|
||||
Reference in new issue
Block a user