Conventions¶
These rules are non-negotiable. They come from
CLAUDE.md and
spec_v3.md ยง1.3 Key Design Principles.
Design Principles¶
- Config over code. Model routing, task types, state transitions,
prompt templates, and preferences live as YAML/JSON under
config/andschemas/. Never hardcode these in application logic. - Safety first, dial back later. Agents start with minimal autonomy. Email is draft-only. Code goes to feature branches only. Constraints relax explicitly via config, never implicitly.
- Structured logging on every model call. Every LLM invocation logs
task_type,model,latency,tokens,cost, and the output (seedonna.logging.invocation_logger). - Internal API over MCP for orchestrator calls. The orchestrator calls integrations via direct Python modules. MCP is only for LLM-facing dynamic tool discovery.
- Model abstraction. All LLM calls go through
router.complete(prompt, task_type, user_id)โ seedonna.models.router. Never call a provider directly. - Tool validation layer. Models propose tool calls; the orchestrator validates and executes. Models never call tools directly.
Coding Conventions¶
- Async everywhere. Use
async def/awaitfor all I/O. - Type hints on every function signature.
mypy --strictis enforced in CI. - Structured logging via
structlog. Never useprint(). - SQLite access via
aiosqlite. Single connection, WAL mode. - State transitions go through the state machine. Loaded from
config/task_states.yaml. - Schema changes require an Alembic migration. Never modify tables manually.
How to Update Docs¶
- Narrative pages (
architecture/,domain/,workflows/,operations/) are hand-written markdown. - API Reference, Config, and
Schemas pages are auto-generated from source by
scripts/gen_ref_pages.pyโ do not edit the generated pages. - Keep docstrings in Google style; mkdocstrings renders them.
- When you add a new module under
src/donna/, it appears in the reference automatically on the nextproperdocs build. - For any design decision, cross-reference the relevant section of
spec_v3.md.