Phase 3.1: adopt the foundation store as the postgres module

InstallStore turns the mesh-store the foundation raised at genesis into the
postgres module, adopted in place: it verifies the module's server names the
same container and the same image the foundation is running (fail-fast on a
drift, rather than tearing down the mesh's store), then registers, builds the
provisioner, and carries the superuser in via secret accept — the mesh cannot
invent a credential that already made the databases (mirroring the control
plane's store-connection delivery, control.go). pinImage generalised to any
module for reuse.

Issue 051 (WBS 3.1). One server holds the controller's contexts and every
module's database.

Claude-Session: https://claude.ai/code/session_01D6qtiYU3P9jk3pnAXyAFyx
This commit is contained in:
2026-09-16 21:04:06 +02:00
parent 121367319d
commit 9109a8c178
6 changed files with 223 additions and 16 deletions
+6 -4
View File
@@ -588,10 +588,12 @@ func Run(ctx context.Context, o Options, d Deps, say func(string)) (Result, erro
}
// ---- 14. store ------------------------------------------------------------------------
// A database PROVIDER. The foundation's store is the control plane's own memory and offers
// nothing to anything; the first thing that wants a database is the catalogue, next.
say("store — a database provider, which the foundation's own store is not")
if err := InstallFromCatalogue(ctx, o, permanentControl, "postgres", say); err != nil {
// The foundation's own store, ADOPTED as the `postgres` module (novox/hq issue 051): one
// server holds the control plane's contexts and every module's database, rather than the
// foundation's store beside a second one a module raised. Adopted in place — the module names
// the container the foundation is already running, and the applier leaves it be (phase3.go).
say("store — the foundation's store, adopted as the postgres module: one server, not two")
if err := InstallStore(ctx, o, permanentControl, rewritten.Declaration, say); err != nil {
return result, failed(StepStore, err)
}