Phase 1: Extract the Gateway Service #112
Notifications
Due Date
No due date set.
Blocks
Depends on
Reference: sam/archie#112
Reference in new issue
Block a user
First real process extraction in the resolved extraction order (open
question #1). Stand up archie-gateway as its own binary serving
ChatContract over gRPC, using its existing isolated session SQLite
(internal/gateway/session_store_sqlite.go) and its existing store
adapters (the Gateway does not import internal/store today --
main.go:139, gateway/tasks.go:44 -- it consumes narrow contracts
StatusReader/TaskCreator/TaskLister/TaskController/AgentReader that
internal/app/archied adapts).
Migrate consumers onto ChatContract over gRPC:
ModelManager/PersonaRegistry in-process and calls ChatContract instead.
(chatTaskActorAdapter.ApplyChatTaskAction,
internal/app/archied/main.go:655) stops detouring through webui's
handleTaskAction HTTP handler (internal/webui/api_tasks.go:136,
mounted at server.go:294) and calls ChatContract directly.
Why the Gateway goes first (not the generic "leaf first" advice): it is
already store-decoupled and already owns isolated session data, making
it both the stickiest capability (everything routes through it) and the
one with a ready seam -- extracting it first also unblocks UI (the most
entangled consumer), which is the PRD's ultimate goal. This is also the
operations dry-run for the gRPC/discovery playbook.
Depends on Phase 0 (the ChatContract seam, local + gRPC adapters, and
conformance suite must exist and be usable before the network path
becomes production).
Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1
(Phase 1 section).
Acceptance criteria
(using the generated server/client from Phase 0's proto definition).
question #3's resolved mechanism (no dual-live window); consumers
flipped to mode = "remote" for ChatContract in that same commit.
the new binary; no other domain's data moves.
holds gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry
struct fields directly (closes verified coupling #2 from the PRD).
ChatContract directly; the webui HTTP detour
(chatTaskActorAdapter.ApplyChatTaskAction -> handleTaskAction) is
removed (closes verified coupling #1 from the PRD).
binary (deployments/ per this repo's existing profile conventions).
end-to-end smoke path (chat turn through the new gRPC hop) is
exercised.
Close reason
Atomic flip landed: ChatContract now served only by archie-gateway over gRPC; daemon has no in-process fallback. Telegram/email keep in-process routers (streaming callback can't cross the wire-safe contract). Verified end-to-end (both binaries booted, webui chat round-tripped through the gRPC hop). Commit 38cd0d5 on feat/gateway-service.
Imported from beads
archie-core-8cda.3· GitHub #730 · type task · priority P2 · created 2026-09-05 · closed 2026-09-05