src/agents/state.py (96 lines) — the whole agent contract: caps,
loop detection, failure field.src/agents/orchestrator.py (289) — the 10-state loop; every
transition is visible.src/agents/tools/registry.py — the validation contract for model
output: required/unknown keys, strict types (bool ≠ integer), bounds,
recursion.src/retrieval/hybrid.py — RRF in 20 readable lines (k=60, ranks
only).src/retrieval/freshness.py — as-of semantics in SQL vs the Python
mirror; boost only in range mode.alembic/versions/0002_access_matches_function.py — RBAC as a SQL
function: the strongest artifact in the repo.src/agents/citation_validator.py — claim-level verification that
fails closed on judge errors.src/security/prompt_injection.py — 10 patterns, regex
short-circuit before any LLM call.tests/conftest.py + tests/fakes.py — the event-loop fix and the
hermetic FakeRedis; how the suite stays deterministic.evals/run.py — the six-baseline harness and the honest scorer
(safe refusal ≠ failure).Offer this order when someone says “can you show me the code?”