Ratify State Store contract surface and transport design #1141
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#1141
Reference in new issue
Block a user
RATIFY State Store contract boundary & transport design. AUTHORITATIVE DOC: docs/prds/state-store-contract.md.
Notes
RATIFIED (rev. 2, docs/prds/state-store-contract.md). Resolves the 3 reviewer conditions: (1) ownership split — consumer-owned workflow.Store + workflow.Task/Status/Source in internal/domain/workflow (rules #2/#7), producer-owned daemon/webui store surfaces in internal/store; the Task/Status/Source + interface relocation is a Phase 2 prerequisite pulled from migration-decisions 84 (Task -> WorkflowExecution). (2) Agent gRPC handoff via STATE_STORE_URL/STATE_STORE_TOKEN injected like NATS_URL/NATS_TOKEN. (3) loopback+bearer-token transport security, sanitised error details. Plus: RecordDispatch drops *sql.Tx (required interface migration before .4.2), Close off-wire, 40 RPCs, presence-based [services.state].target default-local, migration order workflow.Store -> archie-state-store -> Capture -> Mapping -> Binding -> TaskStore. .4.2/.4.3 implement against the doc.
rev.2b: Second-pass review findings resolved. Documents migration-decisions 84 remains authoritative & open (NOT replaced by this PRD); fixed stale WorkflowStore reference in service-decomposition Q4 (now workflow.Store supersedes store.WorkflowStore); labeled internal/store as a TRANSITIONAL compatibility location (target internal/infrastructure/store); called out current-state outliers (workflow files still import internal/store, store.WorkflowStore in TaskContext, NATS storerpc still wired => acceptance criterion NOT yet met); and operationalized the agent gRPC handoff (who binds in-process listener, Docker-bridge host-gateway address selection via container/network.go host-gateway resolution, per-task deployment via containerEnv beside NATS_URL, per-incumbence bearer token lifecycle + gRPC-interceptor validation, fail-closed on non-loopback without TLS/token).
rev.2c: Third-pass review resolved. (1) Fixed stale generic migration wording in service-decomposition Q3 (store.WorkflowStore idiom + mode=inproc|remote enum) to match the ratified ownership split and presence-based [services.].target (the mode enum is explicitly marked dropped). (2) Replaced the contradictory listener-topology wording with a single explicit rule: one in-process listener — host-gateway bridge address + mandatory bearer token when agent containers consume it (the Phase 2 default), loopback-only for a daemon-local-only consumer; no dual-listener design. commits d18ea38 + this rev.
Close reason
Re-closed after bd github sync reverted status (2026-09-07). Ratified: docs/prds/state-store-contract.md exists, rev. 2c, referenced as authority throughout the codebase (AGENTS.md, staterpc package docs, bootstrap.go comments). No further evidence needed beyond the doc's existence and its use as the standing authority for .4.2-.4.7.
Imported from beads
archie-core-8cda.4.1· GitHub #763 · type task · priority P2 · created 2026-09-06 · closed 2026-09-07