TL4: the teller's manifest says version 0.1, declares its finding stream and hears the keeper's ask

Builds: design 47 G §383, §387, §368, §411

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 11:48:34 +01:00
parent 839bc4a6e5
commit 9b9e9f68bb
2 changed files with 29 additions and 4 deletions
+19 -3
View File
@@ -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 <module>-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)
}
+10 -1
View File
@@ -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"
],