From 278310cc6759edbbcdf6f830f04fadaa75423cce Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 22 Nov 2026 00:05:48 +0100 Subject: [PATCH] D4: the catalog seat pages registrations, says the seat list, takes a source alone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit registrations filters by repository beside module while it reads, pages by the cursor next and answers capped and total. The read verb seat-list answers the seat list's object in seat-lists by digest, size and name. A registration takes a source-only form under source.., with origin, one branch, policy and check (a build seat and a step kind), naming no module; its history keeps the same key. The seat's form rises to 2. Builds: design 47 H2 §806, §811, §814, §815; H-A-349 DQ-9, DQ-10 --- .../go/seats/meshcatalog/contract.go | 168 ++++++++++++++++-- .../go/seats/meshcatalog/contract_test.go | 18 ++ .../seats/mesh-catalog/fixtures/states.json | 52 ++++++ .../seats/mesh-catalog/fixtures/verbs.json | 50 ++++++ .../seats/mesh-catalog/seat.json | 112 +++++++++++- .../ts/seats/meshcatalog/index.d.ts | 64 ++++++- .../ts/seats/meshcatalog/index.js | 47 +++++ 7 files changed, 489 insertions(+), 22 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract.go b/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract.go index be09443c8..6a09c17a2 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract.go @@ -14,13 +14,13 @@ const Seat = "mesh-catalog" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1" - generatedFieldsDigest = "ActingRule=8a83ce7e0457 Artifact=78b05c1a9ec3 ArtifactPackage=2a3a660a934d ArtifactRef=a2f06147f4b6 BuildEdge=76f0684e254a BuildEdges=d2b95000259e BuildEdgesByModuleBranchValue=4fdf7cc1e723 CandidatesByGroupValue=9ea8c6c580d2 CandidatesByGroupValuePullsItem=90fb03643258 CandidatesByGroupValuePullsItemFpsValue=4c6783201aa3 CatalogEntry=d154f232237b CatalogRevision=d1ecaaa484af CatalogRevisionDefinitionsItem=77fcff620d48 CatalogRevisionEvent=710cbc5bfff1 CatalogRevisionsByBranchRevisionValue=17e54f635d35 CatalogRevisionsByCandidateGroupHeadsValue=17e54f635d35 CatalogRevisionsByEntryDigestValue=8755036a3051 DependentsAnswer=7538f2f5e68e Edge=7242732afaef EntryAnswer=805c2ff28e1c EntryInputs=76a7f8690dd2 EntryRef=ff109e5089e1 Fill=80f442916429 FillingEvent=5bd4df78ed84 FingerprintInputs=99a6df7f991f FullEvent=5bd4df78ed84 Head=774b4bf88ba4 InputAnswer=cd41ee65565d InputsByTimeDigestValue=a2f06147f4b6 ManifestsByDigestValue=51b3822b29c6 ModuleAnswer=499a03ce9b27 ModuleAnswerModule=c0f679e09f08 ModulesAnswer=6d119571c69e ModulesAnswerModulesItem=a70f39c60b67 ModulesByModuleValue=fc7530ba893a ModulesByModuleValueInputs2=99a6df7f991f Outdated=e820214f66bc OutdatedAnswer=275fb25266b9 OutdatedDependency=dc35dca1b683 PackagesByModuleValue=2b62574b709f PackagesByModuleValuePackagesItem=a7d30558470d PackagesByPackageSeriesValue=07421d8d3411 PackagesByPackageSeriesValueNewest=aba144994370 PackagesByPackageSeriesValueNewestContents=eca2ccf56913 PackagesByPackageSeriesValueNewestContentsPackagesItem=a7d30558470d PackagesByPackageSeriesValueNumbered=c8ffc628599c PackagesByPackageSeriesValueNumberedContents=0def6c0794ee PackagesByPackageSeriesValueNumberedContentsPackagesItem=a7d30558470d Policy=719e2f460c6f PolicyAnswer=46cdf8430557 PredefinedByListValue=ec8e3febe8ac ProvidesAnswer=7538f2f5e68e RegisterAnswer=46cdf8430557 Registration=2de67522639b RegistrationAsked=55adba349c24 RegistrationChangedEvent=99a3268edf41 RegistrationHistoryByModuleVersionValue=0999b5bb7dc7 RegistrationsAnswer=90757c7185f6 RegistrationsByModuleValue=0999b5bb7dc7 RevisionAnswer=258ea5124931 RoomEvent=5bd4df78ed84 SeatDefinitionChangedEvent=e271d24d58f7 SeatDefinitionRemovedEvent=f7d6171111e6 SeatDefinitionsAnswer=0fd6a59fec59 SeatDefinitionsAnswerEntry=d006f68d2be5 SeatDefinitionsAnswerSeatsItem=e271d24d58f7 StepStatuses=4f50aa633e61 TakeInEntry=545ec1528499 ToolchainUsed=43b6d42376fb UnwatchAnswer=46cdf8430557 VersionArtifact=438c49a392b0 VersionEdge=b0f80e83f4dc VersionEntry=33f5b00dbda9 VersionReleasedEvent=4ccf1ea90e7f VersionsAnswer=b59e6e057e7b VersionsByModuleVersionValue=e546dfadb913 VersionsFilledEvent=4cc437912dc3 WatchAnswer=46cdf8430557" + generatedForms = "2" + generatedFieldsDigest = "ActingRule=8a83ce7e0457 Artifact=78b05c1a9ec3 ArtifactPackage=2a3a660a934d ArtifactRef=a2f06147f4b6 BuildEdge=76f0684e254a BuildEdges=d2b95000259e BuildEdgesByModuleBranchValue=4fdf7cc1e723 CandidatesByGroupValue=9ea8c6c580d2 CandidatesByGroupValuePullsItem=90fb03643258 CandidatesByGroupValuePullsItemFpsValue=4c6783201aa3 CatalogEntry=d154f232237b CatalogRevision=d1ecaaa484af CatalogRevisionDefinitionsItem=77fcff620d48 CatalogRevisionEvent=710cbc5bfff1 CatalogRevisionsByBranchRevisionValue=17e54f635d35 CatalogRevisionsByCandidateGroupHeadsValue=17e54f635d35 CatalogRevisionsByEntryDigestValue=8755036a3051 DependentsAnswer=7538f2f5e68e Edge=7242732afaef EntryAnswer=805c2ff28e1c EntryInputs=76a7f8690dd2 EntryRef=ff109e5089e1 Fill=80f442916429 FillingEvent=5bd4df78ed84 FingerprintInputs=99a6df7f991f FullEvent=5bd4df78ed84 Head=774b4bf88ba4 InputAnswer=cd41ee65565d InputsByTimeDigestValue=a2f06147f4b6 ManifestsByDigestValue=51b3822b29c6 ModuleAnswer=499a03ce9b27 ModuleAnswerModule=c0f679e09f08 ModulesAnswer=6d119571c69e ModulesAnswerModulesItem=a70f39c60b67 ModulesByModuleValue=fc7530ba893a ModulesByModuleValueInputs2=99a6df7f991f Outdated=e820214f66bc OutdatedAnswer=275fb25266b9 OutdatedDependency=dc35dca1b683 PackagesByModuleValue=2b62574b709f PackagesByModuleValuePackagesItem=a7d30558470d PackagesByPackageSeriesValue=07421d8d3411 PackagesByPackageSeriesValueNewest=aba144994370 PackagesByPackageSeriesValueNewestContents=eca2ccf56913 PackagesByPackageSeriesValueNewestContentsPackagesItem=a7d30558470d PackagesByPackageSeriesValueNumbered=c8ffc628599c PackagesByPackageSeriesValueNumberedContents=0def6c0794ee PackagesByPackageSeriesValueNumberedContentsPackagesItem=a7d30558470d Policy=719e2f460c6f PolicyAnswer=46cdf8430557 PredefinedByListValue=ec8e3febe8ac ProvidesAnswer=7538f2f5e68e RegisterAnswer=46cdf8430557 Registration=ef03d1b2e73f RegistrationAsked=55adba349c24 RegistrationChangedEvent=99a3268edf41 RegistrationHistoryByModuleVersionValue=0999b5bb7dc7 RegistrationHistoryBySourceOwnerNameVersionValue=0999b5bb7dc7 RegistrationsAnswer=8849ef618cf3 RegistrationsByModuleValue=0999b5bb7dc7 RegistrationsBySourceOwnerNameValue=0999b5bb7dc7 RevisionAnswer=258ea5124931 RoomEvent=5bd4df78ed84 SeatDefinitionChangedEvent=e271d24d58f7 SeatDefinitionRemovedEvent=f7d6171111e6 SeatDefinitionsAnswer=0fd6a59fec59 SeatDefinitionsAnswerEntry=d006f68d2be5 SeatDefinitionsAnswerSeatsItem=e271d24d58f7 SeatListAnswer=912c0cebcf0a SourceCheck=d1ed7cbbd579 StepStatuses=4f50aa633e61 TakeInEntry=545ec1528499 ToolchainUsed=43b6d42376fb UnwatchAnswer=46cdf8430557 VersionArtifact=438c49a392b0 VersionEdge=b0f80e83f4dc VersionEntry=33f5b00dbda9 VersionReleasedEvent=4ccf1ea90e7f VersionsAnswer=b59e6e057e7b VersionsByModuleVersionValue=e546dfadb913 VersionsFilledEvent=4cc437912dc3 WatchAnswer=46cdf8430557" ) const ( @@ -29,6 +29,7 @@ const ( VerbProvides = "provides" VerbDependents = "dependents" VerbSeatDefinitions = "seat-definitions" + VerbSeatList = "seat-list" VerbRevision = "revision" VerbRegistrations = "registrations" VerbRegister = "register" @@ -55,7 +56,7 @@ const ( // Verbs is every verb the seat serves, in its definition's order: a new copy each call. func Verbs() []string { - return []string{VerbModules, VerbModule, VerbProvides, VerbDependents, VerbSeatDefinitions, VerbRevision, VerbRegistrations, VerbRegister, VerbPolicy, VerbWatch, VerbUnwatch, VerbVersions, VerbOutdated, VerbInput, VerbEntry} + return []string{VerbModules, VerbModule, VerbProvides, VerbDependents, VerbSeatDefinitions, VerbSeatList, VerbRevision, VerbRegistrations, VerbRegister, VerbPolicy, VerbWatch, VerbUnwatch, VerbVersions, VerbOutdated, VerbInput, VerbEntry} } // Events is every event published on the seat's subject: a new copy each call. @@ -410,6 +411,43 @@ func DecodeRegistrationsByModuleValue(raw []byte) (RegistrationsByModuleValue, i return v, formRead(raw), nil } +// RegistrationsBySourceOwnerNameKey is the key of one value of the state registrations under the form "source..". +func RegistrationsBySourceOwnerNameKey(owner, name string) string { + return "source." + owner + "." + name +} + +// ParseRegistrationsBySourceOwnerNameKey reads the parts of a key of the form "source..", in the order of the form; the last result is false for a key of another form. +func ParseRegistrationsBySourceOwnerNameKey(key string) (string, string, bool) { + rest := key + if !strings.HasPrefix(rest, "source.") { + return "", "", false + } + rest = rest[7:] + v1, after1, found1 := strings.Cut(rest, ".") + if !found1 || v1 == "" { + return "", "", false + } + rest = after1 + if rest == "" { + return "", "", false + } + v3 := rest + rest = "" + if rest != "" { + return "", "", false + } + return v1, v3, true +} + +// DecodeRegistrationsBySourceOwnerNameValue reads one value of the state registrations under the form "source.." as another part wrote it: a field RegistrationsBySourceOwnerNameValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). +func DecodeRegistrationsBySourceOwnerNameValue(raw []byte) (RegistrationsBySourceOwnerNameValue, int, error) { + var v RegistrationsBySourceOwnerNameValue + if err := json.Unmarshal(raw, &v); err != nil { + return v, 0, err + } + return v, formRead(raw), nil +} + // RegistrationHistoryByModuleVersionKey is the key of one value of the state registration-history under the form ".". func RegistrationHistoryByModuleVersionKey(module, version string) string { return module + "." + version @@ -443,6 +481,48 @@ func DecodeRegistrationHistoryByModuleVersionValue(raw []byte) (RegistrationHist return v, formRead(raw), nil } +// RegistrationHistoryBySourceOwnerNameVersionKey is the key of one value of the state registration-history under the form "source...". +func RegistrationHistoryBySourceOwnerNameVersionKey(owner, name, version string) string { + return "source." + owner + "." + name + "." + version +} + +// ParseRegistrationHistoryBySourceOwnerNameVersionKey reads the parts of a key of the form "source...", in the order of the form; the last result is false for a key of another form. +func ParseRegistrationHistoryBySourceOwnerNameVersionKey(key string) (string, string, string, bool) { + rest := key + if !strings.HasPrefix(rest, "source.") { + return "", "", "", false + } + rest = rest[7:] + v1, after1, found1 := strings.Cut(rest, ".") + if !found1 || v1 == "" { + return "", "", "", false + } + rest = after1 + v3, after3, found3 := strings.Cut(rest, ".") + if !found3 || v3 == "" { + return "", "", "", false + } + rest = after3 + if rest == "" { + return "", "", "", false + } + v5 := rest + rest = "" + if rest != "" { + return "", "", "", false + } + return v1, v3, v5, true +} + +// DecodeRegistrationHistoryBySourceOwnerNameVersionValue reads one value of the state registration-history under the form "source..." as another part wrote it: a field RegistrationHistoryBySourceOwnerNameVersionValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). +func DecodeRegistrationHistoryBySourceOwnerNameVersionValue(raw []byte) (RegistrationHistoryBySourceOwnerNameVersionValue, int, error) { + var v RegistrationHistoryBySourceOwnerNameVersionValue + if err := json.Unmarshal(raw, &v); err != nil { + return v, 0, err + } + return v, formRead(raw), nil +} + // VersionsByModuleVersionKey is the key of one value of the state versions under the form ".". func VersionsByModuleVersionKey(module, version string) string { return module + "." + version } @@ -807,20 +887,23 @@ type Policy struct { Steps StepStatuses `json:"steps"` } -// Registration is a module's registration (ADR 0666 section 2; design 47 *A module's registration*): its git origin, its manifest's path, its watched branches and its policy, every version with who changed it and the warrant of the operator's Approve. +// Registration is a module's registration (ADR 0666 section 2; design 47 *A module's registration*): its git origin, its manifest's path, its watched branches and its policy, every version with who changed it and the warrant of the operator's Approve; or a source-only registration of a repository with no module (design 47 H2 §815): its origin, one watched branch, its policy and its check, naming no module and no path, kept under source... type Registration struct { At *time.Time `json:"at,omitempty"` // its watched branches, the first the default a placement runs Branches []string `json:"branches"` // who asked the change By string `json:"by,omitempty"` + // for a source-only registration, the one step its heads run (design 47 H2 §815) + Check *SourceCheck `json:"check,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). - Form int64 `json:"form,omitempty"` - Module string `json:"module"` + Form int64 `json:"form,omitempty"` + // the module; absent for a source-only registration + Module string `json:"module,omitempty"` // its git origin, the repository as / Origin string `json:"origin"` - // the path of its manifest in the repository - Path string `json:"path"` + // the path of its manifest in the repository; absent for a source-only registration + Path string `json:"path,omitempty"` Policy Policy `json:"policy"` // the layout version V int64 `json:"v,omitempty"` @@ -855,6 +938,28 @@ const ( RegistrationAskedRefusedNothingMoves = "nothing moves" ) +// SourceCheck is the check of a source-only registration: a build seat and a step kind, run at the repository's root, never a free command (design 47 H2 §815). +type SourceCheck struct { + // the build seat that runs it + Seat string `json:"seat"` + // the step kind + Step string `json:"step"` +} + +// The values of SourceCheck's seat. +const ( + SourceCheckSeatNodeBuildGo = "node-build-go" + SourceCheckSeatNodeBuildNode = "node-build-node" + SourceCheckSeatNodeBuildImage = "node-build-image" +) + +// The values of SourceCheck's step. +const ( + SourceCheckStepLint = "lint" + SourceCheckStepUnit = "unit" + SourceCheckStepIntegration = "integration" +) + // StepStatuses is the status of each pipeline step (design 47 *Pipeline steps and the policy*); a step left out keeps the module's. type StepStatuses struct { // required runs and holds the delivery until it passes; optional runs, a failure is shown and may be accepted; bypass runs nothing and is said as bypassed @@ -1123,6 +1228,22 @@ type SeatDefinitionsAnswer struct { Seats []SeatDefinitionsAnswerSeatsItem `json:"seats,omitempty"` } +// SeatListInput is what seat-list takes. +type SeatListInput struct { +} + +// SeatListAnswer is what seat-list answers. +type SeatListAnswer struct { + // the seat list's digest + Digest string `json:"digest"` + // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). + Form int64 `json:"form,omitempty"` + // the object's name in seat-lists + Object string `json:"object"` + // the object's size in bytes + Size int64 `json:"size"` +} + // RevisionInput is what revision takes. type RevisionInput struct { // the last module of the page before; absent: the first page @@ -1158,16 +1279,26 @@ type RegistrationsInput struct { History bool `json:"history,omitempty"` // one module; absent, every registration Module string `json:"module,omitempty"` + // the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779) + Next string `json:"next,omitempty"` + // only the registrations of this repository, /, applied while reading (design 47 H2 §806) + Repository string `json:"repository,omitempty"` } // RegistrationsAnswer is what registrations answers. type RegistrationsAnswer struct { - Fill *Fill `json:"fill,omitempty"` + // yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §806) + Capped bool `json:"capped,omitempty"` + Fill *Fill `json:"fill,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // every version of the one module asked, oldest first - History []Registration `json:"history,omitempty"` + History []Registration `json:"history,omitempty"` + // the cursor of the next page, opaque; empty at the end (design 47 H2 §779) + Next string `json:"next,omitempty"` Registrations []Registration `json:"registrations"` + // how many registrations the filters hold in all (design 47 H2 §811) + Total int64 `json:"total,omitempty"` } // RegisterInput is what register takes. @@ -1590,9 +1721,15 @@ type CatalogRevisionsByEntryDigestValue = CatalogEntry // RegistrationsByModuleValue is one value of the state registrations under the key . type RegistrationsByModuleValue = Registration +// RegistrationsBySourceOwnerNameValue is one value of the state registrations under the key source... +type RegistrationsBySourceOwnerNameValue = Registration + // RegistrationHistoryByModuleVersionValue is one value of the state registration-history under the key .. type RegistrationHistoryByModuleVersionValue = Registration +// RegistrationHistoryBySourceOwnerNameVersionValue is one value of the state registration-history under the key source.... +type RegistrationHistoryBySourceOwnerNameVersionValue = Registration + // VersionsByModuleVersionValue is one value of the state versions under the key .. type VersionsByModuleVersionValue = VersionEntry @@ -1647,6 +1784,15 @@ func DecodeSeatDefinitionsAnswer(raw []byte) (SeatDefinitionsAnswer, int, error) return v, formRead(raw), nil } +// DecodeSeatListAnswer reads a SeatListAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). +func DecodeSeatListAnswer(raw []byte) (SeatListAnswer, int, error) { + var v SeatListAnswer + if err := json.Unmarshal(raw, &v); err != nil { + return v, 0, err + } + return v, formRead(raw), nil +} + // DecodeRevisionAnswer reads a RevisionAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeRevisionAnswer(raw []byte) (RevisionAnswer, int, error) { var v RevisionAnswer diff --git a/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract_test.go index 5258e5ea3..0f4791843 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract_test.go @@ -119,6 +119,18 @@ func TestFixtures(t *testing.T) { err := json.Unmarshal(b, &v) return v, err }, subjectIs: nil}, + {name: "a source-only registration of a repository with no module", subject: "", given: "{\"at\":\"2026-11-22T00:10:00Z\",\"branches\":[\"main\"],\"by\":\"operator@workstation\",\"check\":{\"seat\":\"node-build-go\",\"step\":\"unit\"},\"origin\":\"novox/hq\",\"policy\":{\"steps\":{\"approval\":\"bypass\",\"review\":\"optional\",\"unit\":\"required\"}},\"v\":1,\"version\":1,\"warrant\":\"ask-m2kx9a1b3c4d6a\"}", wire: "{\"at\":\"2026-11-22T00:10:00Z\",\"branches\":[\"main\"],\"by\":\"operator@workstation\",\"check\":{\"seat\":\"node-build-go\",\"step\":\"unit\"},\"origin\":\"novox/hq\",\"policy\":{\"steps\":{\"approval\":\"bypass\",\"review\":\"optional\",\"unit\":\"required\"}},\"v\":1,\"version\":1,\"warrant\":\"ask-m2kx9a1b3c4d6a\"}", + decode: func(b []byte) (any, error) { + var v RegistrationsBySourceOwnerNameValue + err := json.Unmarshal(b, &v) + return v, err + }, subjectIs: nil}, + {name: "one version of a source-only registration in the history", subject: "", given: "{\"at\":\"2026-11-22T00:10:00Z\",\"branches\":[\"main\"],\"by\":\"operator@workstation\",\"check\":{\"seat\":\"node-build-go\",\"step\":\"unit\"},\"origin\":\"novox/hq\",\"policy\":{\"steps\":{\"approval\":\"bypass\",\"review\":\"optional\",\"unit\":\"required\"}},\"v\":1,\"version\":1,\"warrant\":\"ask-m2kx9a1b3c4d6a\"}", wire: "{\"at\":\"2026-11-22T00:10:00Z\",\"branches\":[\"main\"],\"by\":\"operator@workstation\",\"check\":{\"seat\":\"node-build-go\",\"step\":\"unit\"},\"origin\":\"novox/hq\",\"policy\":{\"steps\":{\"approval\":\"bypass\",\"review\":\"optional\",\"unit\":\"required\"}},\"v\":1,\"version\":1,\"warrant\":\"ask-m2kx9a1b3c4d6a\"}", + decode: func(b []byte) (any, error) { + var v RegistrationHistoryBySourceOwnerNameVersionValue + err := json.Unmarshal(b, &v) + return v, err + }, subjectIs: nil}, {name: "revision asks the trunk's newest", subject: "", given: "{}", wire: "{}", decode: func(b []byte) (any, error) { var v RevisionInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "revision asks a candidate's, from a page on", subject: "", given: "{\"after\":\"mesh-build-go\",\"group\":\"feat/47-G\",\"heads\":\"0123456789ab\"}", wire: "{\"after\":\"mesh-build-go\",\"group\":\"feat/47-G\",\"heads\":\"0123456789ab\"}", @@ -163,6 +175,12 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v InputAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "entry asks by fingerprint", subject: "", given: "{\"fingerprint\":\"src2:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\"}", wire: "{\"fingerprint\":\"src2:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\"}", decode: func(b []byte) (any, error) { var v EntryInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "registrations of one repository from a cursor", subject: "", given: "{\"next\":\"c-120\",\"repository\":\"novox/mesh-catalog\"}", wire: "{\"next\":\"c-120\",\"repository\":\"novox/mesh-catalog\"}", + decode: func(b []byte) (any, error) { var v RegistrationsInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "registrations answers a capped page with a source-only registration and the next cursor", subject: "", given: "{\"capped\":true,\"next\":\"c-121\",\"registrations\":[{\"at\":\"2026-11-22T00:10:00Z\",\"branches\":[\"main\"],\"by\":\"operator@workstation\",\"check\":{\"seat\":\"node-build-go\",\"step\":\"unit\"},\"origin\":\"novox/hq\",\"policy\":{\"steps\":{\"approval\":\"bypass\",\"review\":\"optional\",\"unit\":\"required\"}},\"v\":1,\"version\":1,\"warrant\":\"ask-m2kx9a1b3c4d6a\"}],\"total\":118}", wire: "{\"capped\":true,\"next\":\"c-121\",\"registrations\":[{\"at\":\"2026-11-22T00:10:00Z\",\"branches\":[\"main\"],\"by\":\"operator@workstation\",\"check\":{\"seat\":\"node-build-go\",\"step\":\"unit\"},\"origin\":\"novox/hq\",\"policy\":{\"steps\":{\"approval\":\"bypass\",\"review\":\"optional\",\"unit\":\"required\"}},\"v\":1,\"version\":1,\"warrant\":\"ask-m2kx9a1b3c4d6a\"}],\"total\":118}", + decode: func(b []byte) (any, error) { var v RegistrationsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "seat-list answers the seat list's object by its digest", subject: "", given: "{\"digest\":\"sha256:eeee\",\"object\":\"sha256-eeee\",\"size\":412345}", wire: "{\"digest\":\"sha256:eeee\",\"object\":\"sha256-eeee\",\"size\":412345}", + decode: func(b []byte) (any, error) { var v SeatListAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/seats/mesh-catalog/fixtures/states.json b/modules/mesh-delivery-contracts/seats/mesh-catalog/fixtures/states.json index 965b8ff63..18e92dfa7 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-catalog/fixtures/states.json +++ b/modules/mesh-delivery-contracts/seats/mesh-catalog/fixtures/states.json @@ -549,5 +549,57 @@ "name": "an input", "of": "state:inputs/