From f39572c87817872001f7bdf5566e654722d91a12 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 03:10:46 +0100 Subject: [PATCH] RD-0: the judge's state rule names max-mib among a state's words MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mesh-sdk's reader release reads max-mib on an old state section and names it in its refusal of an unknown word; the judge's row reads that refusal. Builds: design 47 G §494, §469 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- .../mesh-delivery-indexer/judge/rules_test.go | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/mesh-delivery-indexer/judge/rules_test.go b/modules/mesh-delivery-indexer/judge/rules_test.go index 113c1610..809a516b 100644 --- a/modules/mesh-delivery-indexer/judge/rules_test.go +++ b/modules/mesh-delivery-indexer/judge/rules_test.go @@ -2929,7 +2929,7 @@ func caseAStateNameIsLocalAndOneToken(t *testing.T) { {`{"module":"a.b","version":"1","state":["s"]}`, `no dot`}, {`{"module":"a","version":"1","reads":["bindings"]}`, `a read is .`}, {`{"module":"a","version":"1","reads":["a.s"]}`, `which is its own state`}, - {`{"module":"a","version":"1","state":[{"name":"s","shared":true}]}`, `{name, history, ttl-seconds, per-machine, key-ttl, read-only, form, catch-up}`}, + {`{"module":"a","version":"1","state":[{"name":"s","shared":true}]}`, `{name, history, ttl-seconds, per-machine, key-ttl, read-only, max-mib, form, catch-up}`}, } { _, err := ParseManifest([]byte(c.manifest)) if c.says == "" { @@ -6379,4 +6379,25 @@ func TestRulesOther(t *testing.T) { t.Run("AskingForTheRuleSetWithNowhereToPutItIsRefused", caseAskingForTheRuleSetWithNowhereToPutItIsRefused) t.Run("TakesSettingsIsRefusedWhereItCannotMeanAnything", caseTakesSettingsIsRefusedWhereItCannotMeanAnything) t.Run("TheInstallationCheckReadsADefault", caseTheInstallationCheckReadsADefault) + t.Run("ASeatNamedViewIsJudgedAgainstTheSeatsViews", caseASeatNamedViewIsJudgedAgainstTheSeatsViews) +} + +// A consumed view, `seat:.views.`, is accepted where the seat offers the state as a view and refused, by name, +// where it does not or the seat is unknown (design 47 G §616, §699, §621). +func caseASeatNamedViewIsJudgedAgainstTheSeatsViews(t *testing.T) { + was := catalogue.Seats() + t.Cleanup(func() { catalogue.UseSeats(was) }) + catalogue.UseSeats([]catalogue.Seat{{Name: "mesh-module-assigner", Scope: catalogue.ScopeMesh, Decision: "test", + Views: []string{"assignments"}}}) + for _, row := range []struct{ consume, says string }{ + {"seat:mesh-module-assigner.views.assignments", ""}, + {"seat:mesh-module-assigner.views.placement", "does not offer the state"}, + {"seat:mesh-unknown.views.assignments", "mesh-unknown"}, + {"seat:mesh-module-assigner.assignments", "does not name a seat and its view"}, + } { + problems := strings.Join(EventProblems(catalogue.Manifest{Module: "reader", Consumes: []string{row.consume}}), "\n") + if row.says == "" && problems != "" || row.says != "" && !strings.Contains(problems, row.says) { + t.Errorf("%s: problems %q, want %q", row.consume, problems, row.says) + } + } }