Phase 2: Extract the State Store Service #113
Notifications
Due Date
No due date set.
Blocks
Depends on
#114 Phase 3: Extract the UI Service
sam/archie
#112 Phase 1: Extract the Gateway Service
sam/archie
Reference: sam/archie#113
Reference in new issue
Block a user
Second extraction in the resolved order. Expose internal/store as its own
service behind its narrow contracts over gRPC. This generalises the
pattern already in production: internal/storerpc proxies
store.WorkflowStore to the archie-agent container over NATS request/reply
today (see resolved open question #4).
Per question #4's resolution: ONE State Store service owns the existing
single SQLite file (archie.db) behind narrow typed contracts (TaskStore,
CaptureStore, MappingStore, BindingStore, WorkflowStore, BindingDispatcher,
BindingTaskCreator from internal/store/interface.go). No physical
database-per-service split -- one store means no distributed-transactions
problem, and per the team-topology rule of thumb a solo maintainer gets no
autonomy benefit from physical isolation. The Gateway's already-separate
session SQLite is unaffected and stays Gateway-owned.
Migration path (from the research doc, in order of blast radius):
Store contract surface (already true in code; authority decision only).
serving the full narrow contract set, and move it from NATS
request/reply to gRPC (per the PRD, gRPC is the sync transport).
internal/domain/workflow, and the intake/binding paths onto the
contract, starting with low-touch reads (CaptureStore, MappingStore,
BindingStore), then WorkflowStore, then the TaskStore lifecycle
surface.
same archie.db file); delete the in-process imports once every
consumer speaks the contract.
Depends on Phase 1 (Gateway extraction) per the resolved extraction
order -- Gateway proves the process-split + gRPC playbook first.
Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#4
and #1 (Phase 2 section).
Acceptance criteria
MappingStore, BindingStore, WorkflowStore, BindingDispatcher, and
BindingTaskCreator over gRPC, all backed by the single existing
archie.db SQLite file (no physical file split).
full narrow contract set, migrated from NATS request/reply to gRPC.
no longer import internal/store directly -- they call the State Store
contract.
bufconn-conformance-suite shape from Phase 0, with a same-commit flip
to mode = "remote" once archie-state-store is standing.
Gateway-owned.
multiple contracts (task/event/capture) still works correctly through
the new contract calls.
Close reason
All 8 children (.4.1-.4.8) verified against main and closed 2026-09-07: .4.1 ratification (docs/prds/state-store-contract.md), .4.8 domain type relocation (PR #754), .4.2 gRPC contract generalization (PR #770), .4.3 standalone archie-state-store binary (PR #771), .4.4 capture/mapping/binding consumer migration (PR #772), .4.5 workflow/intake/task-lifecycle migration (PR #773), .4.6 daemon/Gateway cutover (PR #774), .4.7 end-to-end verification + the remaining task-scoped-credential/streaming-capture/CI-artifact gaps found and fixed this session (commits f94e484, accb987, 4e1efd5, d687f05). Phase 2 acceptance criteria (single archie.db owner, narrow typed contracts, task check passing, dashboard reading across contracts) all hold.
Imported from beads
archie-core-8cda.4· GitHub #729 · type task · priority P2 · created 2026-09-05 · closed 2026-09-07