WIZ-prereq-A Role-keyed dispatch refactor + default type rename #670
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#671 WIZ-prereq-B POST /agents/types/{old}/rename — transactional type rename
charles/claude-hooks
#672 WIZ-1 Onboarding state table + /onboarding/should-redirect trigger
charles/claude-hooks
Reference
charles/claude-hooks#670
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a platform engineer, I want every hardcoded
type === "X"check that drives dispatch behaviour replaced with a role-keyed equivalent, AND the default agent type names changed toarchitect(was foreman) +code-lead(was boss), so that future renames don't break routing and the post-login wizard never has to ask the operator to rename anything.Acceptance criteria
Role enum
apps/server/src/shared/config/agents-config-schema.ts::agentRoleSchemabecomesz.enum(["host", "code-lead", "code", "review", "design", "design-review"]). Existing rows missing aroledefault to a sensible value via a one-time migration (boss → code-lead, foreman → host).agents.jsondeclares itsrole. Validation fails on missing.Refactor sites
domain/workflow/post-ci.ts:332—MERGE_AGENT_TYPE = "boss"→MERGE_ROLE = "code-lead". Resolve viaresolveAgentByRole("code-lead").domain/workflow/slash-commands.ts:87—resolveAgentByRole("code-lead")for breakdown dispatch.domain/workflow/deps.ts:155-186— everyreturn { type: "..." }becomesreturn { role: "..." }. Caller resolves role → instance viawc.typeForRole(role)at the leaf.domain/views/pipeline.ts:60, 74, 79, 92, 289-295— stage mapping keyed by role.domain/views/board.ts:106— dispatch label matrix keyed by role.domain/dispatch/completion-proof.ts:277, 284— proof rules keyed by role.infrastructure/database/db.ts:602, 943, 977—role === "host"→ host-mode flag.background/janitor.ts:289— resolve design-reviewer agent via role, not literal name.main.ts:3358— same.apps/web/src/**/*.{ts,tsx}— display strings + queryKeys updated (["foreman", ...]→["architect", ...]). Cache invalidations re-checked.Default rename
config/agents.json— top-level keysforeman→architect,boss→code-lead.git_author,git_name,git_emailupdated for both.config/mcp-builtin.json— top-level keys updated./skills/*.mdbody that names "boss" or "foreman" in prose is rewritten.git grep -E '\bboss\b|\bforeman\b' /skillsreturns zero hits after the rename.~/.claude/CLAUDE.md,docs/agents-architecture.md,docs/foreman.md(renamed todocs/architect.md),docs/breakdown.md, every doc page that names agents — rewritten.architect+code-leadForgejo users, mint PATs, addFORGEJO_TOKEN_ARCHITECT+FORGEJO_TOKEN_CODE_LEADenv vars (or seed via/secrets).Tests
resolveAgentByRole("code-lead")returns the right agent.routeForLabelsreturns{ role: "code-lead" }for an architecture-touching ticket.type === "boss"callsites.Out of scope
References
specs/first-login-wizard.md§Architecture and §Story WIZ-prereq-Aapps/server/src/shared/config/agents-config-schema.ts🦵 @charles kicked the queue — re-running implement on @boss.
🦵 @charles kicked the queue — re-running implement on @boss.