feat(agents): role-keyed dispatch + default rename (boss→code-lead, foreman→architect) #686
No reviewers
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.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!686
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/670"
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?
Role-keyed dispatch refactor + default rename per WIZ-prereq-A. Every hardcoded
type === "X"site that drives dispatch now routes throughresolveAgentByRole(role)/typeForRole(role); default type names rename tocode-lead(was boss) andarchitect(was foreman).resolveAgentByRole,typeForRole,roleForTypein webhook-config (host-mode-safe).post-ci.ts:332,slash-commands.ts:87,deps.ts:155-186,pipeline.ts:60+74+79+92+289-295,board.ts:106,completion-proof.ts:277+284,db.ts:602+943+977,janitor.ts:289,main.ts:3358.boss-*/foreman-*rows in place; idempotent.\bboss\b|\bforeman\bin /skills);docs/foreman.md→docs/architect.md./foreman/*chat URLs preserved for stability.["foreman", ...]→["architect", ...]); cache invalidations re-checked.Operator migration (one-shot, after deploy)
code-lead+architect; mint PATs.FORGEJO_TOKEN_CODE_LEAD+FORGEJO_TOKEN_ARCHITECTenv vars (or seed via/secrets).~/.config/claude-hooks/agent-env/{boss,foreman}→.../{code-lead,architect}; same fortokens/.Test plan
bun x turbo run typecheck— clean.bun test(server) — 2976 pass / 0 fail. New unit coverage forresolveAgentByRole,typeForRole,roleForType.suggestAssigneereturns{ role: "code-lead" }for architecture-touching tickets.git grep -E '\bboss\b|\bforeman\b' skills/returns zero hits.Closes #670
Add `code-lead` to the role enum, introduce role-keyed resolver helpers, and route every hardcoded `type === "X"` dispatch site through them. Apply the default rename: `boss` → `code-lead` and `foreman` → `architect` (with matching git_author + container path updates). Refactored sites (per spec §Architecture): - post-ci.ts MERGE_AGENT_TYPE → MERGE_ROLE = "code-lead" - slash-commands.ts breakdown dispatch → resolveAgentByRole("code-lead") - deps.ts suggestAssignee returns { role }; propagator resolves at leaf - pipeline.ts stage rollup keyed by role (with baked-default fallback) - board.ts AGENT_ROLE_RULES + per-type override for reviewer-security - completion-proof.ts COMPLETION_PROOF_RULES_BY_ROLE - db.ts host-mode flag declared by caller via is_host_mode - janitor.ts + main.ts design-reviewer resolution via typeForRole - agentRoleSchema + AGENT_ROLES extended with code-lead New helpers in webhook-config.ts: - resolveAgentByRole(role) — host-mode-safe role-to-instance resolver - typeForRole(role) — first registered type carrying the role - roleForType(name) — read declared role for a known type Migration (one-shot, idempotent): migrateForLegacyTypeRenames() promotes existing `boss-*` agent rows to `code-lead-*` and `foreman-*` to `architect-*` on first boot post-#670 — runs before ensureDefaultForTypes so a fleet doesn't end up with both old + new instances. Skills + docs: every prose mention of "boss" / "foreman" rewritten; docs/foreman.md renamed to docs/architect.md. Skills now have zero \bboss\b|\bforeman\b matches. /foreman/* chat URLs preserved for stability. Web app: display strings + TanStack queryKeys (`["foreman", ...]` → `["architect", ...]`) updated; cache invalidations re-checked. Tests: 2976 pass / 0 fail. New unit coverage for resolveAgentByRole, typeForRole, roleForType. The deps.ts heuristic tests now assert against { role } shape per AC. Operator migration steps (one-shot, after deploy): 1. Create Forgejo users `code-lead` and `architect`; mint PATs. 2. Set env vars FORGEJO_TOKEN_CODE_LEAD + FORGEJO_TOKEN_ARCHITECT (or seed via /secrets). 3. Move ~/.config/claude-hooks/agent-env/{boss,foreman} → .../{code-lead,architect}; same for tokens/. 4. Restart the service. The DB migration renames in-place; old PATs can be deleted after verification. Closes #670 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>Role-keyed dispatch + rename correct end-to-end. DB migration idempotent, host-mode safety rail preserved, B10 dual-path fallback handles no-config fixtures,
dispatchMergedispatches viaagent.typenot the old literal. CI green.98112e1e2f47a846b17d