From f4b8707ba9ebf5e83e2b6e7b1edb2b823f8eb8f8 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Thu, 24 Sep 2026 19:39:06 +1000 Subject: [PATCH] docs(store): drop residual SQLite references; fix lane lint findings --- cmd/archie-state-store/main.go | 11 ++--- cmd/archie-state-store/main_test.go | 4 +- cmd/archie-ui/architecture_test.go | 2 +- internal/app/archied/bootstrap.go | 2 +- .../archied/chat_store_composition_test.go | 3 +- .../archied/config_snapshot_channels_test.go | 3 +- internal/app/archied/config_snapshot_test.go | 3 +- internal/app/archied/main.go | 6 +-- internal/app/archied/main_test.go | 3 +- internal/app/archied/nats/endpoint.json | 2 +- .../$G/streams/ARCHIE_REACTIONS/msgs/1.blk | Bin 51 -> 153 bytes .../ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.inf | 1 + .../ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.sum | 1 + .../ARCHIE_REACTIONS/obs/QZFaSGZ6/o.dat | Bin 0 -> 18 bytes .../obs/archie-daemon/meta.inf | 2 +- .../obs/archie-daemon/meta.sum | 2 +- .../ARCHIE_REACTIONS/obs/jRzCdtm6/meta.inf | 1 + .../ARCHIE_REACTIONS/obs/jRzCdtm6/meta.sum | 1 + .../ARCHIE_REACTIONS/obs/jRzCdtm6/o.dat | Bin 0 -> 8 bytes .../ARCHIE_REACTIONS/obs/kmNsDMt5/meta.inf | 1 + .../ARCHIE_REACTIONS/obs/kmNsDMt5/meta.sum | 1 + .../ARCHIE_REACTIONS/obs/kmNsDMt5/o.dat | Bin 0 -> 8 bytes .../ARCHIE_REACTIONS/obs/nYF2oUak/meta.inf | 1 + .../ARCHIE_REACTIONS/obs/nYF2oUak/meta.sum | 1 + .../ARCHIE_REACTIONS/obs/nYF2oUak/o.dat | Bin 0 -> 18 bytes .../ARCHIE_REACTIONS/obs/s3Z87297/meta.inf | 2 +- .../ARCHIE_REACTIONS/obs/s3Z87297/meta.sum | 2 +- .../ARCHIE_REACTIONS/obs/sg9Gl4th/meta.inf | 2 +- .../ARCHIE_REACTIONS/obs/sg9Gl4th/meta.sum | 2 +- .../ARCHIE_TASKS/obs/archie-daemon/meta.inf | 2 +- .../ARCHIE_TASKS/obs/archie-daemon/meta.sum | 2 +- internal/app/archied/readiness_test.go | 3 +- internal/app/archied/routing_bindings_test.go | 3 +- internal/app/archied/sd_notify_test.go | 3 +- internal/app/archied/state_store.go | 2 +- .../app/archied/state_store_client_test.go | 4 +- .../app/archied/state_store_consumers_test.go | 3 +- .../app/archied/state_store_toolcalls_test.go | 2 +- internal/app/archied/step_vocabulary.go | 2 +- .../app/archied/task_action_adapter_test.go | 3 +- internal/app/archied/task_actions_test.go | 3 +- internal/daemon/daemon.go | 2 +- internal/daemon/dispatch_bindings_test.go | 8 +--- internal/domain/scheduling/cron.go | 41 +++++++++++------- .../domain/storecontract/storecontract.go | 15 +++---- .../domain/workflow/store_integration_test.go | 5 +-- internal/domain/workflow/task/task.go | 4 +- internal/events/events.go | 2 +- internal/gateway/compress_identity_test.go | 2 +- internal/gateway/task_tools.go | 8 ++-- internal/gateway/tasks.go | 4 +- internal/gateway/turn_ledger_test.go | 17 ++++++-- .../captureintake/receiver_test.go | 2 +- internal/infrastructure/postgres/store.go | 6 +-- internal/infrastructure/readiness/probes.go | 2 +- .../staterpc/capture_stream_test.go | 2 +- .../staterpc/conformance_test.go | 2 +- internal/infrastructure/staterpc/server.go | 2 +- .../staterpc/task_grants_test.go | 2 +- .../infrastructure/staterpc/values_test.go | 2 +- internal/taskstate/taskstate.go | 2 +- internal/webui/webui_test.go | 3 +- 62 files changed, 113 insertions(+), 111 deletions(-) create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.inf create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.sum create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/o.dat create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.inf create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.sum create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/o.dat create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.inf create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.sum create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/o.dat create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.inf create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.sum create mode 100644 internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/o.dat diff --git a/cmd/archie-state-store/main.go b/cmd/archie-state-store/main.go index c95b8f2c2..30cf1c573 100644 --- a/cmd/archie-state-store/main.go +++ b/cmd/archie-state-store/main.go @@ -1,11 +1,6 @@ -// Command archie-state-store hosts the State Store's gRPC contract and owns -// the single archie.db SQLite file. It is the .4.3 companion to the daemon's -// in-process State Store server: the same StateStoreService .4.2 serves, but -// extracted into its own process with its own store lifecycle. -// -// The gateway's session SQLite is owned by the separate archie-gateway process -// and is untouched here. See docs/prds/state-store-contract.md (rev. 2c) §5, -// §9 and §11. +// Command archie-state-store hosts the State Store's gRPC contract and is the +// only process that owns the PostgreSQL stores behind it. See +// docs/prds/state-store-contract.md §5, §9 and §11. package main import ( diff --git a/cmd/archie-state-store/main_test.go b/cmd/archie-state-store/main_test.go index 3f8d5d82b..b68397fb8 100644 --- a/cmd/archie-state-store/main_test.go +++ b/cmd/archie-state-store/main_test.go @@ -5,10 +5,10 @@ // // This is the .4.7 end-to-end verification for // docs/prds/state-store-contract.md (rev. 2c): it proves the process owns the -// single archie.db task SQLite, serves the combined task/event/capture +// task store, serves the combined task/event/capture // surface over one gRPC service, preserves error-sentinel fidelity across the // wire, honours a per-call deadline, survives a restart/recovery cycle, and -// is the sole owner of the SQLite file. See §5 (binary layout), §6 (handoff), +// is the sole owner of the store. See §5 (binary layout), §6 (handoff), // §7 (error semantics), §11 (remote adapter) and §12 step 7/8 (single owner). package main diff --git a/cmd/archie-ui/architecture_test.go b/cmd/archie-ui/architecture_test.go index e8ad16a66..30f55643e 100644 --- a/cmd/archie-ui/architecture_test.go +++ b/cmd/archie-ui/architecture_test.go @@ -1,6 +1,6 @@ // This file enforces the objective half of the UI Service deletion gate // (docs/prds/ui-service-boundary.md, "The deletion gate is objective"). The -// composition half -- no config.Holder, no concrete *store.Store, no Gateway +// composition half -- no config.Holder, no concrete task store, no Gateway // runtime type -- is pinned by internal/app/archieui's // TestComposeUIServerHoldsNoDaemonState. This pins the claim that test cannot // see: that the linked binary carries no daemon runtime at all. Go imports diff --git a/internal/app/archied/bootstrap.go b/internal/app/archied/bootstrap.go index 43df551da..4f174f4b9 100644 --- a/internal/app/archied/bootstrap.go +++ b/internal/app/archied/bootstrap.go @@ -475,7 +475,7 @@ func (b *boot) loadCatalog(ctx context.Context, cfgPath string) { b.log.Info("model catalog loaded", "providers", len(catalog.Providers), "models", len(b.catalogModels)) } -// setupObservability builds the event bus and dashboard server. Every event is logged to SQLite (stamped with its row id) and +// setupObservability builds the event bus and dashboard server. Every event is persisted (stamped with its row id) and // then fanned out to live dashboard connections. func (b *boot) setupObservability(ctx context.Context) { cfg, log := b.cfg, b.log diff --git a/internal/app/archied/chat_store_composition_test.go b/internal/app/archied/chat_store_composition_test.go index b4e96a929..610260383 100644 --- a/internal/app/archied/chat_store_composition_test.go +++ b/internal/app/archied/chat_store_composition_test.go @@ -5,10 +5,9 @@ import ( "path/filepath" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/gateway" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgtest" ) diff --git a/internal/app/archied/config_snapshot_channels_test.go b/internal/app/archied/config_snapshot_channels_test.go index cc85dd889..758a2b41d 100644 --- a/internal/app/archied/config_snapshot_channels_test.go +++ b/internal/app/archied/config_snapshot_channels_test.go @@ -5,9 +5,8 @@ import ( "log/slog" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/webui" ) diff --git a/internal/app/archied/config_snapshot_test.go b/internal/app/archied/config_snapshot_test.go index c2f9546f5..f08bf34d7 100644 --- a/internal/app/archied/config_snapshot_test.go +++ b/internal/app/archied/config_snapshot_test.go @@ -6,10 +6,9 @@ import ( "log/slog" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/infrastructure/configuration" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/webui" ) diff --git a/internal/app/archied/main.go b/internal/app/archied/main.go index 045dcffbe..fcaaa0129 100644 --- a/internal/app/archied/main.go +++ b/internal/app/archied/main.go @@ -138,7 +138,7 @@ func toolLimits(cfg config.Config) agentexec.ToolLimits { const taskListOverRead = 5 // chatTaskListerAdapter gives the gateway a read view of one identity's tasks. -// gateway deliberately does not import internal/store, so the projection +// gateway deliberately does not import the task store, so the projection // happens here, as it does for the writer and controller adapters below. type chatTaskListerAdapter struct { tasks func(context.Context, int) ([]workflow.Task, error) @@ -608,7 +608,7 @@ func (a chatTaskControllerAdapter) CancelChatTask(ctx context.Context, taskID in } // chatTaskLogReaderAdapter gives the gateway a read view of a task's -// persisted log history without importing internal/logging or internal/store +// persisted log history without importing internal/logging or the task store // into the gateway package. Each identity's reader is scoped to its own // tasks: the identity bound at construction is used for authorization, so a // model cannot read another identity's task logs by passing a different @@ -803,7 +803,7 @@ func subscribeSystemLogs(nc *natsio.Conn, taskLogs *logging.TaskRegistry, log *s // progress, outcome, parking) here because that worker's own *events.Bus is // in-process and invisible to the daemon; this is the other half of the // bridge, landing them on bus so persistAndBroadcastEvents -- the single -// choke point that inserts into the SQLite events table and fans out over +// choke point that inserts into the events table and fans out over // SSE -- treats them exactly like every other daemon-observed event. Mirrors // subscribeSystemLogs's demux-by-taskID shape. func subscribeAgentEvents(nc *natsio.Conn, bus *events.Bus, log *slog.Logger) (unsubscribe func(), err error) { diff --git a/internal/app/archied/main_test.go b/internal/app/archied/main_test.go index bc99a28a7..accc1ab7e 100644 --- a/internal/app/archied/main_test.go +++ b/internal/app/archied/main_test.go @@ -13,8 +13,6 @@ import ( "testing" "time" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/nats-io/nats-server/v2/server" natssrv "github.com/nats-io/nats-server/v2/test" natsio "github.com/nats-io/nats.go" @@ -29,6 +27,7 @@ import ( "github.com/samcharles93/archie-core/internal/forge" "github.com/samcharles93/archie-core/internal/forgerpc" "github.com/samcharles93/archie-core/internal/gateway" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/logging" "github.com/samcharles93/archie-core/internal/secret" "github.com/samcharles93/archie-core/internal/tools" diff --git a/internal/app/archied/nats/endpoint.json b/internal/app/archied/nats/endpoint.json index 34e1c7fcc..5ece4aae4 100644 --- a/internal/app/archied/nats/endpoint.json +++ b/internal/app/archied/nats/endpoint.json @@ -1 +1 @@ -{"url":"nats://127.0.0.1:42009","token":"PXDPQYX3SBCBW6MNZTUSB5LNDW"} \ No newline at end of file +{"url":"nats://127.0.0.1:40943","token":"KL5KSFZT4PI5KIHF3GUOYXUTOQ"} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/msgs/1.blk b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/msgs/1.blk index 422dca8c217b369b5614f87b7f508ce94a0bd6f5..479637b99739a3606aa08027d42f19f52f5a2778 100644 GIT binary patch literal 153 zcmXqJU|?VbVi3?Tc#`I)aYI6cA+abqBQsU6C^a#;Br`uxuOzj&q+)>;Yx}I9FT#w0 wN}0eK7#P~~cZum(;M5{ed|qO@O3WLO7G|iH_~k#}yW`gKE_-Xm_qm4O04T{Zh5!Hn delta 5 McmbQqXgt9f00i;@kpKVy diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.inf new file mode 100644 index 000000000..ab7e4762f --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.inf @@ -0,0 +1 @@ +{"Created":"0001-01-01T00:00:00Z","Name":"","name":"QZFaSGZ6","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":5000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.sum new file mode 100644 index 000000000..bb4f54738 --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/meta.sum @@ -0,0 +1 @@ +fb9d97471241c535 \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/o.dat b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/QZFaSGZ6/o.dat new file mode 100644 index 0000000000000000000000000000000000000000..b594d2ea741959241905aa99a5489c719465dba6 GIT binary patch literal 18 ZcmWe*VqjooWPGz{`D$K9##0lR7yu*O1c3km literal 0 HcmV?d00001 diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.inf index ddd6e649a..135b0f241 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.inf +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.inf @@ -1 +1 @@ -{"Created":"2026-09-24T04:46:09.06756232Z","Name":"archie-daemon","durable_name":"archie-daemon","name":"archie-daemon","deliver_policy":"all","ack_policy":"explicit","ack_wait":300000000000,"max_deliver":3,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":86400000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file +{"Created":"2026-09-24T09:38:53.493195549Z","Name":"archie-daemon","durable_name":"archie-daemon","name":"archie-daemon","deliver_policy":"all","ack_policy":"explicit","ack_wait":300000000000,"max_deliver":3,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":86400000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.sum index 7e55c58e9..7668ca660 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.sum +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/archie-daemon/meta.sum @@ -1 +1 @@ -d87c12a35c167265 \ No newline at end of file +989e2c19cd43eee8 \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.inf new file mode 100644 index 000000000..750d283dc --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.inf @@ -0,0 +1 @@ +{"Created":"2026-09-24T09:38:53.500447377Z","Name":"jRzCdtm6","name":"jRzCdtm6","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.sum new file mode 100644 index 000000000..2c2c94c55 --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/meta.sum @@ -0,0 +1 @@ +620c347e0e296f80 \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/o.dat b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/jRzCdtm6/o.dat new file mode 100644 index 0000000000000000000000000000000000000000..f291c5c9aee705825aeb37a04f10452de37894c4 GIT binary patch literal 8 NcmWe*Vgv#P1^@uq0384T literal 0 HcmV?d00001 diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.inf new file mode 100644 index 000000000..95325b28b --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.inf @@ -0,0 +1 @@ +{"Created":"2026-09-24T09:38:53.500003272Z","Name":"kmNsDMt5","name":"kmNsDMt5","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.sum new file mode 100644 index 000000000..918537729 --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/meta.sum @@ -0,0 +1 @@ +e571c54b14192a8c \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/o.dat b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/kmNsDMt5/o.dat new file mode 100644 index 0000000000000000000000000000000000000000..f291c5c9aee705825aeb37a04f10452de37894c4 GIT binary patch literal 8 NcmWe*Vgv#P1^@uq0384T literal 0 HcmV?d00001 diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.inf new file mode 100644 index 000000000..5fa815f45 --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.inf @@ -0,0 +1 @@ +{"Created":"0001-01-01T00:00:00Z","Name":"","name":"nYF2oUak","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":5000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.sum new file mode 100644 index 000000000..17ef7664d --- /dev/null +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/meta.sum @@ -0,0 +1 @@ +52d9f8cea485537a \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/o.dat b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/nYF2oUak/o.dat new file mode 100644 index 0000000000000000000000000000000000000000..b594d2ea741959241905aa99a5489c719465dba6 GIT binary patch literal 18 ZcmWe*VqjooWPGz{`D$K9##0lR7yu*O1c3km literal 0 HcmV?d00001 diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.inf index 3af67b620..f0394cd23 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.inf +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.inf @@ -1 +1 @@ -{"Created":"2026-09-24T04:46:09.078999729Z","Name":"s3Z87297","name":"s3Z87297","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file +{"Created":"0001-01-01T00:00:00Z","Name":"","name":"s3Z87297","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":5000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.sum index f8024e5e9..8b73fe0fb 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.sum +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/s3Z87297/meta.sum @@ -1 +1 @@ -8f8b6852faee5da4 \ No newline at end of file +218aa24a9029a5b8 \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.inf index 338606278..ac599128b 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.inf +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.inf @@ -1 +1 @@ -{"Created":"2026-09-24T04:46:09.079549283Z","Name":"sg9Gl4th","name":"sg9Gl4th","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file +{"Created":"0001-01-01T00:00:00Z","Name":"","name":"sg9Gl4th","deliver_policy":"all","ack_policy":"explicit","ack_wait":30000000000,"max_deliver":-1,"filter_subject":"archie.reaction.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":5000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.sum index ffa829155..0e91fdf5c 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.sum +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_REACTIONS/obs/sg9Gl4th/meta.sum @@ -1 +1 @@ -3c91a932fe817389 \ No newline at end of file +4719ba6cad8cfe3c \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.inf b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.inf index 602f55962..58e5a1544 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.inf +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.inf @@ -1 +1 @@ -{"Created":"2026-09-24T04:46:09.068004189Z","Name":"archie-daemon","durable_name":"archie-daemon","name":"archie-daemon","deliver_policy":"all","ack_policy":"explicit","ack_wait":300000000000,"max_deliver":3,"filter_subject":"archie.task.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":86400000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file +{"Created":"2026-09-24T09:38:53.492664758Z","Name":"archie-daemon","durable_name":"archie-daemon","name":"archie-daemon","deliver_policy":"all","ack_policy":"explicit","ack_wait":300000000000,"max_deliver":3,"filter_subject":"archie.task.\u003e","replay_policy":"instant","max_waiting":512,"max_ack_pending":1000,"inactive_threshold":86400000000000,"num_replicas":0,"metadata":{"_nats.req.level":"0"}} \ No newline at end of file diff --git a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.sum b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.sum index 60c5000ac..09a3db414 100644 --- a/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.sum +++ b/internal/app/archied/nats/jetstream/$G/streams/ARCHIE_TASKS/obs/archie-daemon/meta.sum @@ -1 +1 @@ -514bef62122c4381 \ No newline at end of file +424323b7dcce276c \ No newline at end of file diff --git a/internal/app/archied/readiness_test.go b/internal/app/archied/readiness_test.go index 638f1bb16..f31525926 100644 --- a/internal/app/archied/readiness_test.go +++ b/internal/app/archied/readiness_test.go @@ -5,10 +5,9 @@ import ( "path/filepath" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/gateway" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/webui" ) diff --git a/internal/app/archied/routing_bindings_test.go b/internal/app/archied/routing_bindings_test.go index 080cfc6a5..a264263b3 100644 --- a/internal/app/archied/routing_bindings_test.go +++ b/internal/app/archied/routing_bindings_test.go @@ -4,11 +4,10 @@ import ( "log/slog" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/domain/workflow" "github.com/samcharles93/archie-core/internal/domain/workintake" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" ) // TestBuildDaemonCarriesWorkflowRoutingBindings pins the composition hop in the diff --git a/internal/app/archied/sd_notify_test.go b/internal/app/archied/sd_notify_test.go index 1d44ea13e..bd2aedcf2 100644 --- a/internal/app/archied/sd_notify_test.go +++ b/internal/app/archied/sd_notify_test.go @@ -14,10 +14,9 @@ import ( "testing" "time" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/daemon" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" ) // notifyRecorder captures every record at every level. The other recording diff --git a/internal/app/archied/state_store.go b/internal/app/archied/state_store.go index cf6492a52..7e056d3fe 100644 --- a/internal/app/archied/state_store.go +++ b/internal/app/archied/state_store.go @@ -213,7 +213,7 @@ func (b *boot) openStateStore(ctx context.Context) error { } // stateStoreDeps assembles the store surfaces the StateStore service fronts. -// b.st is the narrow storecontract.TaskStore; the wide *store.Store also implements +// b.st is the narrow storecontract.TaskStore; the concrete store also implements // the capture/mapping/binding surfaces, so each is asserted here (the same // pattern the daemon's wireWebStoreSurfaces uses) and a store that lacks one // degrades that group rather than aborting boot. diff --git a/internal/app/archied/state_store_client_test.go b/internal/app/archied/state_store_client_test.go index 5fabfd7e4..50a0e87f0 100644 --- a/internal/app/archied/state_store_client_test.go +++ b/internal/app/archied/state_store_client_test.go @@ -68,7 +68,7 @@ func TestOpenStateStoreAdapterRequiresTarget(t *testing.T) { b.secrets = &secret.Registry{} // After .4.6 the daemon and gateway no longer own archie.db in-process, so // an empty [services.state].target is a composition error, not the old - // local *store.Store default (docs/prds/state-store-contract.md §12 step 7). + // local task-store default (docs/prds/state-store-contract.md §12 step 7). if err := b.openStateStoreAdapter(); err == nil { t.Fatal("empty services.state.target should error: the in-process store path is deleted") } @@ -98,7 +98,7 @@ func TestStateStoreSingleOwnerComposition(t *testing.T) { b := newBootstrap() b.secrets = &secret.Registry{} - // The daemon openStores path must not construct a local *store.Store. + // The daemon openStores path must not construct a local task store. // openStores only resolves secrets and the forge client, then opens chat // sessions; the task store surface comes from the remote adapter, so no // archie.db task file is touched. This asserts openStateStoreAdapter (the diff --git a/internal/app/archied/state_store_consumers_test.go b/internal/app/archied/state_store_consumers_test.go index a78e15d7c..ede6466fc 100644 --- a/internal/app/archied/state_store_consumers_test.go +++ b/internal/app/archied/state_store_consumers_test.go @@ -4,9 +4,8 @@ import ( "log/slog" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres" - "github.com/samcharles93/archie-core/internal/config" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres" "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" taskactionstore "github.com/samcharles93/archie-core/internal/infrastructure/taskactions" ) diff --git a/internal/app/archied/state_store_toolcalls_test.go b/internal/app/archied/state_store_toolcalls_test.go index 92a7048c6..6c29e49d6 100644 --- a/internal/app/archied/state_store_toolcalls_test.go +++ b/internal/app/archied/state_store_toolcalls_test.go @@ -124,7 +124,7 @@ func TestInsertEventLeavesOtherKindsUnprojected(t *testing.T) { } } -// failingToolCallWriter stands in for a broken PocketBase side, so the +// failingToolCallWriter stands in for a broken event-capture store, so the // never-returned-failure contract can be tested without sabotaging the real // store. type failingToolCallWriter struct{ err error } diff --git a/internal/app/archied/step_vocabulary.go b/internal/app/archied/step_vocabulary.go index 8815c15ce..68600f9ae 100644 --- a/internal/app/archied/step_vocabulary.go +++ b/internal/app/archied/step_vocabulary.go @@ -21,7 +21,7 @@ import ( // // It is a named function so that step_vocabulary_test.go can fail if a root // stops resolving the shipped stages, or hands a constructor a manager other -// than the one this returns; the roots themselves own a SQLite file and dial +// than the one this returns; the roots themselves open a database and dial // gRPC, so the test asserts their wiring by parsing their bodies. // // Agreement is within one build: the State Store and archie-agent are diff --git a/internal/app/archied/task_action_adapter_test.go b/internal/app/archied/task_action_adapter_test.go index fc7e66286..2daa8428c 100644 --- a/internal/app/archied/task_action_adapter_test.go +++ b/internal/app/archied/task_action_adapter_test.go @@ -7,13 +7,12 @@ import ( "strings" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/domain/storecontract" "github.com/samcharles93/archie-core/internal/domain/taskactions" "github.com/samcharles93/archie-core/internal/domain/workflow" "github.com/samcharles93/archie-core/internal/gateway" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/taskstate" ) diff --git a/internal/app/archied/task_actions_test.go b/internal/app/archied/task_actions_test.go index cbe1af4d2..4754d72fd 100644 --- a/internal/app/archied/task_actions_test.go +++ b/internal/app/archied/task_actions_test.go @@ -9,12 +9,11 @@ import ( "strconv" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/domain/storecontract" "github.com/samcharles93/archie-core/internal/domain/workflow" "github.com/samcharles93/archie-core/internal/gateway" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" "github.com/samcharles93/archie-core/internal/webui" ) diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index 7823f027b..568b5a7d3 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -835,7 +835,7 @@ func (d *Daemon) botUserForTask(task *workflowtask.Task) string { return d.Cfg.Get().BotUser } -// drainNATS processes tasks from NATS, falling back to SQLite ClaimNext for +// drainNATS processes tasks from NATS, falling back to the task store's ClaimNext for // requeued tasks (waiting_human approval, retry-parked) that didn't come // through a NATS publish. func (d *Daemon) drainNATS(ctx context.Context) { diff --git a/internal/daemon/dispatch_bindings_test.go b/internal/daemon/dispatch_bindings_test.go index d460aaa31..653ff6194 100644 --- a/internal/daemon/dispatch_bindings_test.go +++ b/internal/daemon/dispatch_bindings_test.go @@ -245,12 +245,6 @@ func TestDispatchBindingsNilDispatcherIsNoOp(t *testing.T) { // ── helpers ────────────────────────────────────────────────────── -// openDispatchTestStore creates a fresh in-memory SQLite store for -// each dispatch test. The TempDir anchor matches store.OpenTest's -// own convention; tests rely on the same schema-migration path -// production uses (CREATE TABLE + ALTER TABLE migrations), so -// binding_id / binding_version / binding_dispatches all exist on the -// store by the time a test runs. // dispatchStores pairs the two stores the dispatcher spans: the task store and // the event-capture store, so a seed helper reads as one handle. type dispatchStores struct { @@ -259,6 +253,8 @@ type dispatchStores struct { edaPool *pgxpool.Pool } +// openDispatchTestStore opens fresh migrated task and event-capture stores for +// each dispatch test. func openDispatchTestStore(t *testing.T) *dispatchStores { t.Helper() s := pgstore.Open(t) diff --git a/internal/domain/scheduling/cron.go b/internal/domain/scheduling/cron.go index 73ebe0c4e..0daeba0d7 100644 --- a/internal/domain/scheduling/cron.go +++ b/internal/domain/scheduling/cron.go @@ -82,22 +82,9 @@ func parseCronSegment(segment string, lo, hi int) (cronSlots, error) { } step = n } - first, last := lo, hi - if base != "*" { - from, to, ranged := strings.Cut(base, "-") - if !ranged && stepped { - return 0, fmt.Errorf("step in %q needs a wildcard or a range", part) - } - var err error - if first, err = cronValue(from, lo, hi); err != nil { - return 0, err - } - last = first - if ranged { - if last, err = cronValue(to, first, hi); err != nil { - return 0, err - } - } + first, last, err := cronRange(base, part, stepped, lo, hi) + if err != nil { + return 0, err } for v := first; v <= last; v += step { slots |= 1 << v @@ -106,6 +93,28 @@ func parseCronSegment(segment string, lo, hi int) (cronSlots, error) { return slots, nil } +// cronRange returns the values base names: every value for "*", else a +// single value or a from-to range. +func cronRange(base, part string, stepped bool, lo, hi int) (first, last int, err error) { + if base == "*" { + return lo, hi, nil + } + from, to, ranged := strings.Cut(base, "-") + if !ranged && stepped { + return 0, 0, fmt.Errorf("step in %q needs a wildcard or a range", part) + } + if first, err = cronValue(from, lo, hi); err != nil { + return 0, 0, err + } + if !ranged { + return first, first, nil + } + if last, err = cronValue(to, first, hi); err != nil { + return 0, 0, err + } + return first, last, nil +} + func cronValue(text string, lo, hi int) (int, error) { v, err := strconv.Atoi(text) if err != nil { diff --git a/internal/domain/storecontract/storecontract.go b/internal/domain/storecontract/storecontract.go index 74628182b..ce7538af2 100644 --- a/internal/domain/storecontract/storecontract.go +++ b/internal/domain/storecontract/storecontract.go @@ -1,8 +1,8 @@ // Package storecontract is the ratified State Store contract as its // consumers reference it: the producer-owned daemon/webui/intake store // surfaces (docs/prds/state-store-contract.md §1, §2). It carries no -// persistence -- *store.Store (SQLite, transitional location) and -// *staterpc.Client (the remote adapter) both satisfy these interfaces -- +// persistence -- internal/infrastructure/postgres and *staterpc.Client (the +// remote adapter) both satisfy these interfaces -- // so a process that only holds the contracts, such as the archie-ui // dashboard process, can reference them without linking the SQL // implementation. @@ -10,9 +10,7 @@ // It is hand-written and lives in the domain layer (which owns required // contracts), NOT under internal/contracts: that tree is the buf generate // output and is wiped and regenerated by tools/proto.sh, which would -// delete a hand-written file there (archie-core-8cda.5.6). Relocated from -// internal/store by the UI Service deletion gate; internal/store keeps -// type aliases so daemon-side callers are unaffected. +// delete a hand-written file there (archie-core-8cda.5.6). package storecontract import ( @@ -230,7 +228,7 @@ type BindingTaskCreator interface { // playbook's ledger rows on explicit request only: a playbook file missing at // boot may be an unmounted directory, and reclaiming on that would let // redelivered events fire again. There is deliberately no *sql.Tx: any -// transaction stays server-side inside internal/store. +// transaction stays server-side inside the store. type PlaybookDispatcher interface { RecordPlaybookDispatch(ctx context.Context, playbookID, playbookVersion, eventID, actionID string) error DeletePlaybookDispatches(ctx context.Context, playbookID string) error @@ -382,9 +380,8 @@ var ( // Resource is one control-plane resource document: the stored value for a // kind, its revision, and the audit record written with the last write. -// Resource and ResourceWrite live here (rather than internal/store) so the -// PostgreSQL implementation and the UI-side consumers can reference them -// without linking the SQLite implementation. +// Resource and ResourceWrite live here so the UI-side consumers can reference +// them without linking the PostgreSQL implementation. type Resource struct { Kind string Value []byte diff --git a/internal/domain/workflow/store_integration_test.go b/internal/domain/workflow/store_integration_test.go index 84d3061e7..6750ce75f 100644 --- a/internal/domain/workflow/store_integration_test.go +++ b/internal/domain/workflow/store_integration_test.go @@ -7,11 +7,10 @@ import ( "strings" "testing" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/agentexec" "github.com/samcharles93/archie-core/internal/config" "github.com/samcharles93/archie-core/internal/domain/workflow" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" ) // storeIntegrationRunner is a minimal agentexec.Runner stub, duplicated @@ -19,7 +18,7 @@ import ( // lives in the external workflow_test package: it needs the real // *pgstore.TaskDB as a workflow.Store, and the package under test now owns // workflow.Task/Status/Source, which would otherwise cycle back through -// internal/store's dependency on internal/domain/workflow. +// the store's dependency on internal/domain/workflow. type storeIntegrationRunner struct { result agentexec.Result } diff --git a/internal/domain/workflow/task/task.go b/internal/domain/workflow/task/task.go index 0a8dbd410..3ac6adba8 100644 --- a/internal/domain/workflow/task/task.go +++ b/internal/domain/workflow/task/task.go @@ -33,7 +33,7 @@ const ( ) // Task is the task-execution record the workflow domain operates on. -// internal/store persists this type (persistence -> domain). +// internal/infrastructure/postgres persists this type (persistence -> domain). type Task struct { ID int64 `json:"id"` Owner string `json:"owner"` @@ -134,7 +134,7 @@ func (t Task) IsForgeBacked() bool { } // Store is the narrow, consumer-owned subset of the State Store contract -// that workflow stages call mid-run. *store.Store and staterpc.Client +// that workflow stages call mid-run. The PostgreSQL store and staterpc.Client // satisfy it; this is the interface archie-agent uses over the gRPC State // Store contract. It supersedes store.WorkflowStore. type Store interface { diff --git a/internal/events/events.go b/internal/events/events.go index 6676faf9a..d5e1cd2ae 100644 --- a/internal/events/events.go +++ b/internal/events/events.go @@ -106,7 +106,7 @@ const ( KindTurnCompleted = "turn_completed" // EDA edit activity (bindings and mappings on the captures store). Each - // successful write on the State Store's PocketBase tables emits one + // successful write on the State Store's binding and mapping tables emits one // event through the same task-DB path capture arrival uses, so a // dashboard edit is visible on the activity stream without a manual // refresh. data: id (the edited record), action (create, update, diff --git a/internal/gateway/compress_identity_test.go b/internal/gateway/compress_identity_test.go index aeeb6f8bf..9ecdb2d58 100644 --- a/internal/gateway/compress_identity_test.go +++ b/internal/gateway/compress_identity_test.go @@ -13,7 +13,7 @@ import ( func compressBackends() map[string]func(t *testing.T) SessionStore { return map[string]func(t *testing.T) SessionStore{ "memory": func(*testing.T) SessionStore { return NewSessionStoreMemory() }, - "postgres": func(t *testing.T) SessionStore { return newPostgresStore(t) }, + "postgres": newPostgresStore, } } diff --git a/internal/gateway/task_tools.go b/internal/gateway/task_tools.go index 88cb409fe..243284c98 100644 --- a/internal/gateway/task_tools.go +++ b/internal/gateway/task_tools.go @@ -53,7 +53,7 @@ type ChatTaskSummary struct { // ChatTaskLister is the read surface the task tools need. It mirrors the // existing chatTaskWriter/chatTaskController pattern: gateway states what it // needs and the daemon supplies an adapter over the store, so this package -// keeps its independence from internal/store. +// keeps its independence from the task store. type ChatTaskLister interface { ListChatTasks(ctx context.Context, identity string, limit int) ([]ChatTaskSummary, error) } @@ -72,7 +72,7 @@ type TaskSpawnResult struct { // ChatTaskActor is the mutation surface task_action needs. It mirrors the // ChatTaskLister pattern: gateway states what it needs and the daemon // supplies an adapter over the store and runtime, so this package keeps its -// independence from internal/store. +// independence from the task store. type ChatTaskActor interface { // ApplyChatTaskAction executes action on taskID, scoped to identity's own // tasks. A nil identity is an authenticated dashboard operator, who acts @@ -85,7 +85,7 @@ type ChatTaskActor interface { // ChatTaskLogEntry is one log line as task_logs returns it. It mirrors // internal/logging.Entry's shape without importing that package: gateway // keeps its independence from internal/logging the same way it already does -// from internal/store, with the daemon adapting between them. +// from the task store, with the daemon adapting between them. type ChatTaskLogEntry struct { Time time.Time `json:"time"` Level string `json:"level"` @@ -144,7 +144,7 @@ type ChatTaskLogResult struct { // ChatTaskLogReader is the read surface task_logs needs. It mirrors the // ChatTaskLister pattern: gateway states what it needs and the daemon // supplies an adapter, so this package keeps its independence from -// internal/store and internal/logging. +// the task store and internal/logging. type ChatTaskLogReader interface { // ReadChatTaskLogs returns taskID's log entries for attempt (0 selects // the task's current/latest attempt), scoped to identity's own tasks. diff --git a/internal/gateway/tasks.go b/internal/gateway/tasks.go index 8be724c23..0a307a1ed 100644 --- a/internal/gateway/tasks.go +++ b/internal/gateway/tasks.go @@ -41,7 +41,7 @@ type taskProfile struct { // chatTaskWriter is the write surface StoreTaskCreator needs. It // returns the created task's real database ID, not a *workflow.Task -- -// gateway deliberately has no dependency on internal/store or +// gateway deliberately has no dependency on the task store or // internal/domain/workflow; the daemon supplies an adapter closure over // the store.TaskStore method of the same name. type chatTaskWriter interface { @@ -116,7 +116,7 @@ func splitOwnerRepo(s string) (owner, repo string, ok bool) { } // Task lifecycle statuses come from internal/taskstate, a leaf package with -// no dependencies, so gateway stays decoupled from internal/store without +// no dependencies, so gateway stays decoupled from the task store without // keeping a hand-synced copy of the strings. The copy that used to live here // is how the dashboard and chat ended up recording different states for the // same operator decision. diff --git a/internal/gateway/turn_ledger_test.go b/internal/gateway/turn_ledger_test.go index c3021acb2..7af0254b8 100644 --- a/internal/gateway/turn_ledger_test.go +++ b/internal/gateway/turn_ledger_test.go @@ -18,14 +18,14 @@ func TestTurnLedgerClaimLifecycleIsIdempotent(t *testing.T) { name: "memory", open: func(t *testing.T) (TurnLedger, func()) { store := NewSessionStoreMemory() - return store.(TurnLedger), func() { _ = store.Close() } + return asTurnLedger(t, store), func() { _ = store.Close() } }, }, { name: "postgres", open: func(t *testing.T) (TurnLedger, func()) { store := newPostgresStore(t) - return store.(TurnLedger), func() { _ = store.Close() } + return asTurnLedger(t, store), func() { _ = store.Close() } }, }, } @@ -113,14 +113,14 @@ func TestTurnLedgerReclaimsAcrossProcessOwnersAndRejectsStaleWrites(t *testing.T name: "memory", open: func(t *testing.T) (TurnLedger, func()) { store := NewSessionStoreMemory() - return store.(TurnLedger), func() { _ = store.Close() } + return asTurnLedger(t, store), func() { _ = store.Close() } }, }, { name: "postgres", open: func(t *testing.T) (TurnLedger, func()) { store := newPostgresStore(t) - return store.(TurnLedger), func() { _ = store.Close() } + return asTurnLedger(t, store), func() { _ = store.Close() } }, }, } @@ -393,3 +393,12 @@ func TestTurnRunnerCanonicalTurnIDRejectsCollidingLegacyRecord(t *testing.T) { got, want, collidingLegacyID) } } + +func asTurnLedger(t *testing.T, store SessionStore) TurnLedger { + t.Helper() + ledger, ok := store.(TurnLedger) + if !ok { + t.Fatalf("%T does not implement TurnLedger", store) + } + return ledger +} diff --git a/internal/infrastructure/captureintake/receiver_test.go b/internal/infrastructure/captureintake/receiver_test.go index 29400ece4..70f54bfee 100644 --- a/internal/infrastructure/captureintake/receiver_test.go +++ b/internal/infrastructure/captureintake/receiver_test.go @@ -212,7 +212,7 @@ func TestHandleCaptureStoresRedactedBody(t *testing.T) { // host process's pipeline (the daemon's bus drain), already tested there. // // The published event is deliberately LIGHTWEIGHT (id + source only, no -// body/headers): the events table this feeds (internal/store/events.go) has +// body/headers): the events table this feeds (the State Store events table) has // no retention or row-count prune, unlike captured_events, so embedding the // full (up to CaptureMaxBodyBytes) payload here would duplicate it into an // unbounded table and defeat the disk-bound guarantee InsertCapture's own diff --git a/internal/infrastructure/postgres/store.go b/internal/infrastructure/postgres/store.go index e6e5faf10..0fcd23f9c 100644 --- a/internal/infrastructure/postgres/store.go +++ b/internal/infrastructure/postgres/store.go @@ -35,14 +35,14 @@ func (s *Store) queries() *postgresdb.Queries { return postgresdb.New(s.pool) } -// Close is a no-op: unlike the SQLite store, this store owns no file handle +// Close is a no-op: this store owns no file handle // or connection -- the pool belongs to the composition that opened it. func (s *Store) Close() error { return nil } // syntheticIssueNumberBase is the seed for a repo's first chat task. The // COALESCE allocator adds one to the passed fallback, so the fallback here is -// base-1 and the first chat task lands on exactly base, matching the SQLite -// store's reserved JSON-safe floor (see internal/store.EnqueueChatTask). +// base-1 and the first chat task lands on exactly base: the reserved +// JSON-safe floor that keeps synthetic issue numbers clear of real ones. const syntheticIssueNumberBase = 1_000_000_000_000_000 // taskFromRow maps the generated task row to the workflow.Task the daemon and diff --git a/internal/infrastructure/readiness/probes.go b/internal/infrastructure/readiness/probes.go index 2192f3d88..a8c94d152 100644 --- a/internal/infrastructure/readiness/probes.go +++ b/internal/infrastructure/readiness/probes.go @@ -26,7 +26,7 @@ import ( // --- state_db --- // statusCounter is the read-only store surface the state_db probe needs. -// The daemon's *store.Store satisfies it; the probe never depends on the +// The task store satisfies it; the probe never depends on the // full task-lifecycle interface. type statusCounter interface { StatusCounts(ctx context.Context) (map[string]int, error) diff --git a/internal/infrastructure/staterpc/capture_stream_test.go b/internal/infrastructure/staterpc/capture_stream_test.go index 0cb54894c..7a89aaecd 100644 --- a/internal/infrastructure/staterpc/capture_stream_test.go +++ b/internal/infrastructure/staterpc/capture_stream_test.go @@ -29,7 +29,7 @@ func TestCaptureListsExceedUnaryMessageLimit(t *testing.T) { t.Fatal(mapErr) } // ListUndispatchedCaptures only returns sources with an armed binding - // (edastore.ArmedBindingsForSource), so "large" needs one taken through the + // (ArmedBindingsForSource), so "large" needs one taken through the // public draft -> pending_approval -> armed lifecycle. id, err := eda.InsertBinding(t.Context(), binding.Binding{ Name: "large binding", Matcher: binding.Matcher{Source: "large"}, diff --git a/internal/infrastructure/staterpc/conformance_test.go b/internal/infrastructure/staterpc/conformance_test.go index d84ddcf07..b484e33a5 100644 --- a/internal/infrastructure/staterpc/conformance_test.go +++ b/internal/infrastructure/staterpc/conformance_test.go @@ -31,7 +31,7 @@ type contract interface { storecontract.ApplyStatusStore } -// edaContract is the event-capture half, which the PocketBase store serves. +// edaContract is the event-capture half, which the PostgreSQL EDA store serves. // It is a separate interface because no single type implements both halves // any more: that split is the point of the migration, not an accident. type edaContract interface { diff --git a/internal/infrastructure/staterpc/server.go b/internal/infrastructure/staterpc/server.go index 808f7252e..856b12443 100644 --- a/internal/infrastructure/staterpc/server.go +++ b/internal/infrastructure/staterpc/server.go @@ -1,4 +1,4 @@ -// Package staterpc adapts the State Store contract (internal/store's +// Package staterpc adapts the State Store contract (internal/domain/storecontract's // producer-owned surfaces plus the consumer-owned workflow.Store) to gRPC. // See docs/prds/state-store-contract.md for the ratified contract this // package implements against. diff --git a/internal/infrastructure/staterpc/task_grants_test.go b/internal/infrastructure/staterpc/task_grants_test.go index def46342a..28d70ad4c 100644 --- a/internal/infrastructure/staterpc/task_grants_test.go +++ b/internal/infrastructure/staterpc/task_grants_test.go @@ -93,7 +93,7 @@ func TestCaptureStreamsCarryTheAdminToken(t *testing.T) { if mapErr != nil { t.Fatal(mapErr) } - // (edastore.ArmedBindingsForSource), so "large" needs one taken through the + // (ArmedBindingsForSource), so "large" needs one taken through the // public draft -> pending_approval -> armed lifecycle. id, err := admin.InsertBinding(ctx, binding.Binding{ Name: "large binding", Matcher: binding.Matcher{Source: "large"}, diff --git a/internal/infrastructure/staterpc/values_test.go b/internal/infrastructure/staterpc/values_test.go index 03875ca61..c513e74b3 100644 --- a/internal/infrastructure/staterpc/values_test.go +++ b/internal/infrastructure/staterpc/values_test.go @@ -94,7 +94,7 @@ func TestTaskLogStageFilterSurvivesTheWire(t *testing.T) { } // TestEventDataJSONPreservesMarshalErrorMarker pins §11's conformance -// invariant: the local store (internal/store/events.go) records a +// invariant: the store records a // {"marshal_error":%q} marker when json.Marshal of event Data fails, so the // remote wire must carry the same marker rather than silently emptying the // Data on the hop. diff --git a/internal/taskstate/taskstate.go b/internal/taskstate/taskstate.go index df133c0d5..c7a902acb 100644 --- a/internal/taskstate/taskstate.go +++ b/internal/taskstate/taskstate.go @@ -9,7 +9,7 @@ // for "the pull request was closed without merging" -- no longer meant one // thing. // -// internal/gateway deliberately does not import internal/store, so it kept a +// internal/gateway deliberately does not import the task store, so it kept a // hand-synced copy of the status strings with a comment asking future editors // to keep them aligned. That is the same defect one level down. This package // has no dependencies, so both can import it and the copy can go. diff --git a/internal/webui/webui_test.go b/internal/webui/webui_test.go index f62e8fbd2..9f1db8ac9 100644 --- a/internal/webui/webui_test.go +++ b/internal/webui/webui_test.go @@ -25,11 +25,10 @@ import ( "testing" "time" - "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" - "github.com/samcharles93/archie-core/internal/domain/storecontract" "github.com/samcharles93/archie-core/internal/domain/workflow" "github.com/samcharles93/archie-core/internal/events" + "github.com/samcharles93/archie-core/internal/infrastructure/postgres/pgstore" ) func newTestServer(t *testing.T) *Server {