diff --git a/module.json b/module.json index 928d52f7..ee50160c 100644 --- a/module.json +++ b/module.json @@ -4,6 +4,7 @@ "slug": "host", "class": "core", "declaration-reads": 2, + "declaration-writes": 2, "build": { "artifacts": [ { diff --git a/packaging/operator_keys_test.go b/packaging/operator_keys_test.go index 6798db6c..95628fa0 100644 --- a/packaging/operator_keys_test.go +++ b/packaging/operator_keys_test.go @@ -122,7 +122,7 @@ func testTheManifestConsumesTheBackupEvent(t *testing.T) { // delivery (H-A-388 and its addendum, H-A-394). 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); !slices.Equal(missing, []string{"word:class", "word:declaration-reads"}) { + } else if missing := catalogue.MissingManifestReads(needs, nil); !slices.Equal(missing, []string{"word:class", "word:declaration-reads", "word:declaration-writes"}) { 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 @@ -151,8 +151,10 @@ func testTheManifestConsumesTheBackupEvent(t *testing.T) { if parsed, err := catalogue.Decode(raw); err != nil || parsed.Class != catalogue.ClassCore { t.Errorf("the manifest's class is %q, and the node-engine claims a seat (%v)", parsed.Class, err) } - 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) + // H-A-416 (2): and the Version its composer writes, since the composer is the engine's own build. + if parsed, err := catalogue.Decode(raw); err != nil || parsed.DeclarationReads != declaration.Version || parsed.DeclarationWrites != declaration.Version { + t.Errorf("the manifest states it reads declaration Version %d and writes %d, and the engine reads and writes %d (%v)", + parsed.DeclarationReads, parsed.DeclarationWrites, 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).