diff --git a/modules/mesh-delivery-assigner/internal/assign/asks.go b/modules/mesh-delivery-assigner/internal/assign/asks.go index 77ac64f9c..e3c15c1e9 100644 --- a/modules/mesh-delivery-assigner/internal/assign/asks.go +++ b/modules/mesh-delivery-assigner/internal/assign/asks.go @@ -3,6 +3,7 @@ package assign import ( "fmt" "mesh-delivery-assigner/internal/assignment" + "mesh-delivery-assigner/internal/outside" "strings" "time" @@ -52,13 +53,18 @@ func OutsideAsk(key, about, node, module, fp, cause string, since time.Time, ask // id `.`, severity warning, naming the module, the machine and the cause by its condition's key, and needing // nothing, so it is sent to no one: the operator's one message is the ask at the bound. func WaitsOutsideFinding(node, module, causeKey, on string, at time.Time) Observed { + needs := "Nothing for you to do." + if on == outside.OnUnread { + // A read that failed leaves the wait standing until an input judges it again (design 47 H2b §829 5.): the way through is named. + needs = "The conditions of " + node + " could not be read: ask assigner_release for " + module + " on " + node + " with how rejudge to judge it again now." + } return Observed{Scope: "delivery", ID: node + "." + module, Kind: "delivery-waits-outside", Machine: node, Severity: "warning", Summary: fmt.Sprintf("%s on %s waits on %s (the condition %s)", module, node, on, causeKey), Headline: fmt.Sprintf("%s on %s waits on an outside cause", module, node), Explanation: fmt.Sprintf("The health check of %s fails on %s while %s is open, which is outside the delivery. The delivery "+ "waits, judges again when it clears and goes on by itself.", module, node, causeKey), - Needs: "Nothing for you to do.", Source: "assigner.delivery-waits-outside"} + Needs: needs, Source: "assigner.delivery-waits-outside"} } // The options of the record ask (ADR 0539 §14) and of the backup ask (§16). diff --git a/modules/mesh-delivery-assigner/internal/assign/asks_test.go b/modules/mesh-delivery-assigner/internal/assign/asks_test.go index 78a9d0f6a..d13e3180d 100644 --- a/modules/mesh-delivery-assigner/internal/assign/asks_test.go +++ b/modules/mesh-delivery-assigner/internal/assign/asks_test.go @@ -4,6 +4,7 @@ import ( "fmt" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-teller/tellerevents" "mesh-delivery-assigner/internal/assignment" + "mesh-delivery-assigner/internal/outside" "mesh-delivery-assigner/internal/puts" "regexp" "slices" @@ -217,6 +218,16 @@ func theBackupAskIsValid(t *testing.T) { // 1952/WM6: the assigner's conditions are findings. func TestTheAssignersConditions(t *testing.T) { t.Run("1952/WM6: each said condition is a finding, its clear deletes it, said straight only with no findings bucket", saidConditionsAreFindings) + // Design 47 H2b §829 5. (review r1 finding 6): a wait on conditions-unread names the way through; any other wait needs nothing. + t.Run("the finding of a wait on conditions-unread names assigner_release with rejudge", func(t *testing.T) { + at := time.Date(2026, 11, 27, 4, 0, 0, 0, time.UTC) + if o := WaitsOutsideFinding("ace", "nats", "", outside.OnUnread, at); !strings.Contains(o.Needs, "assigner_release") || !strings.Contains(o.Needs, "rejudge") { + t.Errorf("a wait on conditions-unread needs %q", o.Needs) + } + if o := WaitsOutsideFinding("ace", "nats", "machine.hub.unreachable", "unreachable:hub", at); o.Needs != "Nothing for you to do." { + t.Errorf("a wait on a cause needs %q", o.Needs) + } + }) } // 1952/WM6 (ADR 0564 §2, issue 1952 note 16): every condition the assigner says is a finding in its own bucket, under