Drop the plan state from the store and the assignments: migration 0108 and placement-only assignments (release 6, issue 1945 B9, B4)

This commit is contained in:
2026-10-24 16:42:02 +02:00
parent 96d7784bce
commit 788fb681ec
110 changed files with 512 additions and 10584 deletions
@@ -0,0 +1,35 @@
//go:build integration
package main
import (
"strings"
"testing"
"git.novox.be/novox/mesh-sdk/go/catalogue"
)
// **The controller opens on a store whose plan tables are gone** (novox/hq ADR 0539 §17, issue 1945 B9): migration 0108 has
// dropped the record of sends, the assignment generation, the gate's verdicts and the durations, and the controller still
// assigns a module, reads where it runs, takes it off and reads the nodes.
func TestTheControllerOpensOnAStoreWithoutThePlanTables(t *testing.T) {
open := aMesh(t)
ctx := t.Context()
inv := open.inventory
for _, row := range inv.QueryForTest(t, `select table_name::text from information_schema.tables where table_schema = 'public'`) {
switch name := strings.Trim(row[0], `"`); name {
case "declaration_send", "assignment_generation", "build_gate", "duration":
t.Errorf("the table %s is in the store", name)
}
}
register(t, open, catalogue.Manifest{Module: "notes", Version: "1"})
if _, err := assign(ctx, open, "anchor", "notes"); err != nil {
t.Fatalf("assign on the migrated store: %v", err)
}
if on, err := inv.Assigned(ctx, "anchor"); err != nil || len(on) != 1 || on[0] != "notes" {
t.Fatalf("assigned %v: %v", on, err)
}
if nodes, err := inv.Nodes(ctx); err != nil || len(nodes) == 0 {
t.Fatalf("nodes %v: %v", nodes, err)
}
}