src/sentinel/holds the application package (CLI entrypoint issentinel.cli:main).tests/contains unit tests;tests/integration/contains API-keyed integration tests.docs/holds architecture and system design references.data/is the runtime state directory (persona files likedata/identity.mdanddata/agenda.md).- Root configs include
pyproject.toml,.env.example, anduv.lock.
uv syncinstalls dependencies into the local environment.uv run sentinel --helpverifies the CLI is wired up.uv run sentinel initinitializesdata/and persona files.uv run sentinel runstarts the Telegram bot; add--debugfor log output.uv run pytest -vruns the test suite (integration tests are ignored by default).uv run pytest tests/integration -vruns integration tests (requires.envwith API keys).uv run ruff check src tests --fixlints and auto-fixes issues.
- Python 3.12+ only; prefer clear, terse code with self-explanatory structure.
- Line length: 100 characters (
ruffenforces this). - Follow
rufflint rules (E,F,I,UP,B,SIM). - Keep modules consolidated; add new files only for clear separation of concerns.
- Primary framework:
pytestwithpytest-asyncio. - Integration tests live under
tests/integration/and require real API keys. - Test names should be descriptive and map to functionality (e.g.,
test_llm_routing.py).
- Use Conventional Commits observed in history (e.g.,
feat: ...,fix: ...,docs: ...,test: ...). - Keep commits scoped to one change set and include context in the message.
- PRs should include: clear description, linked issue (if any), and test results.
- If behavior changes, add or update tests and note how to validate locally.
- Do not commit
.envor secrets; use.env.examplefor reference. - Integration tests require provider keys such as
SENTINEL_ANTHROPIC_API_KEY. - Treat
data/as local state; avoid committing generated runtime files.