From 5b9c81bf26fab51e574cd108d5653667d7c33cb4 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 12 Oct 2026 01:44:18 +0200 Subject: [PATCH 1/2] Hold a leaf delivery to three minutes (hq ADR 0304 decision 4, issue 525) ADR 0304 lowered a leaf module's delivery budget from five minutes to three, the time its measured phases support once a leaf is judged on one reading and waits only for what it shares. --- cmd/mesh-controller/doctor.go | 4 ++-- cmd/mesh-controller/over_budget.go | 9 +++++---- cmd/mesh-controller/over_budget_test.go | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cmd/mesh-controller/doctor.go b/cmd/mesh-controller/doctor.go index ff21a2b6..f98e4039 100644 --- a/cmd/mesh-controller/doctor.go +++ b/cmd/mesh-controller/doctor.go @@ -122,8 +122,8 @@ var probeRegistry = []probe{ Kind: kindDeliveryStalled, Phase: 3, run: probeDeliveries}, // The delivery budgets (novox/hq ADR 0282 decision 7): the newest delivery of each class within its budget, // read from mesh-delivery's `times`; a measurement said, never a delivery held. - {ID: probeBudgetsID, Asserts: "the newest delivery of a leaf module ran on every machine within five minutes of " + - "its merge, and of a core module within ten: mesh-delivery's `times`", From: "ADR 0282", + {ID: probeBudgetsID, Asserts: "the newest delivery of a leaf module ran on every machine within three minutes of " + + "its merge, and of a core module within ten: mesh-delivery's `times`", From: "ADR 0282, ADR 0304", Kind: kindOverBudget, Phase: 3, run: probeBudgets}, // A client of the bus reconnecting in a loop (novox/hq issue 327), from the server's record of closed // connections, which the bus's own module reads. diff --git a/cmd/mesh-controller/over_budget.go b/cmd/mesh-controller/over_budget.go index 8fbc895c..a3b8101e 100644 --- a/cmd/mesh-controller/over_budget.go +++ b/cmd/mesh-controller/over_budget.go @@ -17,8 +17,8 @@ import ( // A delivery over its budget is loud (novox/hq ADR 0282 decision 7, issue 382): the self-check reads // mesh-delivery's `times` and raises the warning `delivery..over-budget` when the newest delivery of a -// class whose delivery time is known took longer than its class's budget — five minutes for a leaf module, ten -// for a core module — naming the delivery and its longest phase. It clears when the next delivery of that class +// class whose delivery time is known took longer than its class's budget — three minutes for a leaf module (ADR +// 0304 decision 4), ten for a core module — naming the delivery and its longest phase. It clears when the next delivery of that class // lands within its budget. Measurement only: the condition says, it never holds or acts on a delivery. // probeBudgetsID is the probe that reads the delivery times. @@ -27,8 +27,9 @@ const probeBudgetsID = "D16" // kindOverBudget is what a delivery over its class's budget raises. const kindOverBudget = "over-budget" -// deliveryBudgets are the budgets by class (ADR 0282 decision 1); the probe raises nothing for another class. -var deliveryBudgets = map[string]time.Duration{inventory.ClassLeaf: 5 * time.Minute, inventory.ClassCore: 10 * time.Minute} +// deliveryBudgets are the budgets by class (ADR 0282 decision 1, the leaf's as ADR 0304 decision 4 changed it); +// the probe raises nothing for another class. +var deliveryBudgets = map[string]time.Duration{inventory.ClassLeaf: 3 * time.Minute, inventory.ClassCore: 10 * time.Minute} // timesAnswer is what mesh-delivery's `times` answers, as far as the probe reads it. type timesAnswer struct { diff --git a/cmd/mesh-controller/over_budget_test.go b/cmd/mesh-controller/over_budget_test.go index 483e068a..3131e9b8 100644 --- a/cmd/mesh-controller/over_budget_test.go +++ b/cmd/mesh-controller/over_budget_test.go @@ -10,11 +10,12 @@ import ( "github.com/novox/mesh-controller/internal/inventory" ) -// A leaf delivery of 5 minutes 10 seconds raises delivery.leaf.over-budget naming its longest phase; one of -// exactly five minutes, a core one of nine and a class without a budget raise nothing (ADR 0282 decision 7). +// A leaf delivery of 3 minutes 10 seconds raises delivery.leaf.over-budget naming its longest phase; one of +// exactly three minutes, a core one of nine and a class without a budget raise nothing (ADR 0282 decision 7, +// the leaf's budget as ADR 0304 decision 4 changed it). func TestADeliveryOverItsBudgetIsLoud(t *testing.T) { a := ×Answer{Classes: []timesClass{ - {Class: inventory.ClassLeaf, Latest: ×Latest{ID: "novox/mesh-catalog@abc", TookMS: (5*time.Minute + 10*time.Second).Milliseconds(), + {Class: inventory.ClassLeaf, Latest: ×Latest{ID: "novox/mesh-catalog@abc", TookMS: (3*time.Minute + 10*time.Second).Milliseconds(), Longest: "judgement 2m40s"}}, {Class: inventory.ClassCore, Latest: ×Latest{ID: "novox/mesh-controller@def", TookMS: (9 * time.Minute).Milliseconds(), Longest: "build 1m"}}, @@ -30,7 +31,7 @@ func TestADeliveryOverItsBudgetIsLoud(t *testing.T) { t.Fatalf("the condition names its delivery and longest phase: %s — %s", o.Key(), o.Summary) } // The next leaf delivery within its budget clears it: the probe raises nothing for the class. - a.Classes[0].Latest = ×Latest{ID: "novox/mesh-catalog@ghi", TookMS: (5 * time.Minute).Milliseconds()} + a.Classes[0].Latest = ×Latest{ID: "novox/mesh-catalog@ghi", TookMS: (3 * time.Minute).Milliseconds()} if obs := overBudgetObservations(a); len(obs) != 0 { t.Fatalf("a delivery of exactly its budget is within it: %+v", obs) } From e6bd8f1deec4f5c9263af6edd5396d884928e623 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 12 Oct 2026 01:46:26 +0200 Subject: [PATCH 2/2] Say a leaf delivery's budget as three minutes in the times verb's description --- internal/catalogue/delivery_seat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/catalogue/delivery_seat.go b/internal/catalogue/delivery_seat.go index 7871f694..682723e1 100644 --- a/internal/catalogue/delivery_seat.go +++ b/internal/catalogue/delivery_seat.go @@ -21,7 +21,7 @@ func deliveryVerbs() []Verb { // Delivery time against the delivery budgets (novox/hq ADR 0282): what probe D16 reads, optional until its // holder serves it. {Name: "times", Description: "Delivery time: from a merge to every machine of its walk running the build. " + - "Each class's delivery budget (a leaf module five minutes, a core module ten), the last days' median and " + + "Each class's delivery budget (a leaf module three minutes, a core module ten), the last days' median and " + "worst, how many within and over, the newest delivery of each class, every delivery over its budget with its " + "longest phase, and the delivered ones whose time is not known. Given a delivery's id, its time phase by phase.", Input: schema(map[string]string{"days": "how many days back (default 7)", "id": "one delivery's id: its phases"}, nil),