From 3b365ba7ccdbac03d9ff6ce2d108af27f0cde9b8 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 16 Nov 2026 14:26:03 +0100 Subject: [PATCH] node-engine: a catalog revision's manifest digest is made the candidate's hex form (A-226b) Builds: design 47 G (G-22 lead answers 2) A-226b --- internal/selfcompose/candidate.go | 5 ++++- internal/selfcompose/candidate_test.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/selfcompose/candidate.go b/internal/selfcompose/candidate.go index ef2c65a5..4aedc170 100644 --- a/internal/selfcompose/candidate.go +++ b/internal/selfcompose/candidate.go @@ -16,6 +16,7 @@ import ( "maps" "slices" "sort" + "strings" "sync" "time" @@ -543,7 +544,9 @@ func (s *Shadow) revisionCandidate(ctx context.Context, base *Composer, key nec. if pulls[g] == nil { pulls[g] = map[string]meshcatalog.CandidatesByGroupValuePullsItemFpsValue{} } - pulls[g][e.Module] = meshcatalog.CandidatesByGroupValuePullsItemFpsValue{Fp2: e.Fp, Manifest: e.ManifestDigest} + // The catalog entry's manifest-digest is the `sha256:`-prefixed form (the seat's definition, entryManifest); a candidate's + // module and the manifests and verdicts keys carry the 64 hex digits alone (ADR 0429 clause 16, meshcatalogclient). + pulls[g][e.Module] = meshcatalog.CandidatesByGroupValuePullsItemFpsValue{Fp2: e.Fp, Manifest: strings.TrimPrefix(e.ManifestDigest, "sha256:")} } if a.Next == "" { break diff --git a/internal/selfcompose/candidate_test.go b/internal/selfcompose/candidate_test.go index c7562103..84bde8f3 100644 --- a/internal/selfcompose/candidate_test.go +++ b/internal/selfcompose/candidate_test.go @@ -94,7 +94,7 @@ func TestTheNodeComposesACandidateOnAsk(t *testing.T) { return json.Marshal(meshcatalog.RevisionAnswer{NoneYet: true}) } moved := entry - moved.Fp, moved.ManifestDigest = fpNew, digest2 + moved.Fp, moved.ManifestDigest = fpNew, "sha256:"+digest2 // the entry carries the prefixed form return json.Marshal(meshcatalog.RevisionAnswer{Revision: &meshcatalog.CatalogRevision{Branch: "main", Revision: 362}, Entries: []meshcatalog.CatalogEntry{moved}}) } return json.Marshal(meshcatalog.EntryAnswer{Entry: entry})