G A-92: the node-engine's manifest declares the state bounds, a lifetime per key, in its old section

Builds: design 47 G §560, §557, §627, A-77, A-92
(the seat definition: mesh-contracts 2ae0c679304b828a3973dd23ecd19861577d141d)

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-11 23:48:16 +01:00
parent 5173f2a31c
commit 7c7b5e2d68
3 changed files with 38 additions and 2 deletions
+5
View File
@@ -51,6 +51,11 @@
},
{
"name": "packages"
},
{
"name": "bounds",
"history": 1,
"key-ttl": true
}
],
"config": {
+30
View File
@@ -0,0 +1,30 @@
package packaging_test
import (
"os"
"testing"
"git.novox.be/novox/mesh-sdk/go/catalogue"
)
// The node-engine's waits run against bound keys with their own time to live, in its old section as its other states are
// (design 47 G A-92, §560, §627): the manifest declares the state bounds with a lifetime per key.
func TestTheManifestDeclaresTheBoundsStateWithAKeyLifetime(t *testing.T) {
raw, err := os.ReadFile("../module.json")
if err != nil {
t.Fatal(err)
}
m, err := catalogue.Decode(raw)
if err != nil {
t.Fatalf("the manifest no longer parses: %v", err)
}
for _, s := range m.State {
if s.Name == "bounds" {
if !s.KeyTTL || s.History != 1 {
t.Fatalf("the state bounds is %+v: one value a key, each key with its own lifetime", s)
}
return
}
}
t.Fatal("the manifest declares no state bounds")
}
+3 -2
View File
@@ -91,10 +91,11 @@ func TestTheManifestConsumesTheBackupEvent(t *testing.T) {
// ADR 0565 clause 6: and the state packages, one key per node, its compositions' declared packages, read by pacman.
// ADR 0564 §2, ADR 0636 §1: and the state findings, the node's finding that it waits for the seat list (no TTL: the
// finding stays until the first full read deletes its key).
if len(parsed.State) != 4 || parsed.State[0].Name != "health" || parsed.State[0].TTLSeconds != 0 ||
// Design 47 G A-92: and the state bounds, each key a wait's bound with its own lifetime (packaging/bounds_state_test.go).
if len(parsed.State) != 5 || parsed.State[0].Name != "health" || parsed.State[0].TTLSeconds != 0 ||
parsed.State[1].Name != "findings" || parsed.State[1].TTLSeconds != 0 ||
parsed.State[2].Name != "data" || parsed.State[2].TTLSeconds != 0 || parsed.State[3].Name != "packages" ||
parsed.State[3].TTLSeconds != 0 {
parsed.State[3].TTLSeconds != 0 || parsed.State[4].Name != "bounds" {
t.Fatalf("the manifest declares the state %+v", parsed.State)
}
}