diff --git a/modules/distribution/module.json b/modules/distribution/module.json index cfc9b8f2c..c55d46e45 100644 --- a/modules/distribution/module.json +++ b/modules/distribution/module.json @@ -62,14 +62,12 @@ "mesh-delivery-view.delivered", "node-engine.manifest-reads-changed" ], - "emits": [ - "old-name-closed", - "direct-writes-closed" - ], "config": { "callers": { "type": "string", "trusted": true, + "runtime": true, + "default": "", "description": "per verb, the modules that may call it (JSON object of verb to modules; operator for the operator's session); empty is design 51's list" } }, @@ -120,6 +118,10 @@ "storage": "stream", "template": "events", "options": { + "events": [ + "old-name-closed", + "direct-writes-closed" + ], "max-age-days": 7, "max-mib": 16 } diff --git a/modules/gitea/cmd/package-registry/retention_test.go b/modules/gitea/cmd/package-registry/retention_test.go index 092d3dc12..d1df9bee9 100644 --- a/modules/gitea/cmd/package-registry/retention_test.go +++ b/modules/gitea/cmd/package-registry/retention_test.go @@ -468,11 +468,16 @@ func TestToolsAreTheOnesTheReadmeNamesAndSayWhatTheyDo(t *testing.T) { t.Errorf("the seat tools are %v", names) } req, _ := json.Marshal(m.Requires) - for _, want := range []string{`"name":"incoming"`, `"name":"transfers"`, `"name":"findings"`, `"name":"idle","options":{"key-ttl":true}`} { + for _, want := range []string{`"name":"incoming"`, `"name":"transfers"`, `"name":"idle","options":{"key-ttl":true}`} { if !strings.Contains(string(req), want) { t.Errorf("the manifest does not require %s (%s)", want, req) } } + // findings is one local name in one form (novox/hq ADR 0595 §11): the old section state, which the TypeScript bundle + // announces readable for the condition keeper (kept.ts), never also under requires. + if strings.Contains(string(req), `"name":"findings"`) { + t.Errorf("findings is required as well as kept in state: %s", req) + } // transfers keeps for good: a lifetime of its own would drop a transfer's key and leave its chunks in incoming. if strings.Contains(string(req), `"name":"transfers","options"`) { t.Errorf("transfers has options (a lifetime): %s", req) diff --git a/modules/gitea/module.json b/modules/gitea/module.json index 0c0e1095d..49fd37455 100644 --- a/modules/gitea/module.json +++ b/modules/gitea/module.json @@ -26,11 +26,6 @@ "options": { "key-ttl": true } - }, - { - "name": "findings", - "storage": "key-value", - "template": "state" } ], "contributes": { @@ -230,6 +225,7 @@ "callers": { "type": "string", "trusted": true, + "runtime": true, "default": "", "description": "per verb of the two package seats, the callers that may call it (JSON object of verb to callers; * every proved caller, operator the operator's session); empty is design 51's list: publish and publish-part mesh-build-go and mesh-build-node, remove mesh-delivery-builder, versions anyone" } diff --git a/modules/mesh-config/cmd/mesh-config/manifest_test.go b/modules/mesh-config/cmd/mesh-config/manifest_test.go index 42fa4e6de..0c14a2267 100644 --- a/modules/mesh-config/cmd/mesh-config/manifest_test.go +++ b/modules/mesh-config/cmd/mesh-config/manifest_test.go @@ -4,6 +4,7 @@ import ( "encoding/json" "os" "path/filepath" + "slices" "strings" "testing" @@ -53,11 +54,9 @@ func TestEveryStateAndActHasItsTool(t *testing.T) { if dm, err := catalogue.Decode(raw); err != nil { t.Errorf("the manifest does not decode: %v", err) } else { - emits := strings.Join(dm.Emits, ",") - for _, e := range []string{ConfigChanged, EventRenamed, EventRetiring, EventRetired} { - if !strings.Contains(emits, e) { - t.Errorf("the manifest does not declare the event %s", e) - } + // An event goes to one place (novox/hq ADR 0363 §2): config-changed to EVENTS, the rename window's to the stream. + if !slices.Equal(dm.Emits, []string{ConfigChanged}) { + t.Errorf("emits %v, want only %s: the stream carries the others", dm.Emits, ConfigChanged) } if len(dm.Streams) != 1 || dm.Streams[0].Name != StreamName || dm.Streams[0].Days() != 7 || !dm.Streams[0].Carries(EventRenamed) || !dm.Streams[0].Carries(EventRetiring) || !dm.Streams[0].Carries(EventRetired) || dm.Streams[0].Carries(ConfigChanged) { diff --git a/modules/mesh-config/module.json b/modules/mesh-config/module.json index f52841dcd..117fa37eb 100644 --- a/modules/mesh-config/module.json +++ b/modules/mesh-config/module.json @@ -13,10 +13,7 @@ } ], "emits": [ - "config-changed", - "renamed", - "retiring", - "retired" + "config-changed" ], "uses": [ "operator-channel" diff --git a/modules/mesh-knowledge/cmd/mesh-knowledge/ledger_fake_test.go b/modules/mesh-knowledge/cmd/mesh-knowledge/ledger_fake_test.go index 377eb6023..91d773573 100644 --- a/modules/mesh-knowledge/cmd/mesh-knowledge/ledger_fake_test.go +++ b/modules/mesh-knowledge/cmd/mesh-knowledge/ledger_fake_test.go @@ -148,7 +148,7 @@ func (f *fakeLedger) apply(r buscalls.ApplyRequest) (buscalls.Applied, error) { continue } okType := map[string]func(any) bool{ - "string": func(v any) bool { _, ok := v.(string); return ok }, "integer": func(v any) bool { _, ok := v.(float64); return ok }, + "string": func(v any) bool { _, ok := v.(string); return ok }, "text": func(v any) bool { _, ok := v.(string); return ok }, "integer": func(v any) bool { _, ok := v.(float64); return ok }, "object": func(v any) bool { _, ok := v.(map[string]any); return ok }, }[field.Type] if okType != nil && !okType(v) { diff --git a/modules/mesh-knowledge/module.json b/modules/mesh-knowledge/module.json index 0f4c24c0c..71dd47421 100644 --- a/modules/mesh-knowledge/module.json +++ b/modules/mesh-knowledge/module.json @@ -17,7 +17,7 @@ "version": {"type": "object"}, "pending-sections": {"type": "object"}, "title": {"type": "string"}, - "text": {"type": "string"}, + "text": {"type": "text"}, "digest": {"type": "string", "digest-of": "text"}, "why": {"type": "string"}, "reason": {"type": "string"} @@ -49,7 +49,7 @@ "version": {"type": "object"}, "pending-sections": {"type": "object"}, "title": {"type": "string"}, - "text": {"type": "string"}, + "text": {"type": "text"}, "digest": {"type": "string", "digest-of": "text"}, "why": {"type": "string"}, "reason": {"type": "string"} @@ -242,6 +242,7 @@ "config": { "readers": { "type": "object", + "trusted": true, "description": "The modules heard on the reviews of records (the stream of each part's verdict), by name, each with why; empty grants none. Set only at the controller's terminal or on the operator's Approve.", "default": {} }, diff --git a/modules/messenger/cmd/messenger/manifest_test.go b/modules/messenger/cmd/messenger/manifest_test.go index b5272447a..481e6769d 100644 --- a/modules/messenger/cmd/messenger/manifest_test.go +++ b/modules/messenger/cmd/messenger/manifest_test.go @@ -95,7 +95,7 @@ func TestItDeclaresTheSeatsOfAnAskAndHoldsTheOperatorChannel(t *testing.T) { // } // It performs nothing: the verbs it calls read the open conditions, whether root is free, and which issues // track which conditions. - if !reflect.DeepEqual(m.Emits, []string{"refused", "offered", "closed"}) || !reflect.DeepEqual(m.Invokes, []string{ + if !reflect.DeepEqual(m.Emits, []string{"refused"}) /* offered and closed go to the stream asks only (ADR 0363 §2) */ || !reflect.DeepEqual(m.Invokes, []string{ "seat:mesh-conditions.conditions", "seat:" + EngineSeat + ".root-free", TrackingVerb}) { t.Fatalf("emits %v invokes %v", m.Emits, m.Invokes) } diff --git a/modules/messenger/module.json b/modules/messenger/module.json index f831d641e..4ca99c0f0 100644 --- a/modules/messenger/module.json +++ b/modules/messenger/module.json @@ -86,9 +86,7 @@ "intake.standing" ], "emits": [ - "refused", - "offered", - "closed" + "refused" ], "streams": [ {