refactor(agents): rename architect agent type → foreman #217
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#217
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 an operator, I want the
architectagent type renamed toforemanacross config, code, database, Forgejo identity, and docs, so that the name matches the mental model I already have (the foreman runs the site, delegates work to boss/dev/reviewer, doesn't swing a hammer) and fits cleanly alongsideboss/dev/reviewer/designer/design-revieweras a labor-hierarchy.Acceptance criteria
Config + DB
config/agents.json— renametypes.architect→types.foreman. Updateforgejo_user+git_name+git_email+branch_prefix+token_file(rename the token file on disk too).default_system_promptupdated to reference "Foreman" instead of "Architect".HOST_MODE_TYPESallowlist inwebhook-config.tsupdated from["architect"]to["foreman"].NON_DISPATCHABLE_TYPESinwebhook-routing.tsupdated.db.ts::ensureDefaultForTypes(or a sibling migration helper) that runs on boot:UPDATE agents SET type='foreman' WHERE type='architect'; UPDATE agents SET name=REPLACE(name, 'architect-', 'foreman-') WHERE name LIKE 'architect-%'. Idempotent — skip if noarchitectrows remain.architect:…→foreman:…(sessions.ts— check<type>:<repo>:<issueOrPr>key prefix).Source code sweep
apps/server/src/architect.ts→apps/server/src/foreman.ts(git mv). All imports updated.architect*identifiers in code:buildArchitectSdkOptions,getArchitectWorker,registerArchitectWorker,resolveArchitectCapture,ArchitectSessionView,ArchitectSessionListEntry,ArchitectFileEntry, etc. — renamed to theForeman*prefix. Keep the SDK security rails (canUseTooldenies ongit push origin main/master+mcp__forgejo__merge_pull_request) — those rails must apply toforemanidentically./architect/*endpoints as deprecated aliases for 1 release, add matching/foreman/*endpoints. Both hit the same handlers. Delete the aliases in a follow-up ticket once the SPA has shipped with the new paths for a release.packages/shared/src/*.ts—Architect*types renamed toForeman*.apps/web/src/**—routes/planner.*.tsx,components/planner/**,lib/architect.ts,stores/planner-store.ts— rename identifiers + API call sites to/foreman/*. Keep the/app/plannerURL — the page name can stay, only the role underneath it changes.Forgejo identity
architectForgejo user or create a newforemanuser + rotate the token.architect), but cleaner long-term.token_filepath accordingly.Bind dir + credentials
~/.config/claude-hooks/agent-env/architect/→…/foreman/. Updatecontainer.credentials_host_dirinagents.json.container.enabled: false) — no container to recreate.Docs + skills + UI copy
CLAUDE.md—## Roles, "Host-mode architect" section, everyarchitectreference →foreman. Keep the "why host-mode" / "why singleton" sections verbatim (still true).MEMORY.md— anything that references the architect rename scope gets a note.skills/*— any slash-command prompt template that mentions "architect" updated.apps/web/src/components/planner/*— copy: "Foreman worker is not registered" banner, "foreman" chip label, role-color wired to a new--color-role-foremantoken.design/tokens.json— add--color-role-foreman(suggest reusing the architect color — not a visual rebrand, just a name change).Cleanup
agent-defaultrow (type"agent"— no matching entry inagents.json::types). Either via a one-off migration in the same boot step, or via a DELETE /agents/agent-default call from the dashboard after auth.Verification
bun run build+bun run qaclean.just agents-syncreports no changes (container reconcile is a no-op — foreman is host-mode)./breakdownto the boss pool.foreman-key.Out of scope
/architect/*endpoint aliases — follow-up ticket after one release./app/plannerURL — the page name is fine; the agent underneath is what changes.References
apps/server/src/architect.ts— core SDK setup + security rails.apps/server/src/webhook-config.ts::HOST_MODE_TYPES— host-mode allowlist (architect-only today).apps/server/src/webhook-routing.ts::NON_DISPATCHABLE_TYPES— webhook dispatch gate.apps/server/src/db.ts::ensureDefaultForTypes— singleton seeding logic; add the rename migration next to it.config/agents.json—types.architectblock.CLAUDE.md— "Host-mode architect (M18-4 / #165)" section, "Agent types vs. instances" block, modules table.apps/web/src/routes/planner.index.tsx— the "worker not registered" banner.