diff --git a/go/seats/containerimageregistry/contract.go b/go/seats/containerimageregistry/contract.go index 01fcea6..ef6d3f2 100644 --- a/go/seats/containerimageregistry/contract.go +++ b/go/seats/containerimageregistry/contract.go @@ -66,7 +66,7 @@ type Artifact struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // the tag it carries, for a tagged version Tag string `json:"tag,omitempty"` @@ -74,6 +74,15 @@ type Artifact struct { Version string `json:"version,omitempty"` } +// The values of Artifact's kind. +const ( + ArtifactKindPackage = "package" + ArtifactKindImage = "image" + ArtifactKindBundle = "bundle" + ArtifactKindArchive = "archive" + ArtifactKindUpstream = "upstream" +) + // Hold is the body of held and released. type Hold struct { // when, RFC 3339 @@ -102,9 +111,9 @@ type Outcome struct { Holder string `json:"holder"` // what it is Kind string `json:"kind"` - // the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact + // the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact Module string `json:"module,omitempty"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) Reason string `json:"reason,omitempty"` @@ -118,6 +127,15 @@ type Outcome struct { Version string `json:"version,omitempty"` } +// The values of Outcome's kind. +const ( + OutcomeKindPackage = "package" + OutcomeKindImage = "image" + OutcomeKindBundle = "bundle" + OutcomeKindArchive = "archive" + OutcomeKindUpstream = "upstream" +) + // Part is one part of a transfer. type Part struct { // the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob @@ -136,7 +154,7 @@ type PublishInput struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // every part's digest and size; none when the digest is already held Parts []Part `json:"parts,omitempty"` @@ -148,6 +166,15 @@ type PublishInput struct { Version string `json:"version,omitempty"` } +// The values of PublishInput's kind. +const ( + PublishInputKindPackage = "package" + PublishInputKindImage = "image" + PublishInputKindBundle = "bundle" + PublishInputKindArchive = "archive" + PublishInputKindUpstream = "upstream" +) + // PublishAnswer is what publish answers. type PublishAnswer struct { // the digest is held already: nothing to send; the outcome follows as an event @@ -214,6 +241,12 @@ type RemoveInput struct { Version string `json:"version,omitempty"` } +// The values of RemoveInput's reason. +const ( + RemoveInputReasonTagGone = "tag-gone" + RemoveInputReasonRetention = "retention" +) + // RemoveAnswer is what remove answers. type RemoveAnswer struct { Artifact *Artifact `json:"artifact,omitempty"` @@ -291,7 +324,7 @@ type ReleaseInput struct { // ReleaseAnswer is what release answers. type ReleaseAnswer struct { - // the hold is gone + // a hold was let go; false when there was none Released bool `json:"released"` } diff --git a/go/seats/containerimageregistry/contract_test.go b/go/seats/containerimageregistry/contract_test.go index 7141141..6b5e2c0 100644 --- a/go/seats/containerimageregistry/contract_test.go +++ b/go/seats/containerimageregistry/contract_test.go @@ -37,6 +37,8 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a release of what is not held answers released false", subject: "", given: "{\"released\":false}", wire: "{\"released\":false}", + decode: func(b []byte) (any, error) { var v ReleaseAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/go/seats/gopackageregistry/contract.go b/go/seats/gopackageregistry/contract.go index 98aea35..54ea7a4 100644 --- a/go/seats/gopackageregistry/contract.go +++ b/go/seats/gopackageregistry/contract.go @@ -54,7 +54,7 @@ type Artifact struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // the tag it carries, for a tagged version Tag string `json:"tag,omitempty"` @@ -62,6 +62,15 @@ type Artifact struct { Version string `json:"version,omitempty"` } +// The values of Artifact's kind. +const ( + ArtifactKindPackage = "package" + ArtifactKindImage = "image" + ArtifactKindBundle = "bundle" + ArtifactKindArchive = "archive" + ArtifactKindUpstream = "upstream" +) + // Outcome is the body of published, refused and removed. type Outcome struct { // the source commit it was built from @@ -74,9 +83,9 @@ type Outcome struct { Holder string `json:"holder"` // what it is Kind string `json:"kind"` - // the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact + // the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact Module string `json:"module,omitempty"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) Reason string `json:"reason,omitempty"` @@ -90,6 +99,15 @@ type Outcome struct { Version string `json:"version,omitempty"` } +// The values of Outcome's kind. +const ( + OutcomeKindPackage = "package" + OutcomeKindImage = "image" + OutcomeKindBundle = "bundle" + OutcomeKindArchive = "archive" + OutcomeKindUpstream = "upstream" +) + // Part is one part of a transfer. type Part struct { // the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob @@ -108,7 +126,7 @@ type PublishInput struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // every part's digest and size; none when the digest is already held Parts []Part `json:"parts,omitempty"` @@ -120,6 +138,15 @@ type PublishInput struct { Version string `json:"version,omitempty"` } +// The values of PublishInput's kind. +const ( + PublishInputKindPackage = "package" + PublishInputKindImage = "image" + PublishInputKindBundle = "bundle" + PublishInputKindArchive = "archive" + PublishInputKindUpstream = "upstream" +) + // PublishAnswer is what publish answers. type PublishAnswer struct { // the digest is held already: nothing to send; the outcome follows as an event @@ -186,6 +213,12 @@ type RemoveInput struct { Version string `json:"version,omitempty"` } +// The values of RemoveInput's reason. +const ( + RemoveInputReasonTagGone = "tag-gone" + RemoveInputReasonRetention = "retention" +) + // RemoveAnswer is what remove answers. type RemoveAnswer struct { Artifact *Artifact `json:"artifact,omitempty"` diff --git a/go/seats/gopackageregistry/contract_test.go b/go/seats/gopackageregistry/contract_test.go index ff2164e..8f127f0 100644 --- a/go/seats/gopackageregistry/contract_test.go +++ b/go/seats/gopackageregistry/contract_test.go @@ -17,21 +17,21 @@ func TestFixtures(t *testing.T) { decode func([]byte) (any, error) subjectIs *regexp.Regexp }{ - {name: "published on the seat's subject", subject: "mesh.seat.go-package-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"module\":\"git.novox.be/novox/mesh-sdk/go\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"module\":\"git.novox.be/novox/mesh-sdk/go\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "published on the seat's subject", subject: "mesh.seat.go-package-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"module\":\"git.novox.be/novox/mesh-sdk/go\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"reference\":\"git.novox.be/novox/mesh-sdk/go@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"module\":\"git.novox.be/novox/mesh-sdk/go\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"reference\":\"git.novox.be/novox/mesh-sdk/go@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v PublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.go-package-registry\\.event\\.published$")}, - {name: "refused on the seat's subject", subject: "mesh.seat.go-package-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "refused on the seat's subject", subject: "mesh.seat.go-package-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"reason\":\"retention\",\"reference\":\"git.novox.be/novox/mesh-sdk/go@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"reason\":\"retention\",\"reference\":\"git.novox.be/novox/mesh-sdk/go@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.go-package-registry\\.event\\.refused$")}, - {name: "removed on the seat's subject", subject: "mesh.seat.go-package-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "removed on the seat's subject", subject: "mesh.seat.go-package-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"reason\":\"retention\",\"reference\":\"git.novox.be/novox/mesh-sdk/go@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"reason\":\"retention\",\"reference\":\"git.novox.be/novox/mesh-sdk/go@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v RemovedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.go-package-registry\\.event\\.removed$")}, - {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"later\":{\"x\":1},\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"later\":{\"x\":1},\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "publish answers what it lacks", subject: "", given: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", wire: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a chunk of a part", subject: "", given: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", wire: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", + {name: "the versions held", subject: "", given: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.19\"}]}", decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { diff --git a/go/seats/meshbroker/contract.go b/go/seats/meshbroker/contract.go index 1dcdb23..5313b13 100644 --- a/go/seats/meshbroker/contract.go +++ b/go/seats/meshbroker/contract.go @@ -100,6 +100,25 @@ type Entry struct { Template string `json:"template,omitempty"` } +// The values of Entry's storage-type. +const ( + EntryStorageTypeStream = "stream" + EntryStorageTypeKeyValue = "key-value" + EntryStorageTypeObjectStore = "object-store" + EntryStorageTypeLedger = "ledger" +) + +// The values of Entry's template. +const ( + EntryTemplateState = "state" + EntryTemplateEvents = "events" + EntryTemplateWorkQueue = "work-queue" + EntryTemplateLog = "log" + EntryTemplateObjects = "objects" + EntryTemplateLedger = "ledger" + EntryTemplate = "" +) + // Fill is a type of the contract. type Fill struct { // bytes held @@ -135,6 +154,35 @@ type Held struct { Why string `json:"why,omitempty"` } +// The values of Held's state. +const ( + HeldStateHeld = "held" + HeldStateRefused = "refused" + HeldStateWaiting = "waiting" + HeldStateDrifted = "drifted" + HeldStateFull = "full" + HeldStateOrphaned = "orphaned" +) + +// The values of Held's storage-type. +const ( + HeldStorageTypeStream = "stream" + HeldStorageTypeKeyValue = "key-value" + HeldStorageTypeObjectStore = "object-store" + HeldStorageTypeLedger = "ledger" +) + +// The values of Held's template. +const ( + HeldTemplateState = "state" + HeldTemplateEvents = "events" + HeldTemplateWorkQueue = "work-queue" + HeldTemplateLog = "log" + HeldTemplateObjects = "objects" + HeldTemplateLedger = "ledger" + HeldTemplate = "" +) + // Named is a type of the contract. type Named struct { // the entry's local name @@ -173,6 +221,25 @@ type Said struct { Why string `json:"why,omitempty"` } +// The values of Said's storage-type. +const ( + SaidStorageTypeStream = "stream" + SaidStorageTypeKeyValue = "key-value" + SaidStorageTypeObjectStore = "object-store" + SaidStorageTypeLedger = "ledger" +) + +// The values of Said's template. +const ( + SaidTemplateState = "state" + SaidTemplateEvents = "events" + SaidTemplateWorkQueue = "work-queue" + SaidTemplateLog = "log" + SaidTemplateObjects = "objects" + SaidTemplateLedger = "ledger" + SaidTemplate = "" +) + // Warranted is a type of the contract. type Warranted struct { // the entry's local name diff --git a/go/seats/meshconfig/contract.go b/go/seats/meshconfig/contract.go index e5d5005..0ab1684 100644 --- a/go/seats/meshconfig/contract.go +++ b/go/seats/meshconfig/contract.go @@ -112,6 +112,12 @@ type RetiringHolderEvent struct { Since string `json:"since"` } +// The values of RetiringHolderEvent's kind. +const ( + RetiringHolderEventKindValue = "value" + RetiringHolderEventKindSecret = "secret" +) + // RetiredHolderEvent is the body of the holder's event retired. type RetiredHolderEvent struct { // the ask's id diff --git a/go/seats/meshvault/contract.go b/go/seats/meshvault/contract.go index 14bd5c1..df00f7c 100644 --- a/go/seats/meshvault/contract.go +++ b/go/seats/meshvault/contract.go @@ -295,6 +295,18 @@ type EnrolmentTokenInput struct { Tunnel *EnrolmentTokenInputTunnel `json:"tunnel,omitempty"` } +// The values of EnrolmentTokenInput's drop. +const ( + EnrolmentTokenInputDropTrue = "true" + EnrolmentTokenInputDropFalse = "false" +) + +// The values of EnrolmentTokenInput's sealed. +const ( + EnrolmentTokenInputSealedTrue = "true" + EnrolmentTokenInputSealedFalse = "false" +) + // EnrolmentTokenAnswer is what enrolment-token answers. type EnrolmentTokenAnswer struct { // the bus's address the machine dials @@ -323,6 +335,12 @@ type NodeAccountInput struct { SealingKey string `json:"sealing_key,omitempty"` } +// The values of NodeAccountInput's retire. +const ( + NodeAccountInputRetireTrue = "true" + NodeAccountInputRetireFalse = "false" +) + // NodeAccountAnswer is what node-account answers. type NodeAccountAnswer struct { // the account sealed to the node's sealing key, in base64 diff --git a/go/seats/nodeengine/contract.go b/go/seats/nodeengine/contract.go index 200524c..8e6a947 100644 --- a/go/seats/nodeengine/contract.go +++ b/go/seats/nodeengine/contract.go @@ -97,6 +97,14 @@ type Act struct { Why string `json:"why,omitempty"` } +// The values of Act's state. +const ( + ActStateAsked = "asked" + ActStateDone = "done" + ActStateRefused = "refused" + ActStateAnswered = "answered" +) + // ActSaid is what the seat says of an act: the act, the path or access, the caller as the runtime proved it and the ask (ADR 0563 §1). type ActSaid struct { // the act @@ -115,6 +123,13 @@ type ActSaid struct { Subject string `json:"subject,omitempty"` } +// The values of ActSaid's state. +const ( + ActSaidStateAsked = "asked" + ActSaidStateDone = "done" + ActSaidStateRefused = "refused" +) + // Acts is the acts kept. type Acts struct { // the acts, newest first @@ -147,6 +162,12 @@ type ManifestReadsChanged struct { Why string `json:"why"` } +// The values of ManifestReadsChanged's why. +const ( + ManifestReadsChangedWhyStarted = "started" + ManifestReadsChangedWhyReturned = "returned" +) + // Module is one module's composition with the candidate. type Module struct { // the candidate changes it from the one composed without it @@ -163,6 +184,13 @@ type Module struct { Words string `json:"words,omitempty"` } +// The values of Module's state. +const ( + ModuleStateComposed = "composed" + ModuleStateRefused = "refused" + ModuleStateHeld = "held" +) + // Revision is one revision of a composition key. type Revision struct { // its digest @@ -266,6 +294,12 @@ type PackagesInput struct { Write string `json:"write,omitempty"` } +// The values of PackagesInput's write. +const ( + PackagesInputWriteTrue = "true" + PackagesInputWriteFalse = "false" +) + // PackagesAnswerKeyPackagesItem is a type of the contract. type PackagesAnswerKeyPackagesItem struct { // declared absent @@ -492,6 +526,14 @@ type ComposeCandidateAnswer struct { Verdict string `json:"verdict"` } +// The values of ComposeCandidateAnswer's verdict. +const ( + ComposeCandidateAnswerVerdictComposed = "composed" + ComposeCandidateAnswerVerdictRefused = "refused" + ComposeCandidateAnswerVerdictUnready = "unready" + ComposeCandidateAnswerVerdictNotJudged = "not-judged" +) + // ManifestReadsInput is what manifest-reads takes. type ManifestReadsInput struct { } diff --git a/go/seats/npmpackageregistry/contract.go b/go/seats/npmpackageregistry/contract.go index 79d2b05..1237a9e 100644 --- a/go/seats/npmpackageregistry/contract.go +++ b/go/seats/npmpackageregistry/contract.go @@ -54,7 +54,7 @@ type Artifact struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // the tag it carries, for a tagged version Tag string `json:"tag,omitempty"` @@ -62,6 +62,15 @@ type Artifact struct { Version string `json:"version,omitempty"` } +// The values of Artifact's kind. +const ( + ArtifactKindPackage = "package" + ArtifactKindImage = "image" + ArtifactKindBundle = "bundle" + ArtifactKindArchive = "archive" + ArtifactKindUpstream = "upstream" +) + // Outcome is the body of published, refused and removed. type Outcome struct { // the source commit it was built from @@ -74,9 +83,9 @@ type Outcome struct { Holder string `json:"holder"` // what it is Kind string `json:"kind"` - // the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact + // the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact Module string `json:"module,omitempty"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) Reason string `json:"reason,omitempty"` @@ -90,6 +99,15 @@ type Outcome struct { Version string `json:"version,omitempty"` } +// The values of Outcome's kind. +const ( + OutcomeKindPackage = "package" + OutcomeKindImage = "image" + OutcomeKindBundle = "bundle" + OutcomeKindArchive = "archive" + OutcomeKindUpstream = "upstream" +) + // Part is one part of a transfer. type Part struct { // the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob @@ -108,7 +126,7 @@ type PublishInput struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // every part's digest and size; none when the digest is already held Parts []Part `json:"parts,omitempty"` @@ -120,6 +138,15 @@ type PublishInput struct { Version string `json:"version,omitempty"` } +// The values of PublishInput's kind. +const ( + PublishInputKindPackage = "package" + PublishInputKindImage = "image" + PublishInputKindBundle = "bundle" + PublishInputKindArchive = "archive" + PublishInputKindUpstream = "upstream" +) + // PublishAnswer is what publish answers. type PublishAnswer struct { // the digest is held already: nothing to send; the outcome follows as an event @@ -186,6 +213,12 @@ type RemoveInput struct { Version string `json:"version,omitempty"` } +// The values of RemoveInput's reason. +const ( + RemoveInputReasonTagGone = "tag-gone" + RemoveInputReasonRetention = "retention" +) + // RemoveAnswer is what remove answers. type RemoveAnswer struct { Artifact *Artifact `json:"artifact,omitempty"` diff --git a/go/seats/npmpackageregistry/contract_test.go b/go/seats/npmpackageregistry/contract_test.go index 66b39b2..ed57d7f 100644 --- a/go/seats/npmpackageregistry/contract_test.go +++ b/go/seats/npmpackageregistry/contract_test.go @@ -17,21 +17,21 @@ func TestFixtures(t *testing.T) { decode func([]byte) (any, error) subjectIs *regexp.Regexp }{ - {name: "published on the seat's subject", subject: "mesh.seat.npm-package-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "published on the seat's subject", subject: "mesh.seat.npm-package-registry.event.published", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"reference\":\"@novox/mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"reference\":\"@novox/mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v PublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.npm-package-registry\\.event\\.published$")}, - {name: "refused on the seat's subject", subject: "mesh.seat.npm-package-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "refused on the seat's subject", subject: "mesh.seat.npm-package-registry.event.refused", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"reason\":\"retention\",\"reference\":\"@novox/mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"reason\":\"retention\",\"reference\":\"@novox/mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v RefusedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.npm-package-registry\\.event\\.refused$")}, - {name: "removed on the seat's subject", subject: "mesh.seat.npm-package-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"reason\":\"retention\",\"reference\":\"mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "removed on the seat's subject", subject: "mesh.seat.npm-package-registry.event.removed", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"reason\":\"retention\",\"reference\":\"@novox/mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"holder\":\"gitea\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"reason\":\"retention\",\"reference\":\"@novox/mesh-sdk@0.1.19\",\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v RemovedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.npm-package-registry\\.event\\.removed$")}, - {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "publish opens a transfer", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"later\":{\"x\":1},\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", + {name: "a field the reader does not know is dropped", subject: "", given: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"later\":{\"x\":1},\"name\":\"@novox/mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", wire: "{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"parts\":[{\"digest\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"size\":1048576}],\"transfer\":\"t1\",\"version\":\"0.1.19\"}", decode: func(b []byte) (any, error) { var v PublishInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "publish answers what it lacks", subject: "", given: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", wire: "{\"lacks\":[\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\"],\"transfer\":\"t1\"}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a chunk of a part", subject: "", given: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", wire: "{\"data\":\"aGVsbG8=\",\"last\":true,\"part\":\"sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"sequence\":0,\"transfer\":\"t1\"}", decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", + {name: "the versions held", subject: "", given: "{\"name\":\"@novox/mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"@novox/mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"@novox/mesh-sdk\",\"version\":\"0.1.19\"}]}", decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { diff --git a/go/seats/ociartifactregistry/contract.go b/go/seats/ociartifactregistry/contract.go index 5746c78..a02d700 100644 --- a/go/seats/ociartifactregistry/contract.go +++ b/go/seats/ociartifactregistry/contract.go @@ -64,7 +64,7 @@ type Artifact struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // the tag it carries, for a tagged version Tag string `json:"tag,omitempty"` @@ -72,6 +72,15 @@ type Artifact struct { Version string `json:"version,omitempty"` } +// The values of Artifact's kind. +const ( + ArtifactKindPackage = "package" + ArtifactKindImage = "image" + ArtifactKindBundle = "bundle" + ArtifactKindArchive = "archive" + ArtifactKindUpstream = "upstream" +) + // Hold is the body of held and released. type Hold struct { // when, RFC 3339 @@ -100,9 +109,9 @@ type Outcome struct { Holder string `json:"holder"` // what it is Kind string `json:"kind"` - // the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact + // the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact Module string `json:"module,omitempty"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) Reason string `json:"reason,omitempty"` @@ -116,6 +125,15 @@ type Outcome struct { Version string `json:"version,omitempty"` } +// The values of Outcome's kind. +const ( + OutcomeKindPackage = "package" + OutcomeKindImage = "image" + OutcomeKindBundle = "bundle" + OutcomeKindArchive = "archive" + OutcomeKindUpstream = "upstream" +) + // Part is one part of a transfer. type Part struct { // the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob @@ -134,7 +152,7 @@ type PublishInput struct { Fingerprint string `json:"fingerprint,omitempty"` // what it is Kind string `json:"kind"` - // the package's, image's, bundle's or archive's name + // the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) Name string `json:"name"` // every part's digest and size; none when the digest is already held Parts []Part `json:"parts,omitempty"` @@ -146,6 +164,15 @@ type PublishInput struct { Version string `json:"version,omitempty"` } +// The values of PublishInput's kind. +const ( + PublishInputKindPackage = "package" + PublishInputKindImage = "image" + PublishInputKindBundle = "bundle" + PublishInputKindArchive = "archive" + PublishInputKindUpstream = "upstream" +) + // PublishAnswer is what publish answers. type PublishAnswer struct { // the digest is held already: nothing to send; the outcome follows as an event @@ -212,6 +239,12 @@ type RemoveInput struct { Version string `json:"version,omitempty"` } +// The values of RemoveInput's reason. +const ( + RemoveInputReasonTagGone = "tag-gone" + RemoveInputReasonRetention = "retention" +) + // RemoveAnswer is what remove answers. type RemoveAnswer struct { Artifact *Artifact `json:"artifact,omitempty"` @@ -249,7 +282,7 @@ type ReleaseInput struct { // ReleaseAnswer is what release answers. type ReleaseAnswer struct { - // the hold is gone + // a hold was let go; false when there was none Released bool `json:"released"` } diff --git a/go/seats/ociartifactregistry/contract_test.go b/go/seats/ociartifactregistry/contract_test.go index f8e04e6..8c8cdd6 100644 --- a/go/seats/ociartifactregistry/contract_test.go +++ b/go/seats/ociartifactregistry/contract_test.go @@ -37,6 +37,8 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v PublishPartInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "the versions held", subject: "", given: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", wire: "{\"name\":\"mesh-sdk\",\"versions\":[{\"commit\":\"cccccccccccccccccccccccccccccccccccccccc\",\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"fingerprint\":\"f1\",\"kind\":\"package\",\"name\":\"mesh-sdk\",\"version\":\"0.1.19\"}]}", decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "a release of what is not held answers released false", subject: "", given: "{\"released\":false}", wire: "{\"released\":false}", + decode: func(b []byte) (any, error) { var v ReleaseAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/go/seats/operatorchannel/contract.go b/go/seats/operatorchannel/contract.go index eece285..bb087ee 100644 --- a/go/seats/operatorchannel/contract.go +++ b/go/seats/operatorchannel/contract.go @@ -210,6 +210,15 @@ type Warrant struct { Words string `json:"words,omitempty"` } +// The values of Warrant's outcome. +const ( + WarrantOutcomeChosen = "chosen" + WarrantOutcomeExpired = "expired" + WarrantOutcomeCancelled = "cancelled" + WarrantOutcomeReplaced = "replaced" + WarrantOutcomeRefused = "refused" +) + // OpenInput is what open takes. type OpenInput struct { } @@ -245,6 +254,12 @@ type NotifyInput struct { Summary string `json:"summary,omitempty"` } +// The values of NotifyInput's severity. +const ( + NotifyInputSeverityUrgent = "urgent" + NotifyInputSeverityWarning = "warning" +) + // NotifyAnswer is what notify answers. type NotifyAnswer = map[string]any @@ -304,5 +319,14 @@ type ClosedHolderEvent struct { ID string `json:"id"` } +// The values of ClosedHolderEvent's how. +const ( + ClosedHolderEventHowAnswered = "answered" + ClosedHolderEventHowExpired = "expired" + ClosedHolderEventHowCancelled = "cancelled" + ClosedHolderEventHowReplaced = "replaced" + ClosedHolderEventHowUnlinked = "unlinked" +) + // AsksRecord is one value of the record asks. type AsksRecord = map[string]any diff --git a/go/seats/seats.go b/go/seats/seats.go index 2eb7cbb..3464d0d 100644 --- a/go/seats/seats.go +++ b/go/seats/seats.go @@ -384,47 +384,47 @@ func List() []Seat { {Name: NpmPackageRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0109", Delivers: "npm-package-registry", Emits: []string{"published", "refused", "removed"}, Serves: []Verb{ {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", Optional: true, - Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 760 KiB of data, base64.", Optional: true, Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 760 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", Optional: true, Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, }}, {Name: GoPackageRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0605", Delivers: "go-package-registry", Emits: []string{"published", "refused", "removed"}, Serves: []Verb{ {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", Optional: true, - Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 760 KiB of data, base64.", Optional: true, Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 760 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", Optional: true, Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, }}, {Name: ContainerImageRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0605", Delivers: "artifact-store", Emits: []string{"published", "refused", "removed", "held", "released"}, Serves: []Verb{ {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", Optional: true, - Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 760 KiB of data, base64.", Optional: true, Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 760 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", Optional: true, Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, {Name: "mirror", Description: "Copy an outside image into the store by its pinned digest; emits published or refused.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "its pinned digest, sha256:", "type": "string"}, "name": map[string]any{"description": "the name it is kept under", "type": "string"}, "source": map[string]any{"description": "the outside image's reference", "type": "string"}}, "required": []string{"source", "digest", "name"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest stored", "type": "string"}, "reference": map[string]any{"description": "the reference the seat answers", "type": "string"}}, "required": []string{"reference", "digest"}, "type": "object"}}, @@ -434,30 +434,30 @@ func List() []Seat { {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 §2); never an image of the holder's own. Emits held.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "which of the sweep's rules keeps it", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "it is held", "type": "boolean"}, "since": map[string]any{"description": "when the hold began, RFC 3339", "type": "string"}}, "required": []string{"held"}, "type": "object"}}, - {Name: "release", Description: "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", Optional: true, + {Name: "release", Description: "Let a hold go; emits released. A release of what is not held answers released false and emits nothing, never an error: the outcome asked holds already. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it is let go", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"released": map[string]any{"description": "the hold is gone", "type": "boolean"}}, "required": []string{"released"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"released": map[string]any{"description": "a hold was let go; false when there was none", "type": "boolean"}}, "required": []string{"released"}, "type": "object"}}, }}, {Name: OciArtifactRegistry, Scope: "mesh", Grain: "whole", Decision: "novox/hq ADR 0605", Delivers: "artifact-store", Emits: []string{"published", "refused", "removed", "held", "released"}, Serves: []Verb{ {Name: "publish", Description: "Open a transfer, naming the artifact and the digest of every part; answers the digests the holder lacks, which the caller then sends by publish-part. A transfer already open answers the parts held, so a cut transfer goes on from there. With no parts and a version, the held digest is published under that version and nothing is stored (the trunk's claim).", Optional: true, - Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, + Input: map[string]any{"properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "parts": map[string]any{"description": "every part's digest and size; none when the digest is already held", "items": map[string]any{"description": "one part of a transfer", "properties": map[string]any{"digest": map[string]any{"description": "the part's digest, sha256:: an image's layer or config, a package's file, a bundle's blob", "type": "string"}, "size": map[string]any{"description": "its size in bytes", "type": "integer"}}, "required": []string{"digest", "size"}, "type": "object"}, "type": "array"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "transfer": map[string]any{"description": "the transfer's name, the caller's own; the same name opens the same transfer again", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"transfer", "name", "kind", "digest"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "the digest is held already: nothing to send; the outcome follows as an event", "type": "boolean"}, "lacks": map[string]any{"description": "the digests of the parts the holder lacks, to send by publish-part", "items": map[string]any{"type": "string"}, "type": "array"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer"}, "type": "object"}}, {Name: "publish-part", Description: "Send one chunk of one part of an open transfer; the last chunk of the last part ends the transfer, and the holder hashes what it received, asks builder_versions, stores it and says published or refused. A chunk's message stays under the bus's largest message (1 MiB), so at most 760 KiB of data, base64.", Optional: true, Input: map[string]any{"properties": map[string]any{"data": map[string]any{"description": "the chunk's bytes, base64 (at most 760 KiB before encoding)", "type": "string"}, "last": map[string]any{"description": "this chunk is the part's last", "type": "boolean"}, "part": map[string]any{"description": "the part's digest", "type": "string"}, "sequence": map[string]any{"description": "the chunk's place in its part, from 0", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part", "sequence", "last", "data"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"complete": map[string]any{"description": "the part is whole and its bytes match its digest", "type": "boolean"}, "part": map[string]any{"description": "the part", "type": "string"}, "received": map[string]any{"description": "the chunks of the part held so far", "type": "integer"}, "transfer": map[string]any{"description": "the transfer", "type": "string"}}, "required": []string{"transfer", "part"}, "type": "object"}}, {Name: "versions", Description: "The versions the seat holds of one name, newest first: each one's version, tag, digest, kind and when it was published.", Optional: true, Input: map[string]any{"properties": map[string]any{"kind": map[string]any{"description": "narrowed to one kind (optional)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}}, "required": []string{"name"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"name": map[string]any{"description": "the name", "type": "string"}, "versions": map[string]any{"description": "newest first", "items": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "type": "array"}}, "required": []string{"name", "versions"}, "type": "object"}}, {Name: "remove", Description: "Remove one tagged version; the holder refuses an untagged one but for the retention removal of a bundle, archive or copied base by the artifact sweep's holder. Every removal emits removed with its reason.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest (for a bundle, archive or copied base)", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it goes", "enum": []string{"tag-gone", "retention"}, "type": "string"}, "tag": map[string]any{"description": "the tag (for a tagged version)", "type": "string"}, "version": map[string]any{"description": "the version", "type": "string"}}, "required": []string{"name", "reason"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"artifact": map[string]any{"description": "one published thing, as every registry event and answer names it", "properties": map[string]any{"commit": map[string]any{"description": "the source commit it was built from", "type": "string"}, "digest": map[string]any{"description": "its digest, sha256: (a Go package's h1: hash beside it in the version's record)", "type": "string"}, "fingerprint": map[string]any{"description": "the build's fingerprint", "type": "string"}, "kind": map[string]any{"description": "what it is", "enum": []string{"package", "image", "bundle", "archive", "upstream"}, "type": "string"}, "name": map[string]any{"description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string"}, "tag": map[string]any{"description": "the tag it carries, for a tagged version", "type": "string"}, "version": map[string]any{"description": "the version the builder gave it (design 51 *The versions*); empty for a bundle or archive published by its digest alone", "type": "string"}}, "required": []string{"name", "kind", "digest"}, "type": "object"}, "removed": map[string]any{"description": "it is gone", "type": "boolean"}}, "required": []string{"removed"}, "type": "object"}}, {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 §2); never an image of the holder's own. Emits held.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "which of the sweep's rules keeps it", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, Output: map[string]any{"properties": map[string]any{"held": map[string]any{"description": "it is held", "type": "boolean"}, "since": map[string]any{"description": "when the hold began, RFC 3339", "type": "string"}}, "required": []string{"held"}, "type": "object"}}, - {Name: "release", Description: "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", Optional: true, + {Name: "release", Description: "Let a hold go; emits released. A release of what is not held answers released false and emits nothing, never an error: the outcome asked holds already. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", Optional: true, Input: map[string]any{"properties": map[string]any{"digest": map[string]any{"description": "the digest", "type": "string"}, "name": map[string]any{"description": "the name", "type": "string"}, "reason": map[string]any{"description": "why it is let go", "type": "string"}}, "required": []string{"name", "digest", "reason"}, "type": "object"}, - Output: map[string]any{"properties": map[string]any{"released": map[string]any{"description": "the hold is gone", "type": "boolean"}}, "required": []string{"released"}, "type": "object"}}, + Output: map[string]any{"properties": map[string]any{"released": map[string]any{"description": "a hold was let go; false when there was none", "type": "boolean"}}, "required": []string{"released"}, "type": "object"}}, }}, {Name: Git, Scope: "mesh", Grain: "seat-list", Decision: "novox/hq ADR 0111", Delivers: "git"}, {Name: NodeBuildGo, Scope: "node", Grain: "seat-list", Decision: "novox/hq ADR 0525, ADR 0536, ADR 0553", Accepts: []string{"delivery", "check", "recheck"}, PulledByKind: true, Yields: true, diff --git a/parts/registry.json b/parts/registry.json index 0fcb16b..af1249c 100644 --- a/parts/registry.json +++ b/parts/registry.json @@ -12,7 +12,7 @@ "properties": { "name": { "type": "string", - "description": "the package's, image's, bundle's or archive's name" + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)" }, "version": { "type": "string", @@ -275,7 +275,7 @@ "properties": { "name": { "type": "string", - "description": "the package's, image's, bundle's or archive's name" + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)" }, "version": { "type": "string", @@ -339,11 +339,11 @@ "properties": { "name": { "type": "string", - "description": "the package's, image's, bundle's or archive's name" + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)" }, "module": { "type": "string", - "description": "the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact" + "description": "the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact" }, "version": { "type": "string", diff --git a/seats/container-image-registry/fixtures/verbs.json b/seats/container-image-registry/fixtures/verbs.json index 2c03cdc..2d94ee7 100644 --- a/seats/container-image-registry/fixtures/verbs.json +++ b/seats/container-image-registry/fixtures/verbs.json @@ -93,5 +93,13 @@ } ] } + }, + { + "name": "a release of what is not held answers released false", + "of": "verb:release.answer", + "why": "A3t: the outcome asked holds already, so it is no error", + "given": { + "released": false + } } ] diff --git a/seats/container-image-registry/seat.json b/seats/container-image-registry/seat.json index 651ad69..8877a5b 100644 --- a/seats/container-image-registry/seat.json +++ b/seats/container-image-registry/seat.json @@ -153,7 +153,7 @@ }, { "name": "release", - "description": "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + "description": "Let a hold go; emits released. A release of what is not held answers released false and emits nothing, never an error: the outcome asked holds already. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", "callers": "the module that runs the artifact sweep; the operator's session through the holder's tool", "input": { "type": "object", @@ -182,7 +182,7 @@ "properties": { "released": { "type": "boolean", - "description": "the hold is gone" + "description": "a hold was let go; false when there was none" } }, "required": [ diff --git a/seats/go-package-registry/fixtures/events.json b/seats/go-package-registry/fixtures/events.json index 23d9779..37579ae 100644 --- a/seats/go-package-registry/fixtures/events.json +++ b/seats/go-package-registry/fixtures/events.json @@ -4,7 +4,7 @@ "of": "event:published", "subject": "mesh.seat.go-package-registry.event.published", "given": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "module": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", @@ -13,7 +13,7 @@ "commit": "cccccccccccccccccccccccccccccccccccccccc", "holder": "gitea", "transfer": "t1", - "reference": "mesh-sdk@0.1.19" + "reference": "git.novox.be/novox/mesh-sdk/go@0.1.19" } }, { @@ -21,7 +21,7 @@ "of": "event:refused", "subject": "mesh.seat.go-package-registry.event.refused", "given": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -29,7 +29,7 @@ "commit": "cccccccccccccccccccccccccccccccccccccccc", "holder": "gitea", "transfer": "t1", - "reference": "mesh-sdk@0.1.19", + "reference": "git.novox.be/novox/mesh-sdk/go@0.1.19", "reason": "retention" } }, @@ -38,7 +38,7 @@ "of": "event:removed", "subject": "mesh.seat.go-package-registry.event.removed", "given": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -46,7 +46,7 @@ "commit": "cccccccccccccccccccccccccccccccccccccccc", "holder": "gitea", "transfer": "t1", - "reference": "mesh-sdk@0.1.19", + "reference": "git.novox.be/novox/mesh-sdk/go@0.1.19", "reason": "retention" } } diff --git a/seats/go-package-registry/fixtures/verbs.json b/seats/go-package-registry/fixtures/verbs.json index 338bf36..716fe9f 100644 --- a/seats/go-package-registry/fixtures/verbs.json +++ b/seats/go-package-registry/fixtures/verbs.json @@ -3,7 +3,7 @@ "name": "publish opens a transfer", "of": "verb:publish.input", "given": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -23,7 +23,7 @@ "of": "verb:publish.input", "why": "ADR 0608 §6: a reader ignores a field it does not know", "given": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -41,7 +41,7 @@ } }, "wire": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -81,10 +81,10 @@ "name": "the versions held", "of": "verb:versions.answer", "given": { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "versions": [ { - "name": "mesh-sdk", + "name": "git.novox.be/novox/mesh-sdk/go", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", diff --git a/seats/npm-package-registry/fixtures/events.json b/seats/npm-package-registry/fixtures/events.json index f7cca82..0fe1c76 100644 --- a/seats/npm-package-registry/fixtures/events.json +++ b/seats/npm-package-registry/fixtures/events.json @@ -4,7 +4,7 @@ "of": "event:published", "subject": "mesh.seat.npm-package-registry.event.published", "given": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -12,7 +12,7 @@ "commit": "cccccccccccccccccccccccccccccccccccccccc", "holder": "gitea", "transfer": "t1", - "reference": "mesh-sdk@0.1.19" + "reference": "@novox/mesh-sdk@0.1.19" } }, { @@ -20,7 +20,7 @@ "of": "event:refused", "subject": "mesh.seat.npm-package-registry.event.refused", "given": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -28,7 +28,7 @@ "commit": "cccccccccccccccccccccccccccccccccccccccc", "holder": "gitea", "transfer": "t1", - "reference": "mesh-sdk@0.1.19", + "reference": "@novox/mesh-sdk@0.1.19", "reason": "retention" } }, @@ -37,7 +37,7 @@ "of": "event:removed", "subject": "mesh.seat.npm-package-registry.event.removed", "given": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -45,7 +45,7 @@ "commit": "cccccccccccccccccccccccccccccccccccccccc", "holder": "gitea", "transfer": "t1", - "reference": "mesh-sdk@0.1.19", + "reference": "@novox/mesh-sdk@0.1.19", "reason": "retention" } } diff --git a/seats/npm-package-registry/fixtures/verbs.json b/seats/npm-package-registry/fixtures/verbs.json index 338bf36..529d486 100644 --- a/seats/npm-package-registry/fixtures/verbs.json +++ b/seats/npm-package-registry/fixtures/verbs.json @@ -3,7 +3,7 @@ "name": "publish opens a transfer", "of": "verb:publish.input", "given": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -23,7 +23,7 @@ "of": "verb:publish.input", "why": "ADR 0608 §6: a reader ignores a field it does not know", "given": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -41,7 +41,7 @@ } }, "wire": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -81,10 +81,10 @@ "name": "the versions held", "of": "verb:versions.answer", "given": { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "versions": [ { - "name": "mesh-sdk", + "name": "@novox/mesh-sdk", "version": "0.1.19", "kind": "package", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", diff --git a/seats/oci-artifact-registry/fixtures/verbs.json b/seats/oci-artifact-registry/fixtures/verbs.json index 697b2ca..b571a88 100644 --- a/seats/oci-artifact-registry/fixtures/verbs.json +++ b/seats/oci-artifact-registry/fixtures/verbs.json @@ -93,5 +93,13 @@ } ] } + }, + { + "name": "a release of what is not held answers released false", + "of": "verb:release.answer", + "why": "A3t: the outcome asked holds already, so it is no error", + "given": { + "released": false + } } ] diff --git a/seats/oci-artifact-registry/seat.json b/seats/oci-artifact-registry/seat.json index c826e5c..df5f58c 100644 --- a/seats/oci-artifact-registry/seat.json +++ b/seats/oci-artifact-registry/seat.json @@ -56,7 +56,7 @@ }, { "name": "release", - "description": "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + "description": "Let a hold go; emits released. A release of what is not held answers released false and emits nothing, never an error: the outcome asked holds already. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", "callers": "the module that runs the artifact sweep; the operator's session through the holder's tool", "input": { "type": "object", @@ -85,7 +85,7 @@ "properties": { "released": { "type": "boolean", - "description": "the hold is gone" + "description": "a hold was let go; false when there was none" } }, "required": [ diff --git a/ts/seats/containerimageregistry/src/index.ts b/ts/seats/containerimageregistry/src/index.ts index ca92d41..b20e37e 100644 --- a/ts/seats/containerimageregistry/src/index.ts +++ b/ts/seats/containerimageregistry/src/index.ts @@ -137,7 +137,7 @@ export interface ReleaseInput { /** is what release answers. */ export interface ReleaseAnswer { - /** the hold is gone */ + /** a hold was let go; false when there was none */ "released": boolean; } diff --git a/ts/seats/containerimageregistry/src/parts/registry.ts b/ts/seats/containerimageregistry/src/parts/registry.ts index 9642c2d..544dc55 100644 --- a/ts/seats/containerimageregistry/src/parts/registry.ts +++ b/ts/seats/containerimageregistry/src/parts/registry.ts @@ -25,7 +25,7 @@ export interface Artifact { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** the tag it carries, for a tagged version */ "tag"?: string; @@ -45,9 +45,9 @@ export interface Outcome { "holder": string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact */ + /** the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact */ "module"?: string; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) */ "reason"?: string; @@ -79,7 +79,7 @@ export interface PublishInput { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** every part's digest and size; none when the digest is already held */ "parts"?: Part[]; diff --git a/ts/seats/gopackageregistry/src/parts/registry.ts b/ts/seats/gopackageregistry/src/parts/registry.ts index 9642c2d..544dc55 100644 --- a/ts/seats/gopackageregistry/src/parts/registry.ts +++ b/ts/seats/gopackageregistry/src/parts/registry.ts @@ -25,7 +25,7 @@ export interface Artifact { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** the tag it carries, for a tagged version */ "tag"?: string; @@ -45,9 +45,9 @@ export interface Outcome { "holder": string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact */ + /** the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact */ "module"?: string; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) */ "reason"?: string; @@ -79,7 +79,7 @@ export interface PublishInput { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** every part's digest and size; none when the digest is already held */ "parts"?: Part[]; diff --git a/ts/seats/npmpackageregistry/src/parts/registry.ts b/ts/seats/npmpackageregistry/src/parts/registry.ts index 9642c2d..544dc55 100644 --- a/ts/seats/npmpackageregistry/src/parts/registry.ts +++ b/ts/seats/npmpackageregistry/src/parts/registry.ts @@ -25,7 +25,7 @@ export interface Artifact { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** the tag it carries, for a tagged version */ "tag"?: string; @@ -45,9 +45,9 @@ export interface Outcome { "holder": string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact */ + /** the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact */ "module"?: string; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) */ "reason"?: string; @@ -79,7 +79,7 @@ export interface PublishInput { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** every part's digest and size; none when the digest is already held */ "parts"?: Part[]; diff --git a/ts/seats/ociartifactregistry/src/index.ts b/ts/seats/ociartifactregistry/src/index.ts index 974cccd..1467090 100644 --- a/ts/seats/ociartifactregistry/src/index.ts +++ b/ts/seats/ociartifactregistry/src/index.ts @@ -96,7 +96,7 @@ export interface ReleaseInput { /** is what release answers. */ export interface ReleaseAnswer { - /** the hold is gone */ + /** a hold was let go; false when there was none */ "released": boolean; } diff --git a/ts/seats/ociartifactregistry/src/parts/registry.ts b/ts/seats/ociartifactregistry/src/parts/registry.ts index 9642c2d..544dc55 100644 --- a/ts/seats/ociartifactregistry/src/parts/registry.ts +++ b/ts/seats/ociartifactregistry/src/parts/registry.ts @@ -25,7 +25,7 @@ export interface Artifact { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** the tag it carries, for a tagged version */ "tag"?: string; @@ -45,9 +45,9 @@ export interface Outcome { "holder": string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the Go module path a Go package is fetched under (go-package-registry's published); empty for every other kind of artifact */ + /** the Go module path a Go package is fetched under, equal to name for a Go package (go-package-registry's published); empty for every other kind of artifact */ "module"?: string; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** why: a refusal's cause, or a removal's (retention, tag-gone, by-hand) */ "reason"?: string; @@ -79,7 +79,7 @@ export interface PublishInput { "fingerprint"?: string; /** what it is */ "kind": "package" | "image" | "bundle" | "archive" | "upstream"; - /** the package's, image's, bundle's or archive's name */ + /** the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk) */ "name": string; /** every part's digest and size; none when the digest is already held */ "parts"?: Part[]; diff --git a/ts/src/seats.ts b/ts/src/seats.ts index 13ff8a5..c4f7292 100644 --- a/ts/src/seats.ts +++ b/ts/src/seats.ts @@ -3097,7 +3097,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "parts": { @@ -3286,7 +3286,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -3381,7 +3381,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -3453,7 +3453,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "parts": { @@ -3642,7 +3642,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -3737,7 +3737,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -3811,7 +3811,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "parts": { @@ -4000,7 +4000,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -4095,7 +4095,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -4264,7 +4264,7 @@ export const list: readonly Seat[] = [ } }, { - "description": "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + "description": "Let a hold go; emits released. A release of what is not held answers released false and emits nothing, never an error: the outcome asked holds already. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", "input": { "properties": { "digest": { @@ -4292,7 +4292,7 @@ export const list: readonly Seat[] = [ "output": { "properties": { "released": { - "description": "the hold is gone", + "description": "a hold was let go; false when there was none", "type": "boolean" } }, @@ -4346,7 +4346,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "parts": { @@ -4535,7 +4535,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -4630,7 +4630,7 @@ export const list: readonly Seat[] = [ "type": "string" }, "name": { - "description": "the package's, image's, bundle's or archive's name", + "description": "the package's, image's, bundle's or archive's name; a package's is its name in its own language (design 32): a Go package's the go.mod module path (git.novox.be/novox/mesh-sdk/go), an npm package's package.json's name (@novox/mesh-sdk)", "type": "string" }, "tag": { @@ -4704,7 +4704,7 @@ export const list: readonly Seat[] = [ } }, { - "description": "Let a hold go; emits released. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", + "description": "Let a hold go; emits released. A release of what is not held answers released false and emits nothing, never an error: the outcome asked holds already. By hand only through the holder's own tool, the operator's session as the proved caller, recorded as a hand act.", "input": { "properties": { "digest": { @@ -4732,7 +4732,7 @@ export const list: readonly Seat[] = [ "output": { "properties": { "released": { - "description": "the hold is gone", + "description": "a hold was let go; false when there was none", "type": "boolean" } },