From eba4309b19cfbac2268c0a1da3cf3ef06e2f0518 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 20:58:06 +0100 Subject: [PATCH] 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" } ] }