From b30232298c93942ae99fba3098e81f0257086e19 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 13 Nov 2026 11:45:26 +0100 Subject: [PATCH] D4 judge-foundation-list: the parts G puts on the foundation list keep their old sections before it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before G's merge the foundation list stays as it is; the forge module, the image registry module and the node-engine's module are accepted with their old `objects` section, their stream `-findings` and their bus state in `requires`, as G's judge accepts them, and are counted as today, so no other module's verdict moves. Builds: design 47 G §584, §627, §529, A-343, A-345 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- modules/mesh-delivery-indexer/judge/judge_test.go | 13 +++++++++++-- modules/mesh-delivery-indexer/judge/oldsections.go | 8 +++++++- modules/mesh-delivery-indexer/judge/rules.go | 5 +++-- modules/mesh-delivery-indexer/judge/rules_test.go | 5 +++++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/modules/mesh-delivery-indexer/judge/judge_test.go b/modules/mesh-delivery-indexer/judge/judge_test.go index 0eaf20e8..5cecb643 100644 --- a/modules/mesh-delivery-indexer/judge/judge_test.go +++ b/modules/mesh-delivery-indexer/judge/judge_test.go @@ -116,7 +116,15 @@ func TestTheJudge(t *testing.T) { "user": {Raw: json.RawMessage(`{"module":"user","version":"1","state":["x"]}`)}, "late": {Raw: json.RawMessage(`{"module":"late","version":"1","logs":[{"name":"l"}]}`)}, "newer": {Raw: json.RawMessage(`{"module":"newer","version":"1","state":["y"]}`)}, - "mesh-grants": {Raw: json.RawMessage(`{"module":"mesh-grants","version":"1","logs":[{"name":"l"}]}`)}}}, + "mesh-grants": {Raw: json.RawMessage(`{"module":"mesh-grants","version":"1","logs":[{"name":"l"}]}`)}, + // Design 47 G §584, §627, A-345: the parts G puts on the foundation list keep their old sections before it, the + // old objects section, the stream `-findings` and bus state in `requires` among them; another module's + // old objects section, which no trunk module uses, is refused as before. + "gitea": {Raw: json.RawMessage(`{"module":"gitea","version":"1","objects":[{"name":"incoming","max-mib":64}],` + + `"requires":[{"name":"idle","storage":"key-value","template":"state"}]}`)}, + "mesh-host": {Raw: json.RawMessage(`{"module":"mesh-host","version":"1","streams":[` + + `{"name":"mesh-host-findings","events":["finding-written.*"],"max-age-days":7,"max-mib":16}]}`)}, + "keeper": {Raw: json.RawMessage(`{"module":"keeper","version":"1","objects":[{"name":"incoming","max-mib":64}]}`)}}}, {Name: "trunk", Manifests: map[string]composer.Manifest{ "user": {Raw: json.RawMessage(`{"module":"user","version":"1","state":["x"]}`)}, "mesh-grants": {Raw: json.RawMessage(`{"module":"mesh-grants","version":"1","logs":[{"name":"l"}]}`)}}}}} @@ -126,7 +134,8 @@ func TestTheJudge(t *testing.T) { } got := ov.Cases[0].Manifests if got["late"].Accepted || !strings.Contains(got["late"].Refused, "late uses the old section logs") || - !got["newer"].Accepted || !got["user"].Accepted || !got["mesh-grants"].Accepted { + !got["newer"].Accepted || !got["user"].Accepted || !got["mesh-grants"].Accepted || !got["gitea"].Accepted || + !got["mesh-host"].Accepted || got["keeper"].Accepted || !strings.Contains(got["keeper"].Refused, "keeper uses the old section objects") { t.Errorf("the change's old sections: %+v", got) } r.Cases[0].Manifests["c"] = composer.Manifest{Digest: strings.Repeat("a", 64)} diff --git a/modules/mesh-delivery-indexer/judge/oldsections.go b/modules/mesh-delivery-indexer/judge/oldsections.go index 91a2446d..d4e28eb8 100644 --- a/modules/mesh-delivery-indexer/judge/oldsections.go +++ b/modules/mesh-delivery-indexer/judge/oldsections.go @@ -23,6 +23,12 @@ var OldSections = []string{"state", "logs", "streams", "objects"} var Foundation = []string{"nats", "mesh-grants", "mesh-delivery-indexer", "mesh-delivery-assigner", "node-tools", "mesh-delivery-builder", "mesh-delivery-checker", "mesh-config", "mesh-vault"} +// foundationAtG are the parts design 47 G puts on the foundation list in its own change: the forge module and the image +// registry module (G §584) and the node-engine's module (§627). Until then their old sections are accepted as a foundation +// part's, its old `objects` section and its stream `-findings` among them, and their bus state in `requires` as +// today (A-343, A-345); they are counted as today, so no other module's verdict moves. +var foundationAtG = []string{"gitea", "distribution", "mesh-host"} + // ViewOwners are the two owners whose state every reader reads through their first views and read tools, never by a // `reads` entry (novox/hq ADR 0615 §1): CountOwnerReads counts what is left of those entries. var ViewOwners = []string{"mesh-delivery-indexer", "mesh-delivery-assigner"} @@ -90,7 +96,7 @@ func OldSectionProblems(m catalogue.Manifest, counts OldSectionCounts) []string } return nil } - if counts == nil { + if counts == nil || slices.Contains(foundationAtG, m.Module) { return nil } var problems []string diff --git a/modules/mesh-delivery-indexer/judge/rules.go b/modules/mesh-delivery-indexer/judge/rules.go index 01dfe290..6af40f0a 100644 --- a/modules/mesh-delivery-indexer/judge/rules.go +++ b/modules/mesh-delivery-indexer/judge/rules.go @@ -5701,8 +5701,9 @@ func PredefinedFormProblems(m catalogue.Manifest) []string { for _, s := range m.Streams { // A stream that keeps its history is one of the bus's predefined forms (novox/hq ADR 0592 §6). // A foundation part keeps its old sections for good, its streams among them: its findings stream - // `-findings` (design 47 G §529, A-30, A-146). - if !s.KeepsHistory() && !slices.Contains(Foundation, m.Module) && !slices.Contains(streamsKeptUntilMoved[m.Module], s.Name) { + // `-findings` (design 47 G §529, A-30, A-146); so do the parts G puts on the list (A-345). + foundation := slices.Contains(Foundation, m.Module) || slices.Contains(foundationAtG, m.Module) + if !s.KeepsHistory() && !foundation && !slices.Contains(streamsKeptUntilMoved[m.Module], s.Name) { out = append(out, fmt.Sprintf("%s keeps the stream %q, outside the bus's predefined forms: keep it as a state, "+ "a log or an object store, which the runtime reads for the module's tools and others read by `reads`", m.Module, s.Name)) } diff --git a/modules/mesh-delivery-indexer/judge/rules_test.go b/modules/mesh-delivery-indexer/judge/rules_test.go index 6be77af8..5da4519e 100644 --- a/modules/mesh-delivery-indexer/judge/rules_test.go +++ b/modules/mesh-delivery-indexer/judge/rules_test.go @@ -5226,6 +5226,11 @@ func caseTwoModulesCannotDeclareOneStream(t *testing.T) { if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-delivery-indexer", Streams: findings}); len(got) != 0 { t.Fatalf("a foundation part's findings stream was refused: %v", got) } + // So does a part G puts on the list, before it (design 47 G §627, A-345). + hostFindings := []catalogue.StreamDeclaration{{Name: "mesh-host-findings", Events: []string{"finding-written.*"}}} + if got := PredefinedFormProblems(catalogue.Manifest{Module: "mesh-host", Streams: hostFindings}); len(got) != 0 { + t.Fatalf("the node-engine's findings stream was refused: %v", got) + } } // A seat name meaning two protocols is the failure nobody could diagnose afterwards.