Finding 6 (review r1): a wait on conditions-unread names assigner_release with rejudge

Builds: design 47 H2b §829 5.
This commit is contained in:
2026-11-27 03:54:36 +01:00
parent f3d678d88d
commit abd2e6e50f
2 changed files with 18 additions and 1 deletions
@@ -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 `<node>.<module>`, 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).
@@ -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