diff --git a/modules/mesh-delivery-teller/manifest_test.go b/modules/mesh-delivery-teller/manifest_test.go index 829136df..953960be 100644 --- a/modules/mesh-delivery-teller/manifest_test.go +++ b/modules/mesh-delivery-teller/manifest_test.go @@ -23,6 +23,13 @@ type state struct { History int `json:"history,omitempty"` } +type stream struct { + Name string `json:"name"` + Events []string `json:"events"` + MaxAgeDays int `json:"max-age-days"` + MaxMiB int `json:"max-mib"` +} + type artifact struct { Name string `json:"name"` Kind string `json:"kind"` @@ -44,6 +51,7 @@ type manifest struct { Invokes []string `json:"invokes"` Consumes []string `json:"consumes"` Emits []string `json:"emits"` + Streams []stream `json:"streams"` OwnSecrets map[string]string `json:"own-secrets"` SecretsOwner string `json:"secrets-owner"` Resources []map[string]any `json:"resources"` @@ -102,7 +110,8 @@ func TestManifestDeclarations(t *testing.T) { // 1240/AC1 if want := []string{"mesh-delivery-assigner.assigner_read_asks", "seat:mesh-hand-acts.hand-act"}; !reflect.DeepEqual(m.Invokes, want) { t.Errorf("invokes = %v, want %v", m.Invokes, want) } - if want := []string{"mesh-delivery-assigner.views.asks"}; !reflect.DeepEqual(m.Consumes, want) { + // design 47 G §387: the keeper's ask for the findings is heard, and the finding stream is declared (§383). + if want := []string{"mesh-conditions.findings-asked", "mesh-delivery-assigner.views.asks"}; !reflect.DeepEqual(m.Consumes, want) { t.Errorf("consumes = %v, want %v", m.Consumes, want) } if want := []string{"operator-channel"}; !reflect.DeepEqual(sorted(m.Uses), want) { @@ -122,8 +131,15 @@ func TestManifestDeclarations(t *testing.T) { // 1240/AC1 if want := []string{tellerevents.AskEnded}; !reflect.DeepEqual(m.Emits, want) { t.Errorf("emits = %v, want %v", m.Emits, want) } - // No streams, bus or seat (ADR 0437 §4). - for _, k := range []string{"streams", "logs", "claims", "provides", "requires", "defines-seats", "seat", "seats", "bus"} { + // design 47 G §383, §387: the stream -findings, 7 days and 16 MiB; §368: version is MAJOR.MINOR. + if want := []stream{{Name: "mesh-delivery-teller-findings", Events: []string{"finding-written.*", "finding-cleared.*", "findings-stated.*"}, MaxAgeDays: 7, MaxMiB: 16}}; !reflect.DeepEqual(m.Streams, want) { + t.Errorf("streams = %+v, want %+v", m.Streams, want) + } + if m.Version != "0.1" { + t.Errorf("version = %q, want 0.1", m.Version) + } + // No bus or seat (ADR 0437 §4). + for _, k := range []string{"logs", "claims", "provides", "requires", "defines-seats", "seat", "seats", "bus"} { if _, ok := top[k]; ok { t.Errorf("the manifest declares %q: the teller has none", k) } diff --git a/modules/mesh-delivery-teller/module.json b/modules/mesh-delivery-teller/module.json index c6e1a80c..cc176fd7 100644 --- a/modules/mesh-delivery-teller/module.json +++ b/modules/mesh-delivery-teller/module.json @@ -1,6 +1,6 @@ { "module": "mesh-delivery-teller", - "version": "1", + "version": "0.1", "slug": "teller", "tools": [ "teller_end_ask", @@ -12,8 +12,17 @@ "seat:mesh-hand-acts.hand-act" ], "consumes": [ + "mesh-conditions.findings-asked", "mesh-delivery-assigner.views.asks" ], + "streams": [ + { + "name": "mesh-delivery-teller-findings", + "events": ["finding-written.*", "finding-cleared.*", "findings-stated.*"], + "max-age-days": 7, + "max-mib": 16 + } + ], "emits": [ "ask-ended" ],