db: add is_reviewer flag, remove role from agent_type #1225

Closed
opened 2026-05-16 21:07:49 +00:00 by claude-desktop · 0 comments
Collaborator

As an operator, I want agent types to declare is_reviewer explicitly so reviewer-pool membership and completion-proof selection work without a hardcoded role enum, and so I can set this flag from both the onboarding wizard and the agent settings UI.

Acceptance criteria

Migration

  • Add is_reviewer INTEGER NOT NULL DEFAULT 0 to agent_type
  • Data-fix: set is_reviewer = 1 for rows where role IN ('review', 'design-review')
  • Drop role column (and its CHECK constraint)

Drizzle schema (schema/agent-type.ts)

  • role field removed, is_reviewer: integer added
  • agent-type-config.ts resolved type updated accordingly

API

  • config-agent-types.ts — reject role in create/update (400); accept is_reviewer: boolean
  • onboarding-apply.ts — writes is_reviewer instead of role
  • webhook-config-parser.ts — reads is_reviewer, not role

Routing section UI (features/agents/sections/routing-section.tsx)

  • Role <select> removed
  • is_reviewer <Switch> (or checkbox) added with label "Reviewer" and caption "This type reviews PRs — skips post-CI re-dispatch and uses PR-submitted completion proof"
  • Wired to patch({ is_reviewer: value })

Roster assistant proposal (packages/shared/src/roster-proposal.ts)

  • role field (prose description) renamed to description — it is a one-sentence purpose statement, not the technical role enum
  • is_reviewer: boolean field added to the proposal shape
  • All call sites updated (proposal-diff.ts, proposal-preview.tsx, proposed-agent-card.tsx, proposal-accept.ts)

Proposed agent card UI (features/agents/roster/proposed-agent-card.tsx)

  • role input renamed to description (label + testid updated)
  • is_reviewer toggle added below description field

Tests

  • Migration test: is_reviewer present, role absent
  • Onboarding test: is_reviewer set correctly per category
  • routing-section test: is_reviewer switch renders, toggling calls patch
  • Roster proposal tests updated for renamed description field + new is_reviewer field

Out of scope

  • AgentRole TS type removal (next issue)
  • Routing table cleanup (separate issue)

References

  • migrate.ts:533 — role CHECK constraint to remove
  • routing-section.tsx:94 — role dropdown to replace
  • proposed-agent-card.tsx:140 — prose role field to rename
  • roster-proposal.ts:124 — role field to rename + is_reviewer to add
  • Design: penpot_mcp + is_reviewer replace role for all derivations
As an operator, I want agent types to declare `is_reviewer` explicitly so reviewer-pool membership and completion-proof selection work without a hardcoded role enum, and so I can set this flag from both the onboarding wizard and the agent settings UI. ## Acceptance criteria ### Migration - [ ] Add `is_reviewer INTEGER NOT NULL DEFAULT 0` to `agent_type` - [ ] Data-fix: set `is_reviewer = 1` for rows where `role IN ('review', 'design-review')` - [ ] Drop `role` column (and its CHECK constraint) ### Drizzle schema (`schema/agent-type.ts`) - [ ] `role` field removed, `is_reviewer: integer` added - [ ] `agent-type-config.ts` resolved type updated accordingly ### API - [ ] `config-agent-types.ts` — reject `role` in create/update (400); accept `is_reviewer: boolean` - [ ] `onboarding-apply.ts` — writes `is_reviewer` instead of `role` - [ ] `webhook-config-parser.ts` — reads `is_reviewer`, not `role` ### Routing section UI (`features/agents/sections/routing-section.tsx`) - [ ] Role `<select>` removed - [ ] `is_reviewer` `<Switch>` (or checkbox) added with label "Reviewer" and caption "This type reviews PRs — skips post-CI re-dispatch and uses PR-submitted completion proof" - [ ] Wired to `patch({ is_reviewer: value })` ### Roster assistant proposal (`packages/shared/src/roster-proposal.ts`) - [ ] `role` field (prose description) renamed to `description` — it is a one-sentence purpose statement, not the technical role enum - [ ] `is_reviewer: boolean` field added to the proposal shape - [ ] All call sites updated (`proposal-diff.ts`, `proposal-preview.tsx`, `proposed-agent-card.tsx`, `proposal-accept.ts`) ### Proposed agent card UI (`features/agents/roster/proposed-agent-card.tsx`) - [ ] `role` input renamed to `description` (label + testid updated) - [ ] `is_reviewer` toggle added below description field ### Tests - [ ] Migration test: `is_reviewer` present, `role` absent - [ ] Onboarding test: `is_reviewer` set correctly per category - [ ] `routing-section` test: `is_reviewer` switch renders, toggling calls patch - [ ] Roster proposal tests updated for renamed `description` field + new `is_reviewer` field ## Out of scope - AgentRole TS type removal (next issue) - Routing table cleanup (separate issue) ## References - `migrate.ts:533` — role CHECK constraint to remove - `routing-section.tsx:94` — role dropdown to replace - `proposed-agent-card.tsx:140` — prose role field to rename - `roster-proposal.ts:124` — role field to rename + is_reviewer to add - Design: `penpot_mcp` + `is_reviewer` replace role for all derivations
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/agent-hooks#1225
No description provided.