From ba78025469290c281ec59e0fb54e3ee0d524e694 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 22 Nov 2026 00:27:55 +0100 Subject: [PATCH] E7b: state the declaration Version the engine reads MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A process's drain-bound raises the declaration's Version to 2, and an engine before it decodes such a declaration strictly and refuses it, so the composer that writes Version 2 must come after every engine that reads it. The engine's manifest states the Version it reads, declaration-reads 2, the edge the delivery plan derives; an engine before it cannot state the word, so this build is held for a yes once at its delivery. Builds: design 47 H2 §813 (12); H-A-358, H-A-384 (3), H-A-388 (2) --- module.json | 1 + packaging/operator_keys_test.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/module.json b/module.json index 52b30be5..e0392d39 100644 --- a/module.json +++ b/module.json @@ -2,6 +2,7 @@ "module": "mesh-host", "version": "0.1", "slug": "host", + "declaration-reads": 2, "build": { "artifacts": [ { diff --git a/packaging/operator_keys_test.go b/packaging/operator_keys_test.go index f13e9455..1cf41516 100644 --- a/packaging/operator_keys_test.go +++ b/packaging/operator_keys_test.go @@ -9,6 +9,7 @@ import ( "testing" "git.novox.be/novox/mesh-sdk/go/catalogue" + "git.novox.be/novox/mesh-sdk/go/declaration" ) // The operator's public keys reach every node as a file beside the state file, fed by a setting of the node-engine @@ -115,12 +116,19 @@ func TestTheManifestConsumesTheBackupEvent(t *testing.T) { t.Fatal(err) } // ADR 0614 §4: the node-engine's own manifest uses only words every running engine reads (the baseline, what an engine - // stating none is read as), so its new build is never held for a word only it reads. + // stating none is read as), so its new build is never held for a word only it reads; but for the declaration Version it + // reads, which an engine before it cannot state, so its build is held for a yes once at that delivery (H-A-388 and + // its addendum). if needs, err := catalogue.ManifestNeeds(raw); err != nil || len(needs) == 0 { t.Fatalf("the manifest's needs: %v, %v", needs, err) - } else if missing := catalogue.MissingManifestReads(needs, nil); len(missing) != 0 { + } else if missing := catalogue.MissingManifestReads(needs, nil); !slices.Equal(missing, []string{"word:declaration-reads"}) { t.Errorf("the manifest needs %v, which an engine stating nothing does not read: its new build would be held", missing) } + // Design 47 H2 §813 (12), H-A-388: it states the declaration Version it reads, the one its contract parses, so the + // delivery plan orders the composer that writes that Version after it. + if parsed, err := catalogue.Decode(raw); err != nil || parsed.DeclarationReads != declaration.Version { + t.Errorf("the manifest states it reads declaration Version %d, and the engine reads %d (%v)", parsed.DeclarationReads, declaration.Version, err) + } // 774 (the alert table): the state health, one key per node, the node's own health report, kept until // written again (no TTL: a node that stops writing keeps its last word, which the watchman reads with its time). // ADR 0577 clause 1: and the state data, one key per module placed on the node that declares data items, kept until