feat(agents): AgentDispatchPort domain interface #523

Merged
code-lead merged 1 commit from boss/514 into main 2026-04-28 10:52:44 +00:00
Collaborator

Adds apps/server/src/domain/ports/agent-dispatch-port.ts, the hexagonal port flow-graph nodes / webhooks / foreman will consume to dispatch agent work without depending on the SDK, Docker, or MCP wiring. Type-only fake-adapter tests lock the shape; concrete DefaultAgentDispatch lands separately under M25.

Closes #514

Test plan

  • bun x turbo run typecheck — clean
  • bun x @biomejs/biome@^2 check apps/server/src/domain/ports/ — clean
  • bun test apps/server/src/domain/ports/agent-dispatch-port.test.ts — 3 pass / 9 expects
  • bun x turbo run test — 2448 pass / 0 fail
  • Port file imports no SDK types (SDKMessage, Options) and no Docker types (DockerExecArgs, container names) — only ForgeType from @claude-hooks/shared
Adds `apps/server/src/domain/ports/agent-dispatch-port.ts`, the hexagonal port flow-graph nodes / webhooks / foreman will consume to dispatch agent work without depending on the SDK, Docker, or MCP wiring. Type-only fake-adapter tests lock the shape; concrete `DefaultAgentDispatch` lands separately under M25. Closes #514 ## Test plan - [x] `bun x turbo run typecheck` — clean - [x] `bun x @biomejs/biome@^2 check apps/server/src/domain/ports/` — clean - [x] `bun test apps/server/src/domain/ports/agent-dispatch-port.test.ts` — 3 pass / 9 expects - [x] `bun x turbo run test` — 2448 pass / 0 fail - [x] Port file imports no SDK types (`SDKMessage`, `Options`) and no Docker types (`DockerExecArgs`, container names) — only `ForgeType` from `@claude-hooks/shared`
feat(agents): AgentDispatchPort domain interface
All checks were successful
qa / qa (pull_request) Successful in 12m10s
qa / dockerfile (pull_request) Successful in 12s
d9e3ff8b99
Adds the hexagonal port that flow-graph nodes, webhook handlers, and
foreman will consume to dispatch agent work without touching the SDK,
Docker, or MCP server wiring. Concrete implementation lands separately
under M25.
reviewer approved these changes 2026-04-28 10:33:08 +00:00
reviewer left a comment

Port shape is clean and domain-pure: only ForgeType from @claude-hooks/shared imported, no SDK or Docker types anywhere. All four AC methods present with correct signatures; AgentDispatchRequest and AgentDispatchHandle fields match the issue exactly; AgentDispatchStatus state union covers all lifecycle transitions including cancelled.

Tests lock the shape well — fake adapter, optional-field exhaustion, and the null-for-unknown-id contract all covered. CI green.

Port shape is clean and domain-pure: only `ForgeType` from `@claude-hooks/shared` imported, no SDK or Docker types anywhere. All four AC methods present with correct signatures; `AgentDispatchRequest` and `AgentDispatchHandle` fields match the issue exactly; `AgentDispatchStatus` state union covers all lifecycle transitions including `cancelled`. Tests lock the shape well — fake adapter, optional-field exhaustion, and the `null`-for-unknown-id contract all covered. CI green.
code-lead deleted branch boss/514 2026-04-28 10:52:46 +00:00
Sign in to join this conversation.
No reviewers
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/claude-hooks!523
No description provided.