From 82d00aeb5ecb7adeb61abc86ef73441d01ebbb45 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 17:26:32 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Builders,=20the=20artifact=20store's=20tool?= =?UTF-8?q?s=20and=20distribution=20read=20and=20write=20the=20registry=20?= =?UTF-8?q?reference=20form=20through=20the=20registry=20clients'=20refere?= =?UTF-8?q?nce=20package,=20and=20name=20the=20sweep=20seat=20from=20its?= =?UTF-8?q?=20contract=20(ADR=200634=20=C2=A74,=20S-8;=20issue=201966)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit catalogue's SeatReference, InRegistrySeat, Routed, Recorded, InArtifactStore and ArtifactSweepSeat leave mesh-sdk; each package gives the two registry seats' names from their contracts (or the build step's copies of them). Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- .../cmd/artifact-store-tools/holder.go | 24 +++++++++---------- .../cmd/artifact-store-tools/holder_test.go | 12 ++++++---- .../cmd/artifact-store-tools/seat.go | 6 ++--- .../cmd/artifact-store-tools/store_test.go | 7 +++--- .../cmd/artifact-store-tools/sweepseats.go | 5 ++++ modules/artifact-store-tools/go.mod | 1 + modules/distribution/go.mod | 1 + .../internal/holder/holder_test.go | 7 ++++-- .../distribution/internal/holder/transfer.go | 2 +- .../mesh-build-go/cmd/mesh-build-go/build.go | 3 ++- .../mesh-build-go/store_integration_test.go | 12 ++++++---- modules/mesh-build-go/go.mod | 1 + .../cmd/mesh-build-image/publish.go | 4 ++-- modules/mesh-build-image/go.mod | 1 + .../cmd/mesh-build-node/build.go | 4 ++-- .../mesh-build-node/store_integration_test.go | 10 +++++--- modules/mesh-build-node/go.mod | 1 + 17 files changed, 63 insertions(+), 38 deletions(-) diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go b/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go index 1f3d8f09b..841058b70 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go @@ -32,8 +32,8 @@ import ( "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" meshconditions "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/views" ) @@ -220,8 +220,8 @@ func KeepSet(builds []Build, wants []Want) map[string]*Ref { out := map[string]*Ref{} for _, b := range builds { for _, a := range b.Artifacts { - reference := canonical(catalogue.Recorded(a.Reference)) - if _, ours := catalogue.InArtifactStore(reference); !ours || a.Kind == "package" { + reference := canonical(registryForms.Recorded(a.Reference)) + if _, ours := registryForms.InArtifactStore(reference); !ours || a.Kind == "package" { continue } r := out[reference] @@ -386,7 +386,7 @@ func Mirrors(v *View, builds []Build, kept map[string][]string, against map[stri continue } for d := range v.L.Repos[name].Revisions { - r := catalogue.ArtifactStoreScheme + name + "@" + d + r := artifactref.ArtifactStoreScheme + name + "@" + d out[r] = &Ref{Reference: r, Kind: "image"} } } @@ -400,7 +400,7 @@ func Mirrors(v *View, builds []Build, kept map[string][]string, against map[stri continue } for _, base := range bases { - if m := out[catalogue.Recorded(base)]; m != nil { + if m := out[registryForms.Recorded(base)]; m != nil { m.Builds = append(m.Builds, b) why := kept[b.Key] if len(why) > 0 { @@ -448,7 +448,7 @@ func (j *judged) records(repository string, collected bool) *Records { } } r.Counts[state]++ - if (repository != "" && !strings.HasPrefix(strings.TrimPrefix(ref.Reference, catalogue.ArtifactStoreScheme), repository)) || + if (repository != "" && !strings.HasPrefix(strings.TrimPrefix(ref.Reference, artifactref.ArtifactStoreScheme), repository)) || (state == "collected" && !collected) { continue } @@ -650,7 +650,7 @@ func (h *Holder) sayGone(j *judged, refs []string, how string) { // artifacts-gone against its own key. func namedBy(b Build, r string) string { for _, a := range b.Artifacts { - if rec := catalogue.Recorded(a.Reference); canonical(rec) == r { + if rec := registryForms.Recorded(a.Reference); canonical(rec) == r { return rec } } @@ -678,7 +678,7 @@ func (h *Holder) Held(refs []string) (HeldAnswer, error) { return HeldAnswer{}, fmt.Errorf("held judges at most 64 references at once, and %d were given", len(refs)) } for _, r := range refs { - if _, ours := catalogue.InArtifactStore(r); !ours { + if _, ours := registryForms.InArtifactStore(r); !ours { return HeldAnswer{}, fmt.Errorf("%s is not a reference into the mesh's artifact store (artifact-store://...): nothing was asked", r) } } @@ -744,7 +744,7 @@ func (h *Holder) ImagesOf(node string, address string) (Images, error) { images := []string{} for _, a := range b.Artifacts { if (a.Kind == "image" || a.Kind == "upstream") && a.Reference != "" { - images = append(images, catalogue.Routed(catalogue.Recorded(a.Reference), address)) + images = append(images, registryForms.Routed(registryForms.Recorded(a.Reference), address)) } } pinned, err := h.Pinned(b.Manifest) @@ -845,8 +845,8 @@ func inStoreAt(image, address string) string { if address == "" || !strings.HasPrefix(image, address+"/") || !strings.Contains(image, "@sha256:") { return "" } - r := catalogue.Recorded(image) - if _, ours := catalogue.InArtifactStore(r); !ours { + r := registryForms.Recorded(image) + if _, ours := registryForms.InArtifactStore(r); !ours { return "" } return r @@ -879,7 +879,7 @@ func (h *Holder) Observe(ctx context.Context) error { var refs []string for _, a := range b.Artifacts { if a.Kind == "image" { - refs = append(refs, catalogue.Recorded(a.Reference)) + refs = append(refs, registryForms.Recorded(a.Reference)) } } // And what its manifest pins by itself under the store's address, as the controller judged S25. diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/holder_test.go b/modules/artifact-store-tools/cmd/artifact-store-tools/holder_test.go index dae24779c..aa1aa1d48 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/holder_test.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/holder_test.go @@ -22,7 +22,9 @@ import ( meshconditions "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/catalogue" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" + reg "git.novox.be/novox/mesh-delivery/contracts/go/seats/containerimageregistry" + ociseat "git.novox.be/novox/mesh-delivery/contracts/go/seats/ociartifactregistry" ) // memBus is the holder's bus in memory: states by name, each key's history, and what was published. @@ -110,9 +112,9 @@ func (d *memDoor) seat(key string, body any) (json.RawMessage, error) { var in struct{ Name, Digest, Reason string } _ = json.Unmarshal(raw, &in) seat, verb, _ := strings.Cut(strings.TrimPrefix(key, "seat:"), ".") - ref := catalogue.ArtifactStoreScheme + in.Name + "@" + in.Digest + ref := artifactref.ArtifactStoreScheme + in.Name + "@" + in.Digest if seat == "oci-artifact-registry" { - ref = catalogue.ArtifactStoreScheme + in.Name + "/blobs/" + in.Digest + ref = artifactref.ArtifactStoreScheme + in.Name + "/blobs/" + in.Digest } d.calls = append(d.calls, key+" "+in.Name+"@"+in.Digest+" "+in.Reason) if err := d.refuse[verb+" "+ref]; err != nil { @@ -308,8 +310,8 @@ func TestTheSeatKeepsTheFiveNewestAndTheWantedAndSweepsWithNoLease(t *testing.T) for _, n := range []int{2, 3} { key, _ := builds.BuilderBuildKey("letta", fp(n)) raw, _ := builds.EncodeBuilderBuild(builds.BuilderBuild{State: builds.BuildDone, Manifest: strings.Repeat("d", 64), Artifacts: []builds.BuiltArtifact{ - {Name: "image", Kind: "image", Digest: digestOf(imageRef("letta", n)), Reference: catalogue.SeatReference("container-image-registry", "letta", "image", digestOf(imageRef("letta", n)))}, - {Name: "files", Kind: "archive", Digest: digestOf(archiveRef("letta", n)), Reference: catalogue.SeatReference("oci-artifact-registry", "letta", "files", digestOf(archiveRef("letta", n)))}}}) + {Name: "image", Kind: "image", Digest: digestOf(imageRef("letta", n)), Reference: artifactref.SeatReference(reg.Seat, "letta", "image", digestOf(imageRef("letta", n)))}, + {Name: "files", Kind: "archive", Digest: digestOf(archiveRef("letta", n)), Reference: artifactref.SeatReference(ociseat.Seat, "letta", "files", digestOf(archiveRef("letta", n)))}}}) _ = b.Put(BuildsRead, key, json.RawMessage(raw)) } } diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/seat.go b/modules/artifact-store-tools/cmd/artifact-store-tools/seat.go index 37491142d..67d33e2c2 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/seat.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/seat.go @@ -1,6 +1,6 @@ package main -// The seat mesh-artifact-sweep's verbs (novox/hq ADR 0571 clause 2; catalogue.ArtifactSweepSeat), each a tool named +// The seat mesh-artifact-sweep's verbs (novox/hq ADR 0571 clause 2; sweep.Seat), each a tool named // `artifact-store.` as the runtime serves a seat's verb, answering as the controller's verb answered: {output, // ok, answer}. @@ -8,8 +8,8 @@ import ( "fmt" "strings" + sweep "git.novox.be/novox/mesh-delivery/contracts/go/seats/meshartifactsweep" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/catalogue" ) // verbAnswer is the controller's verbs' answer shape, which the builder and docker read (answerOf). @@ -21,7 +21,7 @@ type verbAnswer struct { // SeatTools are the seat's verbs over h; s reads the store's listing for mirrors. func SeatTools(h *Holder, s *Store) []stdio.Tool { - seat := catalogue.ArtifactSweepSeat + "." + seat := sweep.Seat + "." return []stdio.Tool{ {Name: seat + "artifacts", Description: "Every artifact the mesh made that the store holds: kept and why, eligible, " + "or with collected those it no longer holds.", diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/store_test.go b/modules/artifact-store-tools/cmd/artifact-store-tools/store_test.go index 05d5df58a..3729944df 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/store_test.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/store_test.go @@ -2,6 +2,7 @@ package main import ( reg "git.novox.be/novox/mesh-delivery/contracts/go/seats/containerimageregistry" + sweep "git.novox.be/novox/mesh-delivery/contracts/go/seats/meshartifactsweep" "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/seatlist/seatlisttest" "git.novox.be/novox/mesh-sdk/go/views" @@ -489,15 +490,15 @@ func TestTheToolsServedAreTheToolsTheManifestNames(t *testing.T) { } var verbs []string for _, tl := range SeatTools(&Holder{}, &Store{}) { - verbs = append(verbs, strings.TrimPrefix(tl.Name, catalogue.ArtifactSweepSeat+".")) + verbs = append(verbs, strings.TrimPrefix(tl.Name, sweep.Seat+".")) } catalogue.UseSeats(catalogue.SeatsFromDefinitions(seatlisttest.Definitions())) - seat, _ := catalogue.SeatNamed(catalogue.ArtifactSweepSeat) + seat, _ := catalogue.SeatNamed(sweep.Seat) var contract []string for _, v := range seat.Serves { contract = append(contract, v.Name) } - if len(m.Claims) != 1 || m.Claims[0].Name != catalogue.ArtifactSweepSeat || !reflect.DeepEqual(m.Claims[0].Serves, verbs) || + if len(m.Claims) != 1 || m.Claims[0].Name != sweep.Seat || !reflect.DeepEqual(m.Claims[0].Serves, verbs) || !reflect.DeepEqual(verbs, contract) { t.Errorf("claims %+v, serves %v, the seat's verbs %v", m.Claims, verbs, contract) } diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go b/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go index 7ca0966fe..e0c84fc04 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go @@ -16,6 +16,7 @@ import ( "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" meshconditions "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" ociseat "git.novox.be/novox/mesh-delivery/contracts/go/seats/ociartifactregistry" "git.novox.be/novox/mesh-sdk/go/catalogue" @@ -146,3 +147,7 @@ func keptWhy(r *Ref) string { } return "kept: " + strings.Join(r.Why, "; ") } + +// registryForms reads and routes a reference of the registry form, with the two registry seats' names from their contracts +// (the registry clients' reference forms, novox/hq ADR 0605 §9, ADR 0634 §4). +var registryForms = artifactref.Seats{Image: reg.Seat, Object: ociseat.Seat} diff --git a/modules/artifact-store-tools/go.mod b/modules/artifact-store-tools/go.mod index adcd679f0..f5804c0b2 100644 --- a/modules/artifact-store-tools/go.mod +++ b/modules/artifact-store-tools/go.mod @@ -3,6 +3,7 @@ module artifactstoretools go 1.26.0 require ( + git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/seats/meshartifactsweep v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/placement/go/seats/meshwants v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/go/seats/nodeengine v0.0.0-00010101000000-000000000000 diff --git a/modules/distribution/go.mod b/modules/distribution/go.mod index 0bedb775f..da08b1abe 100644 --- a/modules/distribution/go.mod +++ b/modules/distribution/go.mod @@ -3,6 +3,7 @@ module distribution go 1.26.0 require ( + git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/sdk v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient v0.0.0-00010101000000-000000000000 diff --git a/modules/distribution/internal/holder/holder_test.go b/modules/distribution/internal/holder/holder_test.go index 3c3b31115..7fcede3a6 100644 --- a/modules/distribution/internal/holder/holder_test.go +++ b/modules/distribution/internal/holder/holder_test.go @@ -17,7 +17,7 @@ import ( "time" "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient" - "git.novox.be/novox/mesh-sdk/go/catalogue" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" ) type memObjects map[string][]byte @@ -251,7 +251,7 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) { } // The reference's registry part is the seat's name, as a node-engine reads it back (ADR 0605 §9); nothing set on // the process names a reach. - if seat, path, ok := catalogue.InRegistrySeat(b.said[0].body.Reference); !ok || seat != ArtifactSeat || path != "m/program@"+part.Digest { + if seat, path, ok := registryForms.InRegistrySeat(b.said[0].body.Reference); !ok || seat != ArtifactSeat || path != "m/program@"+part.Digest { t.Errorf("the published reference %q is not the seat's form", b.said[0].body.Reference) } if len(b.h.Objects.(memObjects)) != 0 || len(b.h.Transfers.(memTransfers)) != 0 { @@ -910,3 +910,6 @@ func TestTheHolderOfTheTwoImageSeats(t *testing.T) { } }) } + +// registryForms reads a reference of the registry form, with the two seats' names this holder answers for. +var registryForms = artifactref.Seats{Image: ImageSeat, Object: ArtifactSeat} diff --git a/modules/distribution/internal/holder/transfer.go b/modules/distribution/internal/holder/transfer.go index aaa75418c..6f2a4e5c3 100644 --- a/modules/distribution/internal/holder/transfer.go +++ b/modules/distribution/internal/holder/transfer.go @@ -146,7 +146,7 @@ type Store interface { } // SeatReference is a reference in the form the seat answers (novox/hq ADR 0605 §9): the seat's name, then the path the -// store answers (`@sha256:`), as catalogue.InRegistrySeat reads it back. Nothing set on the process names +// store answers (`@sha256:`), as the registry clients' reference.Seats.InRegistrySeat reads it back. Nothing set on the process names // a reach: the seat's name is the registry part. func SeatReference(seat, path string) string { return seat + "/" + path } diff --git a/modules/mesh-build-go/cmd/mesh-build-go/build.go b/modules/mesh-build-go/cmd/mesh-build-go/build.go index c50fe1533..cb4eab097 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/build.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/build.go @@ -14,6 +14,7 @@ import ( "strings" "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds" "git.novox.be/novox/mesh-sdk/go/catalogue" ) @@ -179,7 +180,7 @@ func (m *Module) packInto(ctx context.Context, workspace, module, name, artifact if err := m.publishArchive(ctx, name, artifact, kind, digest, archive); err != nil { return BuildResult{}, fmt.Errorf("%s%s: %v", builds.NotStored, artifact, err) } - return BuildResult{Artifact: artifact, Digest: digest, Size: len(archive), Reference: catalogue.SeatReference(ArtifactSeat, name, artifact, digest)}, nil + return BuildResult{Artifact: artifact, Digest: digest, Size: len(archive), Reference: artifactref.SeatReference(ArtifactSeat, name, artifact, digest)}, nil } // buildEnv is the environment of the compile: the build agent's (CGO_ENABLED=0, GOFLAGS) with the installed go diff --git a/modules/mesh-build-go/cmd/mesh-build-go/store_integration_test.go b/modules/mesh-build-go/cmd/mesh-build-go/store_integration_test.go index 2bf8e34e1..f7434ad9a 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/store_integration_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/store_integration_test.go @@ -23,9 +23,10 @@ import ( "github.com/distribution/distribution/v3/registry/handlers" _ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory" + "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" registry "git.novox.be/novox/mesh-delivery/contracts/go/seats/containerimageregistry" builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds" - "git.novox.be/novox/mesh-sdk/go/catalogue" ) // realStore starts the artifact store's own program (the distribution registry, modules/distribution) inside this @@ -94,14 +95,14 @@ func uploadBlob(base, name, digest string, body []byte) error { return nil } -// resolve reads a done artifact's reference from the store as a node-engine does (catalogue.Routed): the seat's form +// resolve reads a done artifact's reference from the store as a node-engine does (registryForms.Routed): the seat's form // oci-artifact-registry//@ is /v2///blobs/ (ADR 0605 §9). func resolve(t *testing.T, addr string, a builds.BuiltArtifact) []byte { t.Helper() - if _, _, ok := catalogue.InRegistrySeat(a.Reference); !ok { + if _, _, ok := registryForms.InRegistrySeat(a.Reference); !ok { t.Fatalf("%s's reference %q is not in the form a registry seat answers", a.Name, a.Reference) } - resp, err := http.Get(catalogue.Routed(a.Reference, addr)) + resp, err := http.Get(registryForms.Routed(a.Reference, addr)) if err != nil { t.Fatal(err) } @@ -161,3 +162,6 @@ func TestADoneBuildsArtifactsResolveInARealArtifactStore(t *testing.T) { } } } + +// registryForms reads a reference of the registry form, the two seats' names from the build step (their contracts). +var registryForms = artifactref.Seats{Image: buildstep.ImageSeat, Object: buildstep.ArtifactSeat} diff --git a/modules/mesh-build-go/go.mod b/modules/mesh-build-go/go.mod index 58852098a..c2aae4623 100644 --- a/modules/mesh-build-go/go.mod +++ b/modules/mesh-build-go/go.mod @@ -3,6 +3,7 @@ module meshbuildgo go 1.26.0 require ( + git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/clients/meshcatalogclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/seats/meshcatalog v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds v0.0.0-00010101000000-000000000000 diff --git a/modules/mesh-build-image/cmd/mesh-build-image/publish.go b/modules/mesh-build-image/cmd/mesh-build-image/publish.go index cdfd74c52..4af9d4eb7 100644 --- a/modules/mesh-build-image/cmd/mesh-build-image/publish.go +++ b/modules/mesh-build-image/cmd/mesh-build-image/publish.go @@ -16,9 +16,9 @@ import ( "path/filepath" "strings" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" reg "git.novox.be/novox/mesh-delivery/contracts/go/seats/containerimageregistry" stdio "git.novox.be/novox/mesh-sdk/go" - "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep" builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds" @@ -140,7 +140,7 @@ func (m *Module) publish(ctx context.Context, workspace, module, local string, r } m.say("published %s on %s: %d of its %d parts sent, the rest held", name, buildstep.ImageSeat, len(sent.Parts), len(img.Files)) res.Digest, res.Pushed = img.Digest, true - res.Reference = catalogue.SeatReference(buildstep.ImageSeat, module, res.Artifact, img.Digest) + res.Reference = artifactref.SeatReference(buildstep.ImageSeat, module, res.Artifact, img.Digest) return res, nil } diff --git a/modules/mesh-build-image/go.mod b/modules/mesh-build-image/go.mod index c139be8fd..83e91f63d 100644 --- a/modules/mesh-build-image/go.mod +++ b/modules/mesh-build-image/go.mod @@ -3,6 +3,7 @@ module meshbuildimage go 1.26.0 require ( + git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/seats/nodebuildimage v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/sdk v0.0.0-00010101000000-000000000000 diff --git a/modules/mesh-build-node/cmd/mesh-build-node/build.go b/modules/mesh-build-node/cmd/mesh-build-node/build.go index 88bd2d48c..48abe14b8 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/build.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/build.go @@ -18,9 +18,9 @@ import ( "strings" "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds" sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep" - "git.novox.be/novox/mesh-sdk/go/catalogue" ) // Out is where a bundle's compiled files go in the module's directory (builder toolchain.go:118). @@ -157,7 +157,7 @@ func (m *Module) build(ctx context.Context, args map[string]any) (any, error) { }) sort.Strings(files) return BuildResult{Workspace: workspace, Module: module, Artifact: a.Name, Digest: digest, Bytes: len(archive), - Reference: catalogue.SeatReference(buildstep.ArtifactSeat, a.module, a.Name, digest), Files: files}, nil + Reference: artifactref.SeatReference(buildstep.ArtifactSeat, a.module, a.Name, digest), Files: files}, nil } // bundle makes every entrypoint and every launcher ONE file, with esbuild (builder.go:1971-2039): an entrypoint is diff --git a/modules/mesh-build-node/cmd/mesh-build-node/store_integration_test.go b/modules/mesh-build-node/cmd/mesh-build-node/store_integration_test.go index 1ee5f17ae..7776637c6 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/store_integration_test.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/store_integration_test.go @@ -20,9 +20,10 @@ import ( "github.com/distribution/distribution/v3/registry/handlers" _ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory" + "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep" + artifactref "git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient/reference" registry "git.novox.be/novox/mesh-delivery/contracts/go/seats/containerimageregistry" builds "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds" - "git.novox.be/novox/mesh-sdk/go/catalogue" ) // realStore starts the artifact store's own program (the distribution registry, modules/distribution) inside this @@ -105,11 +106,11 @@ func TestADoneBundleResolvesInARealArtifactStore(t *testing.T) { if _, err := builds.EncodeBuilderBuild(done); err != nil { t.Errorf("the done key the builder would write is refused: %v", err) } - if _, _, ok := catalogue.InRegistrySeat(r.Reference); !ok || !strings.HasSuffix(r.Reference, "@"+r.Digest) { + if _, _, ok := registryForms.InRegistrySeat(r.Reference); !ok || !strings.HasSuffix(r.Reference, "@"+r.Digest) { t.Fatalf("the reference %q is not in the form a registry seat answers", r.Reference) } // Read as a node-engine reads it: the seat's reference routed to the store's address. - resp, err := http.Get(catalogue.Routed(r.Reference, addr)) + resp, err := http.Get(registryForms.Routed(r.Reference, addr)) if err != nil { t.Fatal(err) } @@ -120,3 +121,6 @@ func TestADoneBundleResolvesInARealArtifactStore(t *testing.T) { t.Errorf("the store answered %s with bytes of sha256:%x for %s", resp.Status, sum, r.Reference) } } + +// registryForms reads a reference of the registry form, the two seats' names from the build step (their contracts). +var registryForms = artifactref.Seats{Image: buildstep.ImageSeat, Object: buildstep.ArtifactSeat} diff --git a/modules/mesh-build-node/go.mod b/modules/mesh-build-node/go.mod index 2aaefd4c3..3fe29f831 100644 --- a/modules/mesh-build-node/go.mod +++ b/modules/mesh-build-node/go.mod @@ -3,6 +3,7 @@ module meshbuildnode go 1.26.0 require ( + git.novox.be/novox/mesh-delivery/contracts/go/clients/containerimageregistryclient v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/contracts/go/seats/nodebuildnode v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds v0.0.0-00010101000000-000000000000 git.novox.be/novox/mesh-delivery/sdk v0.0.0-00010101000000-000000000000 From 50acf7c1b430c2c5a73a675fe2efc7918b6a7c07 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 17:38:04 +0100 Subject: [PATCH 2/2] artifact-store-tools: the sweep seats read the artifact store's form through the registry clients' forms too (S-8; issue 1966) Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- .../cmd/artifact-store-tools/sweepseats.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go b/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go index e0c84fc04..568b62781 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go @@ -32,7 +32,7 @@ var sweepFindingKey = meshconditionsclient.Key(meshconditionsclient.ScopeModule, // canonical is a kept reference in the older form, `artifact-store://`, whichever form it came in; another is as // it was. func canonical(reference string) string { - path, kept := catalogue.InArtifactStore(reference) + path, kept := registryForms.InArtifactStore(reference) if !kept { return reference } @@ -42,7 +42,7 @@ func canonical(reference string) string { // seatOf is the seat, name and digest a kept reference is held under: a bundle or an archive on oci-artifact-registry, // an image or a copy of an upstream base on container-image-registry. func seatOf(reference string) (seat, name, digest string, err error) { - path, kept := catalogue.InArtifactStore(reference) + path, kept := registryForms.InArtifactStore(reference) if !kept { return "", "", "", fmt.Errorf("%s is no reference into the mesh's registries", reference) } @@ -57,7 +57,7 @@ func seatOf(reference string) (seat, name, digest string, err error) { // isCopy is whether a kept reference is a copy of an upstream base. func isCopy(reference string) bool { - path, _ := catalogue.InArtifactStore(reference) + path, _ := registryForms.InArtifactStore(reference) return strings.HasPrefix(path, "upstream/") }