chore(state-store): remove the one-time SQLite import and db_path

Every install serves from Postgres, so the legacyread/legacyimport packages,
the archie-state-store import command, the boot gate that refused to serve
over unimported SQLite files, and db_path (which only located those files)
go. Migration 0010 drops the import_completion table.
This commit is contained in:
sam committed 2026-09-25 00:40:48 +10:00
1 parent d61e49b2c9
commit 8c55b5d4e4
65 files changed
+138 -3350

No files matched your search

+1 -1
View File
@@ -141,7 +141,7 @@ existing structure combines different owners.
| Current values | Current location | Target owner and requirement |
| ----------------------------------------------------------------------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `WorkDir`, `StateDir`, `DBPath` | root `Config` | Workspace/storage infrastructure settings, bootstrap-only. `StateDir` holds the embedded NATS store and endpoint file, task logs and the readiness disk target. `DBPath` only locates the legacy SQLite files (`<db_path>-tasks.sqlite`, `-eda.sqlite`, `-conversations.sqlite`) for `archie-state-store import` and the boot gate that refuses to serve until it has run; it goes when the importer does. Defaults derive from the platform data directory. |
| `WorkDir`, `StateDir` | root `Config` | Workspace/storage infrastructure settings, bootstrap-only. `StateDir` holds the embedded NATS store and endpoint file, task logs and the readiness disk target. Defaults derive from the platform data directory. |
| `SkillsDir`, `PluginDir` | root `Config` | Skill and plugin infrastructure settings, independently typed. |
| `PollInterval` | root `Config` | Work-intake scheduling setting; not a daemon-wide constant. |
| `Label`, `BotUser`, `BotEmail` | root `Config` | Identity and dispatch associations. `BotEmail` may be derived from the selected forge account but remains overrideable. |
+2 -2
View File
@@ -223,8 +223,8 @@ pass today. `cmd/archie-messaging/architecture_test.go` does not exist, and the
check that section specifies -- `go list -deps ./cmd/archie-messaging` links
zero banned runtime packages -- reported four at the time (the task store was
then `internal/store` over `modernc.org/sqlite`; the gate now bans
`modernc.org/sqlite`, `github.com/jackc/pgx`, `internal/infrastructure/postgres`
and `internal/infrastructure/legacyread` in its place):
`modernc.org/sqlite`, `github.com/jackc/pgx` and
`internal/infrastructure/postgres` in its place):
| banned package | PRD category |
| --- | --- |
+4 -24
View File
@@ -121,31 +121,11 @@ file values would restore the second source of truth the control plane exists to
remove. The cost is that a bad stored value stops the daemon starting, and the
value can only be corrected through the daemon's own API.
### Upgrading an install from SQLite
### Serving from Postgres
The State Store, the daemon and the Gateway serve from `database_url` only. An
install that still holds the SQLite stores (`<db_path>-tasks.sqlite`,
`<db_path>-eda.sqlite`, `<db_path>-conversations.sqlite`) upgrades in three
steps:
1. Stop every archie process.
2. Run `archie-state-store import`. It moves all three stores into Postgres in
one transaction, verifies the rows, and records completion. The SQLite files
are read, never written.
3. Start archie.
`db_path` exists only to locate these files for the import and the boot gate
below, and goes with the importer. The embedded NATS store, its endpoint file
and task logs live under `state_dir` (default: the data home's `archie`
directory). An install whose `db_path` sat outside the data home sets
`state_dir` to that directory to keep them where they were.
Each serving process checks this at boot, after migrating the schema. With no
completion record and a non-empty legacy file it refuses to start and names the
files and the import command, rather than serve empty tables over existing
data. There is no override. With no legacy data it is a fresh install: it writes
the completion record itself, so a legacy file that appears later is ignored.
A database that recorded a fresh start refuses a later import.
The State Store, the daemon and the Gateway serve from `database_url` only; an
empty value is a startup error. The embedded NATS store, its endpoint file and
task logs live under `state_dir` (default: the data home's `archie` directory).
The Gateway holds a Postgres serve-ownership claim for its whole life, so a
second Gateway against the same database refuses to start (its turn recovery