From c235abcb11122936ace71365bae6120fb890bbb6 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 05:04:06 +0100 Subject: [PATCH] mesh-recovery: the four bound settings take a minimum above 0, as the reader refuses 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 47 G §557, §561, §681 (catalog review finding) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- modules/mesh-recovery/internal/recovery/manifest_test.go | 9 ++++++++- modules/mesh-recovery/module.json | 8 ++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/mesh-recovery/internal/recovery/manifest_test.go b/modules/mesh-recovery/internal/recovery/manifest_test.go index 185840f3d..686e7dd64 100644 --- a/modules/mesh-recovery/internal/recovery/manifest_test.go +++ b/modules/mesh-recovery/internal/recovery/manifest_test.go @@ -21,7 +21,8 @@ type manifest struct { Consumes []string `json:"consumes"` Invokes []string `json:"invokes"` Config map[string]struct { - Default float64 `json:"default"` + Default float64 `json:"default"` + Minimum *float64 `json:"minimum"` } `json:"config"` Data struct { Own []struct{ ID string } `json:"own"` @@ -75,6 +76,12 @@ func TestTheManifestSaysWhatTheModuleIs(t *testing.T) { t.Errorf("setting %s defaults to %v, want %v", k, m.Config[k].Default, want) } } + // A bound of time is never 0, which the reader refuses: its minimum is above 0 (the manifest's minimum is inclusive). + for _, k := range []string{"point-keep-days", "dump-wait-minutes", "snapshot-restore-wait-minutes", "expire-every-hours"} { + if m.Config[k].Minimum == nil || *m.Config[k].Minimum < 1 { + t.Errorf("setting %s has the minimum %v: a bound of 0 is refused by the reader, so the manifest refuses it", k, m.Config[k].Minimum) + } + } // The keeper's snapshot verbs the recovery module asks, the cancel at its bound among them (§681). for _, inv := range []string{"seat:mesh-broker.snapshot-get", "seat:mesh-broker.snapshot-restore", "seat:mesh-broker.snapshot-restore-cancel"} { if !slices.Contains(m.Invokes, inv) { diff --git a/modules/mesh-recovery/module.json b/modules/mesh-recovery/module.json index bbfe35474..acf9bfeb2 100644 --- a/modules/mesh-recovery/module.json +++ b/modules/mesh-recovery/module.json @@ -110,7 +110,7 @@ "point-keep-days": { "type": "number", "description": "days after which a restore point is removed, the newest of its kept data never (design 47 G sections 551, 557).", - "minimum": 0, + "minimum": 1, "maximum": 3650, "trusted": false, "default": 90 @@ -118,7 +118,7 @@ "dump-wait-minutes": { "type": "number", "description": "minutes an act waits on the dump of the bus's item before recovery-waits is written (design 47 G sections 561, 557).", - "minimum": 0, + "minimum": 1, "maximum": 10080, "trusted": false, "default": 60 @@ -126,7 +126,7 @@ "snapshot-restore-wait-minutes": { "type": "number", "description": "minutes a restore in place of a protected keeper's snapshot is waited on, and once more after its cancel (design 47 G section 681, A-138, A-140).", - "minimum": 0, + "minimum": 1, "maximum": 10080, "trusted": false, "default": 90 @@ -134,7 +134,7 @@ "expire-every-hours": { "type": "number", "description": "hours between two removals of the points past their keep days, beside the one at the start and at each snapshot-kept; timed by a bound key of the state bounds (design 47 G sections 551, 557, A-138).", - "minimum": 0, + "minimum": 1, "maximum": 8760, "trusted": false, "default": 24