From c04e5e364c67f769f526cc3f52e18771916f742c Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:15:05 +0100 Subject: [PATCH] DC7 other-bytes: the publish answer of the four registry seats gains other-bytes, each seat one form higher Builds: design 47 H2 H-A-729, H-A-589 (1), H-A-590 (2) --- .../seats/containerimageregistry/contract.go | 16 +++++++++++--- .../containerimageregistry/contract_test.go | 4 ++++ .../go/seats/gopackageregistry/contract.go | 16 +++++++++++--- .../seats/gopackageregistry/contract_test.go | 4 ++++ .../go/seats/npmpackageregistry/contract.go | 16 +++++++++++--- .../seats/npmpackageregistry/contract_test.go | 4 ++++ .../go/seats/ociartifactregistry/contract.go | 16 +++++++++++--- .../ociartifactregistry/contract_test.go | 4 ++++ .../parts/registry.json | 17 +++++++++++++++ .../fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/container-image-registry/seat.json | 7 ++++--- .../go-package-registry/fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/go-package-registry/seat.json | 3 ++- .../npm-package-registry/fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/npm-package-registry/seat.json | 3 ++- .../oci-artifact-registry/fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/oci-artifact-registry/seat.json | 2 +- .../seats/containerimageregistry/index.d.ts | 1 + .../parts/registry.d.ts | 10 +++++++++ .../ts/seats/gopackageregistry/index.d.ts | 1 + .../gopackageregistry/parts/registry.d.ts | 10 +++++++++ .../ts/seats/npmpackageregistry/index.d.ts | 1 + .../npmpackageregistry/parts/registry.d.ts | 10 +++++++++ .../ts/seats/ociartifactregistry/index.d.ts | 1 + .../ociartifactregistry/parts/registry.d.ts | 10 +++++++++ 25 files changed, 222 insertions(+), 18 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go index 0b20f1225..8022f6fa2 100644 --- a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go @@ -13,7 +13,7 @@ const Seat = "container-image-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -21,8 +21,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" + generatedForms = "2 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" ) const ( @@ -329,6 +329,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -337,6 +345,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go index ade124474..394c0c88b 100644 --- a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go @@ -57,6 +57,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v NameOfInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "name-of answers the copy's reference", subject: "", given: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", wire: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", decode: func(b []byte) (any, error) { var v NameOfAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go index 6d632d989..6a76fc78f 100644 --- a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go @@ -12,7 +12,7 @@ const Seat = "go-package-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -20,8 +20,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" + generatedForms = "2 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" ) const ( @@ -189,6 +189,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -197,6 +205,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go index e5f69ec1d..f4070dd6f 100644 --- a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go @@ -37,6 +37,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go index 594e71009..6bc9a77e2 100644 --- a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go @@ -12,7 +12,7 @@ const Seat = "npm-package-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -20,8 +20,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" + generatedForms = "2 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" ) const ( @@ -189,6 +189,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -197,6 +205,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go index 3092b370e..eeccc2a3d 100644 --- a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go @@ -37,6 +37,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go index e327ef168..406be5b9c 100644 --- a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go @@ -13,7 +13,7 @@ const Seat = "oci-artifact-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 2 +const Form = 3 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -21,8 +21,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "2 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" + generatedForms = "3 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" ) const ( @@ -320,6 +320,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -328,6 +336,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go index becff93af..e6cb547d3 100644 --- a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go @@ -57,6 +57,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v ListInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "list answers a capped page with the cursor of the next", subject: "", given: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", wire: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", decode: func(b []byte) (any, error) { var v ListAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/parts/registry.json b/modules/mesh-delivery-contracts/parts/registry.json index 671d4b4d6..6d9b0c560 100644 --- a/modules/mesh-delivery-contracts/parts/registry.json +++ b/modules/mesh-delivery-contracts/parts/registry.json @@ -80,6 +80,23 @@ "held": { "type": "boolean", "description": "the digest is held already: nothing to send; the outcome follows as an event" + }, + "other-bytes": { + "type": "object", + "description": "the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)", + "properties": { + "digest": { + "type": "string", + "description": "the digest the holder holds for that name and version" + }, + "fingerprint": { + "type": "string", + "description": "the fingerprint the holder keeps for it, absent where it keeps none" + } + }, + "required": [ + "digest" + ] } }, "required": [ diff --git a/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json index 1a5dc697c..e25c4ca38 100644 --- a/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json @@ -160,5 +160,26 @@ "given": { "reference": "container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json b/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json index f3340b082..f56c8a38e 100644 --- a/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json @@ -136,7 +136,7 @@ }, { "name": "hold", - "description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 \u00a72); never an image of the holder's own. Emits held.", + "description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.", "input": { "type": "object", "properties": { @@ -218,7 +218,7 @@ }, { "name": "list", - "description": "What the store holds of one repository, or of every repository the seat holds when none is named: every image manifest and index, each with its digest, whether it is an index (and the manifests an index names), the tags naming it, its size and whether it is held. Read from the store itself, so a manifest no tag names is listed too; it reads only (ADR 0632 \u00a73).", + "description": "What the store holds of one repository, or of every repository the seat holds when none is named: every image manifest and index, each with its digest, whether it is an index (and the manifests an index names), the tags naming it, its size and whether it is held. Read from the store itself, so a manifest no tag names is listed too; it reads only (ADR 0632 §3).", "input": { "type": "object", "properties": { @@ -500,5 +500,6 @@ } ] } - ] + ], + "form": 2 } diff --git a/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json index be6a53a30..2a23403bd 100644 --- a/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json @@ -106,5 +106,26 @@ "0.1.19" ] } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json b/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json index 9d426368b..4e026d065 100644 --- a/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json @@ -31,5 +31,6 @@ "description": "form none: the Go module proxy's read side, answered anonymously, with no credential (design 51)" } } - ] + ], + "form": 2 } diff --git a/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json index 0b88f08e3..94cf68a84 100644 --- a/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json @@ -106,5 +106,26 @@ "0.1.19" ] } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json b/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json index ae2ab3db3..55d1096eb 100644 --- a/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json @@ -31,5 +31,6 @@ "description": "form none: the npm registry's read side, answered anonymously, with no credential (design 51)" } } - ] + ], + "form": 2 } diff --git a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json index ea035c6fb..b7c26ec76 100644 --- a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json @@ -164,5 +164,26 @@ "total": 3, "next": "c-4183" } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json index 4dfaf4549..7f8e9639c 100644 --- a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json @@ -397,5 +397,5 @@ ] } ], - "form": 2 + "form": 3 } diff --git a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts index d8a639cfe..0796f0cfb 100644 --- a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts @@ -64,6 +64,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } diff --git a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts index 2876e791a..36932c203 100644 --- a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts @@ -35,6 +35,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } diff --git a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts index 93ef53029..10f90870f 100644 --- a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts @@ -35,6 +35,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } diff --git a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts index 099d9bfa1..6484b0b0d 100644 --- a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts @@ -61,6 +61,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; }