Epic: model provider registry (docs/adr-model-routing.md). Server-only change —
no UI component library inventing; reuse components/ui/. Admin-only mutations.
Filter every DB query by workspace_id. One task per session; claim_task first.
---
# Epic objective
Deliver the workspace-scoped **model provider registry** and **role → alias routing** described in [docs/adr-model-routing.md](../../../docs/adr-model-routing.md): Drizzle schema, zod types in `packages/shared`, `resolveModel()`, tRPC CRUD + `testProvider`, Settings UI, and `agent_runs` model metadata on completion.
This epic is the first shipped piece of the automation-foundation plan and unblocks future orchestrator/worker work.
## In scope / out of scope
**In scope**
- Tables `model_providers`, `role_model_routes`.
- Pure resolver + unit tests.
- tRPC router (workspace admin).
- Settings pages: Providers, Role routing.
- Seed/default routes for nine L2 roles + `gate-copilot` + `chat-default`.