Phase 0: In-process contract seams (modular monolith, no process split) #111
Notifications
Due Date
No due date set.
Reference: sam/archie#111
Reference in new issue
Block a user
First phase of the resolved extraction order (open question #1). Still a
modular monolith -- no new process, nothing listening on a real port.
Introduces, in-process, the seams that make later extraction a swap of
transport rather than a rewrite, per open question #3's resolved
mechanism (multiplexed in-process is the migration default).
Scope:
Router/SessionStore/Turns/ModelManager/PersonaRegistry behind it, so
internal/webui depends on the contract type rather than holding
*gateway.Router, gateway.SessionStore, *gateway.Turns,
gateway.ModelManager, and *gateway.PersonaRegistry directly
(internal/webui/api_chat.go's current ChatService struct, lines 22-26).
(Resolve(service string) []Endpoint; Watch(service string) <-chan
Event), landed as a real internal package
(internal/servicediscovery/servicediscovery.go per the research doc's
citation) -- network-only; it never returns an in-process shim (see
question #3's resolution part 3).
MappingStore, BindingStore, WorkflowStore in
internal/store/interface.go) ratified as the State Store contract
surface -- no code change to the interfaces themselves, this is the
authority decision plus wiring them as wire-safe contracts.
streams only, no callbacks like Gateway's LLMStreamResponder, no
*sql.Tx, no leaked object identity), a local in-process adapter (real
production adapter, not a test fake), a generated gRPC client adapter
satisfying the same interface via a compile-time assertion (the
var _ store.WorkflowStore = (*Client)(nil)idiom, internal/storerpc/storerpc.go:136),and a per-contract conformance suite run against both adapters over
bufconn (the runSessionStoreSuite idiom,
internal/gateway/sessionstore_conformance_test.go:65).
mode = "inproc" | "remote" per service, defaulting to "inproc".
Depends on the contract-definition-mechanism issue (buf/proto toolchain)
since ChatContract's .proto definition and generated Go land here.
Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1
(Phase 0 section) and #3 (the six-part mechanism).
Acceptance criteria
Go landed at internal/contracts/gateway/v1/ via the proto toolchain
from the contract-mechanism issue.
no object identity leaks).
Router/SessionStore/Turns/ModelManager/PersonaRegistry in-process, with
zero serialization.
interface, with a compile-time
var _ ChatContract = (*Client)(nil)assertion.
the same behavioural assertions.
not on gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry
structs directly.
defaulting to "inproc"; no cmd/archie-gateway binary and nothing
listening on a real network port yet.
in internal/servicediscovery, even if only a stub/no-op implementation
backs it at this phase.
fully in-process).
Close reason
Gateway ChatContract, local and gRPC adapters, bufconn conformance, discovery boundary, inproc/remote composition, and webui migration implemented.
Imported from beads
archie-core-8cda.2· GitHub #722 · type task · priority P1 · created 2026-09-05 · closed 2026-09-05