Imported from adam85sims/Sentinel (
AGENTS.md). Install upstream withnpx skills add adam85sims/Sentinel. Copyright stays with the author.
Agent Instructions
Repository boundaries
- The main package is
src/sentinel/and is tested bytests/; its public entrypoints aresentinel/sentinel-run(CLI) andsentinel.__init__. The WebUI issentinel serve(entrypointsentinel-serve) and lives atsrc/sentinel/web/. pattern-memory/is a separate Python package with its ownpyproject.toml, dependencies, CLI, and test suite. Install and test it from that directory; root installs do not cover it.- Framework adapters, OpenTelemetry support, and the WebUI are optional dependencies. Do not add hard imports for them to core code.
Main package commands
- Requires Python 3.11+. Set up the development environment with
pip install -e ".[dev]"; add.[langchain],.[crewai],.[openai],.[otel],.[governance],.[web], or.[all]when needed. - Run the root suite with
python -m pytest tests/ -v; target a file or test with the same command followed by its path and/or-k expression. The[dev]extra now includespytest-asyncio,pytest-xdist,pytest-randomly,pytest-playwright, andhttpx, so parallel/order-independence/E2E tests work out of the box. - Run the LangChain integration file with
pip install -e ".[langchain]"followed bypython -m pytest tests/sentinel/test_integration_langchain.py -v. It uses deterministic simulated agent loops and skips whenlangchain-coreis absent; it does not require an LLM API. - Run lint with
ruff check src/ tests/. Ruff is configured for Python 3.11, 100-character lines, and rulesE,F,W,I,UP. - For testing rules (parallel-safety, no-shared-state, conftest helpers, recommended local commands) see
tests/AGENTS.md— it is the source of truth for anything undertests/.
WebUI
- Start with
sentinel serve(orsentinel-serve); defaulthttp://127.0.0.1:8080. FastAPI app factory is atsentinel.web.app:create_app. - Requires
pip install -e ".[web]". The WebUI ships pre-populated demo data under.sentinel/runs/and.sentinel/baselines/so first-run users see populated lists; regenerate withpython scripts/generate_demo_data.py. - Browser E2E tests live in
tests/sentinel/web/test_playwright_e2e.pyand requirepip install -e ".[dev]"plusplaywright install chromium. They are markede2e; deselect with-m "not e2e"when not available.
CLI and scenarios
sentinel runrequires exactly one of--scenario NAME,--all, or--path FILE; usesentinel run --path examples/basic_scenario.yamlfor a file scenario.- YAML scenario loading requires PyYAML (
.[governance]); JSON scenarios do not. Baseline/report commands operate on persisted results and can create local report artifacts. clickis a core dependency (click>=8.0) — required bysentinel,sentinel-run, andsentinel-serveentrypoints.
Pattern-memory commands
- From
pattern-memory/, install withpip install -e ".[dev]"and runpython3 -m pytest tests/ -v. - Its runtime uses SQLite plus ChromaDB and exposes
pattern-memoryandpattern-memory-server; avoid assuming its top-level modules belong to thesentinelpackage.