Architect: remove host-mode infrastructure and local-FS file paths #1133

Closed
opened 2026-05-13 20:01:09 +00:00 by claude-desktop · 1 comment
Collaborator

As the operator, I want all host-mode escape hatches and local-filesystem file-operation paths deleted so the codebase has no non-containerized code path and no surface that touches process.cwd() from the architect stack.

Depends on the chat relay being live and confirmed working in production.

Spec: specs/architect-dockerize.md

Acceptance criteria

Remove HOST_MODE_TYPES / container.enabled: false

  • HOST_MODE_TYPES set is deleted from webhook-config.ts.
  • container.enabled: false in any agent type config now fails loadWebhookConfig at boot with a clear error message (the escape hatch is gone entirely, not just unused).
  • hostModeConfigDir() helper deleted from agent-runner.ts; all call sites removed.

Remove local-FS file operation paths

  • architectFilesRoot() deleted.
  • resolveAllowlistedFile() deleted.
  • FILE_ALLOWLIST_DIRS and FILE_ALLOWLIST_EXACT constants deleted.
  • The isLocal / repoParam === selfRepo branch is deleted from:
    • handleArchitectFilesList
    • handleArchitectFileContent
    • handleArchitectSpecSave
  • Every one of those handlers now unconditionally calls createForgeAdapterForRepo with the architectToken.
  • node:fs/promises imports (readdir, readFile, stat, writeFile, mkdir) removed from http/handlers/architect.ts — no filesystem calls remain.

Remove getSelfRepo

  • getSelfRepo() and resetSelfRepoCache() deleted from domain/agent/architect.ts.
  • GET /architect/config derives self_repo from ctx.repos[0] or the CLAUDE_HOOKS_SELF_REPO env var (no git remote get-url subprocess).
  • The execSync("git remote get-url origin", ...) call is gone.

Docs

  • docs/architect.md "Host-mode architect" heading updated to reflect containerized model; remove all references to container.enabled: false and cwd: process.cwd().

Tests

  • handleArchitectFilesList unit test: no existsSync/readdir call; mock forge adapter is called instead.
  • handleArchitectSpecSave unit test: calls forge.writeFile, not writeFile from node:fs/promises.
  • handleArchitectFileContent unit test: calls forge.readFile, not readFile from node:fs/promises.
  • Tests for resolveAllowlistedFile and architectFilesRoot are deleted (functions gone).
  • getSelfRepo / resetSelfRepoCache tests deleted.
  • just qa passes.

Out of scope

  • Changes to the workspace UI or spec editor UX — file operations surface identically to the existing remote-repo path.
  • Migrating session transcripts or SQLite schema — architect.db is unaffected.

References

  • Spec: specs/architect-dockerize.md — "File operations", "Self-repo detection", "Remove host-mode infrastructure" sections
  • apps/server/src/domain/agent/architect.tsarchitectFilesRoot, resolveAllowlistedFile, getSelfRepo
  • apps/server/src/http/handlers/architect.tshandleArchitectFilesList, handleArchitectFileContent, handleArchitectSpecSave
  • apps/server/src/shared/config/webhook-config.tsHOST_MODE_TYPES
  • docs/architect.md
As the operator, I want all host-mode escape hatches and local-filesystem file-operation paths deleted so the codebase has no non-containerized code path and no surface that touches `process.cwd()` from the architect stack. Depends on the chat relay being live and confirmed working in production. Spec: `specs/architect-dockerize.md` ### Acceptance criteria #### Remove HOST_MODE_TYPES / container.enabled: false - [ ] `HOST_MODE_TYPES` set is deleted from `webhook-config.ts`. - [ ] `container.enabled: false` in any agent type config now fails `loadWebhookConfig` at boot with a clear error message (the escape hatch is gone entirely, not just unused). - [ ] `hostModeConfigDir()` helper deleted from `agent-runner.ts`; all call sites removed. #### Remove local-FS file operation paths - [ ] `architectFilesRoot()` deleted. - [ ] `resolveAllowlistedFile()` deleted. - [ ] `FILE_ALLOWLIST_DIRS` and `FILE_ALLOWLIST_EXACT` constants deleted. - [ ] The `isLocal` / `repoParam === selfRepo` branch is deleted from: - `handleArchitectFilesList` - `handleArchitectFileContent` - `handleArchitectSpecSave` - [ ] Every one of those handlers now unconditionally calls `createForgeAdapterForRepo` with the `architectToken`. - [ ] `node:fs/promises` imports (`readdir`, `readFile`, `stat`, `writeFile`, `mkdir`) removed from `http/handlers/architect.ts` — no filesystem calls remain. #### Remove getSelfRepo - [ ] `getSelfRepo()` and `resetSelfRepoCache()` deleted from `domain/agent/architect.ts`. - [ ] `GET /architect/config` derives `self_repo` from `ctx.repos[0]` or the `CLAUDE_HOOKS_SELF_REPO` env var (no `git remote get-url` subprocess). - [ ] The `execSync("git remote get-url origin", ...)` call is gone. #### Docs - [ ] `docs/architect.md` "Host-mode architect" heading updated to reflect containerized model; remove all references to `container.enabled: false` and `cwd: process.cwd()`. #### Tests - [ ] `handleArchitectFilesList` unit test: no `existsSync`/`readdir` call; mock forge adapter is called instead. - [ ] `handleArchitectSpecSave` unit test: calls `forge.writeFile`, not `writeFile` from `node:fs/promises`. - [ ] `handleArchitectFileContent` unit test: calls `forge.readFile`, not `readFile` from `node:fs/promises`. - [ ] Tests for `resolveAllowlistedFile` and `architectFilesRoot` are deleted (functions gone). - [ ] `getSelfRepo` / `resetSelfRepoCache` tests deleted. - [ ] `just qa` passes. ### Out of scope - Changes to the workspace UI or spec editor UX — file operations surface identically to the existing remote-repo path. - Migrating session transcripts or SQLite schema — architect.db is unaffected. ### References - Spec: `specs/architect-dockerize.md` — "File operations", "Self-repo detection", "Remove host-mode infrastructure" sections - `apps/server/src/domain/agent/architect.ts` — `architectFilesRoot`, `resolveAllowlistedFile`, `getSelfRepo` - `apps/server/src/http/handlers/architect.ts` — `handleArchitectFilesList`, `handleArchitectFileContent`, `handleArchitectSpecSave` - `apps/server/src/shared/config/webhook-config.ts` — `HOST_MODE_TYPES` - `docs/architect.md`
Collaborator

🦵 @charles kicked the queue — re-running implement on @code-lead.

🦵 @charles kicked the queue — re-running implement on @code-lead.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1133
No description provided.