From 7c7b5e2d6829001acd7f71e750844ab7978477e3 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 23:48:16 +0100 Subject: [PATCH] G A-92: the node-engine's manifest declares the state bounds, a lifetime per key, in its old section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- module.json | 5 +++++ packaging/bounds_state_test.go | 30 ++++++++++++++++++++++++++++++ packaging/operator_keys_test.go | 5 +++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 packaging/bounds_state_test.go diff --git a/module.json b/module.json index 52f97f17..82b00dec 100644 --- a/module.json +++ b/module.json @@ -51,6 +51,11 @@ }, { "name": "packages" + }, + { + "name": "bounds", + "history": 1, + "key-ttl": true } ], "config": { diff --git a/packaging/bounds_state_test.go b/packaging/bounds_state_test.go new file mode 100644 index 00000000..d92beab9 --- /dev/null +++ b/packaging/bounds_state_test.go @@ -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") +} diff --git a/packaging/operator_keys_test.go b/packaging/operator_keys_test.go index d620eef7..2c6ca2ca 100644 --- a/packaging/operator_keys_test.go +++ b/packaging/operator_keys_test.go @@ -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) } }