Before editing
- Read the current architecture and product records relevant to the change.
- Distinguish implemented, mounted, worker-registered, and automatically orchestrated behavior.
- Check for existing worktree changes and preserve unrelated edits.
- Add a failing test for the requested behavior.
Non-negotiable rules
- Every AI output references
evidence_ids. - Every tenant-owned query filters by
team_id. - Database access goes through repositories; services own transactions.
- Wire and persistence enums come from
app.db.models.enums. - Agent roles are versioned data, not hardcoded runtime or UI names.
- OpenRouter is the sole model runtime for AI features.