mesh-recovery: the four bound settings take a minimum above 0, as the reader refuses 0

Builds: design 47 G §557, §561, §681 (catalog review finding)

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
2026-11-12 05:04:06 +01:00
parent dcaa229c2b
commit c235abcb11
2 changed files with 12 additions and 5 deletions
@@ -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) {
+4 -4
View File
@@ -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