refactor(agents): rename architect agent type → foreman #218
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!218
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "boss/217"
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?
Summary
architect→foremanso the name fits the labor-hierarchy alongsideboss/dev/reviewer/designer/design-reviewer. Capabilities, SDK options, and security rails (canUseTool denies ongit push origin main/master+mcp__forgejo__merge_pull_request) are unchanged./foreman/*; legacy/architect/*routes kept as deprecated aliases (sunset in a follow-up ticket after one release).agents.type = architect→foreman, rewritearchitect-*instance names, promote anyarchitect:<repo>:<issue>keys insessions.json, migratearchitect_sessions→foreman_sessionsinside the DB, movearchitect.db→foreman.dbon disk, and drop the orphanagent-defaultrow.Code
config/agents.json—types.architect→types.foreman(forgejo user, git identity, token file, branch prefix, bind-dir all updated).apps/server/src/architect.{ts,test.ts}→foreman.{ts,test.ts}; everyArchitect*identifier renamedForeman*; SQLite tablearchitect_sessions→foreman_sessions.HOST_MODE_TYPES,SINGLETON_TYPES,NON_DISPATCHABLE_TYPESall flipped.db.ts::migrateArchitectToForeman+dropOrphanAgentDefault;sessions.ts::migrateArchitectSessionKeys;foreman.ts::migrateLegacyDbFile+architect_sessions→foreman_sessionstable migration inensureSchema.main.tsregisters/foreman/*as the primary chat surface and keeps/architect/*as aliases pointing at the same handlers.packages/shared—Architect*types renamedForeman*.apps/web/src/lib/architect.{ts,test.ts}→foreman.{ts,test.ts}; every call site and query key flipped to/foreman/*; planner "worker not registered" banner, role chip color, SSE hook all wired to the new name.design/tokens.json+styles/tokens.css— new--color-role-foremantoken (reuses--ch-color-infohex — not a visual rebrand).vite.config.tsproxy table:/foremanprimary +/architectalias so old dev bundles still work against the new server.CLAUDE.md,README.md,scripts/smoke-creds.sh— docs updated. Historical milestone spec file name kept as-is.Test plan
bun x turbo run typecheck— 3 packages clean.bun x turbo run qa— 799 server tests + 187 web tests, 0 failures.bun x turbo run build— SPA bundle produces cleanly.bun x biome check .— 0 lint/format errors./foreman/chat+ GET/foreman/sessions+ GET/foreman/stream/:task_idend-to-end with a single test turn that delegates a/breakdownto the boss pool.architect-default→foreman-defaultmigration runs cleanly on the existing deployment (log line[agents] migrated N architect row(s) → foreman (#217))./architect/*deprecated aliases still respond until the follow-up ticket cuts them over.Out of scope (per AC)
/architect/*route aliases — follow-up ticket after one release./app/plannerURL — the page name stays.Closes #217
Review: APPROVED ✅
CI green (run #1857, 3m56s). All acceptance criteria from issue #217 verified.
Migration correctness
db.ts::migrateArchitectToForeman— thesubstr(name, length('architect-') + 1)strip is arithmetically correct; idempotent guard (count check) fires before any mutation. The pre-ensureDefaultForTypesplacement inloadWebhookConfigis critical and correct — renaming the existingarchitect-defaultrow beforeensureDefaultForTypesruns prevents a duplicateforeman-defaultrow from being seeded on upgrade.foreman.ts::ensureSchema—INSERT OR IGNORE INTO foreman_sessions … SELECT … FROM architect_sessions; DROP TABLE architect_sessionsis atomic under SQLite's implicit transaction;INSERT OR IGNOREsafely handles any UUID collisions. After the first bootarchitect_sessionsis gone and the guard (SQLite master scan) is a fast no-op. ✓foreman.ts::migrateLegacyDbFile— best-effortrenameSync(architect.db → foreman.db); a filesystem failure falls through to creating an emptyforeman.db. Session transcripts are a best-effort cache so silent loss on edge-case failure is acceptable and documented. ✓sessions.ts::migrateArchitectSessionKeys— correctly wired inmain.tsline 2119 behind a fire-and-forget.catch; existingforeman:keys are preserved on collision (map[renamed] === undefinedguard). ✓Security rails preserved
buildForemanSdkOptionsinforeman.tsstill carries both foreman-specificcanUseTooldenies:\bgit\s+push\b+\b(main|master|origin\s+main|origin\s+master)\b→ denymcp__forgejo__merge_pull_request→ denyBaseline destructive guards (
--force,--hard,rm -rf /,sudo) and host-secret path checks are also present. ✓Route aliases
All 8
/architect/*deprecated endpoints (chat, sessions, sessions/:id DELETE/GET, stream/:task_id, config, files, files/content, specs/:name, breakdown-preview, create-issues) are registered inmain.tspointing to the same handlers as/foreman/*. ✓Dispatch gates
HOST_MODE_TYPES = ["foreman"],SINGLETON_TYPES = ["foreman"],NON_DISPATCHABLE_TYPES = new Set(["foreman"])all updated.resolveAgentByUserandresolveAgentByTypeskip host-mode types via thecontainer?.enabled === falseguard. ✓Design tokens
--color-role-foremanadded todesign/tokens.jsonandtokens.css; reuses the--ch-color-infohex value (not a visual rebrand). No raw hex escapes into downstream components. ✓