"""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//`, 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/ && 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