From eba4309b19cfbac2268c0a1da3cf3ef06e2f0518 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 20:58:06 +0100 Subject: [PATCH 1/2] Declare every Go package another module imports as a package artifact of its module (H-A-186) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mesh-build-go and other modules import packages of this repository that no manifest declared, so no release published them and the registry holds no version: their importers stay unpinned and fail past the bound. Each module now declares its imported packages in the form they had before issue 1966's bootstrap took them out: asks (assigner), builds and buildrun (builder), forgemsg (forge bridge), takein (indexer), tellerevents (teller), viewstate (view), grantsstate and busgrants (grants), each a Go package of series 0.1. Each module's manifest test asserts its packages again. Builds: design 47 G §370, H-A-186 --- .../mesh-delivery-assigner/manifest_test.go | 7 +++++++ modules/mesh-delivery-assigner/module.json | 9 +++++++++ modules/mesh-delivery-builder/manifest_test.go | 14 ++++++++++---- modules/mesh-delivery-builder/module.json | 18 ++++++++++++++++++ .../manifest_test.go | 11 +++++++---- modules/mesh-delivery-forge-bridge/module.json | 9 +++++++++ modules/mesh-delivery-indexer/manifest_test.go | 10 ++++++++-- modules/mesh-delivery-indexer/module.json | 9 +++++++++ modules/mesh-delivery-teller/manifest_test.go | 10 ++++++++-- modules/mesh-delivery-teller/module.json | 9 +++++++++ modules/mesh-delivery-view/manifest_test.go | 5 ++--- modules/mesh-delivery-view/module.json | 9 +++++++++ modules/mesh-grants/grants_test.go | 11 +++++++++++ modules/mesh-grants/module.json | 18 ++++++++++++++++++ 14 files changed, 134 insertions(+), 15 deletions(-) diff --git a/modules/mesh-delivery-assigner/manifest_test.go b/modules/mesh-delivery-assigner/manifest_test.go index 16bf094b..993f5206 100644 --- a/modules/mesh-delivery-assigner/manifest_test.go +++ b/modules/mesh-delivery-assigner/manifest_test.go @@ -119,6 +119,13 @@ func TestManifest(t *testing.T) { } } } + // H-A-186 (design 47 G §370): asks, which the gate, the teller and the view import, is a declared Go package of the + // module, so every release publishes it. + if !slices.ContainsFunc(m.Build.Artifacts, func(a catalogue.Artifact) bool { + return a.Name == "asks" && a.Kind == catalogue.ArtifactPackage && a.Language == "go" && slices.Equal(a.Paths, []string{"asks"}) && a.Series == "0.1" + }) { + t.Errorf("artifacts = %+v, want the Go package asks of series 0.1", m.Build.Artifacts) + } // ADR 0635 §5: its views family is its ordinary events, `views.` among its emits, on no stream of its own. // The seat's four events are said on the seat's own subject (the seat's family), so the module keeps no stream for them // and lists none among its emits. diff --git a/modules/mesh-delivery-assigner/module.json b/modules/mesh-delivery-assigner/module.json index 5dfdd07d..659044dc 100644 --- a/modules/mesh-delivery-assigner/module.json +++ b/modules/mesh-delivery-assigner/module.json @@ -370,6 +370,15 @@ "loads": [ "mesh-delivery-assigner" ] + }, + { + "name": "asks", + "kind": "package", + "language": "go", + "paths": [ + "asks" + ], + "series": "0.1" } ] } diff --git a/modules/mesh-delivery-builder/manifest_test.go b/modules/mesh-delivery-builder/manifest_test.go index f39d8693..cdec75a2 100644 --- a/modules/mesh-delivery-builder/manifest_test.go +++ b/modules/mesh-delivery-builder/manifest_test.go @@ -266,10 +266,16 @@ func TestManifestProcess(t *testing.T) { // 1607/AC1 if _, bus := p["bus"]; bus { t.Errorf("the process declares a bus: it runs on its own broker credential") } - // Issue 1966's bootstrap: the package artifact builds is out of the manifest until the new builder runs; the follow-up - // puts it back with its assertion (ADR 0634 §1, ADR 0606 §4: three artifacts, the third the package builds). - if len(m.Build.Artifacts) != 2 { - t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts) + // H-A-186, design 47 G §370: a Go package another module imports is a declared package artifact of its module, so every + // release publishes it: builds (ADR 0634 §1, ADR 0606 §4), imported by the build modules and the node-engine, and + // buildrun, imported by the indexer, the view and the watchman. + if len(m.Build.Artifacts) != 4 { + t.Fatalf("artifacts = %+v, want the program, the tools and the packages builds and buildrun", m.Build.Artifacts) + } + for i, name := range []string{"builds", "buildrun"} { + if a := m.Build.Artifacts[2+i]; a.Name != name || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{name}) || a.Series != "0.1" { + t.Errorf("package artifact = %+v, want the Go package %s of series 0.1", a, name) + } } if a := m.Build.Artifacts[1]; a.Name != "tools" || a.Kind != "bundle" || a.Binary != "mesh-delivery-builder-tools" || !reflect.DeepEqual(a.Loads, []string{"mesh-delivery-builder-tools"}) { t.Errorf("tools artifact = %+v", a) // 1945 diff --git a/modules/mesh-delivery-builder/module.json b/modules/mesh-delivery-builder/module.json index 144223d5..7419cf8d 100644 --- a/modules/mesh-delivery-builder/module.json +++ b/modules/mesh-delivery-builder/module.json @@ -334,6 +334,24 @@ "loads": [ "mesh-delivery-builder-tools" ] + }, + { + "name": "builds", + "kind": "package", + "language": "go", + "paths": [ + "builds" + ], + "series": "0.1" + }, + { + "name": "buildrun", + "kind": "package", + "language": "go", + "paths": [ + "buildrun" + ], + "series": "0.1" } ] } diff --git a/modules/mesh-delivery-forge-bridge/manifest_test.go b/modules/mesh-delivery-forge-bridge/manifest_test.go index fe97eebb..3c81cb8d 100644 --- a/modules/mesh-delivery-forge-bridge/manifest_test.go +++ b/modules/mesh-delivery-forge-bridge/manifest_test.go @@ -187,10 +187,13 @@ func TestManifestProcess(t *testing.T) { // 1235/AC1 if _, bus := p["bus"]; bus { t.Errorf("the process declares a bus: it runs on its own broker credential") } - // Issue 1966's bootstrap: the package artifact forgemsg is out of the manifest until the new builder runs; the follow-up - // puts it back with its assertion (ADR 0573 §1: three artifacts, the third the package forgemsg). - if len(m.Build.Artifacts) != 2 || m.Build.Artifacts[1].Name != "tools" || m.Build.Artifacts[1].From != "cmd/mesh-delivery-forge-bridge-tools" { - t.Fatalf("artifacts = %+v, want the program and the tools bundle", m.Build.Artifacts) + if len(m.Build.Artifacts) != 3 || m.Build.Artifacts[1].Name != "tools" || m.Build.Artifacts[1].From != "cmd/mesh-delivery-forge-bridge-tools" { + t.Fatalf("artifacts = %+v, want the program, the tools bundle and the package forgemsg", m.Build.Artifacts) + } + // ADR 0573 §1, H-A-186 (design 47 G §370): the gate, the builder and the indexer import forgemsg, so the module declares + // it as a package and every release publishes it. + if a := m.Build.Artifacts[2]; a.Name != "forgemsg" || a.Kind != "package" || a.Language != "go" || len(a.Paths) != 1 || a.Paths[0] != "forgemsg" || a.Series != "0.1" { + t.Errorf("package artifact = %+v", a) } a := m.Build.Artifacts[0] if st, err := os.Stat(a.From); err != nil || !st.IsDir() || a.Binary != "mesh-delivery-forge-bridge" || !strings.HasSuffix(a.From, a.Binary) { diff --git a/modules/mesh-delivery-forge-bridge/module.json b/modules/mesh-delivery-forge-bridge/module.json index 3e185e86..2cdf59b7 100644 --- a/modules/mesh-delivery-forge-bridge/module.json +++ b/modules/mesh-delivery-forge-bridge/module.json @@ -101,6 +101,15 @@ "loads": [ "mesh-delivery-forge-bridge-tools" ] + }, + { + "name": "forgemsg", + "kind": "package", + "language": "go", + "paths": [ + "forgemsg" + ], + "series": "0.1" } ] } diff --git a/modules/mesh-delivery-indexer/manifest_test.go b/modules/mesh-delivery-indexer/manifest_test.go index d1a5703a..8a24e6af 100644 --- a/modules/mesh-delivery-indexer/manifest_test.go +++ b/modules/mesh-delivery-indexer/manifest_test.go @@ -42,6 +42,8 @@ type artifact struct { Binary string `json:"binary"` Loads []string `json:"loads"` Env map[string]string `json:"env"` + Paths []string `json:"paths"` + Series string `json:"series"` } type stream struct { @@ -344,8 +346,12 @@ func TestManifestProcess(t *testing.T) { // 1238/AC1 if _, bus := p["bus"]; bus { t.Errorf("the process declares a bus: it runs on its own broker credential") } - if len(m.Build.Artifacts) != 2 { - t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts) + if len(m.Build.Artifacts) != 3 { + t.Fatalf("artifacts = %+v, want the program, the tools and the package takein", m.Build.Artifacts) + } + // H-A-186 (design 47 G §370): takein, which the gate, the view and the watchman import, is a declared package. + if a := m.Build.Artifacts[2]; a.Name != "takein" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"takein"}) || a.Series != "0.1" { + t.Errorf("package artifact = %+v", a) } if a := m.Build.Artifacts[1]; a.Name != "tools" || a.Kind != "bundle" || a.Binary != "mesh-delivery-indexer-tools" || !reflect.DeepEqual(a.Loads, []string{"mesh-delivery-indexer-tools"}) { t.Errorf("tools artifact = %+v", a) // 1945 diff --git a/modules/mesh-delivery-indexer/module.json b/modules/mesh-delivery-indexer/module.json index 5300ac2c..0eeaa80c 100644 --- a/modules/mesh-delivery-indexer/module.json +++ b/modules/mesh-delivery-indexer/module.json @@ -223,6 +223,15 @@ "loads": [ "mesh-delivery-indexer-tools" ] + }, + { + "name": "takein", + "kind": "package", + "language": "go", + "paths": [ + "takein" + ], + "series": "0.1" } ] } diff --git a/modules/mesh-delivery-teller/manifest_test.go b/modules/mesh-delivery-teller/manifest_test.go index 47fa14f5..e031746f 100644 --- a/modules/mesh-delivery-teller/manifest_test.go +++ b/modules/mesh-delivery-teller/manifest_test.go @@ -38,6 +38,8 @@ type artifact struct { From string `json:"from"` Binary string `json:"binary"` Loads []string `json:"loads"` + Paths []string `json:"paths"` + Series string `json:"series"` } type manifest struct { @@ -176,8 +178,12 @@ func TestManifestProcess(t *testing.T) { // 1240/AC1 if _, bus := p["bus"]; bus { t.Errorf("the process declares a bus: it runs on its own broker credential") } - if len(m.Build.Artifacts) != 2 { - t.Fatalf("artifacts = %+v, want the program and the tools", m.Build.Artifacts) + if len(m.Build.Artifacts) != 3 { + t.Fatalf("artifacts = %+v, want the program, the tools and the package tellerevents", m.Build.Artifacts) + } + // H-A-186 (design 47 G §370): tellerevents, which the assigner imports, is a declared package. + if a := m.Build.Artifacts[2]; a.Name != "tellerevents" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"tellerevents"}) || a.Series != "0.1" { + t.Errorf("package artifact = %+v", a) } a := m.Build.Artifacts[0] if st, err := os.Stat(a.From); err != nil || !st.IsDir() || a.Binary != "mesh-delivery-teller" || !strings.HasSuffix(a.From, a.Binary) { diff --git a/modules/mesh-delivery-teller/module.json b/modules/mesh-delivery-teller/module.json index ab2c2678..25e7581b 100644 --- a/modules/mesh-delivery-teller/module.json +++ b/modules/mesh-delivery-teller/module.json @@ -123,6 +123,15 @@ "loads": [ "mesh-delivery-teller-tools" ] + }, + { + "name": "tellerevents", + "kind": "package", + "language": "go", + "paths": [ + "tellerevents" + ], + "series": "0.1" } ] }, diff --git a/modules/mesh-delivery-view/manifest_test.go b/modules/mesh-delivery-view/manifest_test.go index cacee9e3..797882fe 100644 --- a/modules/mesh-delivery-view/manifest_test.go +++ b/modules/mesh-delivery-view/manifest_test.go @@ -313,9 +313,8 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7 func TestManifestIsWholeInItsRepository(t *testing.T) { // 1134/AC7 m, _ := load(t) - // Issue 1966's bootstrap: the package artifact viewstate is out of the manifest until the new builder runs; the - // follow-up puts the count back at 5. - if len(m.Build.Artifacts) != 4 { + // H-A-186 (design 47 G §370): viewstate, which the gate, the assigner and the teller import, is a declared package. + if len(m.Build.Artifacts) != 5 || m.Build.Artifacts[4].Name != "viewstate" { t.Fatalf("artifacts = %+v", m.Build.Artifacts) } for _, a := range m.Build.Artifacts { diff --git a/modules/mesh-delivery-view/module.json b/modules/mesh-delivery-view/module.json index 03b6a334..4d0df481 100644 --- a/modules/mesh-delivery-view/module.json +++ b/modules/mesh-delivery-view/module.json @@ -234,6 +234,15 @@ "name": "files", "kind": "archive", "from": "files" + }, + { + "name": "viewstate", + "kind": "package", + "language": "go", + "paths": [ + "viewstate" + ], + "series": "0.1" } ] }, diff --git a/modules/mesh-grants/grants_test.go b/modules/mesh-grants/grants_test.go index 68aa6546..b4cbb5f4 100644 --- a/modules/mesh-grants/grants_test.go +++ b/modules/mesh-grants/grants_test.go @@ -648,6 +648,17 @@ func TestGrants(t *testing.T) { if _, ok := m.OwnSecrets["broker"]; !ok || len(m.OwnSecrets) != 1 || m.SecretsOwner != "mesh-grants" { t.Errorf("own-secrets %v owner %q: a credential of its own, broker", m.OwnSecrets, m.SecretsOwner) } + // H-A-186 (design 47 G §370): grantsstate (imported by the assigner, the vault and the node-engine) and busgrants + // (imported by the bus module and the watchman) are declared Go packages of the module, so every release publishes them. + var packages []string + for _, a := range m.Build.Artifacts { + if a.Kind == catalogue.ArtifactPackage && a.Language == "go" && len(a.Paths) == 1 && a.Paths[0] == a.Name && a.Series == "0.1" { + packages = append(packages, a.Name) + } + } + if !slices.Equal(packages, []string{"grantsstate", "busgrants"}) { + t.Errorf("Go packages %v, want grantsstate and busgrants of series 0.1", packages) + } }) t.Run("no timer, no update or delete, a publish only of conditions, a create only of declared streams", func(t *testing.T) { diff --git a/modules/mesh-grants/module.json b/modules/mesh-grants/module.json index 006e07cf..29c8489b 100644 --- a/modules/mesh-grants/module.json +++ b/modules/mesh-grants/module.json @@ -185,6 +185,24 @@ "loads": [ "mesh-grants" ] + }, + { + "name": "grantsstate", + "kind": "package", + "language": "go", + "paths": [ + "grantsstate" + ], + "series": "0.1" + }, + { + "name": "busgrants", + "kind": "package", + "language": "go", + "paths": [ + "busgrants" + ], + "series": "0.1" } ] } -- 2.54.0 From 1db38fcc720175be0812cf51188b55e31eca178c Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 21:05:39 +0100 Subject: [PATCH 2/2] Declare asks in the assigner's version series, and have the teller and the view accept it there (H-A-188) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder numbers every artifact of a release in its module's version, so the assigner's package asks is published in 0.3, not the 0.1 eba4309b declared: asks now names series 0.3, and the teller and the view, which import it, accept it at 0.3 in their manifests' packages. The other eight packages' modules are all at 0.1, so their series stand. The gate in mesh-catalog, which imports asks too, follows with the catalog's next change. Builds: design 47 G §370, H-A-186, H-A-188 --- modules/mesh-delivery-assigner/manifest_test.go | 6 +++--- modules/mesh-delivery-assigner/module.json | 2 +- modules/mesh-delivery-teller/manifest_test.go | 5 +++++ modules/mesh-delivery-teller/module.json | 3 +++ modules/mesh-delivery-view/manifest_test.go | 5 +++++ modules/mesh-delivery-view/module.json | 3 +++ 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-assigner/manifest_test.go b/modules/mesh-delivery-assigner/manifest_test.go index 993f5206..8a3db0c2 100644 --- a/modules/mesh-delivery-assigner/manifest_test.go +++ b/modules/mesh-delivery-assigner/manifest_test.go @@ -120,11 +120,11 @@ func TestManifest(t *testing.T) { } } // H-A-186 (design 47 G §370): asks, which the gate, the teller and the view import, is a declared Go package of the - // module, so every release publishes it. + // module, so every release publishes it; H-A-188: in the module's version series, 0.3. if !slices.ContainsFunc(m.Build.Artifacts, func(a catalogue.Artifact) bool { - return a.Name == "asks" && a.Kind == catalogue.ArtifactPackage && a.Language == "go" && slices.Equal(a.Paths, []string{"asks"}) && a.Series == "0.1" + return a.Name == "asks" && a.Kind == catalogue.ArtifactPackage && a.Language == "go" && slices.Equal(a.Paths, []string{"asks"}) && a.Series == m.Version && m.Version == "0.3" }) { - t.Errorf("artifacts = %+v, want the Go package asks of series 0.1", m.Build.Artifacts) + t.Errorf("artifacts = %+v, want the Go package asks of series 0.3, the module's", m.Build.Artifacts) } // ADR 0635 §5: its views family is its ordinary events, `views.` among its emits, on no stream of its own. // The seat's four events are said on the seat's own subject (the seat's family), so the module keeps no stream for them diff --git a/modules/mesh-delivery-assigner/module.json b/modules/mesh-delivery-assigner/module.json index 659044dc..32979138 100644 --- a/modules/mesh-delivery-assigner/module.json +++ b/modules/mesh-delivery-assigner/module.json @@ -378,7 +378,7 @@ "paths": [ "asks" ], - "series": "0.1" + "series": "0.3" } ] } diff --git a/modules/mesh-delivery-teller/manifest_test.go b/modules/mesh-delivery-teller/manifest_test.go index e031746f..dcb8d85b 100644 --- a/modules/mesh-delivery-teller/manifest_test.go +++ b/modules/mesh-delivery-teller/manifest_test.go @@ -43,6 +43,7 @@ type artifact struct { } type manifest struct { + Packages map[string]string `json:"packages"` Module string `json:"module"` Version string `json:"version"` Slug string `json:"slug"` @@ -181,6 +182,10 @@ func TestManifestProcess(t *testing.T) { // 1240/AC1 if len(m.Build.Artifacts) != 3 { t.Fatalf("artifacts = %+v, want the program, the tools and the package tellerevents", m.Build.Artifacts) } + // H-A-188: the assigner is at 0.3, so its package asks, which this module imports, is accepted in that series. + if got := m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks"]; got != "0.3" || len(m.Packages) != 1 { + t.Errorf("packages = %v, want asks accepted in the assigner's series 0.3", m.Packages) + } // H-A-186 (design 47 G §370): tellerevents, which the assigner imports, is a declared package. if a := m.Build.Artifacts[2]; a.Name != "tellerevents" || a.Kind != "package" || a.Language != "go" || !reflect.DeepEqual(a.Paths, []string{"tellerevents"}) || a.Series != "0.1" { t.Errorf("package artifact = %+v", a) diff --git a/modules/mesh-delivery-teller/module.json b/modules/mesh-delivery-teller/module.json index 25e7581b..b993a061 100644 --- a/modules/mesh-delivery-teller/module.json +++ b/modules/mesh-delivery-teller/module.json @@ -1,6 +1,9 @@ { "module": "mesh-delivery-teller", "version": "0.1", + "packages": { + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks": "0.3" + }, "slug": "teller", "tools": [ "teller_end_ask", diff --git a/modules/mesh-delivery-view/manifest_test.go b/modules/mesh-delivery-view/manifest_test.go index 797882fe..e473d9a0 100644 --- a/modules/mesh-delivery-view/manifest_test.go +++ b/modules/mesh-delivery-view/manifest_test.go @@ -70,6 +70,7 @@ type claim struct { } type manifest struct { + Packages map[string]string `json:"packages"` Claims []claim `json:"claims"` State []state `json:"state"` Module string `json:"module"` @@ -313,6 +314,10 @@ func TestManifestIsTakenAndReadsOnly(t *testing.T) { // 1134/AC7 func TestManifestIsWholeInItsRepository(t *testing.T) { // 1134/AC7 m, _ := load(t) + // H-A-188: the assigner is at 0.3, so its package asks, which this module imports, is accepted in that series. + if got := m.Packages["git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks"]; got != "0.3" || len(m.Packages) != 1 { + t.Errorf("packages = %v, want asks accepted in the assigner's series 0.3", m.Packages) + } // H-A-186 (design 47 G §370): viewstate, which the gate, the assigner and the teller import, is a declared package. if len(m.Build.Artifacts) != 5 || m.Build.Artifacts[4].Name != "viewstate" { t.Fatalf("artifacts = %+v", m.Build.Artifacts) diff --git a/modules/mesh-delivery-view/module.json b/modules/mesh-delivery-view/module.json index 4d0df481..b2deb116 100644 --- a/modules/mesh-delivery-view/module.json +++ b/modules/mesh-delivery-view/module.json @@ -1,6 +1,9 @@ { "module": "mesh-delivery-view", "version": "0.1", + "packages": { + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-assigner/asks": "0.3" + }, "moved": true, "slug": "view", "tools": [ -- 2.54.0