From 628d5be5b66df3d1f32b9552767b0c8ce4cad20b Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:06:59 +0100 Subject: [PATCH 01/44] DC1 catalog-forms: the seat mesh-catalog's entry carries consumes, an artifact digests, a revision needs-rules (form 7) Builds: design 47 H2 H-A-580, H-A-605 (4), H-A-621, H-A-682 (1), H-A-698 (3) --- .../go/seats/meshcatalog/contract.go | 22 +++++++++--- .../go/seats/meshcatalog/contract_test.go | 6 ++-- .../seats/mesh-catalog/fixtures/states.json | 14 ++++++-- .../seats/mesh-catalog/seat.json | 36 +++++++++++++++++-- .../ts/seats/meshcatalog/index.d.ts | 15 +++++++- 5 files changed, 81 insertions(+), 12 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract.go b/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract.go index e22840516..66986138e 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 = 6 +const Form = 7 // 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 = "6" - generatedFieldsDigest = "ActingRule=8a83ce7e0457 Artifact=78b05c1a9ec3 ArtifactPackage=2a3a660a934d ArtifactRef=a2f06147f4b6 BuildEdge=76f0684e254a CandidatesByGroupValue=9ea8c6c580d2 CandidatesByGroupValuePullsItem=90fb03643258 CandidatesByGroupValuePullsItemFpsValue=4c6783201aa3 CatalogEntry=c0a4ea25d523 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 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=b529a0e1c5ca 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=04477a8044b1 SourceCheck=d1ed7cbbd579 StepStatuses=4f50aa633e61 TakeInEntry=545ec1528499 ToolchainUsed=43b6d42376fb UnwatchAnswer=46cdf8430557 VersionArtifact=438c49a392b0 VersionEdge=b0f80e83f4dc VersionEntry=33f5b00dbda9 VersionReleasedEvent=4ccf1ea90e7f VersionsAnswer=b59e6e057e7b VersionsByModuleVersionValue=e546dfadb913 WatchAnswer=46cdf8430557" + generatedForms = "7" + generatedFieldsDigest = "ActingRule=8a83ce7e0457 Artifact=0223a648b4e5 ArtifactDigestsItem=a7d30558470d ArtifactPackage=2a3a660a934d ArtifactRef=a2f06147f4b6 BuildEdge=76f0684e254a CandidatesByGroupValue=9ea8c6c580d2 CandidatesByGroupValuePullsItem=90fb03643258 CandidatesByGroupValuePullsItemFpsValue=4c6783201aa3 CatalogEntry=4c82dcc1e492 CatalogRevision=178230def2a0 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 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=b529a0e1c5ca 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=04477a8044b1 SourceCheck=d1ed7cbbd579 StepStatuses=4f50aa633e61 TakeInEntry=545ec1528499 ToolchainUsed=43b6d42376fb UnwatchAnswer=46cdf8430557 VersionArtifact=438c49a392b0 VersionEdge=b0f80e83f4dc VersionEntry=33f5b00dbda9 VersionReleasedEvent=4ccf1ea90e7f VersionsAnswer=b59e6e057e7b VersionsByModuleVersionValue=e546dfadb913 WatchAnswer=46cdf8430557" ) const ( @@ -625,6 +625,14 @@ type ActingRule struct { Step string `json:"step"` } +// ArtifactDigestsItem is a type of the contract. +type ArtifactDigestsItem struct { + // the package's digest, by its files (design 47 H2 H-A-580) + Digest string `json:"digest"` + // the package's Go import path or npm name + Package string `json:"package"` +} + // ArtifactPackage is the package's name read from the revision's own files at the artifact's path (the module of its go.mod, the name of its package.json, the manifest's image name), written at take-in (design 47 G section 676). type ArtifactPackage struct { // go, npm or image @@ -634,6 +642,8 @@ type ArtifactPackage struct { // Artifact is one artifact of a module in the catalog graph entry. type Artifact struct { + // the digest of each package of the artifact, kept by the indexer when it computes the entry, so an importer reads the digest of each package it imports from the entry that publishes it (design 47 H2 H-A-580) + Digests []ArtifactDigestsItem `json:"digests,omitempty"` // the artifact's kind Kind string `json:"kind,omitempty"` // the artifact's language as its manifest says it (go, typescript, ...); a step's build seat is read from it (design 47 G section 323) @@ -670,6 +680,8 @@ type CatalogEntry struct { Class string `json:"class,omitempty"` // the merge commit it was last changed at Commit string `json:"commit"` + // the subjects its accepted manifest consumes, filled by the indexer beside invokes (design 47 H2 H-A-621) + Consumes []string `json:"consumes,omitempty"` // the requirements the manifest's contributes object names as keys, sorted, its local names not carried; each is also in requires (design 47 G section 709) Contributes []string `json:"contributes,omitempty"` // the edges into this module's artifacts, each from the artifact that comes first; the build and the delivery order by these alone @@ -690,7 +702,7 @@ type CatalogEntry struct { // the sha256: digest of the manifest's bytes as the forge answered them, set by the indexer at take-in and never computed again from the manifest whole; the module's value and the manifests key are this digest (design 47 G section 506) ManifestDigest string `json:"manifest-digest,omitempty"` Module string `json:"module"` - // the manifest reads a node-engine must state to compose it, its templates' forms included, as the forge bridge read them at the merge (ADR 0614 §4, ADR 0632 §2) + // the manifest reads a node-engine must state to compose it, its templates' forms included, as the indexer derives them at the take-in (ADR 0614 §4, ADR 0632 §2) Needs []string `json:"needs,omitempty"` // why it has none None string `json:"none,omitempty"` @@ -747,6 +759,8 @@ type CatalogRevision struct { Module string `json:"module,omitempty"` // the movers of the take-in that wrote it, so a redelivered source-moved whose revision is kept says take-in.taken again from them, recomputing nothing (design 47 H §743, H-A-92); absent for one with no mover Movers []TakeInEntry `json:"movers,omitempty"` + // the version of the manifest validator's need rules this revision's entries were derived with, absent read as 0; a take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's (design 47 H2 H-A-569 (2), H-A-605 (4)) + NeedsRules int64 `json:"needs-rules,omitempty"` // for call-kind take-in-again, the repository taken in again (H-A-215) Repository string `json:"repository,omitempty"` // the catalog graph revision's number, counted by its holder 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 0a6c75587..646ad9311 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshcatalog/contract_test.go @@ -57,7 +57,7 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v ModulesAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "the module verb (captured: xclip)", subject: "", given: "{\"module\":{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"manifest\":{\"build\":{\"artifacts\":[{\"binary\":\"xclip-tools\",\"from\":\"cmd/xclip-tools\",\"kind\":\"bundle\",\"language\":\"go\",\"loads\":[\"xclip-tools\"],\"name\":\"tools\",\"system\":\"arch\"}]},\"capabilities\":[\"package-manager\"],\"module\":\"xclip\",\"resources\":[{\"id\":\"package\",\"package\":\"xclip\",\"type\":\"package\"}],\"tools\":[\"xclip_copy\",\"xclip_paste\",\"xclip_targets\",\"xclip_session\"],\"version\":\"1\"},\"module\":\"xclip\",\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\"}}", wire: "{\"module\":{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"manifest\":{\"build\":{\"artifacts\":[{\"binary\":\"xclip-tools\",\"from\":\"cmd/xclip-tools\",\"kind\":\"bundle\",\"language\":\"go\",\"loads\":[\"xclip-tools\"],\"name\":\"tools\",\"system\":\"arch\"}]},\"capabilities\":[\"package-manager\"],\"module\":\"xclip\",\"resources\":[{\"id\":\"package\",\"package\":\"xclip\",\"type\":\"package\"}],\"tools\":[\"xclip_copy\",\"xclip_paste\",\"xclip_targets\",\"xclip_session\"],\"version\":\"1\"},\"module\":\"xclip\",\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\"}}", decode: func(b []byte) (any, error) { var v ModuleAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "a watched branch's catalog graph revision", subject: "", given: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}", wire: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}", + {name: "a watched branch's catalog graph revision", subject: "", given: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"needs-rules\":2,\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}", wire: "{\"at\":\"2026-11-09T19:00:00Z\",\"base\":9,\"branch\":\"main\",\"call\":\"release of mesh-sdk 0.1.27\",\"call-kind\":\"release\",\"definitions\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"seat\":\"node-build-go\"}],\"entries\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"mesh-build-go\"},{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"module\":\"xclip\"}],\"kind\":\"trunk\",\"module\":\"mesh-sdk\",\"movers\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fingerprint\":\"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"repository\":\"novox/mesh-catalog\"}],\"needs-rules\":2,\"revision\":12,\"source\":3589,\"trunk\":[{\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"repository\":\"novox/mesh-catalog\"}],\"v\":1,\"version\":\"0.1.27\"}", decode: func(b []byte) (any, error) { var v CatalogRevisionsByBranchRevisionValue err := json.Unmarshal(b, &v) @@ -69,7 +69,7 @@ func TestFixtures(t *testing.T) { err := json.Unmarshal(b, &v) return v, err }, subjectIs: nil}, - {name: "a catalog graph entry (xclip)", subject: "", given: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", + {name: "a catalog graph entry (xclip)", subject: "", given: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"consumes\":[\"node-engine.running.*.*\"],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"consumes\":[\"node-engine.running.*.*\"],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"xclip\",\"version\":\"1\"},\"manifest-digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"module\":\"xclip\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", decode: func(b []byte) (any, error) { var v CatalogRevisionsByEntryDigestValue err := json.Unmarshal(b, &v) @@ -99,7 +99,7 @@ func TestFixtures(t *testing.T) { err := json.Unmarshal(b, &v) return v, err }, subjectIs: nil}, - {name: "an entry with its artifacts and the edges into them, per artifact", subject: "", given: "{\"artifacts\":[{\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"artifacts\":[{\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", + {name: "an entry with its artifacts and the edges into them, per artifact", subject: "", given: "{\"artifacts\":[{\"digests\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"package\":\"git.novox.be/novox/mesh-sdk/go/keys\"}],\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", wire: "{\"artifacts\":[{\"digests\":[{\"digest\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\",\"package\":\"git.novox.be/novox/mesh-sdk/go/keys\"}],\"language\":\"go\",\"ref\":\"mesh-grants:program\"},{\"language\":\"go\",\"ref\":\"mesh-grants:tools\"}],\"bases\":[\"arch\"],\"commit\":\"f469eb387a3015569d9b16c66ed418e9dd098f64\",\"edges\":[{\"from\":\"mesh-grants:program\",\"kind\":6,\"to\":\"node-tools:runtime\",\"why\":\"seat mesh-grants verb grants\"},{\"from\":\"node-tools:runtime\",\"kind\":4,\"to\":\"mesh-grants:tools\",\"why\":\"the tool runner runs the tools\"},{\"from\":\"mesh-sdk:go\",\"kind\":1,\"to\":\"mesh-grants:program\",\"why\":\"git.novox.be/novox/mesh-sdk/go\"},{\"declared\":true,\"from\":\"nats:program\",\"kind\":4,\"to\":\"mesh-grants:program\",\"why\":\"declared in needs\"}],\"fp\":\"src2:b427bdde1f100e2f52490cfa9df0c5112dd3700226b4892349f0c14a15a4af56\",\"inputs\":{\"from\":{\"bases\":[\"arch\"],\"locks\":{\"go.sum\":\"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"},\"packages\":[\"git.novox.be/novox/mesh-sdk/go@v0.0.0-20261101000000-f469eb387a30\"],\"tree\":\"4b825dc642cb6eb9a060e54bf8d69288fbee4904\"},\"toolchains\":{\"go\":{\"language\":\"go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}}},\"invokes\":[\"node-files.read\"],\"manifest\":{\"module\":\"mesh-grants\",\"version\":\"1\"},\"module\":\"mesh-grants\",\"packages\":{\"git.novox.be/novox/mesh-sdk/go\":\"v0.0.0-20261101000000-f469eb387a30\"},\"path\":\"modules/xclip\",\"repository\":\"novox/mesh-catalog\",\"toolchains\":{\"go\":{\"module\":\"mesh-build-go\",\"recipe\":\"1\",\"version\":\"1.26.0\"}},\"v\":1,\"verdict\":\"accepted\"}", decode: func(b []byte) (any, error) { var v CatalogRevisionsByEntryDigestValue err := json.Unmarshal(b, &v) 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 737600b85..53c8ef963 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-catalog/fixtures/states.json +++ b/modules/mesh-delivery-contracts/seats/mesh-catalog/fixtures/states.json @@ -213,7 +213,8 @@ "call": "release of mesh-sdk 0.1.27", "call-kind": "release", "module": "mesh-sdk", - "version": "0.1.27" + "version": "0.1.27", + "needs-rules": 2 } }, { @@ -303,6 +304,9 @@ }, "invokes": [ "node-files.read" + ], + "consumes": [ + "node-engine.running.*.*" ] } }, @@ -504,7 +508,13 @@ "artifacts": [ { "ref": "mesh-grants:program", - "language": "go" + "language": "go", + "digests": [ + { + "package": "git.novox.be/novox/mesh-sdk/go/keys", + "digest": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ] }, { "ref": "mesh-grants:tools", diff --git a/modules/mesh-delivery-contracts/seats/mesh-catalog/seat.json b/modules/mesh-delivery-contracts/seats/mesh-catalog/seat.json index 5a46b0b1c..9f22a9a31 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-catalog/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-catalog/seat.json @@ -1691,6 +1691,13 @@ }, "description": "each a seat verb or a module tool it calls" }, + "consumes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the subjects its accepted manifest consumes, filled by the indexer beside invokes (design 47 H2 H-A-621)" + }, "serves": { "type": "array", "items": { @@ -1710,7 +1717,7 @@ "items": { "type": "string" }, - "description": "the manifest reads a node-engine must state to compose it, its templates' forms included, as the forge bridge read them at the merge (ADR 0614 §4, ADR 0632 §2)" + "description": "the manifest reads a node-engine must state to compose it, its templates' forms included, as the indexer derives them at the take-in (ADR 0614 §4, ADR 0632 §2)" }, "main": { "type": "string", @@ -1989,6 +1996,10 @@ "base": { "type": "integer", "description": "the newest kept revision of its branch below it, which the take-in that wrote it pinned for its pipeline: the base of the validate step's case before (design 47 H-A-147, H-A-151, H-A-154); absent on the branch's first take-in" + }, + "needs-rules": { + "type": "integer", + "description": "the version of the manifest validator's need rules this revision's entries were derived with, absent read as 0; a take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's (design 47 H2 H-A-569 (2), H-A-605 (4))" } }, "required": [ @@ -2433,6 +2444,27 @@ "ecosystem", "name" ] + }, + "digests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "package": { + "type": "string", + "description": "the package's Go import path or npm name" + }, + "digest": { + "type": "string", + "description": "the package's digest, by its files (design 47 H2 H-A-580)" + } + }, + "required": [ + "package", + "digest" + ] + }, + "description": "the digest of each package of the artifact, kept by the indexer when it computes the entry, so an importer reads the digest of each package it imports from the entry that publishes it (design 47 H2 H-A-580)" } }, "required": [ @@ -2566,5 +2598,5 @@ ] } }, - "form": 6 + "form": 7 } diff --git a/modules/mesh-delivery-contracts/ts/seats/meshcatalog/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshcatalog/index.d.ts index 3a2592697..a213095ef 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshcatalog/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshcatalog/index.d.ts @@ -171,6 +171,13 @@ export interface ActingRule { "step": string; } +export interface ArtifactDigestsItem { + /** the package's digest, by its files (design 47 H2 H-A-580) */ + "digest": string; + /** the package's Go import path or npm name */ + "package": string; +} + /** the package's name read from the revision's own files at the artifact's path (the module of its go.mod, the name of its package.json, the manifest's image name), written at take-in (design 47 G section 676) */ export interface ArtifactPackage { /** go, npm or image */ @@ -180,6 +187,8 @@ export interface ArtifactPackage { /** one artifact of a module in the catalog graph entry */ export interface Artifact { + /** the digest of each package of the artifact, kept by the indexer when it computes the entry, so an importer reads the digest of each package it imports from the entry that publishes it (design 47 H2 H-A-580) */ + "digests"?: ArtifactDigestsItem[]; /** the artifact's kind */ "kind"?: string; /** the artifact's language as its manifest says it (go, typescript, ...); a step's build seat is read from it (design 47 G section 323) */ @@ -216,6 +225,8 @@ export interface CatalogEntry { "class"?: string; /** the merge commit it was last changed at */ "commit": string; + /** the subjects its accepted manifest consumes, filled by the indexer beside invokes (design 47 H2 H-A-621) */ + "consumes"?: string[]; /** the requirements the manifest's contributes object names as keys, sorted, its local names not carried; each is also in requires (design 47 G section 709) */ "contributes"?: string[]; /** the edges into this module's artifacts, each from the artifact that comes first; the build and the delivery order by these alone */ @@ -236,7 +247,7 @@ export interface CatalogEntry { /** the sha256: digest of the manifest's bytes as the forge answered them, set by the indexer at take-in and never computed again from the manifest whole; the module's value and the manifests key are this digest (design 47 G section 506) */ "manifest-digest"?: string; "module": string; - /** the manifest reads a node-engine must state to compose it, its templates' forms included, as the forge bridge read them at the merge (ADR 0614 §4, ADR 0632 §2) */ + /** the manifest reads a node-engine must state to compose it, its templates' forms included, as the indexer derives them at the take-in (ADR 0614 §4, ADR 0632 §2) */ "needs"?: string[]; /** why it has none */ "none"?: string; @@ -292,6 +303,8 @@ export interface CatalogRevision { "module"?: string; /** the movers of the take-in that wrote it, so a redelivered source-moved whose revision is kept says take-in.taken again from them, recomputing nothing (design 47 H §743, H-A-92); absent for one with no mover */ "movers"?: TakeInEntry[]; + /** the version of the manifest validator's need rules this revision's entries were derived with, absent read as 0; a take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's (design 47 H2 H-A-569 (2), H-A-605 (4)) */ + "needs-rules"?: number; /** for call-kind take-in-again, the repository taken in again (H-A-215) */ "repository"?: string; /** the catalog graph revision's number, counted by its holder */ From 98a9c199c1f492034800a50023dd9dd03caa04ad Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:08:03 +0100 Subject: [PATCH 02/44] DC2 step-runner-delivery-forms: step-ended's revision present exactly when superseded (form 4), mover-added and place-unfinished's all (form 13), record-ended's ends (form 3) Builds: design 47 H2 H-A-574, H-A-594 (4), H-A-609 (3), H-A-617, H-A-644, H-A-645, H-A-650 --- .../go/seats/meshbuilds/contract.go | 6 +- .../go/seats/meshbuilds/contract_test.go | 2 + .../go/seats/meshdelivery/contract.go | 8 ++- .../go/seats/meshdelivery/contract_test.go | 2 +- .../go/seats/meshpipelinerunner/contract.go | 57 ++++++++++++++++-- .../seats/meshpipelinerunner/contract_test.go | 8 +++ .../seats/mesh-builds/fixtures/events.json | 22 +++++++ .../seats/mesh-builds/seat.json | 4 +- .../seats/mesh-delivery/fixtures/events.json | 3 +- .../seats/mesh-delivery/seat.json | 6 +- .../mesh-pipeline-runner/fixtures/events.json | 30 +++++++++- .../mesh-pipeline-runner/fixtures/verbs.json | 16 +++++ .../seats/mesh-pipeline-runner/seat.json | 59 ++++++++++++++++++- .../ts/seats/meshbuilds/index.d.ts | 2 +- .../ts/seats/meshdelivery/index.d.ts | 2 + .../ts/seats/meshpipelinerunner/index.d.ts | 35 ++++++++++- .../ts/seats/meshpipelinerunner/index.js | 9 +++ 17 files changed, 247 insertions(+), 24 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go index 002593838..00032cb0c 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go @@ -13,12 +13,12 @@ const Seat = "mesh-builds" // 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 = 3 +const Form = 4 // 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 = "3" + generatedForms = "4" generatedFieldsDigest = "AskTakenEvent=6d5d3da7ac39 BuildEntry=3c829a0a3d58 Dependency=90a32b07c563 DropAnswer=7538f2f5e68e PackagePublished=34dd069a6aab PackagePublishedEvent=8e12888c1559 PublishQueueAnswer=0f1326e35e17 PublishQueueAnswerCountsItem=b770db2f0920 PublishQueueAnswerQueueItem=b1eebc09f41e PublishedAnswer=69a801982819 ReservedAnswer=2272a4d6f0f4 ReservedAnswerArtifactsItem=d74eb6e00abb Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=be571d4ff16f StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07" ) @@ -198,7 +198,7 @@ type StepEnded struct { Packages map[string]string `json:"packages,omitempty"` Pipeline string `json:"pipeline"` Rerun bool `json:"rerun,omitempty"` - // for a step ended superseded, the module graph revision of the entry that superseded it, 0 when the builder knows none; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-561) + // the module graph revision of the entry that superseded the step, present exactly when outcome is superseded and absent otherwise; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-574, H-A-650) Revision int64 `json:"revision,omitempty"` // why it failed, could not run or was superseded: the entry not built, the part not heard, the superseding fingerprint Said string `json:"said,omitempty"` diff --git a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go index f1bf4660f..015ba4fa4 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go @@ -35,6 +35,8 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionReservedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.version-reserved$")}, {name: "a build step's progress while its build waits for a package", subject: "mesh.seat.mesh-builds.event.step-progress.anchor", given: "{\"ask\":\"a1b2\",\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-23T02:40:00Z\",\"phase\":\"build\"}", wire: "{\"ask\":\"a1b2\",\"asker\":\"mesh-delivery-pipeline\",\"at\":\"2026-11-23T02:40:00Z\",\"phase\":\"build\"}", decode: func(b []byte) (any, error) { var v StepProgressEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.step-progress\\.[^.*> ]+$")}, + {name: "the step ended superseded in form 4: revision present exactly when superseded (H-A-574, H-A-650)", subject: "mesh.seat.mesh-builds.event.step-ended.laptop", given: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":4,\"id\":\"m2kx9a1b3c4d6f\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"revision\":14,\"said\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\",\"step\":\"build\",\"v\":1}", wire: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":4,\"id\":\"m2kx9a1b3c4d6f\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"revision\":14,\"said\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\",\"step\":\"build\",\"v\":1}", + decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.step-ended\\.[^.*> ]+$")}, {name: "reserved asks a module", subject: "", given: "{\"module\":\"mesh-sdk\"}", wire: "{\"module\":\"mesh-sdk\"}", decode: func(b []byte) (any, error) { var v ReservedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "reserved asks a package by its name", subject: "", given: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.15\"}", wire: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.15\"}", diff --git a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go index 5ee0a165e..b6fb4877d 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go @@ -14,13 +14,13 @@ const Seat = "mesh-delivery" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 2 +const Form = 3 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "2" - generatedFieldsDigest = "DeliveriesAnswer=d6ae3ca4e5da Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 HeadsByRepositoryBranchValue=b32fd594ee25 Owed=a30ee01924cc OwedByRepositoryNumberHeadActValue=f16ff5733d62 OwedEvent=86af3b56de28 RecordEndedEvent=566edb8684e5 RecordEndedEventAwayItem=44ad7d26bd16 RecordOpenedEvent=9cf9afaa25b4 RecoveryAnswer=8c705e17cdf8 RecoveryMergedEvent=014d4d00d2e5 RoomEvent=5bd4df78ed84 ShowAnswer=7538f2f5e68e SourceAnswer=6ae84f05f10d SourceByBranchValue=31aa822718c0 SourceHead=e722e2d9492f SourceMovedEvent=5231909928e9 SourceMovedEventHeadsItem=774b4bf88ba4 StalledAnswer=7538f2f5e68e" + generatedForms = "3" + generatedFieldsDigest = "DeliveriesAnswer=d6ae3ca4e5da Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 HeadsByRepositoryBranchValue=b32fd594ee25 Owed=a30ee01924cc OwedByRepositoryNumberHeadActValue=f16ff5733d62 OwedEvent=86af3b56de28 RecordEndedEvent=c693c67bd78c RecordEndedEventAwayItem=44ad7d26bd16 RecordOpenedEvent=9cf9afaa25b4 RecoveryAnswer=8c705e17cdf8 RecoveryMergedEvent=014d4d00d2e5 RoomEvent=5bd4df78ed84 ShowAnswer=7538f2f5e68e SourceAnswer=6ae84f05f10d SourceByBranchValue=31aa822718c0 SourceHead=e722e2d9492f SourceMovedEvent=5231909928e9 SourceMovedEventHeadsItem=774b4bf88ba4 StalledAnswer=7538f2f5e68e" ) const ( @@ -436,6 +436,8 @@ type RecordEndedEvent struct { Branch string `json:"branch"` // the merge call Call string `json:"call"` + // the record's end count, one higher at each end after the first, as pipeline-ended's end count is (design 47 H2 H-A-597, H-A-617) + Ends int64 `json:"ends,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // its milestone, . diff --git a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go index bdf78c409..368f47b9f 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go @@ -21,7 +21,7 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v OwedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.owed\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "record-opened is said", subject: "mesh.seat.mesh-delivery.event.record-opened.0123456789abcdef", given: "{\"at\":\"2026-11-20T02:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-20T02:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", decode: func(b []byte) (any, error) { var v RecordOpenedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.record-opened\\.[^.*> ]+$")}, - {name: "record-ended is said", subject: "mesh.seat.mesh-delivery.event.record-ended", given: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", + {name: "record-ended is said", subject: "mesh.seat.mesh-delivery.event.record-ended", given: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"ends\":2,\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-09T21:00:00Z\",\"away\":[{\"node\":\"laptop\",\"since\":\"2026-11-09T18:00:00Z\"}],\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"ends\":2,\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", decode: func(b []byte) (any, error) { var v RecordEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.record-ended$")}, {name: "filling is said", subject: "mesh.seat.mesh-delivery.event.filling", given: "{\"bytes\":650000000,\"cap\":805306368,\"store\":\"records\"}", wire: "{\"bytes\":650000000,\"cap\":805306368,\"store\":\"records\"}", decode: func(b []byte) (any, error) { var v FillingEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.filling$")}, diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index 22a9a5c7a..7189ad1d8 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go @@ -14,13 +14,13 @@ const Seat = "mesh-pipeline-runner" // 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 = 12 +const Form = 13 // 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 = "12" - generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverEnded=4b35095f6829 MoverRow=b61f41d131a3 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=582f8ff3b28d PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=ed94ced4513a Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=48b8cecc529a StandsAnswer=0afa3693bf3b StartAnswer=ed94ced4513a StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" + generatedForms = "13" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=b61f41d131a3 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=582f8ff3b28d PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=ed94ced4513a Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=48b8cecc529a StandsAnswer=0afa3693bf3b StartAnswer=ed94ced4513a StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" ) const ( @@ -45,6 +45,7 @@ const ( const ( EventPipelineStarted = "pipeline-started" + EventMoverAdded = "mover-added" EventPipelineEnded = "pipeline-ended" EventRunStarted = "run-started" EventStepStarted = "step-started" @@ -106,7 +107,7 @@ func VerbDescription(verb string) string { // Events is every event published on the seat's subject: a new copy each call. func Events() []string { - return []string{EventPipelineStarted, EventPipelineEnded, EventRunStarted, EventStepStarted, EventStepEnded, EventWaitHeld, EventWaitEnded, EventRePinned, EventFilling, EventFull, EventRoom} + return []string{EventPipelineStarted, EventMoverAdded, EventPipelineEnded, EventRunStarted, EventStepStarted, EventStepEnded, EventWaitHeld, EventWaitEnded, EventRePinned, EventFilling, EventFull, EventRoom} } // Family is where the seat's events are kept: the shared events stream, filtered to the seat's subjects. @@ -126,6 +127,17 @@ func SubjectPipelineStarted(branch, revision string) string { // SubjectPipelineStartedAll hears every pipeline-started. const SubjectPipelineStartedAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*" +// StreamMoverAdded is the stream mover-added is kept in. +const StreamMoverAdded = "SEAT_mesh-pipeline-runner_mover-added" + +// SubjectMoverAdded is where mover-added is published, on mesh.seat.mesh-pipeline-runner.event.mover-added... +func SubjectMoverAdded(branch, revision string) string { + return "mesh.seat.mesh-pipeline-runner.event.mover-added." + branch + "." + revision +} + +// SubjectMoverAddedAll hears every mover-added. +const SubjectMoverAddedAll = "mesh.seat.mesh-pipeline-runner.event.mover-added.*.*" + // StreamPipelineEnded is the stream pipeline-ended is kept in. const StreamPipelineEnded = "SEAT_mesh-pipeline-runner_pipeline-ended" @@ -717,6 +729,25 @@ const ( MoverUnplacedKeptRevisionUnread = "kept-revision-unread" ) +// MoverAdded is a mover added to a pipeline that waits or runs, or put in a reopened one: said on the pipeline's subject as pipeline-started is, with exactly one of from, caller or take-in; a reader refuses one naming none or two (design 47 H2 H-A-594 (4), H-A-609 (3), H-A-645). +type MoverAdded struct { + // the caller of start, as the runtime proved it + Caller string `json:"caller,omitempty"` + // the mover's fingerprint + Fingerprint string `json:"fingerprint"` + // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). + Form int64 `json:"form,omitempty"` + // the key of the pipeline the mover came from + From string `json:"from,omitempty"` + Module string `json:"module"` + // the key of the pipeline that carries the mover + Pipeline string `json:"pipeline"` + // the catalog graph revision of the pipeline + Revision int64 `json:"revision"` + // the source revision of the take-in whose entries were added to a pipeline already held + TakeIn int64 `json:"take-in,omitempty"` +} + // MoverEnded is one mover at its pipeline's end (design 47 H §746). type MoverEnded struct { // the commit the mover's entry was last changed at, from the pipeline's value (design 47 H-A-119) @@ -1559,8 +1590,10 @@ type PlaceAnswer struct { // PlaceUnfinishedInput is what place-unfinished takes. type PlaceUnfinishedInput struct { - // the unfinished entry's key, . - Key string `json:"key"` + // true to put every key of unfinished at once, one hand act; exactly one of key or all (design 47 H2 H-A-644) + All bool `json:"all,omitempty"` + // the unfinished entry's key, .; exactly one of key or all + Key string `json:"key,omitempty"` // why, written with the caller the runtime proves in the hand-act log Why string `json:"why"` } @@ -1635,6 +1668,9 @@ type TestRunsDropAnswer struct { // PipelineStartedEvent is the body of the event pipeline-started. type PipelineStartedEvent = PipelineStarted +// MoverAddedEvent is the body of the event mover-added. +type MoverAddedEvent = MoverAdded + // PipelineEndedEvent is the body of the event pipeline-ended. type PipelineEndedEvent = PipelineEnded @@ -1881,6 +1917,15 @@ func DecodePipelineStartedEvent(raw []byte) (PipelineStartedEvent, int, error) { return v, formRead(raw), nil } +// DecodeMoverAddedEvent reads a MoverAddedEvent 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 DecodeMoverAddedEvent(raw []byte) (MoverAddedEvent, int, error) { + var v MoverAddedEvent + if err := json.Unmarshal(raw, &v); err != nil { + return v, 0, err + } + return v, formRead(raw), nil +} + // DecodePipelineEndedEvent reads a PipelineEndedEvent 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 DecodePipelineEndedEvent(raw []byte) (PipelineEndedEvent, int, error) { var v PipelineEndedEvent diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go index 7a21c876b..12eb75eee 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -51,6 +51,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.step-ended\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "a kept mover re-pinned", subject: "mesh.seat.mesh-pipeline-runner.event.re-pinned", given: "{\"mover\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":412}", wire: "{\"mover\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":412}", decode: func(b []byte) (any, error) { var v RePinnedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.re-pinned$")}, + {name: "a mover added from the pipeline it came from (H-A-594 (4))", subject: "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589", given: "{\"fingerprint\":\"fp-sdk\",\"from\":\"main.3580\",\"module\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":12}", wire: "{\"fingerprint\":\"fp-sdk\",\"from\":\"main.3580\",\"module\":\"mesh-sdk\",\"pipeline\":\"main.3589\",\"revision\":12}", + decode: func(b []byte) (any, error) { var v MoverAddedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.mover-added\\.[^.*> ]+\\.[^.*> ]+$")}, + {name: "a mover added by a take-in whose pipeline key is held (H-A-609 (3))", subject: "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589", given: "{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"pipeline\":\"main.3589\",\"revision\":12,\"take-in\":3590}", wire: "{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"pipeline\":\"main.3589\",\"revision\":12,\"take-in\":3590}", + decode: func(b []byte) (any, error) { var v MoverAddedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.mover-added\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "a take-in's pipeline kept, its steps naming their mover", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"artifact\":\"nats:program\",\"ask\":\"m2kx9a1b3c4d5e\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"anchor\",\"outcome\":\"passed\",\"seat\":\"node-build-go\",\"status\":\"required\",\"step\":\"lint\"},{\"artifact\":\"nats:program\",\"carried-from\":\"main.3588\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"carried\",\"status\":\"required\",\"step\":\"unit\",\"tests\":{\"unit\":42}},{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"node\":\"home-server\",\"outcome\":\"failed\",\"seat\":\"node-build-go\",\"status\":\"optional\",\"step\":\"integration\",\"tests\":{\"integration\":3},\"why\":\"TestTheBusWhole failed\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"composition\"},{\"module\":\"nats\",\"outcome\":\"bypassed\",\"status\":\"bypass\",\"step\":\"review\"},{\"module\":\"nats\",\"outcome\":\"passed\",\"status\":\"required\",\"step\":\"approval\"}],\"v\":1}", decode: func(b []byte) (any, error) { var v PipelinesByBranchRevisionValue @@ -135,6 +139,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v PlaceInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "end-again asks a running pipeline's end judged once more, with why", subject: "", given: "{\"pipeline\":\"main.20\",\"why\":\"a mover waits on its registration and another failed\"}", wire: "{\"pipeline\":\"main.20\",\"why\":\"a mover waits on its registration and another failed\"}", decode: func(b []byte) (any, error) { var v EndAgainInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "place-unfinished with all, one hand act", subject: "", given: "{\"all\":true,\"why\":\"the unfinished movers of the old pipelines (design 47 H2 H-A-644)\"}", wire: "{\"all\":true,\"why\":\"the unfinished movers of the old pipelines (design 47 H2 H-A-644)\"}", + decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "place-unfinished with one key", subject: "", given: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", wire: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", + decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; 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-builds/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json index c9d557847..dfb873c53 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json @@ -173,5 +173,27 @@ "phase": "build", "at": "2026-11-23T02:40:00Z" } + }, + { + "name": "the step ended superseded in form 4: revision present exactly when superseded (H-A-574, H-A-650)", + "of": "event:step-ended", + "subject": "mesh.seat.mesh-builds.event.step-ended.laptop", + "given": { + "v": 1, + "form": 4, + "id": "m2kx9a1b3c4d6f", + "pipeline": "main.12.nats", + "step": "build", + "node": "laptop", + "outcome": "superseded", + "entries": [ + { + "module": "nats", + "fingerprint": "fp-0123" + } + ], + "said": "nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch", + "revision": 14 + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json b/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json index ce1bca641..7ef5e9e76 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json @@ -689,7 +689,7 @@ }, "revision": { "type": "integer", - "description": "for a step ended superseded, the module graph revision of the entry that superseded it, 0 when the builder knows none; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-561)" + "description": "the module graph revision of the entry that superseded the step, present exactly when outcome is superseded and absent otherwise; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-574, H-A-650)" }, "rerun": { "type": "boolean" @@ -791,5 +791,5 @@ ] } }, - "form": 3 + "form": 4 } diff --git a/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json index 1488efd3a..723cdab38 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json @@ -44,7 +44,8 @@ "at": "2026-11-09T21:00:00Z", "branch": "main", "source": 1044, - "call": "0123456789abcdef" + "call": "0123456789abcdef", + "ends": 2 } }, { diff --git a/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json b/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json index 08e74ab4e..0f0a7ce86 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json @@ -327,6 +327,10 @@ "type": "string", "format": "date-time", "description": "when" + }, + "ends": { + "type": "integer", + "description": "the record's end count, one higher at each end after the first, as pipeline-ended's end count is (design 47 H2 H-A-597, H-A-617)" } }, "required": [ @@ -719,5 +723,5 @@ ] } }, - "form": 2 + "form": 3 } diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json index e7a222b08..e96333b6d 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json @@ -48,7 +48,11 @@ "tier": 1 } ], - "kept": [292, 295, 298], + "kept": [ + 292, + 295, + 298 + ], "at": "2026-11-22T20:00:00Z" } }, @@ -601,5 +605,29 @@ "mover": "mesh-sdk", "revision": 412 } + }, + { + "name": "a mover added from the pipeline it came from (H-A-594 (4))", + "of": "event:mover-added", + "subject": "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589", + "given": { + "pipeline": "main.3589", + "revision": 12, + "module": "mesh-sdk", + "fingerprint": "fp-sdk", + "from": "main.3580" + } + }, + { + "name": "a mover added by a take-in whose pipeline key is held (H-A-609 (3))", + "of": "event:mover-added", + "subject": "mesh.seat.mesh-pipeline-runner.event.mover-added.main.3589", + "given": { + "pipeline": "main.3589", + "revision": 12, + "module": "nats", + "fingerprint": "fp-0123", + "take-in": 3590 + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json index f86884513..816fd5562 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json @@ -341,5 +341,21 @@ "pipeline": "main.20", "why": "a mover waits on its registration and another failed" } + }, + { + "name": "place-unfinished with all, one hand act", + "of": "verb:place-unfinished.input", + "given": { + "all": true, + "why": "the unfinished movers of the old pipelines (design 47 H2 H-A-644)" + } + }, + { + "name": "place-unfinished with one key", + "of": "verb:place-unfinished.input", + "given": { + "key": "main.mesh-sdk", + "why": "the mover passed on its own" + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json index 5e4447060..2f4ef049d 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -604,15 +604,18 @@ "properties": { "key": { "type": "string", - "description": "the unfinished entry's key, ." + "description": "the unfinished entry's key, .; exactly one of key or all" }, "why": { "type": "string", "description": "why, written with the caller the runtime proves in the hand-act log" + }, + "all": { + "type": "boolean", + "description": "true to put every key of unfinished at once, one hand act; exactly one of key or all (design 47 H2 H-A-644)" } }, "required": [ - "key", "why" ] }, @@ -767,6 +770,17 @@ "max-mib": 32 } }, + { + "name": "mover-added", + "subject": "mover-added..", + "body": { + "$ref": "#/defs/MoverAdded" + }, + "keep": { + "max-age-days": 90, + "max-mib": 32 + } + }, { "name": "pipeline-ended", "subject": "pipeline-ended..", @@ -2384,7 +2398,46 @@ "module", "outcome" ] + }, + "MoverAdded": { + "type": "object", + "description": "a mover added to a pipeline that waits or runs, or put in a reopened one: said on the pipeline's subject as pipeline-started is, with exactly one of from, caller or take-in; a reader refuses one naming none or two (design 47 H2 H-A-594 (4), H-A-609 (3), H-A-645)", + "properties": { + "pipeline": { + "type": "string", + "description": "the key of the pipeline that carries the mover" + }, + "revision": { + "type": "integer", + "description": "the catalog graph revision of the pipeline" + }, + "module": { + "type": "string" + }, + "fingerprint": { + "type": "string", + "description": "the mover's fingerprint" + }, + "from": { + "type": "string", + "description": "the key of the pipeline the mover came from" + }, + "caller": { + "type": "string", + "description": "the caller of start, as the runtime proved it" + }, + "take-in": { + "type": "integer", + "description": "the source revision of the take-in whose entries were added to a pipeline already held" + } + }, + "required": [ + "pipeline", + "revision", + "module", + "fingerprint" + ] } }, - "form": 12 + "form": 13 } diff --git a/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts index f0ab476e4..4a9e85275 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts @@ -135,7 +135,7 @@ export interface StepEnded { "packages"?: Record; "pipeline": string; "rerun"?: boolean; - /** for a step ended superseded, the module graph revision of the entry that superseded it, 0 when the builder knows none; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-561) */ + /** the module graph revision of the entry that superseded the step, present exactly when outcome is superseded and absent otherwise; the runner moves the mover out only for a revision newer than its pipeline's that its view holds (design 47 H2 H-A-574, H-A-650) */ "revision"?: number; /** why it failed, could not run or was superseded: the entry not built, the part not heard, the superseding fingerprint */ "said"?: string; diff --git a/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts index f07a02274..62ad33541 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts @@ -269,6 +269,8 @@ export interface RecordEndedEvent { "branch": string; /** the merge call */ "call": string; + /** the record's end count, one higher at each end after the first, as pipeline-ended's end count is (design 47 H2 H-A-597, H-A-617) */ + "ends"?: number; /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ "form"?: number; /** its milestone, . */ diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts index c526c7b30..1f73618f0 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -26,6 +26,7 @@ export declare const verbs: { export declare const events: { readonly pipelineStarted: "pipeline-started"; + readonly moverAdded: "mover-added"; readonly pipelineEnded: "pipeline-ended"; readonly runStarted: "run-started"; readonly stepStarted: "step-started"; @@ -46,6 +47,12 @@ export declare function pipelineStartedSubject(branch: string, revision: string) export declare const pipelineStartedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*"; +export declare const moverAddedStream: "SEAT_mesh-pipeline-runner_mover-added"; + +export declare function moverAddedSubject(branch: string, revision: string): string; + +export declare const moverAddedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.mover-added.*.*"; + export declare const pipelineEndedStream: "SEAT_mesh-pipeline-runner_pipeline-ended"; export declare function pipelineEndedSubject(branch: string, revision: string): string; @@ -257,6 +264,25 @@ export interface Mover { "widens"?: Widening[]; } +/** a mover added to a pipeline that waits or runs, or put in a reopened one: said on the pipeline's subject as pipeline-started is, with exactly one of from, caller or take-in; a reader refuses one naming none or two (design 47 H2 H-A-594 (4), H-A-609 (3), H-A-645) */ +export interface MoverAdded { + /** the caller of start, as the runtime proved it */ + "caller"?: string; + /** the mover's fingerprint */ + "fingerprint": string; + /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ + "form"?: number; + /** the key of the pipeline the mover came from */ + "from"?: string; + "module": string; + /** the key of the pipeline that carries the mover */ + "pipeline": string; + /** the catalog graph revision of the pipeline */ + "revision": number; + /** the source revision of the take-in whose entries were added to a pipeline already held */ + "take-in"?: number; +} + /** one mover at its pipeline's end (design 47 H §746) */ export interface MoverEnded { /** the commit the mover's entry was last changed at, from the pipeline's value (design 47 H-A-119) */ @@ -928,8 +954,10 @@ export interface PlaceAnswer { /** is what place-unfinished takes. */ export interface PlaceUnfinishedInput { - /** the unfinished entry's key, . */ - "key": string; + /** true to put every key of unfinished at once, one hand act; exactly one of key or all (design 47 H2 H-A-644) */ + "all"?: boolean; + /** the unfinished entry's key, .; exactly one of key or all */ + "key"?: string; /** why, written with the caller the runtime proves in the hand-act log */ "why": string; } @@ -997,6 +1025,9 @@ export interface TestRunsDropAnswer { /** is the body of the event pipeline-started. */ export type PipelineStartedEvent = PipelineStarted; +/** is the body of the event mover-added. */ +export type MoverAddedEvent = MoverAdded; + /** is the body of the event pipeline-ended. */ export type PipelineEndedEvent = PipelineEnded; diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js index 00b626424..83d26fbcc 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js @@ -26,6 +26,7 @@ export const verbs = { export const events = { pipelineStarted: "pipeline-started", + moverAdded: "mover-added", pipelineEnded: "pipeline-ended", runStarted: "run-started", stepStarted: "step-started", @@ -48,6 +49,14 @@ export function pipelineStartedSubject(branch, revision) { export const pipelineStartedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.pipeline-started.*.*"; +export const moverAddedStream = "SEAT_mesh-pipeline-runner_mover-added"; + +export function moverAddedSubject(branch, revision) { + return "mesh.seat.mesh-pipeline-runner.event.mover-added." + branch + "." + revision; +} + +export const moverAddedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.mover-added.*.*"; + export const pipelineEndedStream = "SEAT_mesh-pipeline-runner_pipeline-ended"; export function pipelineEndedSubject(branch, revision) { From 9ebf400457b77d60136a8b70c27db47f5e8eb493 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:08:28 +0100 Subject: [PATCH 03/44] DC3 held-want-words: a held want's words may begin awaits-reads: or awaits-entry: Builds: design 47 H2 H-A-682 (2), H-A-698 (2), H-A-706 (DMC-14) --- .../go/clients/meshwantsclient/wants.go | 18 ++++++++++++++++-- .../go/clients/meshwantsclient/wants_test.go | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants.go b/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants.go index 21f87b008..362a94532 100644 --- a/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants.go +++ b/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants.go @@ -56,6 +56,20 @@ const RevertLive = seat.WantsByWantNodeModuleValueRevertLive // want:version: it awaits its hand placement (design 47 H §772, H-A-73). Beside a put it is the one held want. const HoldAwaitsHandPlacement = "awaits-hand-placement" +// HoldAwaitsReadsPrefix begins the words of a want the assigner holds for a reader capability the node's node-engine does +// not state, followed by the missing capabilities (design 47 H2 H-A-682 (2), H-A-706 (DMC-14)). +const HoldAwaitsReadsPrefix = "awaits-reads:" + +// HoldAwaitsEntryPrefix begins the words of a want the assigner holds until the catalog entry of its fingerprint is read, +// followed by the fingerprint (design 47 H2 H-A-698 (2), H-A-706 (DMC-14)). +const HoldAwaitsEntryPrefix = "awaits-entry:" + +// holdWords says whether words are a held want's other than a put's: awaiting its hand placement, or beginning with one of +// the two prefixes. +func holdWords(words string) bool { + return words == HoldAwaitsHandPlacement || strings.HasPrefix(words, HoldAwaitsReadsPrefix) || strings.HasPrefix(words, HoldAwaitsEntryPrefix) +} + // NodeWord is the last part of a node's own key. const NodeWord = "node" @@ -182,8 +196,8 @@ func checkWant(w Want) error { } return nil } - if w.Hold && !w.Put && w.Words != HoldAwaitsHandPlacement { - return fmt.Errorf("wants: only a put, or a want awaiting its hand placement (%s), holds a want", HoldAwaitsHandPlacement) + if w.Hold && !w.Put && !holdWords(w.Words) { + return fmt.Errorf("wants: only a put, or a want awaiting its hand placement (%s), its reads (%s) or its entry (%s), holds a want", HoldAwaitsHandPlacement, HoldAwaitsReadsPrefix, HoldAwaitsEntryPrefix) } if err := checkFingerprint(w.Fp, "a want's fingerprint"); err != nil { return err diff --git a/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants_test.go b/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants_test.go index 9a0d4a17d..da98e58b8 100644 --- a/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants_test.go +++ b/modules/mesh-delivery-contracts/go/clients/meshwantsclient/wants_test.go @@ -45,6 +45,9 @@ func TestWantsAreWhatTheEarlierCodecWrote(t *testing.T) { "a placement's build": {Want{Fp: a, Version: "0.1.14"}, `{"v":1,"fp":"` + a + `","version":"0.1.14"}`}, // design 47 H §772, H-A-73: a node whose node-engine reads no want by version is held, awaiting its hand placement. "awaits its hand placement": {Want{Fp: a, Version: "0.1.15", Pipeline: "main.3589", Rank: 1, Hold: true, Words: HoldAwaitsHandPlacement}, `{"v":1,"fp":"` + a + `","version":"0.1.15","pipeline":"main.3589","rank":1,"hold":true,"words":"awaits-hand-placement"}`}, + // design 47 H2 H-A-682 (2), H-A-698 (2), H-A-706 (DMC-14): held for a reader capability the engine does not state, or for an entry not read yet. + "awaits its reads": {Want{Fp: a, Version: "0.1.15", Hold: true, Words: HoldAwaitsReadsPrefix + "directory-contents-owner"}, `{"v":1,"fp":"` + a + `","version":"0.1.15","hold":true,"words":"awaits-reads:directory-contents-owner"}`}, + "awaits its entry": {Want{Fp: a, Version: "0.1.15", Hold: true, Words: HoldAwaitsEntryPrefix + a}, `{"v":1,"fp":"` + a + `","version":"0.1.15","hold":true,"words":"awaits-entry:` + a + `"}`}, } { t.Run(name, func(t *testing.T) { raw, err := EncodeWant(row.w) From c8f9e1b8d349efb809477f603b8e1c8c9b943e36 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:08:45 +0100 Subject: [PATCH 04/44] DC4 merge-pull-unwatched-base: merge-pull merges a member whose base is no watched branch plainly, whatever its repository, noted no delivery Builds: design 47 H2 H-A-704, H-A-717 (DQ-49) --- modules/mesh-delivery-contracts/go/seats/git/contract.go | 8 ++++---- .../mesh-delivery-contracts/go/seats/git/contract_test.go | 4 ++-- .../seats/git/fixtures/states.json | 4 ++-- .../mesh-delivery-contracts/seats/git/fixtures/verbs.json | 4 ++-- modules/mesh-delivery-contracts/seats/git/seat.json | 8 ++++---- modules/mesh-delivery-contracts/ts/seats/git/index.d.ts | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/git/contract.go b/modules/mesh-delivery-contracts/go/seats/git/contract.go index 47326ac0f..69a7b3045 100644 --- a/modules/mesh-delivery-contracts/go/seats/git/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/git/contract.go @@ -86,7 +86,7 @@ func VerbDescription(verb string) string { case VerbNote: return "Append one line to a commit's note under refs/notes/mesh-plan. The line carries the act's id, and an id the note already holds is skipped (held)." case VerbMergePull: - return "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, its base a watched branch, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose repository has no watched branch is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery (H-A-471). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit." + return "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose base is no watched branch, whatever its repository, is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery, and merge-called leaves it out (H-A-471, H-A-704). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit." case VerbTag: return "Write the git tag of a released version, /vMAJOR.MINOR.PATCH for a Go package (design 47 H2 §796), at the commit its build was made from; the builder writes it only on the catalog's version-released (design 47 G section 370). A tag already at that commit is answered performed. An error answer carries error and error-kind." } @@ -229,12 +229,12 @@ type Call struct { // CallMember is one member of a kept call. type CallMember struct { - // the pull request's base, read at judging: a watched branch, but for a member noted as of a repository with no watched branch + // the pull request's base, read at judging: a watched branch, but for a member noted as one whose base is no watched branch Branch string `json:"branch"` // for merged, the merge commit Commit string `json:"commit,omitempty"` Head string `json:"head"` - // for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471) + // for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704) Note string `json:"note,omitempty"` Number int64 `json:"number"` Repository string `json:"repository"` @@ -298,7 +298,7 @@ type FailedStep struct { type MemberOutcome struct { // for merged, the merge commit; for a member refused already-merged, its commit Commit string `json:"commit,omitempty"` - // for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471) + // for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704) Note string `json:"note,omitempty"` Number int64 `json:"number"` Repository string `json:"repository"` diff --git a/modules/mesh-delivery-contracts/go/seats/git/contract_test.go b/modules/mesh-delivery-contracts/go/seats/git/contract_test.go index 58c4e65b0..d05fd497c 100644 --- a/modules/mesh-delivery-contracts/go/seats/git/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/git/contract_test.go @@ -43,7 +43,7 @@ func TestFixtures(t *testing.T) { }, subjectIs: nil}, {name: "a merge call kept", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}", decode: func(b []byte) (any, error) { var v CallsByCallCallValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "a merge call kept with a member merged plainly, its repository having no watched branch", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}", + {name: "a merge call kept with a member merged plainly, its base being no watched branch", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}],\"said\":true}", decode: func(b []byte) (any, error) { var v CallsByCallCallValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "pull asks", subject: "", given: "{\"merge-commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"repository\":\"novox/mesh-sdk\"}", wire: "{\"merge-commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"repository\":\"novox/mesh-sdk\"}", decode: func(b []byte) (any, error) { var v PullInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, @@ -135,7 +135,7 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v MergePullInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "merge-pull answers the call and each member merged", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"merged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"merged\"}]}", decode: func(b []byte) (any, error) { var v MergePullAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "merge-pull merges a member of a repository with no watched branch plainly, noted no delivery", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: the repository has no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}", + {name: "merge-pull merges a member whose base is no watched branch plainly, noted no delivery", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"commit\":\"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\"note\":\"no delivery: its base is no watched branch\",\"number\":799,\"repository\":\"novox/hq\",\"state\":\"merged\"}]}", decode: func(b []byte) (any, error) { var v MergePullAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "merge-pull refuses every member when one is refused, naming why", subject: "", given: "{\"call\":\"0123456789abcdef\",\"members\":[{\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"refused\",\"why\":\"the head moved: cccccccccccccccccccccccccccccccccccccccc, not the named aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},{\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}]}", wire: "{\"call\":\"0123456789abcdef\",\"members\":[{\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"refused\",\"why\":\"the head moved: cccccccccccccccccccccccccccccccccccccccc, not the named aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"},{\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}]}", decode: func(b []byte) (any, error) { var v MergePullAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, diff --git a/modules/mesh-delivery-contracts/seats/git/fixtures/states.json b/modules/mesh-delivery-contracts/seats/git/fixtures/states.json index 25f8e5f0c..f90538277 100644 --- a/modules/mesh-delivery-contracts/seats/git/fixtures/states.json +++ b/modules/mesh-delivery-contracts/seats/git/fixtures/states.json @@ -44,7 +44,7 @@ } }, { - "name": "a merge call kept with a member merged plainly, its repository having no watched branch", + "name": "a merge call kept with a member merged plainly, its base being no watched branch", "of": "state:calls/call.", "given": { "account": "tools-shanks", @@ -66,7 +66,7 @@ "repository": "novox/hq", "state": "merged", "branch": "main", - "note": "no delivery: the repository has no watched branch" + "note": "no delivery: its base is no watched branch" } ], "said": true diff --git a/modules/mesh-delivery-contracts/seats/git/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/git/fixtures/verbs.json index 5e0c6983d..64cd43af0 100644 --- a/modules/mesh-delivery-contracts/seats/git/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/git/fixtures/verbs.json @@ -515,7 +515,7 @@ } }, { - "name": "merge-pull merges a member of a repository with no watched branch plainly, noted no delivery", + "name": "merge-pull merges a member whose base is no watched branch plainly, noted no delivery", "of": "verb:merge-pull.answer", "why": "a repository of no module is the forge's business alone (design 47 H2 H-A-471)", "given": { @@ -532,7 +532,7 @@ "number": 799, "state": "merged", "commit": "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", - "note": "no delivery: the repository has no watched branch" + "note": "no delivery: its base is no watched branch" } ] } diff --git a/modules/mesh-delivery-contracts/seats/git/seat.json b/modules/mesh-delivery-contracts/seats/git/seat.json index d6e621094..3a9195c1b 100644 --- a/modules/mesh-delivery-contracts/seats/git/seat.json +++ b/modules/mesh-delivery-contracts/seats/git/seat.json @@ -834,7 +834,7 @@ }, { "name": "merge-pull", - "description": "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, its base a watched branch, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose repository has no watched branch is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery (H-A-471). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit.", + "description": "Merge one or more pull requests with the forge tools' account, each at the head the caller names: one merge call, a delivery's start and, with two or more members, its group (design 47 H §734, §735, §766; ADR 0682 §1, §2). Every member is judged before any is merged: still the pull request's head, no run at the head's build-input fingerprint failed a required step (judged from its own state failed-steps), registrations heard; no branch protection is read. A member whose base is no watched branch, whatever its repository, is judged against nothing of the module graph and merged plainly in the order named, starting no delivery: its outcome says merged with the note no delivery, and merge-called leaves it out (H-A-471, H-A-704). When one member is refused, none is merged. Then it merges them in the order named, writing the call in its state calls before the first merge, and says merge-called once. It answers once, at the call's end, naming the call and each member's outcome; a member already merged is refused already-merged, naming its commit.", "input": { "type": "object", "properties": { @@ -1670,7 +1670,7 @@ }, "note": { "type": "string", - "description": "for a member merged plainly, its repository having no watched branch: \"no delivery: the repository has no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471)" + "description": "for a member merged plainly, its base being no watched branch, whatever its repository: \"no delivery: its base is no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704)" } }, "required": [ @@ -1726,7 +1726,7 @@ }, "branch": { "type": "string", - "description": "the pull request's base, read at judging: a watched branch, but for a member noted as of a repository with no watched branch" + "description": "the pull request's base, read at judging: a watched branch, but for a member noted as one whose base is no watched branch" }, "head": { "type": "string", @@ -1751,7 +1751,7 @@ }, "note": { "type": "string", - "description": "for a member merged plainly, its repository having no watched branch: \"no delivery: the repository has no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471)" + "description": "for a member merged plainly, its base being no watched branch, whatever its repository: \"no delivery: its base is no watched branch\"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704)" } }, "required": [ diff --git a/modules/mesh-delivery-contracts/ts/seats/git/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/git/index.d.ts index 4b3578401..d6964cac5 100644 --- a/modules/mesh-delivery-contracts/ts/seats/git/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/git/index.d.ts @@ -92,12 +92,12 @@ export interface Call { /** one member of a kept call */ export interface CallMember { - /** the pull request's base, read at judging: a watched branch, but for a member noted as of a repository with no watched branch */ + /** the pull request's base, read at judging: a watched branch, but for a member noted as one whose base is no watched branch */ "branch": string; /** for merged, the merge commit */ "commit"?: string; "head": string; - /** for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471) */ + /** for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704) */ "note"?: string; "number": number; "repository": string; @@ -146,7 +146,7 @@ export interface FailedStep { export interface MemberOutcome { /** for merged, the merge commit; for a member refused already-merged, its commit */ "commit"?: string; - /** for a member merged plainly, its repository having no watched branch: "no delivery: the repository has no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471) */ + /** for a member merged plainly, its base being no watched branch, whatever its repository: "no delivery: its base is no watched branch"; it starts no delivery and merge-called leaves it out (design 47 H2 H-A-471, H-A-704) */ "note"?: string; "number": number; "repository": string; From 8865d61beca91d0c262eae1068f12639f4c405b8 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:09:01 +0100 Subject: [PATCH 05/44] DC5 published-names-fingerprint: package-published gains the reservation's fingerprint (mesh-builds stays at form 4, one raise per seat) Builds: design 47 H2 H-A-707 (6), H-A-717 (DQ-52) --- .../go/seats/meshbuilds/contract.go | 4 ++- .../go/seats/meshbuilds/contract_test.go | 2 ++ .../seats/mesh-builds/fixtures/events.json | 30 +++++++++++++++++++ .../seats/mesh-builds/seat.json | 4 +++ .../ts/seats/meshbuilds/index.d.ts | 2 ++ 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go index 00032cb0c..6e5555a49 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go @@ -19,7 +19,7 @@ const Form = 4 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "4" - generatedFieldsDigest = "AskTakenEvent=6d5d3da7ac39 BuildEntry=3c829a0a3d58 Dependency=90a32b07c563 DropAnswer=7538f2f5e68e PackagePublished=34dd069a6aab PackagePublishedEvent=8e12888c1559 PublishQueueAnswer=0f1326e35e17 PublishQueueAnswerCountsItem=b770db2f0920 PublishQueueAnswerQueueItem=b1eebc09f41e PublishedAnswer=69a801982819 ReservedAnswer=2272a4d6f0f4 ReservedAnswerArtifactsItem=d74eb6e00abb Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=be571d4ff16f StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07" + generatedFieldsDigest = "AskTakenEvent=6d5d3da7ac39 BuildEntry=3c829a0a3d58 Dependency=90a32b07c563 DropAnswer=7538f2f5e68e PackagePublished=7e20050c6260 PackagePublishedEvent=8e12888c1559 PublishQueueAnswer=0f1326e35e17 PublishQueueAnswerCountsItem=b770db2f0920 PublishQueueAnswerQueueItem=b1eebc09f41e PublishedAnswer=69a801982819 ReservedAnswer=2272a4d6f0f4 ReservedAnswerArtifactsItem=d74eb6e00abb Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=be571d4ff16f StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07" ) const ( @@ -146,6 +146,8 @@ type PackagePublished struct { Dependencies []Dependency `json:"dependencies,omitempty"` // the published artifact's digest Digest string `json:"digest"` + // the fingerprint of the build the reservation holds, so the runner marks every running pipeline of the branch that moves the module at it; absent from a publish whose reservation names none; the builder, the assigner and the indexer read it not and decode it tolerantly (design 47 H2 H-A-707 (6)) + Fingerprint string `json:"fingerprint,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the module diff --git a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go index 015ba4fa4..706c43da9 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go @@ -37,6 +37,8 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v StepProgressEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.step-progress\\.[^.*> ]+$")}, {name: "the step ended superseded in form 4: revision present exactly when superseded (H-A-574, H-A-650)", subject: "mesh.seat.mesh-builds.event.step-ended.laptop", given: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":4,\"id\":\"m2kx9a1b3c4d6f\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"revision\":14,\"said\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\",\"step\":\"build\",\"v\":1}", wire: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":4,\"id\":\"m2kx9a1b3c4d6f\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"revision\":14,\"said\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\",\"step\":\"build\",\"v\":1}", decode: func(b []byte) (any, error) { var v StepEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.step-ended\\.[^.*> ]+$")}, + {name: "a package published, naming the build's fingerprint (H-A-707 (6))", subject: "mesh.seat.mesh-builds.event.package-published", given: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"part\":\"mesh-contracts:go-nodeengine\",\"version\":\"0.1.4\"},{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"part\":\"mesh-build-go:toolchain\",\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}", wire: "{\"artifact\":\"mesh-sdk:go\",\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"dependencies\":[{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":1,\"part\":\"mesh-contracts:go-nodeengine\",\"version\":\"0.1.4\"},{\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"kind\":3,\"part\":\"mesh-build-go:toolchain\",\"version\":\"1.26.0\"}],\"digest\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"source\":3589,\"v\":1,\"version\":\"0.1.15\"}", + decode: func(b []byte) (any, error) { var v PackagePublishedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.package-published$")}, {name: "reserved asks a module", subject: "", given: "{\"module\":\"mesh-sdk\"}", wire: "{\"module\":\"mesh-sdk\"}", decode: func(b []byte) (any, error) { var v ReservedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "reserved asks a package by its name", subject: "", given: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.15\"}", wire: "{\"name\":\"git.novox.be/novox/mesh-sdk/go\",\"version\":\"0.1.15\"}", diff --git a/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json index dfb873c53..ee7b415b2 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json @@ -195,5 +195,35 @@ "said": "nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch", "revision": 14 } + }, + { + "name": "a package published, naming the build's fingerprint (H-A-707 (6))", + "of": "event:package-published", + "subject": "mesh.seat.mesh-builds.event.package-published", + "given": { + "v": 1, + "artifact": "mesh-sdk:go", + "module": "mesh-sdk", + "version": "0.1.15", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "branch": "main", + "source": 3589, + "dependencies": [ + { + "kind": 1, + "version": "0.1.4", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "part": "mesh-contracts:go-nodeengine" + }, + { + "kind": 3, + "version": "1.26.0", + "digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "part": "mesh-build-go:toolchain" + } + ], + "at": "2026-11-10T10:00:00Z", + "fingerprint": "fp-sdk" + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json b/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json index 7ef5e9e76..482f7bf3c 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json @@ -524,6 +524,10 @@ "type": "integer", "description": "the catalog revision number of that branch the build was made from, the indexer's count (design 47 H-A-218, H-A-220); absent from a reservation made before the field" }, + "fingerprint": { + "type": "string", + "description": "the fingerprint of the build the reservation holds, so the runner marks every running pipeline of the branch that moves the module at it; absent from a publish whose reservation names none; the builder, the assigner and the indexer read it not and decode it tolerantly (design 47 H2 H-A-707 (6))" + }, "dependencies": { "type": "array", "items": { diff --git a/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts index 4a9e85275..138a124e6 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts @@ -83,6 +83,8 @@ export interface PackagePublished { "dependencies"?: Dependency[]; /** the published artifact's digest */ "digest": string; + /** the fingerprint of the build the reservation holds, so the runner marks every running pipeline of the branch that moves the module at it; absent from a publish whose reservation names none; the builder, the assigner and the indexer read it not and decode it tolerantly (design 47 H2 H-A-707 (6)) */ + "fingerprint"?: string; /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ "form"?: number; /** the module */ From 6dc9164504feb2d483dd900f191413644cca17b2 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:09:56 +0100 Subject: [PATCH 06/44] DC6 runner-reads-bounded: MoverRow carries fingerprint and version, show and stands take a bound and page by a cursor, pipeline-started's movers are StartedMover Builds: design 47 H2 H-A-709 (1) (2) (3), H-A-717 (DQ-52, DQ-57) --- .../go/seats/meshpipelinerunner/contract.go | 60 ++++++++-- .../seats/meshpipelinerunner/contract_test.go | 10 +- .../mesh-pipeline-runner/fixtures/events.json | 3 +- .../mesh-pipeline-runner/fixtures/verbs.json | 77 +++++++++++++ .../seats/mesh-pipeline-runner/seat.json | 103 ++++++++++++++++-- .../ts/seats/meshpipelinerunner/index.d.ts | 50 +++++++-- 6 files changed, 272 insertions(+), 31 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index 7189ad1d8..65238d420 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go @@ -20,7 +20,7 @@ const Form = 13 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "13" - generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=b61f41d131a3 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=582f8ff3b28d PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=ed94ced4513a Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=48b8cecc529a StandsAnswer=0afa3693bf3b StartAnswer=ed94ced4513a StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=b7ceefe24722 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=ed94ced4513a Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" ) const ( @@ -72,11 +72,11 @@ func VerbDescription(verb string) string { case VerbStart: return "A delivering pipeline for a watched branch's head, by hand; written in the hand-act log. With modules, a pipeline at the head keyed ..again. carrying the named modules whose newest entry has no passed pipeline, at the take-in's tiers; a module whose newest entry passed is refused by name. Exactly one of module or modules (design 47 H2 H-A-479)." case VerbShow: - return "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). Reads only." + return "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). The answer names only the movers its page holds, with each row's fingerprint and version, mover-count and step-count and no unlogged; it answers within bound, capped, total and next, and moved true when the record was written between two pages (design 47 H2 H-A-709 (1), (2)). Reads only." case VerbList: return "The pipelines and runs of a module, a branch or a commit, newest first, of every branch when none is named (design 47 H2 H-A-533): by default one short row per pipeline, the newest 20 (its key, branch, call, source, revision, start, end, outcome, movers' count, its steps counted per outcome and first failed or could-not-run step with its module and why); the whole pipelines, each record with its movers and steps counted, never its steps (show gives those), only with full and a limit (design 47 H2 H-A-376, H-A-467). Reads only." case VerbStands: - return "What stands still, and since when: each step not ended and each wait held. Reads only." + return "What stands still, and since when: each step not ended and each wait held, in the order of their since, then their pipeline, module, step and artifact, within bound; reads only (design 47 H2 H-A-709 (2))." case VerbWhyCarried: return "Where a step's result was carried from, with the kept results it rests on. Reads only." case VerbKept: @@ -768,9 +768,13 @@ type MoverEnded struct { // MoverRow is one mover of a pipeline in show's short form (design 47 H2 H-A-376). type MoverRow struct { Failed *FailedStep `json:"failed,omitempty"` - Module string `json:"module"` + // the mover's build-input fingerprint, which the delivery view's pipeline page reads from the row (design 47 H2 H-A-709 (1)) + Fingerprint string `json:"fingerprint,omitempty"` + Module string `json:"module"` // waiting for a mover with no step placed; running while a required step is open; failed once a required step did not pass; superseded for one a newer pipeline took out Outcome string `json:"outcome"` + // the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1)) + Version string `json:"version,omitempty"` } // The values of MoverRow's outcome. @@ -793,7 +797,7 @@ type Pipeline struct { Ended *time.Time `json:"ended,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` - // how many movers the pipeline has, set by list alone (H-A-191) + // how many movers the pipeline has, set by list and by show (H-A-191, design 47 H2 H-A-709 (1)) MoverCount int64 `json:"mover-count,omitempty"` // the modules the pipeline moves, its take-in's entries (design 47 H §746) Movers []Mover `json:"movers"` @@ -811,13 +815,13 @@ type Pipeline struct { // the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9) Source int64 `json:"source"` Started *time.Time `json:"started,omitempty"` - // how many steps the pipeline's movers have, set by list alone, which answers the record with its steps empty (H-A-191) + // how many steps the pipeline's movers have, set by list, which answers the record with its steps empty, and by show (H-A-191, design 47 H2 H-A-709 (1)) StepCount int64 `json:"step-count,omitempty"` // every mover's steps, each naming its mover, approval last; in the state pipelines a record's own are empty, each mover's kept under its own key (H-A-187) Steps []StepResult `json:"steps"` // the modules a newer waiting take-in of the same branch took out of the pipeline, written with the movers by compare-and-set; at its placing the runner writes a mover's build-step why from it (design 47 H §748, H-A-107) Superseded []string `json:"superseded,omitempty"` - // the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189) + // the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189); show's answer carries none (design 47 H2 H-A-709 (1)) Unlogged []LogEntry `json:"unlogged,omitempty"` // the layout version V int64 `json:"v,omitempty"` @@ -994,8 +998,8 @@ type PipelineStarted struct { Form int64 `json:"form,omitempty"` // every catalog revision the pipeline's movers are kept at, said again in full at each re-pin, so the indexer pins each while the pipeline runs (design 47 H2 H-A-496 and its addendum) Kept []int64 `json:"kept,omitempty"` - // the pipeline's movers - Movers []Mover `json:"movers"` + // the pipeline's movers, each with what its readers read (design 47 H2 H-A-709 (3)) + Movers []StartedMover `json:"movers"` // the pipeline's key, ., or ..published.. for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) Pipeline string `json:"pipeline"` // for a pipeline a package's publish started, that publish (A-202) @@ -1049,6 +1053,20 @@ type Shared struct { Run string `json:"run"` } +// StartedMover is one mover of a pipeline-started: what its readers read, the gate's module, fingerprint and version; published, widens, tests, unplaced, revision and over-budget stay in the pipeline's record, read by show (design 47 H2 H-A-709 (3)). +type StartedMover struct { + // the commit the module's entry was last changed at + Commit string `json:"commit"` + // the module's build-input fingerprint at the commit + Fingerprint string `json:"fingerprint"` + Module string `json:"module"` + Repository string `json:"repository"` + // the mover's tier in the pipeline's delivery order, from 1 (ADR 0666 section 14; design 47 H section 746) + Tier int64 `json:"tier,omitempty"` + // the version released for the mover in this pipeline, absent until one is (design 47 H-A-52) + Version string `json:"version,omitempty"` +} + // StepEvent is a step's start or end: the step, its status, its outcome, its fingerprint, its test counts, what a carried result was carried from, and for a rerun that it is one and its proved caller; a bypassed step too. type StepEvent struct { At *time.Time `json:"at,omitempty"` @@ -1338,9 +1356,11 @@ type StartAnswer struct { // ShowInput is what show takes. type ShowInput struct { + // the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2)) + Bound int64 `json:"bound,omitempty"` // a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187); with neither mover, step nor state the answer holds each mover's row (design 47 H2 H-A-376) Mover string `json:"mover,omitempty"` - // the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789) + // the cursor the previous page answered, opaque: the place of the next row or step among those the filters hold and the record's revision; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57)) Next string `json:"next,omitempty"` // the pipeline's key Pipeline string `json:"pipeline"` @@ -1364,12 +1384,14 @@ const ( // ShowAnswer is what show answers. type ShowAnswer struct { - // yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789) + // yes when the answer stopped at bound; the rest is read from next (design 47 H2 H-A-709 (2)) 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"` Log []LogEntry `json:"log,omitempty"` + // yes when a page was asked with a next of another revision of the record: it answers from that place, though rows and steps may have changed between the pages; a reader that needs one whole picture reads again with no next (design 47 H2 H-A-709 (2)) + Moved bool `json:"moved,omitempty"` // each mover's row, when show names no mover, step or state (design 47 H2 H-A-376) Movers []MoverRow `json:"movers,omitempty"` // the cursor of the next page, opaque; empty at the end (design 47 H2 §779) @@ -1404,13 +1426,27 @@ type ListAnswer struct { // StandsInput is what stands takes. type StandsInput struct { + // the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2)) + Bound int64 `json:"bound,omitempty"` + // only this module's waits, applied while reading + Module string `json:"module,omitempty"` + // the cursor the previous page answered, opaque: the place of the last wait answered, so the next page answers the waits after it; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57)) + Next string `json:"next,omitempty"` + // only this pipeline's waits, applied while reading + Pipeline string `json:"pipeline,omitempty"` } // StandsAnswer is what stands answers. type StandsAnswer struct { + // yes when the answer stopped at bound; the rest is read from next + Capped bool `json:"capped,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). - Form int64 `json:"form,omitempty"` + Form int64 `json:"form,omitempty"` + // the cursor of the next page, opaque; empty at the end + Next string `json:"next,omitempty"` Stands []Wait `json:"stands"` + // how many waits the filters hold in all + Total int64 `json:"total,omitempty"` } // WhyCarriedInput is what why-carried takes. diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go index 12eb75eee..f14ae4e43 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -17,7 +17,7 @@ func TestFixtures(t *testing.T) { decode func([]byte) (any, error) subjectIs *regexp.Regexp }{ - {name: "a take-in's pipeline started with its two movers", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.3589", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}", + {name: "a take-in's pipeline started with its two movers", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.3589", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1,\"version\":\"0.1.15\"},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"repository\":\"mesh-sdk\",\"tier\":1,\"version\":\"0.1.15\"},{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":2}],\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1}", decode: func(b []byte) (any, error) { var v PipelineStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-started\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "a pipeline started again at a re-pin, with the three revisions its movers are kept at (H-A-496)", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-started.main.291", given: "{\"at\":\"2026-11-22T20:00:00Z\",\"branch\":\"main\",\"kept\":[292,295,298],\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"pipeline\":\"main.291\",\"revision\":291,\"source\":114,\"v\":1}", wire: "{\"at\":\"2026-11-22T20:00:00Z\",\"branch\":\"main\",\"kept\":[292,295,298],\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"pipeline\":\"main.291\",\"revision\":291,\"source\":114,\"v\":1}", decode: func(b []byte) (any, error) { var v PipelineStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-started\\.[^.*> ]+\\.[^.*> ]+$")}, @@ -143,6 +143,14 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "place-unfinished with one key", subject: "", given: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", wire: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "show answers a page of movers' rows with their fingerprint and version, moved and capped (H-A-709)", subject: "", given: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\"}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", wire: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\"}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", + decode: func(b []byte) (any, error) { var v ShowAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "stands answers a page, capped, with the total and the cursor of the next (H-A-709)", subject: "", given: "{\"capped\":true,\"next\":\"cursor-2\",\"stands\":[{\"artifact\":\"nats:program\",\"branch\":\"main\",\"module\":\"nats\",\"on\":\"build node\",\"pipeline\":\"main.3589\",\"revision\":12,\"since\":\"2026-11-10T10:00:00Z\",\"source\":3589,\"step\":\"unit\",\"v\":1}],\"total\":300}", wire: "{\"capped\":true,\"next\":\"cursor-2\",\"stands\":[{\"artifact\":\"nats:program\",\"branch\":\"main\",\"module\":\"nats\",\"on\":\"build node\",\"pipeline\":\"main.3589\",\"revision\":12,\"since\":\"2026-11-10T10:00:00Z\",\"source\":3589,\"step\":\"unit\",\"v\":1}],\"total\":300}", + decode: func(b []byte) (any, error) { var v StandsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "stands asked for one pipeline and module, within a bound (H-A-709)", subject: "", given: "{\"bound\":32768,\"module\":\"nats\",\"next\":\"cursor-2\",\"pipeline\":\"main.3589\"}", wire: "{\"bound\":32768,\"module\":\"nats\",\"next\":\"cursor-2\",\"pipeline\":\"main.3589\"}", + decode: func(b []byte) (any, error) { var v StandsInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "show asked within a bound (H-A-709)", subject: "", given: "{\"bound\":65536,\"next\":\"cursor-1\",\"pipeline\":\"main.3589\"}", wire: "{\"bound\":65536,\"next\":\"cursor-1\",\"pipeline\":\"main.3589\"}", + decode: func(b []byte) (any, error) { var v ShowInput; 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-pipeline-runner/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json index e96333b6d..ffc143975 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json @@ -16,7 +16,8 @@ "commit": "0123456789abcdef0123456789abcdef01234567", "fingerprint": "fp-sdk", "repository": "mesh-sdk", - "tier": 1 + "tier": 1, + "version": "0.1.15" }, { "module": "nats", diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json index 816fd5562..b3cb40dc0 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json @@ -357,5 +357,82 @@ "key": "main.mesh-sdk", "why": "the mover passed on its own" } + }, + { + "name": "show answers a page of movers' rows with their fingerprint and version, moved and capped (H-A-709)", + "of": "verb:show.answer", + "given": { + "pipeline": { + "pipeline": "main.3589", + "branch": "main", + "revision": 12, + "source": 3589, + "v": 1, + "outcome": "running", + "mover-count": 129, + "step-count": 516, + "movers": [], + "steps": [] + }, + "movers": [ + { + "module": "nats", + "outcome": "running", + "fingerprint": "fp-0123", + "version": "0.1.9" + }, + { + "module": "mesh-sdk", + "outcome": "passed", + "fingerprint": "fp-sdk" + } + ], + "capped": true, + "total": 129, + "next": "cursor-1", + "moved": true + } + }, + { + "name": "stands answers a page, capped, with the total and the cursor of the next (H-A-709)", + "of": "verb:stands.answer", + "given": { + "stands": [ + { + "pipeline": "main.3589", + "module": "nats", + "branch": "main", + "revision": 12, + "source": 3589, + "v": 1, + "step": "unit", + "artifact": "nats:program", + "on": "build node", + "since": "2026-11-10T10:00:00Z" + } + ], + "capped": true, + "total": 300, + "next": "cursor-2" + } + }, + { + "name": "stands asked for one pipeline and module, within a bound (H-A-709)", + "of": "verb:stands.input", + "given": { + "pipeline": "main.3589", + "module": "nats", + "bound": 32768, + "next": "cursor-2" + } + }, + { + "name": "show asked within a bound (H-A-709)", + "of": "verb:show.input", + "given": { + "pipeline": "main.3589", + "bound": 65536, + "next": "cursor-1" + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json index 2f4ef049d..9eb333c20 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -93,7 +93,7 @@ }, { "name": "show", - "description": "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). Reads only.", + "description": "One pipeline: naming a mover, its steps alone; with no mover, each mover's row (its module, outcome and failed step), never every step of every mover, or the steps of any mover the step and state filters hold; and its step log, with the stores' fill (design 47 H2 §789, H-A-376). The answer names only the movers its page holds, with each row's fingerprint and version, mover-count and step-count and no unlogged; it answers within bound, capped, total and next, and moved true when the record was written between two pages (design 47 H2 H-A-709 (1), (2)). Reads only.", "input": { "type": "object", "properties": { @@ -125,7 +125,13 @@ }, "next": { "type": "string", - "description": "the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789)" + "description": "the cursor the previous page answered, opaque: the place of the next row or step among those the filters hold and the record's revision; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57))" + }, + "bound": { + "type": "integer", + "minimum": 4096, + "maximum": 786432, + "description": "the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2))" } }, "required": [ @@ -152,7 +158,7 @@ }, "capped": { "type": "boolean", - "description": "yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789)" + "description": "yes when the answer stopped at bound; the rest is read from next (design 47 H2 H-A-709 (2))" }, "total": { "type": "integer", @@ -168,6 +174,10 @@ "$ref": "#/defs/MoverRow" }, "description": "each mover's row, when show names no mover, step or state (design 47 H2 H-A-376)" + }, + "moved": { + "type": "boolean", + "description": "yes when a page was asked with a next of another revision of the record: it answers from that place, though rows and steps may have changed between the pages; a reader that needs one whole picture reads again with no next (design 47 H2 H-A-709 (2))" } }, "required": [ @@ -231,10 +241,29 @@ }, { "name": "stands", - "description": "What stands still, and since when: each step not ended and each wait held. Reads only.", + "description": "What stands still, and since when: each step not ended and each wait held, in the order of their since, then their pipeline, module, step and artifact, within bound; reads only (design 47 H2 H-A-709 (2)).", "input": { "type": "object", - "properties": {} + "properties": { + "pipeline": { + "type": "string", + "description": "only this pipeline's waits, applied while reading" + }, + "module": { + "type": "string", + "description": "only this module's waits, applied while reading" + }, + "bound": { + "type": "integer", + "minimum": 4096, + "maximum": 786432, + "description": "the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2))" + }, + "next": { + "type": "string", + "description": "the cursor the previous page answered, opaque: the place of the last wait answered, so the next page answers the waits after it; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57))" + } + } }, "answer": { "type": "object", @@ -244,6 +273,18 @@ "items": { "$ref": "#/defs/Wait" } + }, + "capped": { + "type": "boolean", + "description": "yes when the answer stopped at bound; the rest is read from next" + }, + "total": { + "type": "integer", + "description": "how many waits the filters hold in all" + }, + "next": { + "type": "string", + "description": "the cursor of the next page, opaque; empty at the end" } }, "required": [ @@ -1425,15 +1466,15 @@ "items": { "$ref": "#/defs/LogEntry" }, - "description": "the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189)" + "description": "the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189); show's answer carries none (design 47 H2 H-A-709 (1))" }, "mover-count": { "type": "integer", - "description": "how many movers the pipeline has, set by list alone (H-A-191)" + "description": "how many movers the pipeline has, set by list and by show (H-A-191, design 47 H2 H-A-709 (1))" }, "step-count": { "type": "integer", - "description": "how many steps the pipeline's movers have, set by list alone, which answers the record with its steps empty (H-A-191)" + "description": "how many steps the pipeline's movers have, set by list, which answers the record with its steps empty, and by show (H-A-191, design 47 H2 H-A-709 (1))" }, "published": { "$ref": "#/defs/Published", @@ -1679,9 +1720,9 @@ "movers": { "type": "array", "items": { - "$ref": "#/defs/Mover" + "$ref": "#/defs/StartedMover" }, - "description": "the pipeline's movers" + "description": "the pipeline's movers, each with what its readers read (design 47 H2 H-A-709 (3))" }, "run": { "type": "string", @@ -2378,6 +2419,14 @@ "module": { "type": "string" }, + "fingerprint": { + "type": "string", + "description": "the mover's build-input fingerprint, which the delivery view's pipeline page reads from the row (design 47 H2 H-A-709 (1))" + }, + "version": { + "type": "string", + "description": "the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1))" + }, "outcome": { "type": "string", "enum": [ @@ -2437,6 +2486,40 @@ "module", "fingerprint" ] + }, + "StartedMover": { + "type": "object", + "description": "one mover of a pipeline-started: what its readers read, the gate's module, fingerprint and version; published, widens, tests, unplaced, revision and over-budget stay in the pipeline's record, read by show (design 47 H2 H-A-709 (3))", + "properties": { + "module": { + "type": "string" + }, + "commit": { + "type": "string", + "description": "the commit the module's entry was last changed at" + }, + "fingerprint": { + "type": "string", + "description": "the module's build-input fingerprint at the commit" + }, + "repository": { + "type": "string" + }, + "tier": { + "type": "integer", + "description": "the mover's tier in the pipeline's delivery order, from 1 (ADR 0666 section 14; design 47 H section 746)" + }, + "version": { + "type": "string", + "description": "the version released for the mover in this pipeline, absent until one is (design 47 H-A-52)" + } + }, + "required": [ + "module", + "commit", + "fingerprint", + "repository" + ] } }, "form": 13 diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts index 1f73618f0..f5989b3bf 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -303,9 +303,13 @@ export interface MoverEnded { /** one mover of a pipeline in show's short form (design 47 H2 H-A-376) */ export interface MoverRow { "failed"?: FailedStep; + /** the mover's build-input fingerprint, which the delivery view's pipeline page reads from the row (design 47 H2 H-A-709 (1)) */ + "fingerprint"?: string; "module": string; /** waiting for a mover with no step placed; running while a required step is open; failed once a required step did not pass; superseded for one a newer pipeline took out */ "outcome": "waiting" | "running" | "passed" | "failed" | "superseded"; + /** the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1)) */ + "version"?: string; } /** one pipeline of one take-in, its movers the take-in's entries, as the runner keeps it in its state pipelines by compare-and-set (design 47 H §746) */ @@ -319,7 +323,7 @@ export interface Pipeline { "ended"?: string; /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ "form"?: number; - /** how many movers the pipeline has, set by list alone (H-A-191) */ + /** how many movers the pipeline has, set by list and by show (H-A-191, design 47 H2 H-A-709 (1)) */ "mover-count"?: number; /** the modules the pipeline moves, its take-in's entries (design 47 H §746) */ "movers": Mover[]; @@ -337,13 +341,13 @@ export interface Pipeline { /** the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9) */ "source": number; "started"?: string; - /** how many steps the pipeline's movers have, set by list alone, which answers the record with its steps empty (H-A-191) */ + /** how many steps the pipeline's movers have, set by list, which answers the record with its steps empty, and by show (H-A-191, design 47 H2 H-A-709 (1)) */ "step-count"?: number; /** every mover's steps, each naming its mover, approval last; in the state pipelines a record's own are empty, each mover's kept under its own key (H-A-187) */ "steps": StepResult[]; /** the modules a newer waiting take-in of the same branch took out of the pipeline, written with the movers by compare-and-set; at its placing the runner writes a mover's build-step why from it (design 47 H §748, H-A-107) */ "superseded"?: string[]; - /** the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189) */ + /** the step-log entries of the steps that ended and are not appended to the step log yet, in order; written with the step's end in one write and cleared when appended (design 47 G sections 486, 606); in the state pipelines a record's own are empty, each mover's kept under its own key beside its steps (H-A-189); show's answer carries none (design 47 H2 H-A-709 (1)) */ "unlogged"?: LogEntry[]; /** the layout version */ "v"?: number; @@ -487,8 +491,8 @@ export interface PipelineStarted { "form"?: number; /** every catalog revision the pipeline's movers are kept at, said again in full at each re-pin, so the indexer pins each while the pipeline runs (design 47 H2 H-A-496 and its addendum) */ "kept"?: number[]; - /** the pipeline's movers */ - "movers": Mover[]; + /** the pipeline's movers, each with what its readers read (design 47 H2 H-A-709 (3)) */ + "movers": StartedMover[]; /** the pipeline's key, ., or ..published.. for a pipeline a publish started; a branch escaped as a key's name is (design 47 H §746, §747) */ "pipeline": string; /** for a pipeline a package's publish started, that publish (A-202) */ @@ -542,6 +546,20 @@ export interface Shared { "run": string; } +/** one mover of a pipeline-started: what its readers read, the gate's module, fingerprint and version; published, widens, tests, unplaced, revision and over-budget stay in the pipeline's record, read by show (design 47 H2 H-A-709 (3)) */ +export interface StartedMover { + /** the commit the module's entry was last changed at */ + "commit": string; + /** the module's build-input fingerprint at the commit */ + "fingerprint": string; + "module": string; + "repository": string; + /** the mover's tier in the pipeline's delivery order, from 1 (ADR 0666 section 14; design 47 H section 746) */ + "tier"?: number; + /** the version released for the mover in this pipeline, absent until one is (design 47 H-A-52) */ + "version"?: string; +} + /** a step's start or end: the step, its status, its outcome, its fingerprint, its test counts, what a carried result was carried from, and for a rerun that it is one and its proved caller; a bypassed step too */ export interface StepEvent { "at"?: string; @@ -756,9 +774,11 @@ export interface StartAnswer { /** is what show takes. */ export interface ShowInput { + /** the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2)) */ + "bound"?: number; /** a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187); with neither mover, step nor state the answer holds each mover's row (design 47 H2 H-A-376) */ "mover"?: string; - /** the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789) */ + /** the cursor the previous page answered, opaque: the place of the next row or step among those the filters hold and the record's revision; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57)) */ "next"?: string; /** the pipeline's key */ "pipeline": string; @@ -770,12 +790,14 @@ export interface ShowInput { /** is what show answers. */ export interface ShowAnswer { - /** yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789) */ + /** yes when the answer stopped at bound; the rest is read from next (design 47 H2 H-A-709 (2)) */ "capped"?: boolean; "fill"?: Fill[]; /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ "form"?: number; "log"?: LogEntry[]; + /** yes when a page was asked with a next of another revision of the record: it answers from that place, though rows and steps may have changed between the pages; a reader that needs one whole picture reads again with no next (design 47 H2 H-A-709 (2)) */ + "moved"?: boolean; /** each mover's row, when show names no mover, step or state (design 47 H2 H-A-376) */ "movers"?: MoverRow[]; /** the cursor of the next page, opaque; empty at the end (design 47 H2 §779) */ @@ -810,13 +832,27 @@ export interface ListAnswer { /** is what stands takes. */ export interface StandsInput { + /** the most bytes the answer holds, 4,096 to 786,432; absent, the runner's setting answer-bound (design 47 H2 H-A-709 (2)) */ + "bound"?: number; + /** only this module's waits, applied while reading */ + "module"?: string; + /** the cursor the previous page answered, opaque: the place of the last wait answered, so the next page answers the waits after it; a next the runner cannot read as its own is refused, a page being read again from the start (design 47 H2 H-A-709 (2), H-A-717 (DQ-57)) */ + "next"?: string; + /** only this pipeline's waits, applied while reading */ + "pipeline"?: string; } /** is what stands answers. */ export interface StandsAnswer { + /** yes when the answer stopped at bound; the rest is read from next */ + "capped"?: boolean; /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ "form"?: number; + /** the cursor of the next page, opaque; empty at the end */ + "next"?: string; "stands": Wait[]; + /** how many waits the filters hold in all */ + "total"?: number; } /** is what why-carried takes. */ From dc6669f768e4bf2a8a5637cd4f3fdc5ae326318b Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:10:16 +0100 Subject: [PATCH 07/44] DC2b place-unfinished answers placed and failed with all; mover-added kept as pipeline-started is Builds: design 47 H2 H-A-644, H-A-725, H-A-726 --- .../go/seats/meshpipelinerunner/contract.go | 34 +++++++++--- .../seats/meshpipelinerunner/contract_test.go | 6 +++ .../mesh-pipeline-runner/fixtures/verbs.json | 36 +++++++++++++ .../seats/mesh-pipeline-runner/seat.json | 53 +++++++++++++++++-- .../ts/seats/meshpipelinerunner/index.d.ts | 28 ++++++++-- 5 files changed, 144 insertions(+), 13 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index 65238d420..e5c1449ad 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go @@ -20,7 +20,7 @@ const Form = 13 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "13" - generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=b7ceefe24722 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=ed94ced4513a Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=b7ceefe24722 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" ) const ( @@ -94,7 +94,7 @@ func VerbDescription(verb string) string { case VerbPlace: return "A waiting pipeline placed ahead of its turn, its steps asked now; written in the hand-act log (design 47 H §748, H-A-53)." case VerbPlaceUnfinished: - return "A mover kept in the state unfinished put in a pipeline of its own at once, keyed ..unfinished.; written in the hand-act log (design 47 H2 §786, H-A-398)." + return "A mover kept in the state unfinished put in a pipeline of its own at once, keyed ..unfinished.; written in the hand-act log (design 47 H2 §786, H-A-398). With all, each key of unfinished is put in a pipeline of its own; the answer names every pipeline put and every key that could not be (design 47 H2 H-A-725)." case VerbAskAgain: return "A declined approval step asked again (ADR 0666 section 10). Written in the hand-act log." case VerbTestRuns: @@ -1634,14 +1634,36 @@ type PlaceUnfinishedInput struct { Why string `json:"why"` } -// PlaceUnfinishedAnswer is what place-unfinished answers. -type PlaceUnfinishedAnswer struct { - // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). - Form int64 `json:"form,omitempty"` +// PlaceUnfinishedAnswerFailedItem is a type of the contract. +type PlaceUnfinishedAnswerFailedItem struct { + // the unfinished entry's key + Key string `json:"key"` + // why it could not be put + Words string `json:"words"` +} + +// PlaceUnfinishedAnswerPlacedItem is a type of the contract. +type PlaceUnfinishedAnswerPlacedItem struct { + // the unfinished entry's key + Key string `json:"key"` // the key of the pipeline the mover is put in Pipeline string `json:"pipeline"` } +// PlaceUnfinishedAnswer is what place-unfinished answers. +type PlaceUnfinishedAnswer struct { + // one item per key that could not be put with all, empty with key; always present (design 47 H2 H-A-725) + Failed []PlaceUnfinishedAnswerFailedItem `json:"failed"` + // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). + Form int64 `json:"form,omitempty"` + // with key, the key of the pipeline the mover is put in; absent with all + Pipeline string `json:"pipeline,omitempty"` + // one item per key put with all, empty with key; always present (design 47 H2 H-A-725) + Placed []PlaceUnfinishedAnswerPlacedItem `json:"placed"` + // with all and no key in unfinished, that two empty lists are the answer (design 47 H2 H-A-725) + Said string `json:"said,omitempty"` +} + // AskAgainInput is what ask-again takes. type AskAgainInput struct { // the mover's module, so a pipeline of several movers is never ambiguous; a call naming none on a pipeline of one mover is taken as that mover (design 47 H-A-101) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go index f14ae4e43..9ca12a204 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -151,6 +151,12 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v StandsInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "show asked within a bound (H-A-709)", subject: "", given: "{\"bound\":65536,\"next\":\"cursor-1\",\"pipeline\":\"main.3589\"}", wire: "{\"bound\":65536,\"next\":\"cursor-1\",\"pipeline\":\"main.3589\"}", decode: func(b []byte) (any, error) { var v ShowInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "place-unfinished with all answers each key put and each that could not be (H-A-725)", subject: "", given: "{\"failed\":[{\"key\":\"main.gitea\",\"words\":\"its entry is not read\"}],\"placed\":[{\"key\":\"main.nats\",\"pipeline\":\"main.3589.unfinished.nats\"}]}", wire: "{\"failed\":[{\"key\":\"main.gitea\",\"words\":\"its entry is not read\"}],\"placed\":[{\"key\":\"main.nats\",\"pipeline\":\"main.3589.unfinished.nats\"}]}", + decode: func(b []byte) (any, error) { var v PlaceUnfinishedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "place-unfinished with all over no key answers two empty lists and says so (H-A-725)", subject: "", given: "{\"failed\":[],\"placed\":[],\"said\":\"no key in unfinished\"}", wire: "{\"failed\":[],\"placed\":[],\"said\":\"no key in unfinished\"}", + decode: func(b []byte) (any, error) { var v PlaceUnfinishedAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "place-unfinished with one key answers its pipeline", subject: "", given: "{\"failed\":[],\"pipeline\":\"main.3589.unfinished.nats\",\"placed\":[]}", wire: "{\"failed\":[],\"pipeline\":\"main.3589.unfinished.nats\",\"placed\":[]}", + decode: func(b []byte) (any, error) { var v PlaceUnfinishedAnswer; 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-pipeline-runner/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json index b3cb40dc0..27026dee0 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json @@ -434,5 +434,41 @@ "bound": 65536, "next": "cursor-1" } + }, + { + "name": "place-unfinished with all answers each key put and each that could not be (H-A-725)", + "of": "verb:place-unfinished.answer", + "given": { + "placed": [ + { + "key": "main.nats", + "pipeline": "main.3589.unfinished.nats" + } + ], + "failed": [ + { + "key": "main.gitea", + "words": "its entry is not read" + } + ] + } + }, + { + "name": "place-unfinished with all over no key answers two empty lists and says so (H-A-725)", + "of": "verb:place-unfinished.answer", + "given": { + "placed": [], + "failed": [], + "said": "no key in unfinished" + } + }, + { + "name": "place-unfinished with one key answers its pipeline", + "of": "verb:place-unfinished.answer", + "given": { + "pipeline": "main.3589.unfinished.nats", + "placed": [], + "failed": [] + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json index 9eb333c20..79e55f56d 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -639,7 +639,7 @@ }, { "name": "place-unfinished", - "description": "A mover kept in the state unfinished put in a pipeline of its own at once, keyed ..unfinished.; written in the hand-act log (design 47 H2 §786, H-A-398).", + "description": "A mover kept in the state unfinished put in a pipeline of its own at once, keyed ..unfinished.; written in the hand-act log (design 47 H2 §786, H-A-398). With all, each key of unfinished is put in a pipeline of its own; the answer names every pipeline put and every key that could not be (design 47 H2 H-A-725).", "input": { "type": "object", "properties": { @@ -665,11 +665,58 @@ "properties": { "pipeline": { "type": "string", - "description": "the key of the pipeline the mover is put in" + "description": "with key, the key of the pipeline the mover is put in; absent with all" + }, + "placed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "the unfinished entry's key" + }, + "pipeline": { + "type": "string", + "description": "the key of the pipeline the mover is put in" + } + }, + "required": [ + "key", + "pipeline" + ] + }, + "description": "one item per key put with all, empty with key; always present (design 47 H2 H-A-725)" + }, + "failed": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "the unfinished entry's key" + }, + "words": { + "type": "string", + "description": "why it could not be put" + } + }, + "required": [ + "key", + "words" + ] + }, + "description": "one item per key that could not be put with all, empty with key; always present (design 47 H2 H-A-725)" + }, + "said": { + "type": "string", + "description": "with all and no key in unfinished, that two empty lists are the answer (design 47 H2 H-A-725)" } }, "required": [ - "pipeline" + "placed", + "failed" ] }, "class": "act" diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts index f5989b3bf..5a9c9ac10 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -998,14 +998,34 @@ export interface PlaceUnfinishedInput { "why": string; } -/** is what place-unfinished answers. */ -export interface PlaceUnfinishedAnswer { - /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ - "form"?: number; +export interface PlaceUnfinishedAnswerFailedItem { + /** the unfinished entry's key */ + "key": string; + /** why it could not be put */ + "words": string; +} + +export interface PlaceUnfinishedAnswerPlacedItem { + /** the unfinished entry's key */ + "key": string; /** the key of the pipeline the mover is put in */ "pipeline": string; } +/** is what place-unfinished answers. */ +export interface PlaceUnfinishedAnswer { + /** one item per key that could not be put with all, empty with key; always present (design 47 H2 H-A-725) */ + "failed": PlaceUnfinishedAnswerFailedItem[]; + /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ + "form"?: number; + /** with key, the key of the pipeline the mover is put in; absent with all */ + "pipeline"?: string; + /** one item per key put with all, empty with key; always present (design 47 H2 H-A-725) */ + "placed": PlaceUnfinishedAnswerPlacedItem[]; + /** with all and no key in unfinished, that two empty lists are the answer (design 47 H2 H-A-725) */ + "said"?: string; +} + /** is what ask-again takes. */ export interface AskAgainInput { /** the mover's module, so a pipeline of several movers is never ambiguous; a call naming none on a pipeline of one mover is taken as that mover (design 47 H-A-101) */ From 25e9d71e1953e74a478659c04341ff5db2fb2486 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:10:42 +0100 Subject: [PATCH 08/44] X1 readme-checks: the README names the check main requires, the checker's mesh/check, and no merge-check.sh Builds: design 47 H2 H-A-676 (DQ-28) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a087d22cb..19b971acf 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,4 @@ Novox Mesh — delivery: the parts that build, check and deliver a change by watching and writing keys on the bus (ADR 0429). -Made by the mesh from the gitea module's config value `repositories` (novox/hq ADR 0428). Main takes no push: a change reaches it by a pull request whose `mesh/repo-check` (this repository's `merge-check.sh`) and `mesh/merge-gate` passed. +Made by the mesh from the gitea module's config value `repositories` (novox/hq ADR 0428). Main takes no push: a change reaches it by a pull request whose `mesh/check`, the checker's verdict, passed (ADR 0447 §1); this repository holds no `merge-check.sh`. From e0f69f73d3aac4dc74300cbae0eece460439b62f Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:10:55 +0100 Subject: [PATCH 09/44] K5 missing-reads-go: graph.MissingReads goes, with its rows Builds: design 47 H2 H-A-639 (DQ-1) --- modules/mesh-delivery-sdk/graph/graph_test.go | 19 ---------- modules/mesh-delivery-sdk/graph/reads.go | 37 ------------------- 2 files changed, 56 deletions(-) delete mode 100644 modules/mesh-delivery-sdk/graph/reads.go diff --git a/modules/mesh-delivery-sdk/graph/graph_test.go b/modules/mesh-delivery-sdk/graph/graph_test.go index 86fedf537..bbe5c7914 100644 --- a/modules/mesh-delivery-sdk/graph/graph_test.go +++ b/modules/mesh-delivery-sdk/graph/graph_test.go @@ -18,25 +18,6 @@ func TestGraphEdges(t *testing.T) { t.Run("a node's value", nodeValues) t.Run("a reader of the seat list waits for its holder", readersOfTheSeatList) t.Run("a verb is served by a running healthy have of the node-engine contract", servedByHaves) - // ADR 0636 §2, issue 1966: a need of a bootstrapped seat is read by every engine whatever its statement names; a seat - // not bootstrapped and a word stay missing, and an engine stating none is read as the baseline. - t.Run("a bootstrapped seat is read by every engine", func(t *testing.T) { - stated := []string{"word:claims", "word:invokes"} - for _, c := range []struct { - name string - needs, stated []string - want []string - }{ - {"mesh-catalog and node-backup", []string{"seat:mesh-catalog", "seat:node-backup", "word:invokes"}, stated, nil}, - {"a seat not bootstrapped", []string{"seat:mesh-catalog", "seat:mesh-vault"}, stated, []string{"seat:mesh-vault"}}, - {"a word", []string{"seat:node-engine", "word:zone"}, stated, []string{"word:zone"}}, - {"the baseline", []string{"seat:mesh-catalog", "form:seat-reach"}, nil, []string{"form:seat-reach"}}, - } { - if got := MissingReads(c.needs, c.stated); !slices.Equal(got, c.want) { - t.Errorf("%s: missing %v, want %v", c.name, got, c.want) - } - } - }) fp := "src2:" + strings.Repeat("b", 64) node := func(repository, path string, edit func(*Node)) Node { n := Node{FP: fp, Repository: repository, Path: path} diff --git a/modules/mesh-delivery-sdk/graph/reads.go b/modules/mesh-delivery-sdk/graph/reads.go deleted file mode 100644 index 1ac59974c..000000000 --- a/modules/mesh-delivery-sdk/graph/reads.go +++ /dev/null @@ -1,37 +0,0 @@ -package graph - -import ( - "slices" - "strings" - "sync" - - "git.novox.be/novox/mesh-sdk/go/catalogue" - "git.novox.be/novox/mesh-sdk/go/seatlist" -) - -// bootstrappedReads are the reader capabilities `seat:` of the bootstrapped seats: the embedded files' own, so -// computed once. -var bootstrappedReads = sync.OnceValue(func() []string { - var out []string - for _, d := range seatlist.Bootstrapped() { - out = append(out, catalogue.ReadSeat+d.Seat) - } - return out -}) - -// MissingReads is catalogue.MissingManifestReads with every need of a bootstrapped seat counted as read (novox/hq ADR 0614 -// §4, ADR 0636 §2): every reader of the seat list holds the bootstrapped seats from its start, before it has read the list, -// so a manifest naming one is read by every node-engine whatever its statement names. Without it an engine whose statement -// was made before its list was in use states no seat, and the node-engine's own build naming mesh-catalog is held on the -// very engine that would state it (issue 1966). The assigner's capability hold and the indexer's hold both judge with it, -// so the rule is one. -func MissingReads(needs, stated []string) []string { - boot := bootstrappedReads() - missing := slices.DeleteFunc(catalogue.MissingManifestReads(needs, stated), func(n string) bool { - return strings.HasPrefix(n, catalogue.ReadSeat) && slices.Contains(boot, n) - }) - if len(missing) == 0 { - return nil - } - return missing -} From 81bf6c7cc97bf04c06b9af4e584abbfefa08f24e Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:11:41 +0100 Subject: [PATCH 10/44] K1 stopping-goes: the kind stopping is read nowhere; PublishFault reads no responders as the transport fault Builds: design 47 H2 H-A-570 (3), H-A-624 (3), H-A-658 --- modules/mesh-delivery-sdk/buildstep/ask_test.go | 8 +++----- modules/mesh-delivery-sdk/buildstep/passing.go | 17 ++++------------- modules/mesh-delivery-sdk/steprun/again_test.go | 15 ++++----------- modules/mesh-delivery-sdk/steprun/publish.go | 6 +++--- 4 files changed, 14 insertions(+), 32 deletions(-) diff --git a/modules/mesh-delivery-sdk/buildstep/ask_test.go b/modules/mesh-delivery-sdk/buildstep/ask_test.go index 1a47f3500..188118cc9 100644 --- a/modules/mesh-delivery-sdk/buildstep/ask_test.go +++ b/modules/mesh-delivery-sdk/buildstep/ask_test.go @@ -561,11 +561,9 @@ func TestPauseCapacityAndComposerKey(t *testing.T) { if !IsPassing(fmt.Errorf("fetch: %w", &Passing{Err: errors.New("s")})) || IsPassing(errors.New("i/o timeout")) { t.Error("a wrapped Passing is a Passing error and a bare error is none") } - // A call a stopping tool runner did not take is passing by its typed fault, wrapped or not; its words alone, and a bare - // "timeout", are not (design 47 H2 H-A-542). - if !IsPassing(kindedFault("stopping")) || !IsPassing(fmt.Errorf("publish: %w", kindedFault("stopping"))) || - IsPassing(kindedFault("away")) || IsPassing(errors.New("the tool runner is stopping")) || IsPassing(errors.New("timeout")) { - t.Error("a stopping tool runner's fault is passing by its kind alone") + // H-A-570 (3): no fault kind makes a passing fault; only a Passing does, by its type, and words and a bare "timeout" are none. + if IsPassing(kindedFault("stopping")) || IsPassing(kindedFault("away")) || IsPassing(errors.New("the tool runner is stopping")) || IsPassing(errors.New("timeout")) { + t.Error("only a Passing is passing") } if Ended(Step{State: StepRunning}) || Ended(Step{State: StepAgain}) || !Ended(Step{State: StepPassed}) || !Ended(Step{State: StepFailed}) { t.Error("Ended: running and again are no end") diff --git a/modules/mesh-delivery-sdk/buildstep/passing.go b/modules/mesh-delivery-sdk/buildstep/passing.go index 4aafd08b0..fc11a9369 100644 --- a/modules/mesh-delivery-sdk/buildstep/passing.go +++ b/modules/mesh-delivery-sdk/buildstep/passing.go @@ -14,21 +14,12 @@ type Passing struct{ Err error } func (p *Passing) Error() string { return p.Err.Error() } func (p *Passing) Unwrap() error { return p.Err } -// IsPassing says err is, or wraps, a Passing, or a call a stopping tool runner did not take (errorKindStopping): the one -// place every step's fault reading counts stopping as passing, by its kind and never by its words (design 47 H2 H-A-542). +// IsPassing says err is, or wraps, a Passing: the one place every step's fault reading counts a fault as passing, by its +// type and never by its words. A call that met no responders is the build module's to wrap, as steprun.PublishFault does +// (design 47 H2 H-A-570 (3), H-A-658). func IsPassing(err error) bool { var p *Passing - return errors.As(err, &p) || stopping(err) -} - -// errorKindStopping is the typed fault a stopping tool runner answers each call it does not take with, mesh-sdk stdio's -// ErrorKindStopping (design 47 H2 H-A-542); this package reaches no bus, so it reads the kind by the error's ErrorKind. -const errorKindStopping = "stopping" - -// stopping says err is, or wraps, an error whose typed fault is stopping (ErrorKind() string). -func stopping(err error) bool { - var kinded interface{ ErrorKind() string } - return errors.As(err, &kinded) && kinded.ErrorKind() == errorKindStopping + return errors.As(err, &p) } // passingWords are the words of a network that did not answer, lower-cased: go's and git's (a lookup, a timeout, a refused or diff --git a/modules/mesh-delivery-sdk/steprun/again_test.go b/modules/mesh-delivery-sdk/steprun/again_test.go index 9e051373a..79b15cbb0 100644 --- a/modules/mesh-delivery-sdk/steprun/again_test.go +++ b/modules/mesh-delivery-sdk/steprun/again_test.go @@ -11,20 +11,12 @@ import ( sdkstep "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep" ) -// stoppingFault is a call a stopping tool runner did not take, as mesh-sdk's stdio hands it: its typed fault stopping. -type stoppingFault struct{} - -func (stoppingFault) Error() string { - return "registry's publish was not taken: the tool runner is stopping" -} -func (stoppingFault) ErrorKind() string { return "stopping" } - // Design 47 H2 §799: a fetch met by a forge's 401 or a connection fault, and a publish met by no responders or a bundle // that exited, end their run `again` after again-delays' delay, with no seat call; a third run's fault ends the step failed // with the why `fetch: ` or `publish: `. ADR 0664 §1 with the bus's count above the runs that started: an ask // given back twice before its first run (the bus says delivered 3, the step key 1 run began) meets its fault in run 2, -// given again after again-delays' second, 60 s, not 3. A publish met by a stopping tool runner is one too (H-A-542); a -// bare timeout is not. +// given again after again-delays' second, 60 s, not 3. A publish met by a stopping tool runner is met by no responders (H-A-570 (3)), so it +// is one too; a bare timeout is not. func TestAFetchOrAPublishMetAwayIsATransportFault(t *testing.T) { delay, err := AgainDelays("") if err != nil || delay(1) != 15*time.Second || delay(2) != time.Minute || delay(3) != time.Minute { @@ -47,7 +39,8 @@ func TestAFetchOrAPublishMetAwayIsATransportFault(t *testing.T) { {"a publish met by a bundle that exited", "publish: ", PublishFault(errors.New("the bundle exited"))}, {"a fetch of a commit that is not there", "", gitFailure("fetch", "fatal: unknown revision or path not in the working tree")}, {"a publish refused", "", PublishFault(errors.New("refused: the digest differs"))}, - {"a publish met by a stopping tool runner", "publish: ", PublishFault(fmt.Errorf("asked again: %w", stoppingFault{}))}, + {"a publish met by a stopping tool runner, no responders wrapped", "publish: ", PublishFault(fmt.Errorf("asked again: %w", errors.New("nats: no responders available for request")))}, + {"a publish met by a fault kinded stopping, which no code reads", "", PublishFault(errors.New("registry's publish was not taken: the tool runner is stopping"))}, {"a publish met by a bare timeout", "", PublishFault(errors.New("timeout"))}, } { t.Run(tc.name, func(t *testing.T) { diff --git a/modules/mesh-delivery-sdk/steprun/publish.go b/modules/mesh-delivery-sdk/steprun/publish.go index cbe6af466..a5141188a 100644 --- a/modules/mesh-delivery-sdk/steprun/publish.go +++ b/modules/mesh-delivery-sdk/steprun/publish.go @@ -82,8 +82,8 @@ func PublishParts(ctx context.Context, call SeatCall, seat string, in reg.Publis return sent, PublishFault(err) } -// PublishFault is err, or, when a publish met no responders, a registry's bundle that exited or a stopping tool runner (its -// typed fault stopping, which sdkstep.IsPassing counts, design 47 H2 H-A-542), a sdkstep.Passing whose words open with +// PublishFault is err, or, when a publish met no responders (a stopping tool runner's calls meet none, design 47 H2 H-A-570 +// (3)) or a registry's bundle that exited, a sdkstep.Passing whose words open with // "publish: " (design 47 H2 §799, ADR 0664 §1): the run ends `again`, with no seat call to learn why, and a third run's // fault ends the step failed with the why `publish: `. Any other error, a bare "timeout" among them, is returned as // it is. @@ -93,7 +93,7 @@ func PublishFault(err error) error { return err } words := strings.ToLower(err.Error()) - if !sdkstep.IsPassing(err) && !strings.Contains(words, "no responders") && !strings.Contains(words, "bundle exited") { + if !strings.Contains(words, "no responders") && !strings.Contains(words, "bundle exited") { return err } return &sdkstep.Passing{Err: fmt.Errorf("publish: %w", err)} From 423d06faac50a71ac3fa0535cf1d35ee73845d02 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:12:15 +0100 Subject: [PATCH 11/44] DC3b validate-verb: the seat mesh-wants gains the verb validate (form 4), the assigner's tool reaching the process Builds: design 47 H2 H-A-684 (1), H-A-702, H-A-727 --- .../go/seats/meshwants/contract.go | 74 ++++++++++++- .../go/seats/meshwants/contract_test.go | 6 ++ .../seats/mesh-wants/fixtures/verbs.json | 32 ++++++ .../seats/mesh-wants/seat.json | 102 +++++++++++++++++- .../ts/seats/meshwants/index.d.ts | 40 +++++++ .../ts/seats/meshwants/index.js | 1 + 6 files changed, 250 insertions(+), 5 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go b/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go index 4e95b05e3..ef6a8c8a0 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshwants/contract.go @@ -14,13 +14,13 @@ const Seat = "mesh-wants" // 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 = 3 +const Form = 4 // 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 = "3" - generatedFieldsDigest = "Ask=6cb8b82e2fbe AskTakenEvent=6d5d3da7ac39 AsksByAssignmentsProposalValue=0bb5682c7b3b AsksByBackupNodeModuleFingerprintValue=0bb5682c7b3b AsksByHoldModuleFingerprintValue=0bb5682c7b3b AsksByOutsideNodeModuleFingerprintValue=0bb5682c7b3b AsksByRecordNodeModuleDigestValue=0bb5682c7b3b AsksByRestoreNodeModuleFingerprintValue=0bb5682c7b3b AsksByRevertNodeModuleFingerprintValue=0bb5682c7b3b AssignmentEntry=7d2549782eb2 AssignmentRevision=72c8701f7314 AssignmentRevisionCapabilitiesItem=0c89b0717762 AssignmentRevisionEvent=7faff968ce44 AssignmentRevisionsByCandidateGroupHeadsValue=8553b390118d AssignmentRevisionsByEntryDigestValue=4e5ee7a23e5b AssignmentRevisionsByTrunkRevisionValue=8553b390118d BusAnswer=7538f2f5e68e CatalogOf=7a4646fdbea7 Change=28d1f3c5cd32 ChangeAfterItem=30d718c21581 CompositionReader=5a943c1f8ef1 CompositionRun=2a08fc65e2d0 CompositionRunProgram=5a1202df3497 CompositionRunWaits=9cd147ddfc06 CompositionsAnswer=f8bca93c7f9c CompositionsByGroupHeadsValue=9428965fab8f CompositionsDropAnswer=52803700282a Difference=4011cff516b1 DifferenceAnswer=629237aa39f0 DifferenceEvent=49066d0dff6d DifferenceRefusedItem=0e9caa83ace7 DifferencesByNodeModuleValue=a22487ffadfd DropAnswer=7538f2f5e68e Edge=a71709025a08 EntryAnswer=05adebad70d6 Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 Held=15abbd6a1a33 HeldCandidate=04872f6afbfa InputAnswer=cd41ee65565d KeepNowAnswer=9962ab9fc051 NodeEntryRef=3888ae847653 NotRunning=279b628db0ec PipelineWanted=e1e379c21e59 PipelineWantedEvent=59946b31ab7d PolicyChangedEvent=7538f2f5e68e RevisionAnswer=39002c770cbd RoomEvent=5bd4df78ed84 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=edd08ab1a18b StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=b975f402601a UpgradeAnswer=7538f2f5e68e Wait=951500be820c WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 WantedEvent=58cf7a9f646b WantsByHeldModuleFingerprintValue=ff14aa998a5d WantsByWantNodeModuleValue=ab7c6799fd5d WantsByWantNodeNodeValue=a737a2108d53" + generatedForms = "4" + generatedFieldsDigest = "Ask=6cb8b82e2fbe AskTakenEvent=6d5d3da7ac39 AsksByAssignmentsProposalValue=0bb5682c7b3b AsksByBackupNodeModuleFingerprintValue=0bb5682c7b3b AsksByHoldModuleFingerprintValue=0bb5682c7b3b AsksByOutsideNodeModuleFingerprintValue=0bb5682c7b3b AsksByRecordNodeModuleDigestValue=0bb5682c7b3b AsksByRestoreNodeModuleFingerprintValue=0bb5682c7b3b AsksByRevertNodeModuleFingerprintValue=0bb5682c7b3b AssignmentEntry=7d2549782eb2 AssignmentRevision=72c8701f7314 AssignmentRevisionCapabilitiesItem=0c89b0717762 AssignmentRevisionEvent=7faff968ce44 AssignmentRevisionsByCandidateGroupHeadsValue=8553b390118d AssignmentRevisionsByEntryDigestValue=4e5ee7a23e5b AssignmentRevisionsByTrunkRevisionValue=8553b390118d BusAnswer=7538f2f5e68e CatalogOf=7a4646fdbea7 Change=28d1f3c5cd32 ChangeAfterItem=30d718c21581 CompositionReader=5a943c1f8ef1 CompositionRun=2a08fc65e2d0 CompositionRunProgram=5a1202df3497 CompositionRunWaits=9cd147ddfc06 CompositionsAnswer=f8bca93c7f9c CompositionsByGroupHeadsValue=9428965fab8f CompositionsDropAnswer=52803700282a Difference=4011cff516b1 DifferenceAnswer=629237aa39f0 DifferenceEvent=49066d0dff6d DifferenceRefusedItem=0e9caa83ace7 DifferencesByNodeModuleValue=a22487ffadfd DropAnswer=7538f2f5e68e Edge=a71709025a08 EntryAnswer=05adebad70d6 Fill=80f442916429 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 Held=15abbd6a1a33 HeldCandidate=04872f6afbfa InputAnswer=cd41ee65565d KeepNowAnswer=9962ab9fc051 NodeEntryRef=3888ae847653 NotRunning=279b628db0ec PipelineWanted=e1e379c21e59 PipelineWantedEvent=59946b31ab7d PolicyChangedEvent=7538f2f5e68e RevisionAnswer=39002c770cbd RoomEvent=5bd4df78ed84 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 StepAccept=18efeefb6c34 StepEnded=edd08ab1a18b StepEndedEvent=207787118dac StepProgressEvent=8215e490ea8d StepRun=b975f402601a UpgradeAnswer=7538f2f5e68e ValidateAnswer=484ec1cfda14 ValidateAnswerProblemsItem=728518b4dc83 Wait=951500be820c WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 WantedEvent=58cf7a9f646b WantsByHeldModuleFingerprintValue=ff14aa998a5d WantsByWantNodeModuleValue=ab7c6799fd5d WantsByWantNodeNodeValue=a737a2108d53" ) const ( @@ -32,6 +32,7 @@ const ( VerbInput = "input" VerbCompositions = "compositions" VerbCompositionsDrop = "compositions-drop" + VerbValidate = "validate" VerbKeepNow = "keep-now" VerbDrop = "drop" ) @@ -58,7 +59,7 @@ const ( // Verbs is every verb the seat serves, in its definition's order: a new copy each call. func Verbs() []string { - return []string{VerbUpgrade, VerbBus, VerbRevision, VerbEntry, VerbDifference, VerbInput, VerbCompositions, VerbCompositionsDrop, VerbKeepNow, VerbDrop} + return []string{VerbUpgrade, VerbBus, VerbRevision, VerbEntry, VerbDifference, VerbInput, VerbCompositions, VerbCompositionsDrop, VerbValidate, VerbKeepNow, VerbDrop} } // VerbDescription is a verb's description as the seat's definition says it, "" for a verb the seat does not serve or @@ -81,6 +82,8 @@ func VerbDescription(verb string) string { return "Each composition run the assigner keeps (design 47 G §728): its program, input digest, ask, readers, outcome and verdict, and the state's fill against its cap; with candidate or machine, only those." case VerbCompositionsDrop: return "Drop one composition run by hand (design 47 G §728): the act and why are written in the hand-act log first, then the run's ask is dropped, each reader ended could not run naming the drop, and the key deleted." + case VerbValidate: + return "Judge a pipeline's candidate on request, the manifest validator's verdict of its manifests: the act and why are written in the hand-act log first, then the candidate's validate run, keyed .validate, is joined or started with the step's own code, so a validate step asked later joins it and builds no second manifest validator. It answers the run as it stands: running with its start, or its end: passed; failed cycle naming the cycle; failed manifest-refused with every problem per manifest, those counted and those the case before holds too; could-not-run with why. It writes no want and ends no step (design 47 H2 H-A-684 (1), H-A-702, H-A-727)." case VerbKeepNow: return "Keep the assignment graph's revisions now, by hand (design 47 H2 §813 (2); H-A-417): written in the hand-act log first by the module's tool assigner_keep_now, then the keeping runs at once on the pass's newest computed revision; answers the revision kept, or the fault the keeping met." case VerbDrop: @@ -1287,6 +1290,60 @@ type CompositionsDropAnswer struct { Run CompositionRun `json:"run"` } +// ValidateInput is what validate takes. +type ValidateInput struct { + // the candidate's key as mesh-pipeline-runner.show names it: ., or run- for a run on request + Candidate string `json:"candidate,omitempty"` + // narrows the answer to this module's manifest + Module string `json:"module,omitempty"` + // a pipeline's key as the runner names it, a delivering pipeline's or a run on request's + Pipeline string `json:"pipeline"` + // why, written with the caller the runtime proves in the hand-act log + Why string `json:"why"` +} + +// ValidateAnswerProblemsItem is a type of the contract. +type ValidateAnswerProblemsItem struct { + // the case before holds it too, so the candidate does not cause it + Before bool `json:"before"` + Module string `json:"module"` + Problem string `json:"problem"` +} + +// ValidateAnswer is what validate answers. +type ValidateAnswer struct { + // for failed cycle, the artifacts the cycle passes through + Cycle []string `json:"cycle,omitempty"` + // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). + Form int64 `json:"form,omitempty"` + // the run's state: running, or its end + Outcome string `json:"outcome"` + // for failed manifest-refused, every problem per manifest, those counted and those the case before holds too + Problems []ValidateAnswerProblemsItem `json:"problems,omitempty"` + // for failed, which + Reason string `json:"reason,omitempty"` + // the validate run as it stands + Run *CompositionRun `json:"run,omitempty"` + // when the run started, while it runs + Started *time.Time `json:"started,omitempty"` + // for could-not-run, why + Why string `json:"why,omitempty"` +} + +// The values of ValidateAnswer's outcome. +const ( + ValidateAnswerOutcomeRunning = "running" + ValidateAnswerOutcomePassed = "passed" + ValidateAnswerOutcomeFailed = "failed" + ValidateAnswerOutcomeCouldNotRun = "could-not-run" +) + +// The values of ValidateAnswer's reason. +const ( + ValidateAnswerReasonCycle = "cycle" + ValidateAnswerReasonManifestRefused = "manifest-refused" +) + // KeepNowInput is what keep-now takes. type KeepNowInput struct { // why the keeping runs now @@ -1614,6 +1671,15 @@ func DecodeCompositionsDropAnswer(raw []byte) (CompositionsDropAnswer, int, erro return v, formRead(raw), nil } +// DecodeValidateAnswer reads a ValidateAnswer 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 DecodeValidateAnswer(raw []byte) (ValidateAnswer, int, error) { + var v ValidateAnswer + if err := json.Unmarshal(raw, &v); err != nil { + return v, 0, err + } + return v, formRead(raw), nil +} + // DecodeKeepNowAnswer reads a KeepNowAnswer 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 DecodeKeepNowAnswer(raw []byte) (KeepNowAnswer, int, error) { var v KeepNowAnswer diff --git a/modules/mesh-delivery-contracts/go/seats/meshwants/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshwants/contract_test.go index 0dd21ea75..65f7e3ece 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshwants/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshwants/contract_test.go @@ -163,6 +163,12 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v CompositionsDropInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "C1 compositions-drop answers the run it deleted and the readers it ended", subject: "", given: "{\"ended\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"run\":{\"ask\":\"r1a2b3\",\"candidate\":\"main.12\",\"ended\":\"2026-11-17T10:03:00Z\",\"input\":\"sha256:0123\",\"key\":\"main.12.anchor\",\"machine\":\"anchor\",\"outcome\":\"passed\",\"program\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"directory\":\"cmd/mesh-compose\",\"fingerprint\":\"src2:aaaa\",\"repository\":\"novox/mesh-host\"},\"readers\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"started\":\"2026-11-17T10:00:00Z\",\"verdict\":{\"blamed\":[],\"composes\":true}}}", wire: "{\"ended\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"run\":{\"ask\":\"r1a2b3\",\"candidate\":\"main.12\",\"ended\":\"2026-11-17T10:03:00Z\",\"input\":\"sha256:0123\",\"key\":\"main.12.anchor\",\"machine\":\"anchor\",\"outcome\":\"passed\",\"program\":{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"directory\":\"cmd/mesh-compose\",\"fingerprint\":\"src2:aaaa\",\"repository\":\"novox/mesh-host\"},\"readers\":[{\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"id\":\"m2kx9a1b3c4d6c\",\"module\":\"nats\",\"pipeline\":\"main.12.nats\",\"revision\":12,\"step\":\"composition\"}],\"started\":\"2026-11-17T10:00:00Z\",\"verdict\":{\"blamed\":[],\"composes\":true}}}", decode: func(b []byte) (any, error) { var v CompositionsDropAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "validate asked for a pipeline's candidate", subject: "", given: "{\"candidate\":\"main.12\",\"pipeline\":\"main.3589\",\"why\":\"a manifest changed by a fix has no verdict before its merge\"}", wire: "{\"candidate\":\"main.12\",\"pipeline\":\"main.3589\",\"why\":\"a manifest changed by a fix has no verdict before its merge\"}", + decode: func(b []byte) (any, error) { var v ValidateInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "validate answers a failed run naming a problem the case before holds too", subject: "", given: "{\"outcome\":\"failed\",\"problems\":[{\"before\":true,\"module\":\"nats\",\"problem\":\"a state asks more than 64 MiB\"}],\"reason\":\"manifest-refused\"}", wire: "{\"outcome\":\"failed\",\"problems\":[{\"before\":true,\"module\":\"nats\",\"problem\":\"a state asks more than 64 MiB\"}],\"reason\":\"manifest-refused\"}", + decode: func(b []byte) (any, error) { var v ValidateAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "validate answers a run still running", subject: "", given: "{\"outcome\":\"running\",\"started\":\"2026-11-25T17:00:00Z\"}", wire: "{\"outcome\":\"running\",\"started\":\"2026-11-25T17:00:00Z\"}", + decode: func(b []byte) (any, error) { var v ValidateAnswer; 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-wants/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/mesh-wants/fixtures/verbs.json index 2c09da7a1..81a49b30f 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-wants/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/mesh-wants/fixtures/verbs.json @@ -296,5 +296,37 @@ } ] } + }, + { + "name": "validate asked for a pipeline's candidate", + "of": "verb:validate.input", + "given": { + "pipeline": "main.3589", + "candidate": "main.12", + "why": "a manifest changed by a fix has no verdict before its merge" + } + }, + { + "name": "validate answers a failed run naming a problem the case before holds too", + "of": "verb:validate.answer", + "given": { + "outcome": "failed", + "reason": "manifest-refused", + "problems": [ + { + "module": "nats", + "problem": "a state asks more than 64 MiB", + "before": true + } + ] + } + }, + { + "name": "validate answers a run still running", + "of": "verb:validate.answer", + "given": { + "outcome": "running", + "started": "2026-11-25T17:00:00Z" + } } ] diff --git a/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json b/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json index a2245fc2f..8bb9622bf 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-wants/seat.json @@ -278,6 +278,106 @@ ] } }, + { + "name": "validate", + "class": "act", + "description": "Judge a pipeline's candidate on request, the manifest validator's verdict of its manifests: the act and why are written in the hand-act log first, then the candidate's validate run, keyed .validate, is joined or started with the step's own code, so a validate step asked later joins it and builds no second manifest validator. It answers the run as it stands: running with its start, or its end: passed; failed cycle naming the cycle; failed manifest-refused with every problem per manifest, those counted and those the case before holds too; could-not-run with why. It writes no want and ends no step (design 47 H2 H-A-684 (1), H-A-702, H-A-727).", + "input": { + "type": "object", + "properties": { + "pipeline": { + "type": "string", + "description": "a pipeline's key as the runner names it, a delivering pipeline's or a run on request's" + }, + "module": { + "type": "string", + "description": "narrows the answer to this module's manifest" + }, + "candidate": { + "type": "string", + "description": "the candidate's key as mesh-pipeline-runner.show names it: ., or run- for a run on request" + }, + "why": { + "type": "string", + "description": "why, written with the caller the runtime proves in the hand-act log" + } + }, + "required": [ + "pipeline", + "why" + ] + }, + "answer": { + "type": "object", + "properties": { + "run": { + "$ref": "#/defs/CompositionRun", + "description": "the validate run as it stands" + }, + "outcome": { + "type": "string", + "enum": [ + "running", + "passed", + "failed", + "could-not-run" + ], + "description": "the run's state: running, or its end" + }, + "started": { + "type": "string", + "format": "date-time", + "description": "when the run started, while it runs" + }, + "reason": { + "type": "string", + "enum": [ + "cycle", + "manifest-refused" + ], + "description": "for failed, which" + }, + "cycle": { + "type": "array", + "items": { + "type": "string" + }, + "description": "for failed cycle, the artifacts the cycle passes through" + }, + "problems": { + "type": "array", + "items": { + "type": "object", + "properties": { + "module": { + "type": "string" + }, + "problem": { + "type": "string" + }, + "before": { + "type": "boolean", + "description": "the case before holds it too, so the candidate does not cause it" + } + }, + "required": [ + "module", + "problem", + "before" + ] + }, + "description": "for failed manifest-refused, every problem per manifest, those counted and those the case before holds too" + }, + "why": { + "type": "string", + "description": "for could-not-run, why" + } + }, + "required": [ + "outcome" + ] + } + }, { "name": "keep-now", "description": "Keep the assignment graph's revisions now, by hand (design 47 H2 §813 (2); H-A-417): written in the hand-act log first by the module's tool assigner_keep_now, then the keeping runs at once on the pass's newest computed revision; answers the revision kept, or the fault the keeping met.", @@ -1910,5 +2010,5 @@ "on": "every" } ], - "form": 3 + "form": 4 } diff --git a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts index 357099d37..41e5b3bd7 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.d.ts @@ -13,6 +13,7 @@ export declare const verbs: { readonly input: "input"; readonly compositions: "compositions"; readonly compositionsDrop: "compositions-drop"; + readonly validate: "validate"; readonly keepNow: "keep-now"; readonly drop: "drop"; }; @@ -685,6 +686,45 @@ export interface CompositionsDropAnswer { "run": CompositionRun; } +/** is what validate takes. */ +export interface ValidateInput { + /** the candidate's key as mesh-pipeline-runner.show names it: ., or run- for a run on request */ + "candidate"?: string; + /** narrows the answer to this module's manifest */ + "module"?: string; + /** a pipeline's key as the runner names it, a delivering pipeline's or a run on request's */ + "pipeline": string; + /** why, written with the caller the runtime proves in the hand-act log */ + "why": string; +} + +export interface ValidateAnswerProblemsItem { + /** the case before holds it too, so the candidate does not cause it */ + "before": boolean; + "module": string; + "problem": string; +} + +/** is what validate answers. */ +export interface ValidateAnswer { + /** for failed cycle, the artifacts the cycle passes through */ + "cycle"?: string[]; + /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ + "form"?: number; + /** the run's state: running, or its end */ + "outcome": "running" | "passed" | "failed" | "could-not-run"; + /** for failed manifest-refused, every problem per manifest, those counted and those the case before holds too */ + "problems"?: ValidateAnswerProblemsItem[]; + /** for failed, which */ + "reason"?: "cycle" | "manifest-refused"; + /** the validate run as it stands */ + "run"?: CompositionRun; + /** when the run started, while it runs */ + "started"?: string; + /** for could-not-run, why */ + "why"?: string; +} + /** is what keep-now takes. */ export interface KeepNowInput { /** why the keeping runs now */ diff --git a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js index 94fb35ed8..0fc1c5010 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js +++ b/modules/mesh-delivery-contracts/ts/seats/meshwants/index.js @@ -13,6 +13,7 @@ export const verbs = { input: "input", compositions: "compositions", compositionsDrop: "compositions-drop", + validate: "validate", keepNow: "keep-now", drop: "drop", }; From 899d6ac0e36664a69957e4359581e4f2f5383289 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:12:50 +0100 Subject: [PATCH 12/44] K2 again-delays: the default is 15s,90s, whose sum spans the tool runner's restart Builds: design 47 H2 H-A-603 --- modules/mesh-delivery-sdk/steprun/again.go | 5 ++--- modules/mesh-delivery-sdk/steprun/again_test.go | 10 +++++----- modules/mesh-delivery-sdk/steprun/pull_test.go | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/mesh-delivery-sdk/steprun/again.go b/modules/mesh-delivery-sdk/steprun/again.go index 7dbe6e0b3..22c5867ac 100644 --- a/modules/mesh-delivery-sdk/steprun/again.go +++ b/modules/mesh-delivery-sdk/steprun/again.go @@ -8,11 +8,10 @@ import ( // AgainDelaysSetting is the setting each build module declares for the delay it passes with a run's `again` (design 47 // H2 §799): how long the bus waits before it gives an ask again after its first, then its second run ended on a -// transport fault, as Go durations separated by commas. DefaultAgainDelays is its default, so three runs span a -// one-minute absence of a holder. +// transport fault, as Go durations separated by commas. DefaultAgainDelays is its default, so three runs span the tool runner's restart, 105 s (design 47 H2 H-A-603). const ( AgainDelaysSetting = "again-delays" - DefaultAgainDelays = "15s,60s" + DefaultAgainDelays = "15s,90s" ) // AgainDelays reads the setting again-delays into a Puller's Delay (§799): the run-th delay of the list, its last for a diff --git a/modules/mesh-delivery-sdk/steprun/again_test.go b/modules/mesh-delivery-sdk/steprun/again_test.go index 79b15cbb0..52ad99700 100644 --- a/modules/mesh-delivery-sdk/steprun/again_test.go +++ b/modules/mesh-delivery-sdk/steprun/again_test.go @@ -15,11 +15,11 @@ import ( // that exited, end their run `again` after again-delays' delay, with no seat call; a third run's fault ends the step failed // with the why `fetch: ` or `publish: `. ADR 0664 §1 with the bus's count above the runs that started: an ask // given back twice before its first run (the bus says delivered 3, the step key 1 run began) meets its fault in run 2, -// given again after again-delays' second, 60 s, not 3. A publish met by a stopping tool runner is met by no responders (H-A-570 (3)), so it +// given again after again-delays' second, 90 s, not 3. A publish met by a stopping tool runner is met by no responders (H-A-570 (3)), so it // is one too; a bare timeout is not. func TestAFetchOrAPublishMetAwayIsATransportFault(t *testing.T) { delay, err := AgainDelays("") - if err != nil || delay(1) != 15*time.Second || delay(2) != time.Minute || delay(3) != time.Minute { + if err != nil || delay(1) != 15*time.Second || delay(2) != 90*time.Second || delay(3) != 90*time.Second { t.Fatalf("the default again-delays: %v", err) } if own, err := AgainDelays("2s, 5s"); err != nil || own(1) != 2*time.Second || own(2) != 5*time.Second { @@ -53,7 +53,7 @@ func TestAFetchOrAPublishMetAwayIsATransportFault(t *testing.T) { if !sdkstep.IsPassing(tc.err) || !strings.HasPrefix(tc.err.Error(), tc.why) { t.Fatalf("%v: want a transport fault opening with %q", tc.err, tc.why) } - // Its first run ends again after 15 s; its second, delivered three times, again after 60 s; its third ends the step failed. + // Its first run ends again after 15 s; its second, delivered three times, again after 90 s; its third ends the step failed. for _, run := range []struct { prior int delivered uint64 @@ -78,8 +78,8 @@ func TestAFetchOrAPublishMetAwayIsATransportFault(t *testing.T) { if prior == 0 && (s.State != sdkstep.StepAgain || len(delays) != 1 || delays[0] != 15*time.Second) { t.Errorf("the first run: step %+v, delays %v, want again after 15s", s, delays) } - if prior == 1 && (s.State != sdkstep.StepAgain || s.Run != 2 || len(delays) != 1 || delays[0] != time.Minute) { - t.Errorf("the second run, delivered %d times: step %+v, delays %v, want again in run 2 after 60s", run.delivered, s, delays) + if prior == 1 && (s.State != sdkstep.StepAgain || s.Run != 2 || len(delays) != 1 || delays[0] != 90*time.Second) { + t.Errorf("the second run, delivered %d times: step %+v, delays %v, want again in run 2 after 90s", run.delivered, s, delays) } if prior == 2 && (s.State != sdkstep.StepFailed || !strings.HasPrefix(s.Reason, tc.why)) { t.Errorf("the third run: step %+v, want failed with the why %q", s, tc.why) diff --git a/modules/mesh-delivery-sdk/steprun/pull_test.go b/modules/mesh-delivery-sdk/steprun/pull_test.go index 4c7af288c..df75fba3b 100644 --- a/modules/mesh-delivery-sdk/steprun/pull_test.go +++ b/modules/mesh-delivery-sdk/steprun/pull_test.go @@ -569,7 +569,7 @@ func TestAPoisonedAskIsSaidAndRunNoMore(t *testing.T) { ackedOnly bool }{ {"a transport fault in run 1", 1, &sdkstep.Passing{Err: errors.New("lookup proxy: i/o timeout")}, sdkstep.StepAgain, 15 * time.Second, true, false}, - {"a transport fault in run 2", 2, &sdkstep.Passing{Err: errors.New("lookup proxy: i/o timeout")}, sdkstep.StepAgain, time.Minute, true, false}, + {"a transport fault in run 2", 2, &sdkstep.Passing{Err: errors.New("lookup proxy: i/o timeout")}, sdkstep.StepAgain, 90 * time.Second, true, false}, {"a transport fault in the last run", sdkstep.AskRuns, &sdkstep.Passing{Err: errors.New("lookup proxy: i/o timeout")}, sdkstep.StepFailed, 0, true, true}, {"a compile error in run 1", 1, errors.New("undefined: x"), sdkstep.StepFailed, 0, false, true}, } { From 0239cf3ac4513325aca5a0a7d2f18e6e37333bb8 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:13:55 +0100 Subject: [PATCH 13/44] DC6b: the indexer's take-in test names pipeline-started's movers as StartedMover Builds: design 47 H2 H-A-709 (3) --- .../cmd/mesh-delivery-indexer/takein_integration_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go index f15db48e4..9650b2a6f 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go @@ -357,7 +357,7 @@ func sayPipeline(t *testing.T, ctx context.Context, js jetstream.JetStream, ende pipeline := b + "." + s if !ended { raw, _ := json.Marshal(meshpipelinerunner.PipelineStarted{V: 1, Pipeline: pipeline, Branch: branch, Source: source, Revision: source, - Movers: []meshpipelinerunner.Mover{{Module: "avahi", Tier: 1}}}) + Movers: []meshpipelinerunner.StartedMover{{Module: "avahi", Tier: 1}}}) if _, err := js.Publish(ctx, meshpipelinerunner.SubjectPipelineStarted(b, s), raw); err != nil { t.Fatal(err) } From de7110032bf29d82a467f0c16a7d216bf52762b7 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:13:55 +0100 Subject: [PATCH 14/44] I14 indexer-tools-comment: the package comment names only what the package serves Builds: design 47 H2 H-A-684 (3) --- .../cmd/mesh-delivery-indexer-tools/main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go index dfa7d8439..0945d469d 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go @@ -1,7 +1,6 @@ // Command mesh-delivery-indexer-tools serves the indexer's tools (novox/hq issue 1945): the runtime launches it for a // call. A hand act writes one value of the indexer's takeins state and waits for the indexer's answer there. The -// indexer is the other program: it serves no request subject (ADR 0437 §4); indexer_judge asks the same way, and -// indexer_verdicts reads the indexer's verdicts state. The read tools of the indexer's states are +// indexer is the other program: it serves no request subject (ADR 0437 §4). The read tools of the indexer's states are // mesh-delivery-view's (indexer_module, indexer_modules, indexer_candidate, indexer_candidates). package main @@ -28,7 +27,7 @@ import ( // asker writes a takeins value and waits for the indexer's answer to it. type asker func(key string, value []byte) (index.TakeInAsk, error) -// Tools are the indexer's tools. read is the indexer's state of verdicts, which indexer_verdicts reads; counts the old sections' count. +// Tools are the indexer's tools. counts is the old sections' count. func Tools(ask asker, now func() time.Time, counts func() (index.OldSectionsCount, error), acts meshhandactsclient.Recorder) []stdio.Tool { str := func(args map[string]any, k string) string { s, _ := args[k].(string); return strings.TrimSpace(s) } return []stdio.Tool{ From 661203451fc07f33e6ce7e974b431f84910ff460 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:13:55 +0100 Subject: [PATCH 15/44] I13 state-cap-64: a state's max-mib is at most 64 Builds: design 47 H2 H-A-678, H-A-694 --- modules/mesh-delivery-indexer/judge/busstate.go | 8 ++++++-- modules/mesh-delivery-indexer/judge/busstate_test.go | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-indexer/judge/busstate.go b/modules/mesh-delivery-indexer/judge/busstate.go index b287c2676..28a0900c5 100644 --- a/modules/mesh-delivery-indexer/judge/busstate.go +++ b/modules/mesh-delivery-indexer/judge/busstate.go @@ -40,6 +40,9 @@ type busTemplate struct { fixed string } +// stateMostMiB is the most a state entry's bucket holds, ADR 0690 §1 (design 47 H2 H-A-678, H-A-694). +const stateMostMiB = 64 + // busTemplates are the six templates of design 25 § 12.1 and the bounds of its table. var busTemplates = map[string]busTemplate{ catalogue.TemplateState: { @@ -50,8 +53,9 @@ var busTemplates = map[string]busTemplate{ catalogue.OptionTimeToLive: {kind: optionInt, least: 1, most: 315360000}, catalogue.OptionLifetimePerKey: {kind: optionFlag}, catalogue.OptionPerMachine: {kind: optionFlag}, - // A-277: a state's cap is an option of its template, read as the old state section reads it. - catalogue.OptionCapMiB: {kind: optionInt, least: catalogue.ObjectsLeastMiB, most: catalogue.ObjectsMostMiB}, + // A-277: a state's cap is an option of its template, read as the old state section reads it; ADR 0690 §1 keeps + // its bucket at 64 MiB at most (design 47 H2 H-A-678, H-A-694). + catalogue.OptionCapMiB: {kind: optionInt, least: catalogue.ObjectsLeastMiB, most: stateMostMiB}, // A-314: the cap of the state's own objects store `-objects`, an integer above zero. catalogue.OptionObjectsCapMiB: {kind: optionInt, least: catalogue.ObjectsLeastMiB, most: catalogue.ObjectsMostMiB}, }, diff --git a/modules/mesh-delivery-indexer/judge/busstate_test.go b/modules/mesh-delivery-indexer/judge/busstate_test.go index 6c526d7b9..973dee8c9 100644 --- a/modules/mesh-delivery-indexer/judge/busstate_test.go +++ b/modules/mesh-delivery-indexer/judge/busstate_test.go @@ -64,7 +64,8 @@ func TestBusStateIsJudgedOnce(t *testing.T) { {"objects without a cap", manifest(`{"name":"x","storage":"object-store","template":"objects"}`), []string{"\"x\"", "\"max-mib\" is missing"}}, {"when full given as an option", manifest(`{"name":"x","storage":"stream","template":"log","options":{"when-full":"drop-oldest"}}`), []string{"\"x\"", "\"when-full\"", "fixed"}}, // A-277: a state's max-mib is an option of its template; an approvals state is §677's (key-ttl, 48 hours, at most 64 MiB). - {"a state capped at 256 MiB", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"max-mib":256}}`), nil}, + {"a state capped at 64 MiB (H-A-678)", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"max-mib":64}}`), nil}, + {"a state capped at 65 MiB (H-A-678, H-A-694)", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"max-mib":65}}`), []string{"\"x\"", "\"max-mib\" is 65"}}, {"a state cap over 8192", manifest(`{"name":"x","storage":"key-value","template":"state","options":{"max-mib":8193}}`), []string{"\"x\"", "\"max-mib\" is 8193"}}, {"an approvals state as §677 declares it", manifest(`{"name":"approvals","storage":"key-value","template":"state","options":{"key-ttl":true,"ttl-seconds":172800,"max-mib":64}}`), nil}, {"an approvals state with the default cap", manifest(`{"name":"approvals","storage":"key-value","template":"state","options":{"key-ttl":true,"ttl-seconds":172800}}`), nil}, From a58daa9cf7d827978466d94306001702652b94b7 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:14:30 +0100 Subject: [PATCH 16/44] I16 mesh-fingerprint-refused: a manifest naming MESH_FINGERPRINT in any env is refused Builds: design 47 H2 H-A-710 (1) --- modules/mesh-delivery-indexer/judge/rules.go | 31 +++++++++++++++++++ .../mesh-delivery-indexer/judge/rules_test.go | 5 +++ 2 files changed, 36 insertions(+) diff --git a/modules/mesh-delivery-indexer/judge/rules.go b/modules/mesh-delivery-indexer/judge/rules.go index 626421989..b43ab69b9 100644 --- a/modules/mesh-delivery-indexer/judge/rules.go +++ b/modules/mesh-delivery-indexer/judge/rules.go @@ -2839,6 +2839,8 @@ func parseManifest(raw []byte, predefined catalogue.PredefinedList) (catalogue.M problems = append(problems, ConfigLinesProblems(m)...) // And the node's name, which the node-engine sets in every process's env itself (design 47 G A-342). problems = append(problems, NodeEnvProblems(m)...) + // And the build's fingerprint, which the node-engine hands a service itself (design 47 H2 H-A-710 (1)). + problems = append(problems, FingerprintEnvProblems(m)...) // And what it requires optionally, and the files it delivers only while bound (novox/hq ADR 0330). problems = append(problems, OptionalProblems(m)...) // And which setting keys each mergeable file takes (setting_takes.go, novox/hq ADR 0326). @@ -4205,6 +4207,35 @@ func NodeEnvProblems(m catalogue.Manifest) []string { return problems } +// FingerprintEnv is the variable the node-engine sets to the want's fingerprint in a service's env (design 47 H2 H-A-710 +// (1)): a manifest naming it in any env, a container's, a daemon's or a bundle's, is refused. +const FingerprintEnv = "MESH_FINGERPRINT" + +// FingerprintEnvProblems are the resources and bundles whose env names FingerprintEnv: "MESH_FINGERPRINT is the +// node-engine's to hand". +func FingerprintEnvProblems(m catalogue.Manifest) []string { + var problems []string + say := func(what string) { + problems = append(problems, fmt.Sprintf("%s's %s names %s in its env: %s is the node-engine's to hand (design 47 H2 H-A-710)", + m.Module, what, FingerprintEnv, FingerprintEnv)) + } + for _, r := range m.Resources { + if env, ok := r["env"].(map[string]any); ok { + if _, names := env[FingerprintEnv]; names { + say(fmt.Sprintf("resource %v", r["id"])) + } + } + } + if m.Build != nil { + for _, a := range m.Build.Artifacts { + if _, names := a.Env[FingerprintEnv]; names { + say(fmt.Sprintf("artifact %q", a.Name)) + } + } + } + return problems +} + func filepathDir(p string) string { if i := strings.LastIndex(p, "/"); i > 0 { return p[:i] diff --git a/modules/mesh-delivery-indexer/judge/rules_test.go b/modules/mesh-delivery-indexer/judge/rules_test.go index 4610f9f92..cb1e6aaea 100644 --- a/modules/mesh-delivery-indexer/judge/rules_test.go +++ b/modules/mesh-delivery-indexer/judge/rules_test.go @@ -2529,6 +2529,11 @@ func caseAProcessBusNamesOnlyTheModulesOwn(t *testing.T) { if _, err := ParseManifest([]byte(ownNode)); err == nil || !strings.Contains(err.Error(), "MESH_NODE") { t.Errorf("a process setting MESH_NODE itself: %v; want a refusal naming MESH_NODE", err) } + // Design 47 H2 H-A-710 (1): a resource naming MESH_FINGERPRINT in its env is refused with the node-engine's-to-hand problem. + ownFingerprint := strings.Replace(mailSenderProcessManifest(t, ""), `"user":"mesh-mail-send"}`, `"user":"mesh-mail-send","env":{"MESH_FINGERPRINT":"x"}}`, 1) + if _, err := ParseManifest([]byte(ownFingerprint)); err == nil || !strings.Contains(err.Error(), "MESH_FINGERPRINT is the node-engine's to hand") { + t.Errorf("a process naming MESH_FINGERPRINT itself: %v; want a refusal saying it is the node-engine's to hand", err) + } // Design 47 G A-340: an event the module consumes, its process may hear. consumed := strings.Replace(mailSenderProcessManifest(t, `{"consumes":["billing.paid"]}`), `"resources"`, `"consumes":["billing.paid"],"resources"`, 1) if _, err := ParseManifest([]byte(consumed)); err != nil { From 1d0b2d3e072016766be7a756a082c7ed0503c424 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:15:05 +0100 Subject: [PATCH 17/44] DC6c mover-row-tier: MoverRow gains tier (same form raise of mesh-pipeline-runner) Builds: design 47 H2 H-A-730, H-A-709 (1) --- .../go/seats/meshpipelinerunner/contract.go | 4 +++- .../go/seats/meshpipelinerunner/contract_test.go | 2 +- .../seats/mesh-pipeline-runner/fixtures/verbs.json | 6 ++++-- .../seats/mesh-pipeline-runner/seat.json | 4 ++++ .../ts/seats/meshpipelinerunner/index.d.ts | 2 ++ 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index e5c1449ad..6bc40ce57 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go @@ -20,7 +20,7 @@ const Form = 13 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "13" - generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=b7ceefe24722 Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=6de094f5329f Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" ) const ( @@ -773,6 +773,8 @@ type MoverRow struct { Module string `json:"module"` // waiting for a mover with no step placed; running while a required step is open; failed once a required step did not pass; superseded for one a newer pipeline took out Outcome string `json:"outcome"` + // the mover's tier in the pipeline's delivery order, from 1, which the delivery view's tiered page groups the movers by (design 47 H2 H-A-730) + Tier int64 `json:"tier,omitempty"` // the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1)) Version string `json:"version,omitempty"` } diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go index 9ca12a204..f8989f25f 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -143,7 +143,7 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "place-unfinished with one key", subject: "", given: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", wire: "{\"key\":\"main.mesh-sdk\",\"why\":\"the mover passed on its own\"}", decode: func(b []byte) (any, error) { var v PlaceUnfinishedInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "show answers a page of movers' rows with their fingerprint and version, moved and capped (H-A-709)", subject: "", given: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\"}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", wire: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\"}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", + {name: "show answers a page of movers' rows with their fingerprint and version, moved and capped (H-A-709)", subject: "", given: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"tier\":2,\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"tier\":1}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", wire: "{\"capped\":true,\"moved\":true,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"running\",\"tier\":2,\"version\":\"0.1.9\"},{\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"tier\":1}],\"next\":\"cursor-1\",\"pipeline\":{\"branch\":\"main\",\"mover-count\":129,\"movers\":[],\"outcome\":\"running\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"step-count\":516,\"steps\":[],\"v\":1},\"total\":129}", decode: func(b []byte) (any, error) { var v ShowAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "stands answers a page, capped, with the total and the cursor of the next (H-A-709)", subject: "", given: "{\"capped\":true,\"next\":\"cursor-2\",\"stands\":[{\"artifact\":\"nats:program\",\"branch\":\"main\",\"module\":\"nats\",\"on\":\"build node\",\"pipeline\":\"main.3589\",\"revision\":12,\"since\":\"2026-11-10T10:00:00Z\",\"source\":3589,\"step\":\"unit\",\"v\":1}],\"total\":300}", wire: "{\"capped\":true,\"next\":\"cursor-2\",\"stands\":[{\"artifact\":\"nats:program\",\"branch\":\"main\",\"module\":\"nats\",\"on\":\"build node\",\"pipeline\":\"main.3589\",\"revision\":12,\"since\":\"2026-11-10T10:00:00Z\",\"source\":3589,\"step\":\"unit\",\"v\":1}],\"total\":300}", decode: func(b []byte) (any, error) { var v StandsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json index 27026dee0..970199d9b 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/verbs.json @@ -379,12 +379,14 @@ "module": "nats", "outcome": "running", "fingerprint": "fp-0123", - "version": "0.1.9" + "version": "0.1.9", + "tier": 2 }, { "module": "mesh-sdk", "outcome": "passed", - "fingerprint": "fp-sdk" + "fingerprint": "fp-sdk", + "tier": 1 } ], "capped": true, diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json index 79e55f56d..6b6f3f8e8 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -2474,6 +2474,10 @@ "type": "string", "description": "the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1))" }, + "tier": { + "type": "integer", + "description": "the mover's tier in the pipeline's delivery order, from 1, which the delivery view's tiered page groups the movers by (design 47 H2 H-A-730)" + }, "outcome": { "type": "string", "enum": [ diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts index 5a9c9ac10..aeb039771 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -308,6 +308,8 @@ export interface MoverRow { "module": string; /** waiting for a mover with no step placed; running while a required step is open; failed once a required step did not pass; superseded for one a newer pipeline took out */ "outcome": "waiting" | "running" | "passed" | "failed" | "superseded"; + /** the mover's tier in the pipeline's delivery order, from 1, which the delivery view's tiered page groups the movers by (design 47 H2 H-A-730) */ + "tier"?: number; /** the version released for the mover in this pipeline, absent until one is (design 47 H2 H-A-709 (1)) */ "version"?: string; } From c04e5e364c67f769f526cc3f52e18771916f742c Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:15:05 +0100 Subject: [PATCH 18/44] DC7 other-bytes: the publish answer of the four registry seats gains other-bytes, each seat one form higher Builds: design 47 H2 H-A-729, H-A-589 (1), H-A-590 (2) --- .../seats/containerimageregistry/contract.go | 16 +++++++++++--- .../containerimageregistry/contract_test.go | 4 ++++ .../go/seats/gopackageregistry/contract.go | 16 +++++++++++--- .../seats/gopackageregistry/contract_test.go | 4 ++++ .../go/seats/npmpackageregistry/contract.go | 16 +++++++++++--- .../seats/npmpackageregistry/contract_test.go | 4 ++++ .../go/seats/ociartifactregistry/contract.go | 16 +++++++++++--- .../ociartifactregistry/contract_test.go | 4 ++++ .../parts/registry.json | 17 +++++++++++++++ .../fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/container-image-registry/seat.json | 7 ++++--- .../go-package-registry/fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/go-package-registry/seat.json | 3 ++- .../npm-package-registry/fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/npm-package-registry/seat.json | 3 ++- .../oci-artifact-registry/fixtures/verbs.json | 21 +++++++++++++++++++ .../seats/oci-artifact-registry/seat.json | 2 +- .../seats/containerimageregistry/index.d.ts | 1 + .../parts/registry.d.ts | 10 +++++++++ .../ts/seats/gopackageregistry/index.d.ts | 1 + .../gopackageregistry/parts/registry.d.ts | 10 +++++++++ .../ts/seats/npmpackageregistry/index.d.ts | 1 + .../npmpackageregistry/parts/registry.d.ts | 10 +++++++++ .../ts/seats/ociartifactregistry/index.d.ts | 1 + .../ociartifactregistry/parts/registry.d.ts | 10 +++++++++ 25 files changed, 222 insertions(+), 18 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go index 0b20f1225..8022f6fa2 100644 --- a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go @@ -13,7 +13,7 @@ const Seat = "container-image-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -21,8 +21,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" + generatedForms = "2 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" ) const ( @@ -329,6 +329,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -337,6 +345,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go index ade124474..394c0c88b 100644 --- a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go @@ -57,6 +57,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v NameOfInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "name-of answers the copy's reference", subject: "", given: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", wire: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", decode: func(b []byte) (any, error) { var v NameOfAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go index 6d632d989..6a76fc78f 100644 --- a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go @@ -12,7 +12,7 @@ const Seat = "go-package-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -20,8 +20,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" + generatedForms = "2 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" ) const ( @@ -189,6 +189,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -197,6 +205,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go index e5f69ec1d..f4070dd6f 100644 --- a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go @@ -37,6 +37,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go index 594e71009..6bc9a77e2 100644 --- a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go @@ -12,7 +12,7 @@ const Seat = "npm-package-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 1 +const Form = 2 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -20,8 +20,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" + generatedForms = "2 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" ) const ( @@ -189,6 +189,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -197,6 +205,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go index 3092b370e..eeccc2a3d 100644 --- a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go @@ -37,6 +37,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go index e327ef168..406be5b9c 100644 --- a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go @@ -13,7 +13,7 @@ const Seat = "oci-artifact-registry" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". -const Form = 2 +const Form = 3 // FormRegistry is the form of what the part registry adds. const FormRegistry = 1 @@ -21,8 +21,8 @@ const FormRegistry = 1 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "2 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=a0df0b922e1e PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" + generatedForms = "3 registry:1" + generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" ) const ( @@ -320,6 +320,14 @@ const ( PublishInputKindUpstream = "upstream" ) +// PublishAnswerOtherBytes is the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729). +type PublishAnswerOtherBytes struct { + // the digest the holder holds for that name and version + Digest string `json:"digest"` + // the fingerprint the holder keeps for it, absent where it keeps none + Fingerprint string `json:"fingerprint,omitempty"` +} + // PublishAnswer is what publish answers. type PublishAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). @@ -328,6 +336,8 @@ type PublishAnswer struct { Held bool `json:"held,omitempty"` // the digests of the parts the holder lacks, to send by publish-part Lacks []string `json:"lacks,omitempty"` + // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) + OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` // the transfer Transfer string `json:"transfer"` } diff --git a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go index becff93af..e6cb547d3 100644 --- a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go @@ -57,6 +57,10 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v ListInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "list answers a capped page with the cursor of the next", subject: "", given: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", wire: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", decode: func(b []byte) (any, error) { var v ListAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { v, err := c.decode([]byte(c.given)) diff --git a/modules/mesh-delivery-contracts/parts/registry.json b/modules/mesh-delivery-contracts/parts/registry.json index 671d4b4d6..6d9b0c560 100644 --- a/modules/mesh-delivery-contracts/parts/registry.json +++ b/modules/mesh-delivery-contracts/parts/registry.json @@ -80,6 +80,23 @@ "held": { "type": "boolean", "description": "the digest is held already: nothing to send; the outcome follows as an event" + }, + "other-bytes": { + "type": "object", + "description": "the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729)", + "properties": { + "digest": { + "type": "string", + "description": "the digest the holder holds for that name and version" + }, + "fingerprint": { + "type": "string", + "description": "the fingerprint the holder keeps for it, absent where it keeps none" + } + }, + "required": [ + "digest" + ] } }, "required": [ diff --git a/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json index 1a5dc697c..e25c4ca38 100644 --- a/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json @@ -160,5 +160,26 @@ "given": { "reference": "container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json b/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json index f3340b082..f56c8a38e 100644 --- a/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/container-image-registry/seat.json @@ -136,7 +136,7 @@ }, { "name": "hold", - "description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 \u00a72); never an image of the holder's own. Emits held.", + "description": "Keep one untagged bundle, archive or copied base from removal by retention, as the artifact sweep's rules keep it (ADR 0617 §2); never an image of the holder's own. Emits held.", "input": { "type": "object", "properties": { @@ -218,7 +218,7 @@ }, { "name": "list", - "description": "What the store holds of one repository, or of every repository the seat holds when none is named: every image manifest and index, each with its digest, whether it is an index (and the manifests an index names), the tags naming it, its size and whether it is held. Read from the store itself, so a manifest no tag names is listed too; it reads only (ADR 0632 \u00a73).", + "description": "What the store holds of one repository, or of every repository the seat holds when none is named: every image manifest and index, each with its digest, whether it is an index (and the manifests an index names), the tags naming it, its size and whether it is held. Read from the store itself, so a manifest no tag names is listed too; it reads only (ADR 0632 §3).", "input": { "type": "object", "properties": { @@ -500,5 +500,6 @@ } ] } - ] + ], + "form": 2 } diff --git a/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json index be6a53a30..2a23403bd 100644 --- a/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json @@ -106,5 +106,26 @@ "0.1.19" ] } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json b/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json index 9d426368b..4e026d065 100644 --- a/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/go-package-registry/seat.json @@ -31,5 +31,6 @@ "description": "form none: the Go module proxy's read side, answered anonymously, with no credential (design 51)" } } - ] + ], + "form": 2 } diff --git a/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json index 0b88f08e3..94cf68a84 100644 --- a/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json @@ -106,5 +106,26 @@ "0.1.19" ] } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json b/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json index ae2ab3db3..55d1096eb 100644 --- a/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/npm-package-registry/seat.json @@ -31,5 +31,6 @@ "description": "form none: the npm registry's read side, answered anonymously, with no credential (design 51)" } } - ] + ], + "form": 2 } diff --git a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json index ea035c6fb..b7c26ec76 100644 --- a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json @@ -164,5 +164,26 @@ "total": 3, "next": "c-4183" } + }, + { + "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" + } + } + }, + { + "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", + "of": "verb:publish.answer", + "given": { + "transfer": "", + "other-bytes": { + "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" + } + } } ] diff --git a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json index 4dfaf4549..7f8e9639c 100644 --- a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json +++ b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/seat.json @@ -397,5 +397,5 @@ ] } ], - "form": 2 + "form": 3 } diff --git a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts index d8a639cfe..0796f0cfb 100644 --- a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/index.d.ts @@ -64,6 +64,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } diff --git a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts index 2876e791a..36932c203 100644 --- a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/index.d.ts @@ -35,6 +35,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } diff --git a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts index 93ef53029..10f90870f 100644 --- a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/index.d.ts @@ -35,6 +35,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } diff --git a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts index 099d9bfa1..6484b0b0d 100644 --- a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/index.d.ts @@ -61,6 +61,7 @@ export type KeptEvent = registry.KeptEvent; export type Outcome = registry.Outcome; export type Part = registry.Part; export type PublishAnswer = registry.PublishAnswer; +export type PublishAnswerOtherBytes = registry.PublishAnswerOtherBytes; export type PublishInput = registry.PublishInput; export type PublishPartAnswer = registry.PublishPartAnswer; export type PublishPartInput = registry.PublishPartInput; diff --git a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts index 9899be049..30792b93b 100644 --- a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts @@ -96,6 +96,14 @@ export interface PublishInput { "version"?: string; } +/** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ +export interface PublishAnswerOtherBytes { + /** the digest the holder holds for that name and version */ + "digest": string; + /** the fingerprint the holder keeps for it, absent where it keeps none */ + "fingerprint"?: string; +} + /** is what publish answers. */ export interface PublishAnswer { /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ @@ -104,6 +112,8 @@ export interface PublishAnswer { "held"?: boolean; /** the digests of the parts the holder lacks, to send by publish-part */ "lacks"?: string[]; + /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ + "other-bytes"?: PublishAnswerOtherBytes; /** the transfer */ "transfer": string; } From af5a7e58701c353d68344b70f553019b615e8806 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:18:28 +0100 Subject: [PATCH 19/44] I1 needs-in-the-judge: ManifestNeeds and ModuleNeeds move into the manifest validator, read field by field through catalogue.Manifest, a key taken only where ManifestReads names its path Builds: design 47 H2 H-A-568, H-A-622, H-A-639, H-A-640, H-A-669 --- .../internal/index/modules.go | 3 +- .../internal/index/modules_test.go | 4 +- .../internal/index/source.go | 3 +- modules/mesh-delivery-indexer/judge/needs.go | 360 ++++++++++++++++++ .../mesh-delivery-indexer/judge/needs_test.go | 74 ++++ 5 files changed, 439 insertions(+), 5 deletions(-) create mode 100644 modules/mesh-delivery-indexer/judge/needs.go create mode 100644 modules/mesh-delivery-indexer/judge/needs_test.go diff --git a/modules/mesh-delivery-indexer/internal/index/modules.go b/modules/mesh-delivery-indexer/internal/index/modules.go index a8cb0cec2..6dc86e668 100644 --- a/modules/mesh-delivery-indexer/internal/index/modules.go +++ b/modules/mesh-delivery-indexer/internal/index/modules.go @@ -10,7 +10,6 @@ import ( "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/trunk" - "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/keys" "mesh-delivery-indexer/internal/fingerprint" @@ -102,7 +101,7 @@ func (ix *Indexer) applyMoving(ctx context.Context, f whole, drop bool, moves ma next := meshcatalog.ModulesByModuleValue{Repository: f.Repository, Commit: f.Merge, Manifest: digests[dir], Path: pathOf(dir)} // The reader capabilities a changed manifest needs are written with it, before the judge's pass names them with its // verdict, so no reader takes a new manifest as needing nothing (ADR 0614 §4). - next.Needs, _ = catalogue.ManifestNeeds([]byte(raw)) + next.Needs, _ = judge.ManifestNeeds([]byte(raw)) if whole, ok := f.Needs[dir]; ok { next.Needs = whole // its templates' text too, read by the forge bridge at the merge (ADR 0632 §2) } diff --git a/modules/mesh-delivery-indexer/internal/index/modules_test.go b/modules/mesh-delivery-indexer/internal/index/modules_test.go index e5748ce63..e44343e77 100644 --- a/modules/mesh-delivery-indexer/internal/index/modules_test.go +++ b/modules/mesh-delivery-indexer/internal/index/modules_test.go @@ -16,8 +16,8 @@ import ( "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/clients/meshcatalogclient" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/trunk" - "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/process" + "mesh-delivery-indexer/judge" ) const merge = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -441,7 +441,7 @@ func TestAMergeAddingAModuleDirectoryWritesItsValueWithNoBuildRecordAnywhere(t * } // ADR 0614 §4: the merge writes the reader capabilities its manifest needs, so no reader takes it as needing nothing // before the judge's pass. - if want, _ := catalogue.ManifestNeeds([]byte(avahi)); len(m.Needs) == 0 || !slices.Equal(m.Needs, want) { + if want, _ := judge.ManifestNeeds([]byte(avahi)); len(m.Needs) == 0 || !slices.Equal(m.Needs, want) { t.Errorf("module needs %v, want %v", m.Needs, want) } } diff --git a/modules/mesh-delivery-indexer/internal/index/source.go b/modules/mesh-delivery-indexer/internal/index/source.go index ea7531504..4006704d9 100644 --- a/modules/mesh-delivery-indexer/internal/index/source.go +++ b/modules/mesh-delivery-indexer/internal/index/source.go @@ -10,6 +10,7 @@ import ( "slices" "git.novox.be/novox/mesh-sdk/go/catalogue" + "mesh-delivery-indexer/judge" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/trunk" ) @@ -66,7 +67,7 @@ func (ix *Indexer) wholeAt(ctx context.Context, repository, head string) (whole, if f.Needs == nil { f.Needs = map[string][]string{} } - f.Needs[dir], _ = catalogue.ModuleNeeds([]byte(read.Manifests[dir]), texts) + f.Needs[dir], _ = judge.ModuleNeeds([]byte(read.Manifests[dir]), texts) } if l := read.Locks[dir]; len(l) > 0 { if f.Locks == nil { diff --git a/modules/mesh-delivery-indexer/judge/needs.go b/modules/mesh-delivery-indexer/judge/needs.go new file mode 100644 index 000000000..950ec5f89 --- /dev/null +++ b/modules/mesh-delivery-indexer/judge/needs.go @@ -0,0 +1,360 @@ +package judge + +import ( + "bytes" + "encoding/json" + "reflect" + "regexp" + "slices" + "sort" + "strings" + + "git.novox.be/novox/mesh-contracts/go/seats/nodeengine" + "git.novox.be/novox/mesh-sdk/go/catalogue" +) + +// The reader capabilities a manifest needs (novox/hq ADR 0614 §4; design 47 H2, H-A-639, H-A-669): a manifest word, a +// form or a seat name of the shared contract a reader of manifests (a node-engine) must read for the manifest. +// ManifestNeeds names them for one manifest, ModuleNeeds for a module whose files take their text from templates. The +// manifest is read field by field through catalogue.Manifest, and a key is a word only where catalogue.ManifestReads() +// names its path; a unit test holds the two equal, so a difference fails. + +// requirementLong is one entry of `requires` in its long form, as catalogue reads it. +type requirementLong struct { + Name string `json:"name"` + Optional bool `json:"optional,omitempty"` + Shares []catalogue.BucketShare `json:"shares,omitempty"` +} + +// topWords are the keys catalogue.Manifest's decoder reads whole beside its fields, no words of the contract beneath. +var topWords = []string{"secrets", "contributes", catalogue.OptionalRequiresKey, catalogue.RequireSharesKey} + +// wireKeys are the keys of a block whose decoder reads its object by keys of its own. +var wireKeys = map[reflect.Type][]string{ + reflect.TypeOf(catalogue.OfferIdentity{}): {"max", "in"}, + reflect.TypeOf(catalogue.DataBackup{}): {"dump", "into"}, + reflect.TypeOf(catalogue.OwnSecret{}): {"path", "taken", "issued-by", "prompt", "owner"}, +} + +var ( + takesConfigKey = regexp.MustCompile(`"` + catalogue.TakesConfigField + `"(\s*):`) + needsSeatReach = regexp.MustCompile(`\$\{seat:[a-z0-9][a-z0-9-]*:reach\}`) +) + +const ( + configJSONToken = "${config-json}" + ifConfigWord = catalogue.ReadWord + "resources." + catalogue.IfConfigField + storeHolderSeat = "container-image-registry" +) + +// ManifestNeeds is every reader capability a manifest's own words, forms and seat names need, sorted. An error is +// only bytes that are no JSON object. +func ManifestNeeds(raw []byte) ([]string, error) { + var top map[string]any + dec := json.NewDecoder(bytes.NewReader(raw)) + dec.UseNumber() + if err := dec.Decode(&top); err != nil { + return nil, err + } + used := map[string]bool{} + textNeeds(raw, used) + if claimsAtMesh(top, storeHolderSeat) { + used[catalogue.ReadForm+catalogue.ReferenceFormSeatReach] = true + } + if runsAs, _ := top["runs-as"].(string); runsAs != "" { + used[nodeengine.ManifestReadWordDirectoryContentsOwner] = true + } + for _, r := range asList(top["resources"]) { + if obj, ok := r.(map[string]any); ok { + if _, has := obj[catalogue.IfConfigField]; has { + used[ifConfigWord] = true + } + } + } + if _, has := top[catalogue.ConfigField]; has || takesConfigKey.Match(raw) { + used[catalogue.ReadForm+"config"] = true + } + words := map[string]bool{} + fields := structFields(reflect.TypeOf(catalogue.Manifest{})) + for _, k := range sortedAnyKeys(top) { + v := top[k] + switch { + case k == catalogue.ConfigField: + // The config form is the settings form's words under another key. + words[catalogue.SettingsField] = true + walkValue(v, fields[catalogue.SettingsField].Type, catalogue.SettingsField, words) + case k == "requires": + words[k] = true + for _, e := range asList(v) { + obj, isObj := e.(map[string]any) + if !isObj { + continue + } + if _, bus := obj["storage"]; bus { + words[catalogue.BusStateField] = true + walkValue(obj, reflect.TypeOf(catalogue.BusStateEntry{}), catalogue.BusStateField, words) + continue + } + walkValue(obj, reflect.TypeOf(requirementLong{}), k, words) + } + case slices.Contains(topWords, k): + words[k] = true + default: + if f, known := fields[k]; known { + words[k] = true + walkValue(v, f.Type, k, words) + } + } + } + read := map[string]bool{} + for _, r := range catalogue.ManifestReads() { + read[r] = true + } + for w := range words { + if read[catalogue.ReadWord+w] { + used[catalogue.ReadWord+w] = true + } + } + for _, s := range seatNamesUsed(top) { + used[catalogue.ReadSeat+s] = true + } + return sortedSet(used), nil +} + +// ModuleNeeds is ManifestNeeds of a module whose files take their text from templates: what the manifest needs and +// what each template's text writes, sorted. A template named and not given is no need. +func ModuleNeeds(raw []byte, templates map[string]string) ([]string, error) { + needs, err := ManifestNeeds(raw) + if err != nil || len(templates) == 0 { + return needs, err + } + used := map[string]bool{} + for _, n := range needs { + used[n] = true + } + for _, text := range templates { + textNeeds([]byte(text), used) + } + return sortedSet(used), nil +} + +// readerWords is every word the validator's field-by-field reading can name, by path, sorted: the words +// catalogue.ManifestReads() must name, so a unit test holds the two equal. +func readerWords() []string { + set := map[string]bool{} + walkType(reflect.TypeOf(catalogue.Manifest{}), "", set, map[reflect.Type]bool{}) + set["requires"] = true + set[strings.TrimPrefix(ifConfigWord, catalogue.ReadWord)] = true // a resource's key, read beside the fields + walkType(reflect.TypeOf(requirementLong{}), "requires", set, map[reflect.Type]bool{}) + for _, w := range topWords { + set[w] = true + } + return sortedSet(set) +} + +// textNeeds adds the reference forms a manifest's or a template's text writes to used. +func textNeeds(text []byte, used map[string]bool) { + for _, f := range referenceFormsRead() { + if bytes.Contains(text, []byte("${"+f+":")) { + used[catalogue.ReadForm+f] = true + } + } + if bytes.Contains(text, []byte(configJSONToken)) { + used[catalogue.ReadForm+"config-json"] = true + } + if needsSeatReach.Match(text) { + used[catalogue.ReadForm+catalogue.ReferenceFormSeatReach] = true + } +} + +// referenceFormsRead are the reference forms a manifest's values may hold, `${:…}`: the forms catalogue.ManifestReads() +// names, but for the two it reads by another rule (a build's artifact reference, and a seat's reach). +func referenceFormsRead() []string { + var out []string + for _, r := range catalogue.ManifestReads() { + f, ok := strings.CutPrefix(r, catalogue.ReadForm) + if !ok || f == catalogue.ReferenceFormSeat || f == catalogue.ReferenceFormSeatReach { + continue + } + out = append(out, f) + } + return out +} + +func claimsAtMesh(top map[string]any, seat string) bool { + for _, c := range asList(top["claims"]) { + obj, _ := c.(map[string]any) + name, _ := obj["name"].(string) + scope, _ := obj["scope"].(string) + if hs, ok := catalogue.SeatNamed(name); ok && hs.Name == seat && (scope == "" || scope == catalogue.ScopeMesh) { + return true + } + } + return false +} + +// seatNamesUsed is each seat of the contract's table the manifest names: in a claim, a use, an invoke of a seat's verb, +// and a bucket's share with a seat. +func seatNamesUsed(top map[string]any) []string { + known := map[string]bool{} + for _, s := range catalogue.Seats() { + known[s.Name] = true + } + set := map[string]bool{} + add := func(name string) { + if known[name] { + set[name] = true + } + } + for _, c := range asList(top["claims"]) { + if obj, ok := c.(map[string]any); ok { + name, _ := obj["name"].(string) + add(name) + } + } + for _, u := range asList(top["uses"]) { + name, _ := u.(string) + add(name) + } + for _, i := range asList(top["invokes"]) { + text, _ := i.(string) + if seat, _, ok := catalogue.SeatInvoke(text); ok { + add(seat) + } + } + for _, r := range asList(top["requires"]) { + obj, _ := r.(map[string]any) + for _, share := range asList(obj["shares"]) { + text, _ := share.(string) + if seat, ok := strings.CutPrefix(text, "seat:"); ok { + add(seat) + } + } + } + return sortedSet(set) +} + +func walkType(t reflect.Type, path string, set map[string]bool, onPath map[reflect.Type]bool) { + t = deref(t) + if keys, custom := wireKeys[t]; custom { + for _, k := range keys { + set[joinWord(path, k)] = true + } + return + } + switch t.Kind() { + case reflect.Struct: + if onPath[t] { + return + } + onPath[t] = true + defer delete(onPath, t) + for name, f := range structFields(t) { + word := joinWord(path, name) + set[word] = true + walkType(f.Type, word, set, onPath) + } + case reflect.Slice, reflect.Array, reflect.Map: + if t.Elem().Kind() == reflect.Uint8 { + return + } + walkType(t.Elem(), path, set, onPath) + } +} + +func walkValue(v any, t reflect.Type, path string, used map[string]bool) { + t = deref(t) + if keys, custom := wireKeys[t]; custom { + obj, _ := v.(map[string]any) + for _, k := range keys { + if _, has := obj[k]; has { + used[joinWord(path, k)] = true + } + } + return + } + switch t.Kind() { + case reflect.Struct: + obj, isObj := v.(map[string]any) + if !isObj { + return + } + fields := structFields(t) + for _, k := range sortedAnyKeys(obj) { + f, known := fields[k] + if !known { + continue + } + word := joinWord(path, k) + used[word] = true + walkValue(obj[k], f.Type, word, used) + } + case reflect.Slice, reflect.Array: + if t.Elem().Kind() == reflect.Uint8 { + return + } + for _, item := range asList(v) { + walkValue(item, t.Elem(), path, used) + } + case reflect.Map: + obj, _ := v.(map[string]any) + for _, k := range sortedAnyKeys(obj) { + walkValue(obj[k], t.Elem(), path, used) + } + } +} + +func structFields(t reflect.Type) map[string]reflect.StructField { + out := map[string]reflect.StructField{} + for i := 0; i < t.NumField(); i++ { + f := t.Field(i) + name, _, _ := strings.Cut(f.Tag.Get("json"), ",") + if name == "-" { + continue + } + if f.Anonymous && name == "" && deref(f.Type).Kind() == reflect.Struct { + for k, inner := range structFields(deref(f.Type)) { + if _, shadowed := out[k]; !shadowed { + out[k] = inner + } + } + continue + } + if !f.IsExported() { + continue + } + if name == "" { + name = f.Name + } + out[name] = f + } + return out +} + +func deref(t reflect.Type) reflect.Type { + for t.Kind() == reflect.Pointer { + t = t.Elem() + } + return t +} + +func joinWord(path, key string) string { + if path == "" { + return key + } + return path + "." + key +} + +func asList(v any) []any { + list, _ := v.([]any) + return list +} + +func sortedSet(set map[string]bool) []string { + out := make([]string, 0, len(set)) + for k := range set { + out = append(out, k) + } + sort.Strings(out) + return out +} diff --git a/modules/mesh-delivery-indexer/judge/needs_test.go b/modules/mesh-delivery-indexer/judge/needs_test.go new file mode 100644 index 000000000..81a7ed76c --- /dev/null +++ b/modules/mesh-delivery-indexer/judge/needs_test.go @@ -0,0 +1,74 @@ +package judge + +import ( + "slices" + "strings" + "testing" + + "git.novox.be/novox/mesh-sdk/go/catalogue" +) + +func TestManifestNeeds(t *testing.T) { + for _, row := range []struct { + why, raw string + templates map[string]string + has, not []string + }{ + {"a module of its own account", `{"module":"g","version":"1","runs-as":"g"}`, nil, + []string{"directory-contents-owner", "word:runs-as"}, nil}, + {"a module with no account of its own", `{"module":"g","version":"1"}`, nil, + []string{"word:module"}, []string{"directory-contents-owner"}}, + {"a word the contract does not know", `{"module":"u","version":"1","newer-word":{"inside":1}}`, nil, + []string{"word:module"}, []string{"word:newer-word"}}, + {"a template naming a seat's reach", `{"module":"z","version":"1","resources":[{"id":"f","type":"file","template":"files/d.json"}]}`, + map[string]string{"files/d.json": `{"x":"${seat:container-image-registry:reach}"}`}, + []string{"form:seat-reach"}, nil}, + {"a template writing the config as json", `{"module":"z","version":"1","resources":[{"id":"f","type":"file","template":"files/c.json"}]}`, + map[string]string{"files/c.json": "${config-json}"}, []string{"form:config-json"}, []string{"form:config-lines"}}, + {"a resource with if-config", `{"module":"z","version":"1","resources":[{"id":"f","type":"file","if-config":"x"}]}`, nil, + []string{"word:resources.if-config"}, nil}, + } { + needs, err := ModuleNeeds([]byte(row.raw), row.templates) + if err != nil { + t.Fatalf("%s: %v", row.why, err) + } + for _, n := range row.has { + if !slices.Contains(needs, n) { + t.Errorf("%s: needs %v, not %s", row.why, needs, n) + } + } + for _, n := range row.not { + if slices.Contains(needs, n) { + t.Errorf("%s: needs %v, naming %s", row.why, needs, n) + } + } + } + if _, err := ManifestNeeds([]byte("[]")); err == nil { + t.Error("bytes that are no JSON object: no error") + } +} + +// The manifest validator's reading of a manifest's keys equals ManifestReads' words (H-A-669): a word one names and the +// other does not fails here. +func TestTheValidatorReadsTheWordsManifestReadsNames(t *testing.T) { + var contract []string + for _, r := range catalogue.ManifestReads() { + if w, ok := strings.CutPrefix(r, catalogue.ReadWord); ok { + contract = append(contract, w) + } + } + if got := readerWords(); !slices.Equal(got, contract) { + t.Errorf("the validator reads %d words, ManifestReads names %d: only in the validator %v, only in ManifestReads %v", + len(got), len(contract), diff(got, contract), diff(contract, got)) + } +} + +func diff(a, b []string) []string { + var out []string + for _, x := range a { + if !slices.Contains(b, x) { + out = append(out, x) + } + } + return out +} From d4ea1f34456f17bc953eef24fefbf1cd65515233 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:19:06 +0100 Subject: [PATCH 20/44] I2 own-put-needs-runs-as: a manifest invoking seat:mesh-vault.own-put without runs-as is refused, a get is not Builds: design 47 H2 H-A-576, H-A-584, H-A-670 --- modules/mesh-delivery-indexer/go.mod | 1 + modules/mesh-delivery-indexer/judge/rules.go | 19 +++++++++++++++++++ .../mesh-delivery-indexer/judge/rules_test.go | 17 +++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/modules/mesh-delivery-indexer/go.mod b/modules/mesh-delivery-indexer/go.mod index dcf518af7..fb20e4d9a 100644 --- a/modules/mesh-delivery-indexer/go.mod +++ b/modules/mesh-delivery-indexer/go.mod @@ -49,6 +49,7 @@ require ( ) require git.novox.be/novox/mesh-contracts/go/seats/meshbroker v0.0.0-00010101000000-000000000000 +require git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault v0.0.0-00010101000000-000000000000 replace git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk => ../mesh-delivery-sdk diff --git a/modules/mesh-delivery-indexer/judge/rules.go b/modules/mesh-delivery-indexer/judge/rules.go index b43ab69b9..29601d23f 100644 --- a/modules/mesh-delivery-indexer/judge/rules.go +++ b/modules/mesh-delivery-indexer/judge/rules.go @@ -11,6 +11,7 @@ import ( errors "errors" fmt "fmt" "git.novox.be/novox/mesh-contracts/go/seats/meshbroker" + "git.novox.be/novox/mesh-contracts/identity-and-access/go/seats/meshvault" catalogue "git.novox.be/novox/mesh-sdk/go/catalogue" math "math" net "net" @@ -2870,6 +2871,7 @@ func parseManifest(raw []byte, predefined catalogue.PredefinedList) (catalogue.M // facts about the catalogue and are checked at registration (CatalogueProblems). problems = append(problems, declaredSeatProblems(m)...) problems = append(problems, RunsAsProblems(m)...) + problems = append(problems, OwnPutProblems(m)...) problems = append(problems, ProcessBusProblems(m)...) problems = append(problems, seatEventProblems(m)...) problems = append(problems, ReadsHolderProblems(m)...) @@ -5284,6 +5286,23 @@ func RunsAsProblems(m catalogue.Manifest) []string { return problems } +// OwnPutProblems is what a manifest naming the vault's own-put is held to (design 47 H2, H-A-576, H-A-584, H-A-670): a +// module that invokes seat:mesh-vault.own-put declares runs-as, since the vault hands an own secret only to the account +// of the module's own. A get without runs-as is no problem here: the vault's refusal at the call is its one check. +func OwnPutProblems(m catalogue.Manifest) []string { + if m.RunsAs != "" { + return nil + } + var problems []string + for _, t := range m.Invokes { + if seat, verb, ok := catalogue.SeatInvoke(t); ok && seat == meshvault.Seat && verb == meshvault.VerbOwnPut { + problems = append(problems, fmt.Sprintf("%s invokes %s of the seat %s and declares no runs-as: the vault puts a module's own "+ + "secret only for the account the module runs as (design 47 H2 §822)", m.Module, verb, seat)) + } + } + return problems +} + // capabilityProblems are the words of a claim outside the vocabulary, and capabilities on a claim of a // seat that is not kinded. func capabilityProblems(module string, c catalogue.Claim, kinded bool) []string { diff --git a/modules/mesh-delivery-indexer/judge/rules_test.go b/modules/mesh-delivery-indexer/judge/rules_test.go index cb1e6aaea..ec6a1a964 100644 --- a/modules/mesh-delivery-indexer/judge/rules_test.go +++ b/modules/mesh-delivery-indexer/judge/rules_test.go @@ -4445,6 +4445,22 @@ func caseRunsAsIsAnAccountOfTheModulesOwn(t *testing.T) { } } +func caseOwnPutNeedsRunsAs(t *testing.T) { + for _, row := range []struct { + why, invoke, runsAs string + refused bool + }{ + {"a get without runs-as", "seat:mesh-vault.get", "", false}, + {"an own-put without runs-as", "seat:mesh-vault.own-put", "", true}, + {"an own-put with runs-as", "seat:mesh-vault.own-put", "shop", false}, + } { + got := OwnPutProblems(catalogue.Manifest{Module: "shop", RunsAs: row.runsAs, Invokes: []string{row.invoke}}) + if (len(got) != 0) != row.refused || (row.refused && !strings.Contains(got[0], "shop") && !strings.Contains(got[0], "own-put")) { + t.Errorf("%s: refused = %v, want %v", row.why, got, row.refused) + } + } +} + func caseRuntimeHealthIsRefusedWithoutAnAccountOfItsOwn(t *testing.T) { _, err := ParseManifest(ownAccountManifest(t, false, map[string]any{"kind": "tool", "tool": "keeper_health"})) if err == nil || !strings.Contains(err.Error(), "runtime-health") || !strings.Contains(err.Error(), "runs-as") { @@ -6535,6 +6551,7 @@ func TestRulesSecrets(t *testing.T) { t.Run("HearingARestrictedStreamNeedsAnAccountOfItsOwn", caseHearingARestrictedStreamNeedsAnAccountOfItsOwn) t.Run("ParseManifestForInputsReadsAValueFallingBackToAPredefinedKey", caseParseManifestForInputsReadsAValueFallingBackToAPredefinedKey) t.Run("RunsAsIsAnAccountOfTheModulesOwn", caseRunsAsIsAnAccountOfTheModulesOwn) + t.Run("OwnPutNeedsRunsAs", caseOwnPutNeedsRunsAs) t.Run("RuntimeHealthIsRefusedWithoutAnAccountOfItsOwn", caseRuntimeHealthIsRefusedWithoutAnAccountOfItsOwn) t.Run("TheBussAccountSaysNothingOnTheBus", caseTheBussAccountSaysNothingOnTheBus) t.Run("TheCatalogueCheckRefusesAnIdentityThatOverflowsWhatItRequires", caseTheCatalogueCheckRefusesAnIdentityThatOverflowsWhatItRequires) From 3baef9df5b06e01b464f64ae3e2eb4e298f08714 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:20:01 +0100 Subject: [PATCH 21/44] I11 entry-needs: CatalogEntryOf writes the entry's needs from the module's value, ModuleValueOf reads them back Builds: design 47 H2 H-A-682 (1), H-A-568, H-A-569 (2) --- .../internal/index/catalog_graph.go | 11 ++++++++--- .../internal/index/catalog_graph_test.go | 13 +++++++++++++ .../internal/index/toolchains_test.go | 4 ++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_graph.go b/modules/mesh-delivery-indexer/internal/index/catalog_graph.go index 93ff2d057..203b39ce3 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_graph.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_graph.go @@ -35,6 +35,11 @@ func CatalogEntryOf(module string, cur meshcatalog.ModulesByModuleValue, m catal Commit: cur.Commit, Manifest: manifestWhole(raw), ManifestDigest: meshcatalogclient.EntryManifestDigest(cur.Manifest), Verdict: cur.Verdict, Fp: n.FP, None: n.None, Bases: n.Bases, Packages: maps.Clone(cur.Packages), Provides: n.Provides, Requires: n.Requires, Awaits: n.Awaits, Invokes: n.Invokes, Serves: n.Serves, LeftOut: n.LeftOut, Main: MainOf(m), Contributes: contributesOf(m), Class: m.Class} + // needs are the reader capabilities the module's value names (design 47 H2, H-A-682 (1)): its manifest's words, forms + // and seat names and its templates' forms, sorted, absent when empty. + if len(cur.Needs) > 0 { + e.Needs = slices.Compact(slices.Sorted(slices.Values(cur.Needs))) + } // requires names every requirement as catalogue.Manifest.Wants lists them, optional ones and those only contributes names // included, since contributing to a requirement is requiring it (design 47 G §709, A-229). for _, r := range m.Wants() { @@ -66,11 +71,11 @@ func CatalogEntryOf(module string, cur meshcatalog.ModulesByModuleValue, m catal // ModuleValueOf is the module's value as the indexer computes with it, read back from its catalog graph entry: the // inverse of CatalogEntryOf, by which the indexer's view of the trunk is the newest trunk revision's entries (the lead's -// ruling on milestone 47/G finding 1; ADR 0656 §6: one form of the fact). The old line's fields (the old-form -// fingerprint, the reader needs) are not kept. +// ruling on milestone 47/G finding 1; ADR 0656 §6: one form of the fact), the reader needs included (H-A-682 (1)). The old +// line's old-form fingerprint is not kept. func ModuleValueOf(e meshcatalog.CatalogEntry) meshcatalog.ModulesByModuleValue { v := meshcatalog.ModulesByModuleValue{V: keys.Version, Repository: e.Repository, Path: e.Path, Commit: e.Commit, Manifest: meshcatalogclient.BareManifestDigest(e.ManifestDigest), - Verdict: e.Verdict, Fp2: e.Fp, None2: e.None, Packages: maps.Clone(e.Packages)} + Verdict: e.Verdict, Fp2: e.Fp, None2: e.None, Packages: maps.Clone(e.Packages), Needs: slices.Clone(e.Needs)} if in := e.Inputs; in != nil { v.Toolchains, v.Paths, v.Problems, v.Warnings, v.Unknown = maps.Clone(in.Toolchains), maps.Clone(in.Paths), in.Problems, in.Warnings, in.Unknown if in.From != nil { diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go b/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go index 69dca5113..f54f70885 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go @@ -109,6 +109,19 @@ func TestAnEntryNamesWhatItContributesToAndEveryRequirement(t *testing.T) { if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{}, "", graph.Node{}); e.Contributes != nil || e.Class != "" { t.Errorf("an entry of a manifest contributing nothing and naming no class carries contributes %v, class %q", e.Contributes, e.Class) } + // Design 47 H2 H-A-682 (1): a module whose value names needs carries them sorted on its entry, and the value read back + // from the entry names them; a value with none leaves the entry's needs absent. + needs := []string{"seat:node-engine", "form:dir", "word:runs-as"} + e = CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{Needs: needs}, m, raw, graph.Node{}) + if want := []string{"form:dir", "seat:node-engine", "word:runs-as"}; !reflect.DeepEqual(e.Needs, want) { + t.Errorf("needs = %v, want %v", e.Needs, want) + } + if back := ModuleValueOf(e); !reflect.DeepEqual(back.Needs, e.Needs) { + t.Errorf("the value read back names needs %v, want %v", back.Needs, e.Needs) + } + if e := CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{}, m, raw, graph.Node{}); e.Needs != nil { + t.Errorf("a value with no needs gives the entry needs %v", e.Needs) + } // Design 47 H2 §810, H-A-394 (1): the entry carries its manifest's class, which the gate reads. if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{Class: catalogue.ClassCore}, "", graph.Node{}); e.Class != catalogue.ClassCore { t.Errorf("the entry of a core manifest carries the class %q, want core", e.Class) diff --git a/modules/mesh-delivery-indexer/internal/index/toolchains_test.go b/modules/mesh-delivery-indexer/internal/index/toolchains_test.go index 9ee54972a..0be4f0fde 100644 --- a/modules/mesh-delivery-indexer/internal/index/toolchains_test.go +++ b/modules/mesh-delivery-indexer/internal/index/toolchains_test.go @@ -342,10 +342,10 @@ func TestBasesAreComputedFirstAndNoFingerprintTakesTheBuilder(t *testing.T) { // } // W3.1's inputs (the lead's ruling on finding 1): an entry carries what the next revision is computed from (the // fingerprint's inputs, the toolchains used, the package versions), so the module's value read back from it is the - // value modules held, but for the old line's fields. + // value modules held, but for the old-form fingerprint. for name := range mods.vals { m, _ := moduleOf(t, mods, name) - m.Fp, m.None, m.Needs = "", "", nil + m.Fp, m.None = "", "" if back := ModuleValueOf(entries[name]); !reflect.DeepEqual(back, m) { t.Errorf("%s read back from its entry = %+v, want %+v", name, back, m) } From ca91d4e85bb770055b9854df062367e1a3002b19 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:20:45 +0100 Subject: [PATCH 22/44] I4 consumes-on-entry: an entry's consumes equals its manifest's Builds: design 47 H2 H-A-621 --- .../mesh-delivery-indexer/internal/index/catalog_graph.go | 2 +- .../internal/index/catalog_graph_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_graph.go b/modules/mesh-delivery-indexer/internal/index/catalog_graph.go index 203b39ce3..dd51ae937 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_graph.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_graph.go @@ -33,7 +33,7 @@ const CatalogEntryLayout = 1 func CatalogEntryOf(module string, cur meshcatalog.ModulesByModuleValue, m catalogue.Manifest, raw string, n graph.Node) meshcatalog.CatalogEntry { e := meshcatalog.CatalogEntry{V: CatalogEntryLayout, Module: module, Repository: cur.Repository, Path: cur.Path, Commit: cur.Commit, Manifest: manifestWhole(raw), ManifestDigest: meshcatalogclient.EntryManifestDigest(cur.Manifest), Verdict: cur.Verdict, Fp: n.FP, None: n.None, Bases: n.Bases, - Packages: maps.Clone(cur.Packages), Provides: n.Provides, Requires: n.Requires, Awaits: n.Awaits, Invokes: n.Invokes, + Packages: maps.Clone(cur.Packages), Provides: n.Provides, Requires: n.Requires, Awaits: n.Awaits, Invokes: n.Invokes, Consumes: slices.Clone(m.Consumes), Serves: n.Serves, LeftOut: n.LeftOut, Main: MainOf(m), Contributes: contributesOf(m), Class: m.Class} // needs are the reader capabilities the module's value names (design 47 H2, H-A-682 (1)): its manifest's words, forms // and seat names and its templates' forms, sorted, absent when empty. diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go b/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go index f54f70885..3f9ab847c 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_graph_test.go @@ -109,6 +109,14 @@ func TestAnEntryNamesWhatItContributesToAndEveryRequirement(t *testing.T) { if e := CatalogEntryOf("kv", meshcatalog.ModulesByModuleValue{}, catalogue.Manifest{}, "", graph.Node{}); e.Contributes != nil || e.Class != "" { t.Errorf("an entry of a manifest contributing nothing and naming no class carries contributes %v, class %q", e.Contributes, e.Class) } + // Design 47 H2 H-A-621: an entry's consumes equals its manifest's, beside its invokes. + cm := catalogue.Manifest{Consumes: []string{"mesh-delivery.merge-called", "mesh-builds.step-ended"}} + if e := CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{}, cm, "", graph.Node{}); !reflect.DeepEqual(e.Consumes, cm.Consumes) { + t.Errorf("consumes = %v, want %v", e.Consumes, cm.Consumes) + } + if e := CatalogEntryOf("web", meshcatalog.ModulesByModuleValue{}, m, raw, graph.Node{}); e.Consumes != nil { + t.Errorf("a manifest consuming nothing gives the entry consumes %v", e.Consumes) + } // Design 47 H2 H-A-682 (1): a module whose value names needs carries them sorted on its entry, and the value read back // from the entry names them; a value with none leaves the entry's needs absent. needs := []string{"seat:node-engine", "form:dir", "word:runs-as"} From 7f67e209e618f6736d19111c800cd98ebf7a0a07 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:21:35 +0100 Subject: [PATCH 23/44] I3 needs-rules: each revision carries judge.NeedsRules, a take-in at a higher number derives the unmoved entries' needs from their manifests again Builds: design 47 H2 H-A-569 (2), H-A-605 (4), H-A-586 --- .../internal/index/catalog_branches_test.go | 36 +++++++++++++++++++ .../internal/index/catalog_revisions.go | 26 +++++++++++++- modules/mesh-delivery-indexer/judge/needs.go | 5 +++ 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_branches_test.go b/modules/mesh-delivery-indexer/internal/index/catalog_branches_test.go index 66319e487..ab31890f9 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_branches_test.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_branches_test.go @@ -2,10 +2,12 @@ package index import ( "context" + "slices" "testing" "time" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog" + "mesh-delivery-indexer/judge" ) // Design 47 G A-85, §291, H §743, H-A-32: the indexer keeps a catalog revision per watched branch, . (the @@ -117,3 +119,37 @@ func TestTheRevisionAnswersEveryCaller(t *testing.T) { t.Errorf("an unproven caller answered %+v, %v; want the revision", a, err) } } + +// H-A-569 (2), H-A-605 (4): a take-in whose needs-rules equals its base revision's derives nothing for unmoved entries, and +// one with a higher number derives each from the manifest the entry carries, keeping its fingerprint. +func TestAHigherNeedsRulesDerivesTheUnmovedEntriesNeedsAgain(t *testing.T) { + ctx := context.Background() + ix := &Indexer{Module: testSelf, Revisions: newMemObjects(1 << 20)} + entry := meshcatalog.CatalogEntry{Module: "web", Repository: "novox/w", Commit: "c1", Fp: "src2:aa", + Manifest: map[string]any{"module": "web", "version": "1", "runs-as": "web"}} + if err := ix.KeepBranchEntries(ctx, "main", 1, map[string]meshcatalog.CatalogEntry{"web": entry}, nil); err != nil { + t.Fatal(err) + } + needsOf := func(source int64) ([]string, int64) { + a, err := Revision(ctx, ix.Revisions, nil, meshcatalog.RevisionInput{Branch: "main", Source: source}) + if err != nil || len(a.Entries) != 1 { + t.Fatalf("source %d answered %+v (%v)", source, a, err) + } + if a.Entries[0].Fp != "src2:aa" { + t.Errorf("the entry's fingerprint moved to %q", a.Entries[0].Fp) + } + return a.Entries[0].Needs, a.Revision.NeedsRules + } + if needs, rules := needsOf(1); rules != judge.NeedsRules || !slices.Contains(needs, "directory-contents-owner") { + t.Errorf("the first revision holds needs %v at rules %d, want the runs-as need at rules %d", needs, rules, judge.NeedsRules) + } + // The base was written at the same rules: the needs an entry carries are kept as they are. + kept := entry + kept.Needs = []string{"word:module"} + if err := ix.KeepBranchEntries(ctx, "main", 2, map[string]meshcatalog.CatalogEntry{"web": kept}, nil); err != nil { + t.Fatal(err) + } + if needs, _ := needsOf(2); !slices.Equal(needs, []string{"word:module"}) { + t.Errorf("a take-in at unchanged rules derived needs again: %v", needs) + } +} diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go b/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go index b52da26e7..05d812b8a 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go @@ -20,6 +20,7 @@ import ( "git.novox.be/novox/mesh-sdk/go/keys" "git.novox.be/novox/mesh-sdk/go/process" "git.novox.be/novox/mesh-sdk/go/views" + "mesh-delivery-indexer/judge" ) // The indexer's object bucket catalog-revisions (design 47, Two graphs; novox/hq ADR 0619 §2: declared in the old @@ -379,9 +380,12 @@ func (ix *Indexer) keepBranchEntries(ctx context.Context, branch string, src int } number := newest.Revision + 1 entries = WithEdges(ix.withActs(ctx, entries)) // the acting rules and the edges between artifact references are written here, once, for every reader (A-208) + if judge.NeedsRules > newest.NeedsRules { + entries = withRuleNeeds(entries, movers) // H-A-605 (4): the rules moved since the base, so each unmoved entry is read again + } at := ix.now().UTC() rev, objects, err := CatalogRevisionOf(meshcatalog.CatalogRevision{Revision: number, Kind: "trunk", Branch: branch, Source: src, Call: call.Call, - CallKind: call.Kind, Module: call.Module, Version: call.Version, Repository: call.Repository, At: &at}, entries) + NeedsRules: judge.NeedsRules, CallKind: call.Kind, Module: call.Module, Version: call.Version, Repository: call.Repository, At: &at}, entries) if err != nil { return 0, err } @@ -461,6 +465,26 @@ func (ix *Indexer) keepBranchEntries(ctx context.Context, branch string, src int return number, nil } +// withRuleNeeds is entries with each unmoved entry's needs derived again from the manifest the entry carries whole, the +// manifest validator's rules as they stand (design 47 H2, H-A-569 (2), H-A-605 (4)): an entry gains the need a rule names +// now, keeps the ones it had and keeps its fingerprint, which no need moves. A mover's needs were derived at its take-in. +func withRuleNeeds(entries map[string]meshcatalog.CatalogEntry, movers []meshcatalog.TakeInEntry) map[string]meshcatalog.CatalogEntry { + moved := map[string]bool{} + for _, m := range movers { + moved[m.Module] = true + } + out := make(map[string]meshcatalog.CatalogEntry, len(entries)) + for name, e := range entries { + if raw, err := json.Marshal(e.Manifest); !moved[name] && len(e.Manifest) > 0 && err == nil { + if derived, err := judge.ManifestNeeds(raw); err == nil { + e.Needs = slices.Compact(slices.Sorted(slices.Values(append(slices.Clone(e.Needs), derived...)))) + } + } + out[name] = e + } + return out +} + // revisionCall is what made a catalog revision (design 47 H-A-213 (3), H-A-215): call, the words for a person; Kind, one of the // seat mesh-catalog's three call kinds, which a reader reads instead of the words; Module and Version for a release, Repository // for a take-in again. The zero value names no call (a revision kept by hand or a test). diff --git a/modules/mesh-delivery-indexer/judge/needs.go b/modules/mesh-delivery-indexer/judge/needs.go index 950ec5f89..dfdb404b7 100644 --- a/modules/mesh-delivery-indexer/judge/needs.go +++ b/modules/mesh-delivery-indexer/judge/needs.go @@ -19,6 +19,11 @@ import ( // manifest is read field by field through catalogue.Manifest, and a key is a word only where catalogue.ManifestReads() // names its path; a unit test holds the two equal, so a difference fails. +// NeedsRules is the version of the validator's need rules (design 47 H2, H-A-569 (2), H-A-605 (4)): raised with every +// change of the rules that derive a need from a manifest. Each catalog revision the indexer writes carries it, and a +// take-in derives the rule needs of unmoved entries again only when its own is higher than its base revision's. +const NeedsRules = 1 + // requirementLong is one entry of `requires` in its long form, as catalogue reads it. type requirementLong struct { Name string `json:"name"` From c87d5fe6ab2ef0ece142b89beeb40225d615c4a9 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:22:12 +0100 Subject: [PATCH 24/44] DC8 wait-bound-and-clock: the seat mesh-pipeline-runner's Wait gains bound and clock-from, in form 13's raise Builds: design 47 H2 H-A-736 (1), H-A-599, H-A-611 --- .../go/seats/meshpipelinerunner/contract.go | 6 +++++- .../go/seats/meshpipelinerunner/contract_test.go | 2 +- .../seats/mesh-pipeline-runner/fixtures/events.json | 4 +++- .../seats/mesh-pipeline-runner/seat.json | 9 +++++++++ .../ts/seats/meshpipelinerunner/index.d.ts | 4 ++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index 6bc40ce57..1d7b491f4 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go @@ -20,7 +20,7 @@ const Form = 13 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "13" - generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=6de094f5329f Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=21e4ee7a3ef1 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=6de094f5329f Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=90066504aaa7 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" ) const ( @@ -1244,8 +1244,12 @@ type Wait struct { Artifact string `json:"artifact,omitempty"` // the step's own ask, where it has one (design 47 G §731) Ask string `json:"ask,omitempty"` + // a duration such as 30m: the runner's stalled-bound, which the watchman times the wait by (design 47 H2 H-A-599, H-A-611, H-A-736) + Bound string `json:"bound,omitempty"` // the watched branch, or the branch of a run on request Branch string `json:"branch"` + // the time the bound counts from: when the wait was held (design 47 H2 H-A-599, H-A-736) + ClockFrom *time.Time `json:"clock-from,omitempty"` // the commit the module's entry was last changed at Commit string `json:"commit,omitempty"` // the module's build-input fingerprint at the commit diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go index f8989f25f..9b46e9b0f 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -29,7 +29,7 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v PipelineEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-ended\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "a pipeline ended failed, naming the step that held it, no version released", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.main.3589", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"steps\":[{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"failed\",\"status\":\"required\",\"step\":\"unit\"},{\"module\":\"nats\",\"outcome\":\"not asked\",\"status\":\"required\",\"step\":\"approval\",\"why\":\"unit of nats:program failed\"}],\"tier\":1}],\"outcome\":\"failed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1,\"why\":\"unit of nats:program failed\"}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"movers\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"steps\":[{\"artifact\":\"nats:program\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"outcome\":\"failed\",\"status\":\"required\",\"step\":\"unit\"},{\"module\":\"nats\",\"outcome\":\"not asked\",\"status\":\"required\",\"step\":\"approval\",\"why\":\"unit of nats:program failed\"}],\"tier\":1}],\"outcome\":\"failed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"v\":1,\"why\":\"unit of nats:program failed\"}", decode: func(b []byte) (any, error) { var v PipelineEndedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.pipeline-ended\\.[^.*> ]+\\.[^.*> ]+$")}, - {name: "a pipeline over pipelines-at-once waits its turn", subject: "mesh.seat.mesh-pipeline-runner.event.wait-held.main.3590", given: "{\"branch\":\"main\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}", wire: "{\"branch\":\"main\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}", + {name: "a pipeline over pipelines-at-once waits its turn", subject: "mesh.seat.mesh-pipeline-runner.event.wait-held.main.3590", given: "{\"bound\":\"30m\",\"branch\":\"main\",\"clock-from\":\"2026-11-10T10:01:00Z\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}", wire: "{\"bound\":\"30m\",\"branch\":\"main\",\"clock-from\":\"2026-11-10T10:01:00Z\",\"on\":\"pipelines-at-once\",\"pipeline\":\"main.3590\",\"revision\":13,\"since\":\"2026-11-10T10:01:00Z\",\"source\":3590,\"step\":\"pipeline\",\"v\":1}", decode: func(b []byte) (any, error) { var v WaitHeldEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.wait-held\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "a run on request started", subject: "mesh.seat.mesh-pipeline-runner.event.run-started.nats.main.0123456789abcdef0123456789abcdef01234567", given: "{\"at\":\"2026-11-10T10:00:00Z\",\"by\":\"fix-1965@workstation\",\"members\":[{\"branch\":\"feature/1966-x\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"module\":\"nats\"}],\"run\":\"run-m2kx9a\",\"v\":1}", wire: "{\"at\":\"2026-11-10T10:00:00Z\",\"by\":\"fix-1965@workstation\",\"members\":[{\"branch\":\"feature/1966-x\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"module\":\"nats\"}],\"run\":\"run-m2kx9a\",\"v\":1}", decode: func(b []byte) (any, error) { var v RunStartedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-pipeline-runner\\.event\\.run-started\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")}, diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json index ffc143975..358035fd2 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/events.json @@ -364,7 +364,9 @@ "v": 1, "step": "pipeline", "on": "pipelines-at-once", - "since": "2026-11-10T10:01:00Z" + "since": "2026-11-10T10:01:00Z", + "bound": "30m", + "clock-from": "2026-11-10T10:01:00Z" } }, { diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json index 6b6f3f8e8..ec7b3bfbc 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -1992,6 +1992,15 @@ "type": "string", "description": "the step's own ask, where it has one (design 47 G §731)" }, + "bound": { + "type": "string", + "description": "a duration such as 30m: the runner's stalled-bound, which the watchman times the wait by (design 47 H2 H-A-599, H-A-611, H-A-736)" + }, + "clock-from": { + "type": "string", + "format": "date-time", + "description": "the time the bound counts from: when the wait was held (design 47 H2 H-A-599, H-A-736)" + }, "shared": { "type": "array", "items": { diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts index aeb039771..9c26b027e 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -692,8 +692,12 @@ export interface Wait { "artifact"?: string; /** the step's own ask, where it has one (design 47 G §731) */ "ask"?: string; + /** a duration such as 30m: the runner's stalled-bound, which the watchman times the wait by (design 47 H2 H-A-599, H-A-611, H-A-736) */ + "bound"?: string; /** the watched branch, or the branch of a run on request */ "branch": string; + /** the time the bound counts from: when the wait was held (design 47 H2 H-A-599, H-A-736) */ + "clock-from"?: string; /** the commit the module's entry was last changed at */ "commit"?: string; /** the module's build-input fingerprint at the commit */ From cb8046c3558884caf184d669fe3094ed43905ad1 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:22:40 +0100 Subject: [PATCH 25/44] Judge tests: a holder's served verbs are read from the seat's definition, the uplink's decision is read as naming ADR 0117 The kind: a test that lists a seat's verbs or decision by hand breaks when the seat gains one; met at mesh-networking a49d6d0 (node-resolver's uplink-names, node-uplink's decisions). Builds: design 47 H2 issue 1984 (lead answer of 25 Nov, thorough fix) --- .../mesh-delivery-indexer/judge/rules_test.go | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/modules/mesh-delivery-indexer/judge/rules_test.go b/modules/mesh-delivery-indexer/judge/rules_test.go index ec6a1a964..ea89b9c01 100644 --- a/modules/mesh-delivery-indexer/judge/rules_test.go +++ b/modules/mesh-delivery-indexer/judge/rules_test.go @@ -4293,7 +4293,7 @@ func caseOnlyAClaimantDeclaresASeatsPath(t *testing.T) { uplink := catalogue.Manifest{Module: "uplink", Version: "1", Claims: []catalogue.Claim{{Name: "node-uplink", Scope: catalogue.ScopeNode}}, Facts: map[string]catalogue.RosterFile{"resolvers": {Path: catalogue.ResolverFile, Template: "nameserver 10.42.0.1\n"}}} resolver := localResolver() - resolver.Claims[0].Serves = []string{"routes", "route", "unroute"} + resolver.Claims[0].Serves = seatVerbs(catalogue.ResolverSeat) if got := CatalogueProblems(catalogue.Shelf{"uplink": uplink, resolver.Module: resolver}); len(got) != 0 { t.Errorf("the uplink's holder and the resolver's declaring the resolver file were refused: %v", got) } @@ -4409,7 +4409,7 @@ func caseReplay412(t *testing.T) { t.Fatal("no node-hostname seat") } holder := catalogue.Manifest{Module: "names", Version: "1", Claims: []catalogue.Claim{{Name: "node-hostname", Scope: catalogue.ScopeNode, - Serves: []string{"entries", "add", "remove"}}}} + Serves: seatVerbs("node-hostname")}}} err := catalogue.CanHold(holder, seat) if err == nil { t.Fatal("a holder of node-hostname declaring neither /etc/hosts nor /etc/hostname was accepted") @@ -4959,7 +4959,7 @@ func caseTheMeshsOwnSeatsAreStillClaimable(t *testing.T) { // It delivers the bus, so its holder provides the bus — the rule this check now enforces. m := catalogue.Manifest{Module: "nats", Provides: []catalogue.Offer{{Name: "mesh-bus", Scope: catalogue.ScopeMesh, Credential: &catalogue.OfferCredential{Form: catalogue.CredentialFormNone}}}, - Claims: []catalogue.Claim{{Name: "mesh-broker", Scope: catalogue.ScopeMesh, Serves: []string{"snapshot-get", "snapshot-restore", "snapshot-restore-cancel", "snapshot-remove"}}}} + Claims: []catalogue.Claim{{Name: "mesh-broker", Scope: catalogue.ScopeMesh, Serves: seatVerbs("mesh-broker")}}} if got := problemsFor(t, catalogue.Shelf{"nats": m}); got != "" { t.Fatalf("a mesh seat was refused by the derived check: %s", got) } @@ -5308,7 +5308,7 @@ func caseTheUplinkIsANodeSeatThatDeliversNothing(t *testing.T) { if !known { t.Fatalf("the uplink is not a seat; the seats are: %s", seatNames()) } - if seat.Scope != catalogue.ScopeNode || seat.Delivers != "" || seat.Decision != "novox/hq ADR 0117" { + if seat.Scope != catalogue.ScopeNode || seat.Delivers != "" || !strings.Contains(seat.Decision, "ADR 0117") { t.Fatalf("the uplink is %+v, not a node seat delivering nothing by ADR 0117", seat) } // And a manager's module can hold it without providing anything. @@ -5640,7 +5640,7 @@ func hostnameSeat(t *testing.T) catalogue.Seat { func hostnameHolder(resources ...map[string]any) catalogue.Manifest { return catalogue.Manifest{Module: "names", Version: "1", Claims: []catalogue.Claim{{Name: "node-hostname", Scope: catalogue.ScopeNode, - Serves: []string{"entries", "add", "remove"}}}, Resources: resources} + Serves: seatVerbs("node-hostname")}}, Resources: resources} } func mustParse(t *testing.T, raw string) catalogue.Manifest { @@ -6248,6 +6248,20 @@ const mailStream = `[{"name":"mail","events":["mail.*.message.added","mail.*.mes // localResolver is a stand-in holder: it claims the seat and renders the resolver file naming the // machine's own address. What is under test is the controller's rule, not the catalogue's module. +// seatVerbs are the verbs the seat's definition declares, as a holder's claim names them: a verb added to a seat (met at +// mesh-networking a49d6d0, node-resolver's uplink-names) never breaks a test that lists them by hand. +func seatVerbs(seat string) []string { + def, ok := catalogue.SeatNamed(seat) + if !ok { + panic(seat + " is not a seat; the seats are: " + seatNames()) + } + var verbs []string + for _, v := range def.Serves { + verbs = append(verbs, v.Name) + } + return verbs +} + func localResolver() catalogue.Manifest { return catalogue.Manifest{Module: "local-resolver", Version: "1", Claims: []catalogue.Claim{{Name: catalogue.ResolverSeat, Scope: catalogue.ScopeNode}}, From 04d912b5c8e57494fe864c549f0a1e428f263f52 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:23:00 +0100 Subject: [PATCH 26/44] DC7b transfer-optional: the registry seats' publish answer has transfer present exactly when a transfer is opened, absent when other-bytes is present Builds: design 47 H2 H-A-732, H-A-729 --- .../go/seats/containerimageregistry/contract.go | 6 +++--- .../go/seats/containerimageregistry/contract_test.go | 4 ++-- .../go/seats/gopackageregistry/contract.go | 6 +++--- .../go/seats/gopackageregistry/contract_test.go | 4 ++-- .../go/seats/npmpackageregistry/contract.go | 6 +++--- .../go/seats/npmpackageregistry/contract_test.go | 4 ++-- .../go/seats/ociartifactregistry/contract.go | 6 +++--- .../go/seats/ociartifactregistry/contract_test.go | 4 ++-- modules/mesh-delivery-contracts/parts/registry.json | 6 ++---- .../seats/container-image-registry/fixtures/verbs.json | 2 -- .../seats/go-package-registry/fixtures/verbs.json | 2 -- .../seats/npm-package-registry/fixtures/verbs.json | 2 -- .../seats/oci-artifact-registry/fixtures/verbs.json | 2 -- .../ts/seats/containerimageregistry/parts/registry.d.ts | 4 ++-- .../ts/seats/gopackageregistry/parts/registry.d.ts | 4 ++-- .../ts/seats/npmpackageregistry/parts/registry.d.ts | 4 ++-- .../ts/seats/ociartifactregistry/parts/registry.d.ts | 4 ++-- 17 files changed, 30 insertions(+), 40 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go index 8022f6fa2..71db04ac7 100644 --- a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract.go @@ -22,7 +22,7 @@ const FormRegistry = 1 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "2 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" + generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ca49dd7f20ee Listed=b9f1d1232e64 MirrorAnswer=0d59df97b53b NameOfAnswer=cc75a2f37394 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 TagsAnswer=fe178191458a TagsAnswerTagsItem=eee02e024d64 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" ) const ( @@ -347,8 +347,8 @@ type PublishAnswer struct { Lacks []string `json:"lacks,omitempty"` // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` - // the transfer - Transfer string `json:"transfer"` + // the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) + Transfer string `json:"transfer,omitempty"` } // PublishPartInput is what publish-part takes. diff --git a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go index 394c0c88b..137855f7f 100644 --- a/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/containerimageregistry/contract_test.go @@ -57,9 +57,9 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v NameOfInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "name-of answers the copy's reference", subject: "", given: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", wire: "{\"reference\":\"container-image-registry/upstream/docker.io/library/nats@sha256:eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\"}", decode: func(b []byte) (any, error) { var v NameOfAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { diff --git a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go index 6a76fc78f..5f845b54a 100644 --- a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract.go @@ -21,7 +21,7 @@ const FormRegistry = 1 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "2 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" + generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" ) const ( @@ -207,8 +207,8 @@ type PublishAnswer struct { Lacks []string `json:"lacks,omitempty"` // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` - // the transfer - Transfer string `json:"transfer"` + // the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) + Transfer string `json:"transfer,omitempty"` } // PublishPartInput is what publish-part takes. diff --git a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go index f4070dd6f..bf8f8a014 100644 --- a/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/gopackageregistry/contract_test.go @@ -37,9 +37,9 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { diff --git a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go index 6bc9a77e2..99219ea91 100644 --- a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract.go @@ -21,7 +21,7 @@ const FormRegistry = 1 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "2 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" + generatedFieldsDigest = "Artifact=79361e4ab1cd KeptEvent=ec3ef89ef8a7 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 VersionsAnswer=47e11ca2aea9" ) const ( @@ -207,8 +207,8 @@ type PublishAnswer struct { Lacks []string `json:"lacks,omitempty"` // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` - // the transfer - Transfer string `json:"transfer"` + // the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) + Transfer string `json:"transfer,omitempty"` } // PublishPartInput is what publish-part takes. diff --git a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go index eeccc2a3d..e6e711118 100644 --- a/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/npmpackageregistry/contract_test.go @@ -37,9 +37,9 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v VersionsAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "a tagged version sharing its digest with another tag is kept, not removed", subject: "", given: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", wire: "{\"kept\":true,\"reason\":\"shared-digest\",\"removed\":false,\"tags\":[\"0.1.19\"]}", decode: func(b []byte) (any, error) { var v RemoveAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { diff --git a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go index 406be5b9c..e4317c328 100644 --- a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract.go @@ -22,7 +22,7 @@ const FormRegistry = 1 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "3 registry:1" - generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=1923c8239f6c PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" + generatedFieldsDigest = "Artifact=79361e4ab1cd HeldEvent=b6d4c12500df Hold=c5a97a2f2d5a HoldAnswer=7d536ccb729f HoldsBySeatNameDigestValue=db093998a869 KeptEvent=ec3ef89ef8a7 ListAnswer=ffc9dd135c75 Listed=b9f1d1232e64 Outcome=1e66f7bf6725 PublishAnswer=1ab67aa1750a PublishAnswerOtherBytes=06b1c9853343 PublishPartAnswer=aebe3c6c89e9 PublishedEvent=ec3ef89ef8a7 RefusedEvent=ec3ef89ef8a7 ReleaseAnswer=d30bd6000a16 ReleasedEvent=b6d4c12500df RemoveAnswer=bccb5a322d69 RemovedEvent=ec3ef89ef8a7 Repository=740e54e0b3b0 VersionsAnswer=47e11ca2aea9 WindowsByCallerValue=23d9294dde92 WindowsByCallerValueDroppedItem=d748f0e58825" ) const ( @@ -338,8 +338,8 @@ type PublishAnswer struct { Lacks []string `json:"lacks,omitempty"` // the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) OtherBytes *PublishAnswerOtherBytes `json:"other-bytes,omitempty"` - // the transfer - Transfer string `json:"transfer"` + // the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) + Transfer string `json:"transfer,omitempty"` } // PublishPartInput is what publish-part takes. diff --git a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go index e6cb547d3..b8538f044 100644 --- a/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/ociartifactregistry/contract_test.go @@ -57,9 +57,9 @@ func TestFixtures(t *testing.T) { decode: func(b []byte) (any, error) { var v ListInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, {name: "list answers a capped page with the cursor of the next", subject: "", given: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", wire: "{\"capped\":true,\"next\":\"c-4183\",\"repositories\":[{\"manifests\":[{\"digest\":\"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"held\":false,\"index\":false,\"size\":4096}],\"name\":\"mail/files\"}],\"total\":3}", decode: func(b []byte) (any, error) { var v ListAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes: the name and version are held with another digest (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\",\"fingerprint\":\"src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, - {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"},\"transfer\":\"\"}", + {name: "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", subject: "", given: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", wire: "{\"other-bytes\":{\"digest\":\"sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc\"}}", decode: func(b []byte) (any, error) { var v PublishAnswer; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil}, } for _, c := range cases { diff --git a/modules/mesh-delivery-contracts/parts/registry.json b/modules/mesh-delivery-contracts/parts/registry.json index 6d9b0c560..224fd42d3 100644 --- a/modules/mesh-delivery-contracts/parts/registry.json +++ b/modules/mesh-delivery-contracts/parts/registry.json @@ -68,7 +68,7 @@ "properties": { "transfer": { "type": "string", - "description": "the transfer" + "description": "the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732)" }, "lacks": { "type": "array", @@ -99,9 +99,7 @@ ] } }, - "required": [ - "transfer" - ] + "required": [] }, "optional": true }, diff --git a/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json index e25c4ca38..5764ffd7d 100644 --- a/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/container-image-registry/fixtures/verbs.json @@ -165,7 +165,6 @@ "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" @@ -176,7 +175,6 @@ "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" } diff --git a/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json index 2a23403bd..74546a4e2 100644 --- a/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/go-package-registry/fixtures/verbs.json @@ -111,7 +111,6 @@ "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" @@ -122,7 +121,6 @@ "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" } diff --git a/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json index 94cf68a84..124327c9e 100644 --- a/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/npm-package-registry/fixtures/verbs.json @@ -111,7 +111,6 @@ "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" @@ -122,7 +121,6 @@ "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" } diff --git a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json index b7c26ec76..40328985e 100644 --- a/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json +++ b/modules/mesh-delivery-contracts/seats/oci-artifact-registry/fixtures/verbs.json @@ -169,7 +169,6 @@ "name": "publish answers other-bytes: the name and version are held with another digest (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", "fingerprint": "src2:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" @@ -180,7 +179,6 @@ "name": "publish answers other-bytes, the holder keeping no fingerprint (H-A-729)", "of": "verb:publish.answer", "given": { - "transfer": "", "other-bytes": { "digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc" } diff --git a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts index 30792b93b..109f1be37 100644 --- a/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/containerimageregistry/parts/registry.d.ts @@ -114,8 +114,8 @@ export interface PublishAnswer { "lacks"?: string[]; /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ "other-bytes"?: PublishAnswerOtherBytes; - /** the transfer */ - "transfer": string; + /** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */ + "transfer"?: string; } /** is what publish-part takes. */ diff --git a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts index 30792b93b..109f1be37 100644 --- a/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/gopackageregistry/parts/registry.d.ts @@ -114,8 +114,8 @@ export interface PublishAnswer { "lacks"?: string[]; /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ "other-bytes"?: PublishAnswerOtherBytes; - /** the transfer */ - "transfer": string; + /** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */ + "transfer"?: string; } /** is what publish-part takes. */ diff --git a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts index 30792b93b..109f1be37 100644 --- a/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/npmpackageregistry/parts/registry.d.ts @@ -114,8 +114,8 @@ export interface PublishAnswer { "lacks"?: string[]; /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ "other-bytes"?: PublishAnswerOtherBytes; - /** the transfer */ - "transfer": string; + /** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */ + "transfer"?: string; } /** is what publish-part takes. */ diff --git a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts index 30792b93b..109f1be37 100644 --- a/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/ociartifactregistry/parts/registry.d.ts @@ -114,8 +114,8 @@ export interface PublishAnswer { "lacks"?: string[]; /** the holder holds that name and version with another digest: the digest and the fingerprint it keeps for them, answered instead of failing the call (the fingerprint absent where it keeps none); present only in that case, and never with lacks; the holder says both digests and both fingerprints in its journal (design 47 H2 H-A-589 (1), H-A-729) */ "other-bytes"?: PublishAnswerOtherBytes; - /** the transfer */ - "transfer": string; + /** the transfer the publish opens for its chunks; present whenever a transfer is opened and absent exactly when other-bytes is present, never an empty name (design 47 H2 H-A-732) */ + "transfer"?: string; } /** is what publish-part takes. */ From 13eccb33b377e74b49fe3925b6c8e4022acfdef4 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:23:32 +0100 Subject: [PATCH 27/44] I12 ledger-end-rules: ended-days 1 to 3650, an ends-with naming a field of its schema, ended-days and ends-with given together Builds: design 47 H2 H-A-634 (3), H-A-690 --- .../mesh-delivery-indexer/judge/busstate.go | 18 +++++++++++++++++- .../judge/busstate_test.go | 16 ++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/mesh-delivery-indexer/judge/busstate.go b/modules/mesh-delivery-indexer/judge/busstate.go index 28a0900c5..c90d97693 100644 --- a/modules/mesh-delivery-indexer/judge/busstate.go +++ b/modules/mesh-delivery-indexer/judge/busstate.go @@ -119,7 +119,8 @@ var bareStream = map[string]optionRule{ // ledgerConfiguration is what a ledger's own configuration may give: how long its history is kept (design 25 § 12.1). var ledgerConfiguration = map[string]optionRule{ - catalogue.OptionAgeDays: {kind: optionInt, least: 1, most: 3650}, + catalogue.OptionAgeDays: {kind: optionInt, least: 1, most: 3650}, + catalogue.ConfigEndedDays: {kind: optionInt, least: 1, most: 3650}, } // noAge is how a bare stream says it keeps its messages for good. @@ -433,6 +434,7 @@ func ledgerTypeProblems(at string, e catalogue.BusStateEntry) []string { problems = append(problems, fmt.Sprintf("%s: a ledger names at least one type (novox/hq ADR 0597 §1)", at)) } seen := map[string]bool{} + endsWith := false for _, t := range e.Types { where := fmt.Sprintf("%s: type %q", at, t.Name) switch { @@ -473,6 +475,12 @@ func ledgerTypeProblems(at string, e catalogue.BusStateEntry) []string { } } } + if t.EndsWith != "" { + endsWith = true + if _, ok := t.Schema[t.EndsWith]; !ok { + problems = append(problems, fmt.Sprintf("%s: ends-with names the field %q, which the type's schema does not hold (design 47 H2 H-A-634 (3))", where, t.EndsWith)) + } + } for _, name := range slices.Sorted(maps.Keys(t.Schema)) { of := t.Schema[name].DigestOf if of == "" { @@ -483,6 +491,14 @@ func ledgerTypeProblems(at string, e catalogue.BusStateEntry) []string { } } } + // A ledger gives ended instances a lifetime (ended-days) exactly when a type says what ends an instance (ends-with). + _, endedDays := e.Configuration[catalogue.ConfigEndedDays] + if endedDays && !endsWith { + problems = append(problems, fmt.Sprintf("%s: the configuration gives %s and no type names ends-with, so no instance ends (design 47 H2 H-A-634 (3))", at, catalogue.ConfigEndedDays)) + } + if endsWith && !endedDays { + problems = append(problems, fmt.Sprintf("%s: a type names ends-with and the configuration gives no %s (design 47 H2 H-A-634 (3))", at, catalogue.ConfigEndedDays)) + } return problems } diff --git a/modules/mesh-delivery-indexer/judge/busstate_test.go b/modules/mesh-delivery-indexer/judge/busstate_test.go index 973dee8c9..b59538c17 100644 --- a/modules/mesh-delivery-indexer/judge/busstate_test.go +++ b/modules/mesh-delivery-indexer/judge/busstate_test.go @@ -16,6 +16,15 @@ import ( func TestBusStateIsJudgedOnce(t *testing.T) { const ledger = `{"name":"records","storage":"ledger","template":"ledger","options":{"max-mib":512},"types":[` + `{"name":"decision","schema":{"title":{"type":"text"}},"operations":[{"name":"propose","effect":"set-fields","fields":["title"]}]}]}` + ended := func(ledger, days, endsWith string) string { + if days != "" { + ledger = strings.Replace(ledger, `"options"`, `"configuration":{"ended-days":`+days+`},"options"`, 1) + } + if endsWith != "" { + ledger = strings.Replace(ledger, `"name":"decision",`, `"name":"decision","ends-with":"`+endsWith+`",`, 1) + } + return ledger + } manifest := func(entries string) string { return `{"module":"a","version":"1.0","requires":[` + entries + `]}` } @@ -84,6 +93,13 @@ func TestBusStateIsJudgedOnce(t *testing.T) { {"a bare stream with a wrong when full", manifest(`{"name":"x","storage":"stream","configuration":{"when-full":"crash","max-mib":10,"max-age-days":9}}`), []string{"\"x\"", "\"when-full\"", "\"refuse\" or \"drop-oldest\""}}, {"a ledger effect outside the four", manifest(strings.Replace(ledger, `"set-fields"`, `"upsert"`, 1)), []string{"\"records\"", "effect \"upsert\"", "outside the four"}}, {"a ledger whose history expires", manifest(strings.Replace(ledger, `"options"`, `"configuration":{"max-age-days":30},"options"`, 1)), nil}, + // Design 47 H2 H-A-634 (3), H-A-690: ended-days is 1 to 3650 and goes with a type naming the field that ends an instance. + {"a ledger whose ended instances live 30 days", manifest(ended(ledger, "30", "title")), nil}, + {"ended-days 0", manifest(ended(ledger, "0", "title")), []string{"\"ended-days\""}}, + {"ended-days 3651", manifest(ended(ledger, "3651", "title")), []string{"\"ended-days\""}}, + {"an ends-with naming no field of the schema", manifest(ended(ledger, "30", "nothing")), []string{"ends-with", "\"nothing\""}}, + {"ended-days with no type naming ends-with", manifest(ended(ledger, "30", "")), []string{"ended-days", "no type names ends-with"}}, + {"ends-with with no ended-days", manifest(ended(ledger, "", "title")), []string{"ends-with", "no ended-days"}}, // DLV-I12 (ADR 0595 §8, ADR 0597 §2, §4): each refusal names the module, the entry, the type, the operation or index, and the field. {"a set-entry naming no into", manifest(strings.Replace(ledger, `"effect":"set-fields","fields":["title"]`, `"effect":"set-entry","key":"title"`, 1)), []string{"\"records\"", "type \"decision\"", "operation \"propose\"", "no into"}}, From 336d2abaa8887c8b60f50574a4342623d2aa9540 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:24:26 +0100 Subject: [PATCH 28/44] I6 npm-test-files: the files of an npm package that leave its digest are the indexer's setting npm-test-files, no pattern left in code Builds: design 47 H2 H-A-598, H-A-573 --- .../cmd/mesh-delivery-indexer/main.go | 17 +++++++ .../internal/fingerprint/fingerprint.go | 50 +++++++++++++++---- .../internal/fingerprint/fingerprint_test.go | 19 +++++-- .../internal/index/candidates.go | 3 ++ .../internal/index/packages.go | 2 +- .../internal/index/packages_gone_test.go | 2 +- modules/mesh-delivery-indexer/module.json | 7 +++ 7 files changed, 83 insertions(+), 17 deletions(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go index 8799a9df6..4bbc7f045 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go @@ -358,6 +358,7 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro Packages: awaitedStore{b: packages, js: js, name: index.Bucket(cred.Module, index.PackagesState)}, Files: filesVia(calls.Call), GoMod: goModVia(calls.Call), Heard: heardStore, Runs: awaitedStore{b: runs}, Graph: graph, // How long a reservation is kept and how long its gathering waits at most (design 47 H2 §805, H-A-424). + NpmTestFiles: listSetting("npm-test-files", logger.Printf), ReservedKeep: durationSetting("reserved-keep", index.DefaultReservedKeep, logger.Printf), ReservedSettle: durationSetting("reserved-settle", index.DefaultReservedSettle, logger.Printf), // How long a take-in waits on another part before it says so, and before it raises take-in-waiting (H2 §803, H-A-461 (2)). @@ -684,3 +685,19 @@ func durationSetting(key string, def time.Duration, logf func(string, ...any)) t } return d } + +// listSetting is the setting key read as a list of comma-separated words; one that is not given is said and is no words. +func listSetting(key string, logf func(string, ...any)) []string { + v, ok := stdio.Setting(key) + if !ok { + logf("the setting %s is not given: no file of an npm package is left out of its digest but node_modules", key) + return nil + } + var out []string + for _, w := range strings.Split(v, ",") { + if w = strings.TrimSpace(w); w != "" { + out = append(out, w) + } + } + return out +} diff --git a/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint.go b/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint.go index dca0b6c16..8ce61fdbe 100644 --- a/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint.go +++ b/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint.go @@ -386,11 +386,11 @@ func Packages(module string, files map[string]string) (requires string, packages // (design 47 H2 H-A-546 (1)). It refuses a listing with no package.json at that directory. // // Its one package is the npm name, its digest the hex sha256 of the sorted lines " " of every -// file under it but node_modules and the test files of `node --test`'s default patterns, which the Node build module's unit -// step runs (H-A-547): a file named `*.test.*`, `*-test.*`, `*_test.*` or `test.*`, and everything under a directory named -// test. The requirements' digest is the hex sha256 of the lines "package.json " and "package-lock.json " -// (the second absent with no lock file), as H-A-525 has it for go.mod and go.sum. -func NpmPackage(name string, files map[string]string) (requires string, packages []meshcatalog.PackagesByModuleValuePackagesItem, err error) { +// file under it but node_modules and the test files the indexer's setting npm-test-files names (H-A-598), the patterns of +// `node --test`'s defaults which the Node build module's unit step runs (H-A-547) as the setting's default has them. The +// requirements' digest is the hex sha256 of the lines "package.json " and "package-lock.json " (the second +// absent with no lock file), as H-A-525 has it for go.mod and go.sum. +func NpmPackage(name string, files map[string]string, testFiles []string) (requires string, packages []meshcatalog.PackagesByModuleValuePackagesItem, err error) { pj, ok := files["package.json"] if !ok { return "", nil, fmt.Errorf("the npm package %s has no package.json at its directory", name) @@ -402,7 +402,7 @@ func NpmPackage(name string, files map[string]string) (requires string, packages sum := sha256.Sum256([]byte(req)) var lines []string for p, object := range files { - if npmLeftOut(p) { + if npmLeftOut(p, testFiles) { continue } lines = append(lines, p+" "+object) @@ -413,15 +413,43 @@ func NpmPackage(name string, files map[string]string) (requires string, packages } // npmLeftOut is whether a file of an npm package, by its path relative to the package, leaves its digest: under -// node_modules or a directory named test, or a test file by `node --test`'s default patterns (H-A-547). -func npmLeftOut(p string) bool { - dir, file := path.Split(p) +// node_modules, or matching one of the setting npm-test-files' patterns (H-A-547, H-A-598). +func npmLeftOut(p string, testFiles []string) bool { + dir, _ := path.Split(p) for _, e := range strings.Split(strings.TrimSuffix(dir, "/"), "/") { - if e == "node_modules" || e == "test" { + if e == "node_modules" { return true } } - return strings.HasPrefix(file, "test.") || strings.Contains(file, ".test.") || strings.Contains(file, "-test.") || strings.Contains(file, "_test.") + for _, pattern := range testFiles { + if globMatch(strings.Split(pattern, "/"), strings.Split(p, "/")) { + return true + } + } + return false +} + +// globMatch is whether the path's segments match the pattern's: a segment by path.Match, `**` any number of segments +// (none included). +func globMatch(pattern, segments []string) bool { + if len(pattern) == 0 { + return len(segments) == 0 + } + if pattern[0] == "**" { + for i := 0; i <= len(segments); i++ { + if globMatch(pattern[1:], segments[i:]) { + return true + } + } + return false + } + if len(segments) == 0 { + return false + } + if ok, err := path.Match(pattern[0], segments[0]); err != nil || !ok { + return false + } + return globMatch(pattern[1:], segments[1:]) } // ignoredDir is whether the go tool takes no package from dir: an element named testdata, or starting with _ or . diff --git a/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint_test.go b/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint_test.go index cbccd2319..7c3e797f4 100644 --- a/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint_test.go +++ b/modules/mesh-delivery-indexer/internal/fingerprint/fingerprint_test.go @@ -13,6 +13,9 @@ const sdk = "git.novox.be/novox/mesh-sdk/go" // The indexer's one computation (ADR 0593 §2): what moved out of mesh-sdk computes what it computed, the import form // moves only with what a module imports, and a package's digest is its own files. +// npmTestFiles are the setting npm-test-files' default, as the indexer's manifest gives it (H-A-573, H-A-598). +var npmTestFiles = []string{"**/*.test.*", "**/*-test.*", "**/*_test.*", "**/test.*", "**/test/**"} + func TestTheFingerprintComputation(t *testing.T) { t.Run("the moved computation gives the values it gave in mesh-sdk", movedComputationGivesTheValuesItGaveInMeshSDK) t.Run("the import form moves only with what the module imports", importFormMovesOnlyWithWhatTheModuleImports) @@ -222,7 +225,7 @@ func packageDigestIsItsOwnFiles(t *testing.T) { npm := map[string]string{"package.json": "p1", "package-lock.json": "l1", "src/stdio.ts": "a", "dist/stdio.js": "b", "src/stdio.test.ts": "t1", "src/a-test.ts": "t2", "src/a_test.mjs": "t3", "test.js": "t4", "test/x.ts": "t5", "node_modules/x/index.js": "n"} - npmReq, npmPkgs, err := NpmPackage("@novox/mesh-sdk", npm) + npmReq, npmPkgs, err := NpmPackage("@novox/mesh-sdk", npm, npmTestFiles) if err != nil || len(npmPkgs) != 1 || npmPkgs[0].Package != "@novox/mesh-sdk" || npmPkgs[0].Digest == "" || npmReq == "" { t.Fatalf("NpmPackage = %q, %+v, %v; want one package by its npm name", npmReq, npmPkgs, err) } @@ -231,7 +234,7 @@ func packageDigestIsItsOwnFiles(t *testing.T) { moves bool }{{"src/stdio.ts", true}, {"dist/stdio.js", true}, {"package.json", true}, {"src/stdio.test.ts", false}, {"src/a-test.ts", false}, {"src/a_test.mjs", false}, {"test.js", false}, {"test/x.ts", false}, {"node_modules/x/index.js", false}} { - r, ps, _ := NpmPackage("@novox/mesh-sdk", with(npm, c.file, "zz")) + r, ps, _ := NpmPackage("@novox/mesh-sdk", with(npm, c.file, "zz"), npmTestFiles) if moved := ps[0].Digest != npmPkgs[0].Digest; moved != c.moves { t.Errorf("changing %s of the npm package moved its digest %v, want %v", c.file, moved, c.moves) } @@ -239,10 +242,18 @@ func packageDigestIsItsOwnFiles(t *testing.T) { t.Error("a changed package.json left the npm package's requirements' digest") } } - if r2, _, _ := NpmPackage("@novox/mesh-sdk", with(npm, "package-lock.json", "l2")); r2 == npmReq { + // H-A-598: the patterns are the setting's; given one, a file it matches leaves the digest and another file moves it. + one := []string{"**/*.spec.*"} + _, base, _ := NpmPackage("@novox/mesh-sdk", with(npm, "src/a.spec.ts", "s"), one) + _, specMoved, _ := NpmPackage("@novox/mesh-sdk", with(npm, "src/a.spec.ts", "s2"), one) + _, otherMoved, _ := NpmPackage("@novox/mesh-sdk", with(npm, "src/stdio.test.ts", "t9"), one) + if specMoved[0].Digest != base[0].Digest || otherMoved[0].Digest == base[0].Digest { + t.Error("with the setting npm-test-files given one pattern, a file it matches moved the digest or another did not") + } + if r2, _, _ := NpmPackage("@novox/mesh-sdk", with(npm, "package-lock.json", "l2"), npmTestFiles); r2 == npmReq { t.Error("a changed lock file left the npm package's requirements' digest") } - if _, _, err := NpmPackage("@novox/mesh-sdk", map[string]string{"index.js": "x"}); err == nil { + if _, _, err := NpmPackage("@novox/mesh-sdk", map[string]string{"index.js": "x"}, npmTestFiles); err == nil { t.Error("a listing with no package.json was taken as an npm package") } } diff --git a/modules/mesh-delivery-indexer/internal/index/candidates.go b/modules/mesh-delivery-indexer/internal/index/candidates.go index ffa206021..f174f0ab1 100644 --- a/modules/mesh-delivery-indexer/internal/index/candidates.go +++ b/modules/mesh-delivery-indexer/internal/index/candidates.go @@ -186,6 +186,9 @@ type Indexer struct { // first reservation its gathering settles at the latest: the settings reserved-keep and reserved-settle (design 47 H2 // §805, H-A-424); zero takes the default. ReservedKeep, ReservedSettle time.Duration + // NpmTestFiles are the patterns of the files that leave an npm package's digest, the setting npm-test-files (design 47 H2 + // H-A-598); none leaves only node_modules. + NpmTestFiles []string // WaitingLine is how long a take-in waits on another part before it says so and keeps its waiting-on, and WaitingBound // how long before it raises take-in-waiting: the settings take-in-waiting-line and take-in-waiting-bound (design 47 H2 // §803, H-A-461 (2)); zero takes the default. diff --git a/modules/mesh-delivery-indexer/internal/index/packages.go b/modules/mesh-delivery-indexer/internal/index/packages.go index 8774d9950..be90fcc80 100644 --- a/modules/mesh-delivery-indexer/internal/index/packages.go +++ b/modules/mesh-delivery-indexer/internal/index/packages.go @@ -459,7 +459,7 @@ func (ix *Indexer) npmPackagesIn(ctx context.Context, repository, commit string, if _, ok := files["package.json"]; !ok { continue } - requires, pkgs, err := fingerprint.NpmPackage(name, files) + requires, pkgs, err := fingerprint.NpmPackage(name, files, ix.NpmTestFiles) if err != nil { ix.logf("%s at %s: %v; it is not published", repository, commit, err) break diff --git a/modules/mesh-delivery-indexer/internal/index/packages_gone_test.go b/modules/mesh-delivery-indexer/internal/index/packages_gone_test.go index b56415076..6a2ba3356 100644 --- a/modules/mesh-delivery-indexer/internal/index/packages_gone_test.go +++ b/modules/mesh-delivery-indexer/internal/index/packages_gone_test.go @@ -226,7 +226,7 @@ func TestARepositorysPackagesAreThoseInTheMergesTree(t *testing.T) { if err := ix.publish(ctx, "novox/mesh-sdk", merge, held, false, TrunkBranch); err != nil { t.Fatal(err) } - _, want, _ := fingerprint.NpmPackage(npmName, listing) + _, want, _ := fingerprint.NpmPackage(npmName, listing, nil) got, ok := ix.publishedAll(ctx)[npmName] if !ok || got.Repository != "novox/mesh-sdk" || got.Dir != "ts" || got.Commit != merge || !reflect.DeepEqual(got.Packages, want) { t.Fatalf("packages of %s = %+v (%v), want its digest %+v from novox/mesh-sdk at ts; asked %v", npmName, got, ok, want, asked) diff --git a/modules/mesh-delivery-indexer/module.json b/modules/mesh-delivery-indexer/module.json index 035b7ab74..dbedebf97 100644 --- a/modules/mesh-delivery-indexer/module.json +++ b/modules/mesh-delivery-indexer/module.json @@ -116,6 +116,13 @@ "default": "30s", "runtime": true }, + "npm-test-files": { + "type": "string", + "description": "the patterns of the files of an npm package that leave its digest, comma-separated: a segment as path.Match reads it, ** any number of directories; node's own test patterns and everything under a test directory (design 47 H2 H-A-573, H-A-598).", + "trusted": false, + "default": "**/*.test.*,**/*-test.*,**/*_test.*,**/test.*,**/test/**", + "runtime": true + }, "reserved-keep": { "type": "string", "description": "how long the indexer keeps a pipeline's reservation of a package's version in its state heard (reserved..), a Go duration (design 47 H2 §805, H-A-424 (2)).", From bcf170a003cf9316ea804842f191109ad2246731 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:25:45 +0100 Subject: [PATCH 29/44] I9 dropped-subjects-acked: the hub acknowledges toolchain-agreed and wait-ended with no work and says each subject once Builds: design 47 H2 H-A-578 (2), H-A-651, H-A-706 --- .../cmd/mesh-delivery-indexer/dropped.go | 27 +++++++++++++++++++ .../cmd/mesh-delivery-indexer/main.go | 5 ++++ .../cmd/mesh-delivery-indexer/main_test.go | 18 +++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/dropped.go diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/dropped.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/dropped.go new file mode 100644 index 000000000..fa9d56184 --- /dev/null +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/dropped.go @@ -0,0 +1,27 @@ +package main + +import ( + "sync" + + "github.com/nats-io/nats.go/jetstream" + + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshbuilds" + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants" +) + +// droppedSubjects are the subjects the indexer's manifest no longer consumes while its durable consumer's filter still +// holds them, since the grants part never narrows a filter for a dropped entry (design 47 H2 H-A-578 (2), H-A-651): the +// toolchain agreement of the builder and the end of a want's wait. Listed once, here, beside the hub's handlers. +var droppedSubjects = []string{meshbuilds.SubjectToolchainAgreed, meshwants.SubjectWaitEnded} + +// ackDropped is the hub's handler of a subject no longer consumed: it acknowledges each message at once, with no work, so +// the finding event-unhandled stays clear, and says one journal line for the subject at the first one after the start. +func ackDropped(subject string, logf func(string, ...any)) func(jetstream.Msg) { + var once sync.Once + return func(m jetstream.Msg) { + once.Do(func() { + logf("%s is no longer consumed: its events are acknowledged with no work (design 47 H2 H-A-578 (2))", subject) + }) + _ = m.Ack() + } +} diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go index 4bbc7f045..df3617cd5 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go @@ -616,6 +616,11 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro if err := hub.Handle(decidedSubject(cred.Module), func(m jetstream.Msg) { heardDecided(ctx, registry, m, logger.Printf) }); err != nil { return err } + for _, subject := range droppedSubjects { + if err := hub.Handle(subject, ackDropped(subject, logger.Printf)); err != nil { + return err + } + } // The indexer's own room wakes every take-in held on a full catalog store (design 47 H §744, H-A-50). if err := hub.Handle(meshcatalog.SubjectRoom, func(m jetstream.Msg) { _ = m.Ack(); go sources.takeAgain() }); err != nil { return err diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main_test.go index 8ff5d8db6..cec137541 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main_test.go @@ -3,6 +3,8 @@ package main import ( "context" "encoding/json" + "fmt" + "strings" "testing" "time" @@ -113,3 +115,19 @@ func (h *startedHub) StartKept(context.Context, jetstream.JetStream, process.Acc h.kept = true return 1 } + +// H-A-578 (2): an event of a subject the indexer no longer consumes is acknowledged with no work, and the journal says +// the subject once, at the first. +func TestASubjectNoLongerConsumedIsAcknowledgedAndSaidOnce(t *testing.T) { + if len(droppedSubjects) != 2 { + t.Fatalf("the dropped subjects are %v, want the toolchain agreement and the wait's end", droppedSubjects) + } + var said []string + handle := ackDropped(droppedSubjects[0], func(format string, a ...any) { said = append(said, fmt.Sprintf(format, a...)) }) + first, second := &ackedMsg{}, &ackedMsg{} + handle(first) + handle(second) + if first.acked != 1 || second.acked != 1 || len(said) != 1 || !strings.Contains(said[0], droppedSubjects[0]) { + t.Errorf("acked %d and %d, said %q; want both acknowledged and the subject said once", first.acked, second.acked, said) + } +} From 3bb8413dbd46fa0d320a86bda129cfedde369f76 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:28:22 +0100 Subject: [PATCH 30/44] K3 answered-digest, K4 kits: a publish answered other-bytes with the publish's own fingerprint is the held digest in the step result and both in the log, else refused; the publish kit's rows follow H-A-738, the reproducible kit The shared publish names the ask's own fingerprint on a publish that names none. The kit's Bed gains HoldWith, PublishWith and Held. Builds: design 47 H2 H-A-589 (4), H-A-589 (5), H-A-591, H-A-593 (2) (3), H-A-738 (1) --- .../containerimageregistryclient/client.go | 6 +- .../clients/gopackageregistryclient/client.go | 6 +- .../npmpackageregistryclient/client.go | 6 +- .../ociartifactregistryclient/client.go | 6 +- modules/mesh-delivery-sdk/parts/parts.go | 16 ++++- .../publishconformance/publishconformance.go | 61 ++++++++++++++---- .../publishconformance_test.go | 34 ++++++++++ modules/mesh-delivery-sdk/steprun/answered.go | 62 +++++++++++++++++++ modules/mesh-delivery-sdk/steprun/askrun.go | 15 ++++- .../steprun/conformance/conformance.go | 44 +++++++++++++ .../steprun/conformance/conformance_test.go | 21 +++++++ modules/mesh-delivery-sdk/steprun/publish.go | 6 ++ .../mesh-delivery-sdk/steprun/publish_test.go | 59 ++++++++++++++++++ 13 files changed, 323 insertions(+), 19 deletions(-) create mode 100644 modules/mesh-delivery-sdk/publishconformance/publishconformance_test.go create mode 100644 modules/mesh-delivery-sdk/steprun/answered.go create mode 100644 modules/mesh-delivery-sdk/steprun/publish_test.go diff --git a/modules/mesh-delivery-contracts/go/clients/containerimageregistryclient/client.go b/modules/mesh-delivery-contracts/go/clients/containerimageregistryclient/client.go index 249d10cee..4e3920d42 100644 --- a/modules/mesh-delivery-contracts/go/clients/containerimageregistryclient/client.go +++ b/modules/mesh-delivery-contracts/go/clients/containerimageregistryclient/client.go @@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa if err := json.Unmarshal(raw, &a); err != nil { return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err) } - return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil + opened := parts.Opened{Held: a.Held, Lacks: a.Lacks} + if a.OtherBytes != nil { + opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint} + } + return opened, nil } chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error { raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part, diff --git a/modules/mesh-delivery-contracts/go/clients/gopackageregistryclient/client.go b/modules/mesh-delivery-contracts/go/clients/gopackageregistryclient/client.go index 4bbda8c80..de0ca7b64 100644 --- a/modules/mesh-delivery-contracts/go/clients/gopackageregistryclient/client.go +++ b/modules/mesh-delivery-contracts/go/clients/gopackageregistryclient/client.go @@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa if err := json.Unmarshal(raw, &a); err != nil { return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err) } - return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil + opened := parts.Opened{Held: a.Held, Lacks: a.Lacks} + if a.OtherBytes != nil { + opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint} + } + return opened, nil } chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error { raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part, diff --git a/modules/mesh-delivery-contracts/go/clients/npmpackageregistryclient/client.go b/modules/mesh-delivery-contracts/go/clients/npmpackageregistryclient/client.go index c35810ae6..b1a860b67 100644 --- a/modules/mesh-delivery-contracts/go/clients/npmpackageregistryclient/client.go +++ b/modules/mesh-delivery-contracts/go/clients/npmpackageregistryclient/client.go @@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa if err := json.Unmarshal(raw, &a); err != nil { return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err) } - return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil + opened := parts.Opened{Held: a.Held, Lacks: a.Lacks} + if a.OtherBytes != nil { + opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint} + } + return opened, nil } chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error { raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part, diff --git a/modules/mesh-delivery-contracts/go/clients/ociartifactregistryclient/client.go b/modules/mesh-delivery-contracts/go/clients/ociartifactregistryclient/client.go index 68e1c6a82..b6ca294ba 100644 --- a/modules/mesh-delivery-contracts/go/clients/ociartifactregistryclient/client.go +++ b/modules/mesh-delivery-contracts/go/clients/ociartifactregistryclient/client.go @@ -44,7 +44,11 @@ func Publish(ctx context.Context, call Call, in seat.PublishInput, ps []parts.Pa if err := json.Unmarshal(raw, &a); err != nil { return parts.Opened{}, fmt.Errorf("%s's answer to publish: %w", seat.Seat, err) } - return parts.Opened{Held: a.Held, Lacks: a.Lacks}, nil + opened := parts.Opened{Held: a.Held, Lacks: a.Lacks} + if a.OtherBytes != nil { + opened.Other = &parts.Other{Digest: a.OtherBytes.Digest, Fingerprint: a.OtherBytes.Fingerprint} + } + return opened, nil } chunk := func(_ context.Context, part string, sequence int, last bool, data []byte) error { raw, err := call("seat:"+seat.Seat+"."+seat.VerbPublishPart, seat.PublishPartInput{Transfer: in.Transfer, Part: part, diff --git a/modules/mesh-delivery-sdk/parts/parts.go b/modules/mesh-delivery-sdk/parts/parts.go index e16c46318..7d13964fd 100644 --- a/modules/mesh-delivery-sdk/parts/parts.go +++ b/modules/mesh-delivery-sdk/parts/parts.go @@ -31,6 +31,15 @@ type Part struct { type Opened struct { Held bool Lacks []string + // Other is the receiver's answer that it holds the name and version with another digest: nothing is sent (design 47 H2 + // H-A-729, H-A-738). + Other *Other +} + +// Other is the digest a receiver holds for a name and version it was offered other bytes for, and the fingerprint it keeps +// for them, empty where it keeps none. +type Other struct { + Digest, Fingerprint string } // Open opens (or opens again) the transfer on the receiver, naming every part: the caller's own call. @@ -45,6 +54,8 @@ type Sent struct { Held bool Parts []string Chunks int + // Other is what the receiver held the name and version as, when it answered other bytes: nothing was sent. + Other *Other } // Send opens the transfer and sends the parts the receiver answers it lacks, each in chunks of at most MaxChunk, in @@ -59,7 +70,10 @@ func Send(ctx context.Context, open Open, chunk Chunk, parts []Part) (Sent, erro if err != nil { return Sent{}, err } - sent := Sent{Held: opened.Held} + sent := Sent{Held: opened.Held, Other: opened.Other} + if opened.Other != nil { + return sent, nil + } for _, d := range opened.Lacks { p, ok := byDigest[d] if !ok { diff --git a/modules/mesh-delivery-sdk/publishconformance/publishconformance.go b/modules/mesh-delivery-sdk/publishconformance/publishconformance.go index 336583202..2d535edbc 100644 --- a/modules/mesh-delivery-sdk/publishconformance/publishconformance.go +++ b/modules/mesh-delivery-sdk/publishconformance/publishconformance.go @@ -2,8 +2,9 @@ // one contract cannot each read it their own way (novox/hq design 47 G A-73, A-417, A-490): a publish with a version, a // digest and no parts is the builder's publish again. A holder holding what the digest names under the name says it published // (it moves nothing, or, where the bytes sit in the artifact store, as distribution's A-417 takes them, tags them); a holder -// that holds none of it, or holds the version under another digest, refuses it as not stored, naming the digest, and says it -// refused (A-490, A-490a). The cases live here beside the build modules' conformance kit (design 47 G §680, A-490a). A +// that holds none of it refuses it as not stored, naming the digest, and says it refused (A-490, A-490a); one that holds the +// version under another digest answers other-bytes with that digest and the fingerprint it keeps, no error and nothing +// stored (design 47 H2 H-A-589 (1), H-A-593 (2), H-A-729, H-A-738 (1)). The cases live here beside the build modules' conformance kit (design 47 G §680, A-490a). A // holder's own test runs Run over its own test bed, for every seat it fills. package publishconformance @@ -21,22 +22,38 @@ const ( Other = "sha256:fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210" ) +// OtherBytes is the answer other-bytes: the digest the holder holds for the name and version and the fingerprint it keeps for +// them, empty where it keeps none. +type OtherBytes struct { + Digest, Fingerprint string +} + // Outcome is what a holder did with a publish: whether the transfer ended with it, how many parts it asked for, the event -// it said on its seat (published or refused) with its reason, and the error it answered. +// it said on its seat (published or refused) with its reason, the error it answered and the other-bytes it answered, nil +// when it did not. type Outcome struct { Ended bool Lacks int Event string Reason string Err error + Other *OtherBytes } // Bed is one holder under test, fresh for a case. type Bed struct { // Hold makes the holder hold the digest under Name at Version, as the builder's reservation of Version would find it. Hold func(digest string) - // Publish sends the publish of name at version with the digest and no parts, and reports what the holder did. + // Publish sends the publish of name at version with the digest and no parts, and no fingerprint, and reports what the + // holder did. Publish func(name, version, digest string) Outcome + // HoldWith is Hold, the holder keeping the fingerprint for the version beside the digest. + HoldWith func(digest, fingerprint string) + // PublishWith is Publish naming a fingerprint. + PublishWith func(name, version, digest, fingerprint string) Outcome + // Held is what the holder holds for name at version now, as its verb versions answers it: the digest and the + // fingerprint kept, each empty where none is held. + Held func(name, version string) (digest, fingerprint string) } // Run runs the cases over beds made by fresh. @@ -60,15 +77,37 @@ func Run(t *testing.T, fresh func(t *testing.T) Bed) { t.Errorf("a digest not held answered %+v; want refused said with the digest in its reason, ended, no part lacked", o) } }) - t.Run("a publish with a digest and no parts is refused as not stored, naming the digest, when the holder holds the version under another digest", func(t *testing.T) { + // H-A-593 (2), H-A-738 (1): a version held under another digest is answered other-bytes, never a refusal and never stored. + for _, c := range []struct { + name string + kept, offers string + }{ + {"with the publish's fingerprint", "src2:aa", "src2:aa"}, + {"with another fingerprint", "src2:bb", "src2:aa"}, + {"with no fingerprint kept", "", "src2:aa"}, + {"with no fingerprint named", "src2:aa", ""}, + } { + t.Run("a publish naming the digest of a version the holder holds under another digest "+c.name+" is answered other-bytes, nothing stored", func(t *testing.T) { + b := fresh(t) + b.HoldWith(Other, c.kept) + o := b.PublishWith(Name, Version, Digest, c.offers) + if o.Err != nil || o.Other == nil || o.Other.Digest != Other || o.Other.Fingerprint != c.kept || o.Lacks != 0 { + t.Fatalf("another digest held answered %+v; want no error and other-bytes with %s and the kept fingerprint %q, no part lacked", o, Other, c.kept) + } + if d, f := b.Held(Name, Version); d != Other || f != c.kept { + t.Errorf("the holder holds %s with the fingerprint %q after it, want %s with %q: nothing stored", d, f, Other, c.kept) + } + }) + } + t.Run("a publish of the digest the holder holds is answered as held, with the fingerprint it keeps", func(t *testing.T) { b := fresh(t) - b.Hold(Other) - o := b.Publish(Name, Version, Digest) - if o.Err == nil || !strings.Contains(o.Err.Error(), "not stored") || !strings.Contains(o.Err.Error(), Digest) { - t.Fatalf("another digest held answered %+v; want the error to say not stored and name %s", o, Digest) + b.HoldWith(Digest, "src2:aa") + o := b.PublishWith(Name, Version, Digest, "src2:bb") + if o.Err != nil || o.Other != nil || o.Event != "published" { + t.Fatalf("the held digest answered %+v; want no error, no other-bytes and published", o) } - if o.Event != "refused" || !strings.Contains(o.Reason, "not stored") || !strings.Contains(o.Reason, Digest) || o.Lacks != 0 || !o.Ended { - t.Errorf("another digest held answered %+v; want refused said as not stored with the digest, ended, no part lacked", o) + if d, f := b.Held(Name, Version); d != Digest || f != "src2:aa" { + t.Errorf("versions answers %s with the fingerprint %q, want %s with src2:aa", d, f, Digest) } }) } diff --git a/modules/mesh-delivery-sdk/publishconformance/publishconformance_test.go b/modules/mesh-delivery-sdk/publishconformance/publishconformance_test.go new file mode 100644 index 000000000..cbb9410d5 --- /dev/null +++ b/modules/mesh-delivery-sdk/publishconformance/publishconformance_test.go @@ -0,0 +1,34 @@ +package publishconformance + +import ( + "errors" + "testing" +) + +// holder is a correct holder of a registry seat in memory: what the kit's cases hold it to (design 47 H2 H-A-593 (2), +// H-A-738 (1)). +type holder struct{ digest, fingerprint string } + +func (h *holder) publish(digest, fingerprint string) Outcome { + switch { + case h.digest == digest: + return Outcome{Ended: true, Event: "published"} + case h.digest != "": + return Outcome{Other: &OtherBytes{Digest: h.digest, Fingerprint: h.fingerprint}} + } + reason := "the digest " + digest + " is not stored" + return Outcome{Ended: true, Event: "refused", Reason: reason, Err: errors.New(reason)} +} + +func TestTheKitHoldsACorrectHolder(t *testing.T) { + Run(t, func(t *testing.T) Bed { + h := &holder{} + return Bed{ + Hold: func(d string) { h.digest, h.fingerprint = d, "" }, + Publish: func(_, _, d string) Outcome { return h.publish(d, "") }, + HoldWith: func(d, f string) { h.digest, h.fingerprint = d, f }, + PublishWith: func(_, _, d, f string) Outcome { return h.publish(d, f) }, + Held: func(_, _ string) (string, string) { return h.digest, h.fingerprint }, + } + }) +} diff --git a/modules/mesh-delivery-sdk/steprun/answered.go b/modules/mesh-delivery-sdk/steprun/answered.go new file mode 100644 index 000000000..bd8195897 --- /dev/null +++ b/modules/mesh-delivery-sdk/steprun/answered.go @@ -0,0 +1,62 @@ +package steprun + +import ( + "context" + "fmt" + "sync" +) + +// **A publish answered with the held digest** (design 47 H2 H-A-589 (4), H-A-738 (1)): a registry holds a name and version +// with another digest than the build made and answers `other-bytes` with that digest and the fingerprint it keeps. The +// shared publish compares that fingerprint with the publish's own (the ask's); equal, the publish is answered as published +// with the held digest, nothing stored, and the ask's publish records the digest the seat answered, which the ask's step +// result names for the artifact (ADR 0605 §9: a done key names what its seat answered) while the step log names both +// digests; other or absent, the publish is refused naming both. + +type publishKey struct{} + +// heldPublish is one artifact's publish of an ask: the fingerprint it publishes under, and the digest its seat answered when that +// is not the digest built. +type heldPublish struct { + mu sync.Mutex + fingerprint string + answered string +} + +// withPublish is ctx for the publish of one artifact of an ask whose fingerprint is fingerprint, and the record the ask +// reads the answered digest from. +func withPublish(ctx context.Context, fingerprint string) (context.Context, *heldPublish) { + a := &heldPublish{fingerprint: fingerprint} + return context.WithValue(ctx, publishKey{}, a), a +} + +func publishOf(ctx context.Context) *heldPublish { + a, _ := ctx.Value(publishKey{}).(*heldPublish) + return a +} + +// Answered is the digest the seat answered for the artifact when it held the version as another digest, empty when it +// answered the digest built. +func (a *heldPublish) Answered() string { + if a == nil { + return "" + } + a.mu.Lock() + defer a.mu.Unlock() + return a.answered +} + +// heldAnswer reads a publish answered `other-bytes` of the digest built: the held digest it is published as, or the refusal. +func heldAnswer(ctx context.Context, seat, name, version, built, heldDigest, heldFingerprint, fingerprint string) error { + if fingerprint == "" || heldFingerprint != fingerprint { + return fmt.Errorf("%s holds %s %s as %s with the fingerprint %q, and the publish names %s with the fingerprint %q: a held version offered with other bytes (ADR 0605 §4)", + seat, name, version, heldDigest, heldFingerprint, built, fingerprint) + } + if a := publishOf(ctx); a != nil { + a.mu.Lock() + a.answered = heldDigest + a.mu.Unlock() + } + Phase(ctx, fmt.Sprintf("%s answered %s %s as published with the held digest %s, built %s: the same fingerprint, nothing stored", seat, name, version, heldDigest, built)) + return nil +} diff --git a/modules/mesh-delivery-sdk/steprun/askrun.go b/modules/mesh-delivery-sdk/steprun/askrun.go index 90d3a6aa4..4c6ed0e00 100644 --- a/modules/mesh-delivery-sdk/steprun/askrun.go +++ b/modules/mesh-delivery-sdk/steprun/askrun.go @@ -254,8 +254,9 @@ func (s AskSteps) build(ctx context.Context, job sdkstep.BuildJob, version strin } } var ( - out any - err error + out any + err error + published *heldPublish ) if a.From != "" { if s.Copy == nil { @@ -285,7 +286,9 @@ func (s AskSteps) build(ctx context.Context, job sdkstep.BuildJob, version strin args["version"] = version } Phase(ctx, "build "+a.Artifact) - out, err = s.Build(ctx, args) + var buildCtx context.Context + buildCtx, published = withPublish(ctx, job.Fp) + out, err = s.Build(buildCtx, args) } if err != nil { // The compare's out-of-step is answered with the failure, so the build's end still names it. @@ -306,6 +309,12 @@ func (s AskSteps) build(ctx context.Context, job sdkstep.BuildJob, version strin if err := json.Unmarshal(r, &built); err != nil || built.Digest == "" { return nil, fmt.Errorf("the build of %s answered no digest: %s", a.Artifact, r) } + // A version its seat held as another digest with the same fingerprint is the held digest, which the done key names + // (H-A-589 (4), H-A-738 (1)). + if held := published.Answered(); held != "" { + Phase(ctx, fmt.Sprintf("%s: built %s, answered %s: the step result names %s", a.Artifact, built.Digest, held, held)) + built.Digest = held + } answer.Artifacts = append(answer.Artifacts, sdkstep.AskBuilt{Artifact: a.Artifact, Digest: built.Digest, Reference: built.Reference}) if built.Kept != "" { answer.Kept = strings.TrimPrefix(built.Kept, "sha256:") diff --git a/modules/mesh-delivery-sdk/steprun/conformance/conformance.go b/modules/mesh-delivery-sdk/steprun/conformance/conformance.go index 17f9d6110..7ac90b532 100644 --- a/modules/mesh-delivery-sdk/steprun/conformance/conformance.go +++ b/modules/mesh-delivery-sdk/steprun/conformance/conformance.go @@ -15,9 +15,13 @@ import ( "errors" "fmt" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/steprun" + "io/fs" + "os" + "path/filepath" "slices" "strings" "testing" + "time" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep" ) @@ -324,3 +328,43 @@ func runsCounted(puller func(read func(key string) (json.RawMessage, error)) *st } return nil } + +// Reproducible holds a build module to giving one digest per artifact from two folders (design 47 H2 H-A-591, H-A-593 (3)): +// fill writes the module's files into a folder, build builds its artifacts there and answers each one's digest by name. The +// two folders have different names and the second one's files other times, so a digest that moved with a path or a time +// fails. A catalogue check (failurekit) refuses a build module whose tests do not call it. +func Reproducible(t *testing.T, fill func(dir string) error, build func(dir string) (map[string]string, error)) { + t.Helper() + var digests [2]map[string]string + for i, name := range []string{"first-folder", "a-second-folder-elsewhere"} { + dir := filepath.Join(t.TempDir(), name) + if err := os.MkdirAll(dir, 0o755); err != nil { + t.Fatal(err) + } + if err := fill(dir); err != nil { + t.Fatalf("the module's files are not written into %s: %v", dir, err) + } + if i == 1 { + later := time.Now().Add(-24 * time.Hour) + _ = filepath.WalkDir(dir, func(p string, _ fs.DirEntry, err error) error { + if err == nil { + _ = os.Chtimes(p, later, later) + } + return nil + }) + } + out, err := build(dir) + if err != nil { + t.Fatalf("the build in %s: %v", dir, err) + } + digests[i] = out + } + if len(digests[0]) == 0 { + t.Error("the build gave no artifact, so none is held to one digest") + } + for artifact, first := range digests[0] { + if second, ok := digests[1][artifact]; !ok || second != first { + t.Errorf("the artifact %s has the digest %s built in one folder and %q in another: its bytes depend on where or when it was built", artifact, first, second) + } + } +} diff --git a/modules/mesh-delivery-sdk/steprun/conformance/conformance_test.go b/modules/mesh-delivery-sdk/steprun/conformance/conformance_test.go index d2c4c76a5..9f6253b92 100644 --- a/modules/mesh-delivery-sdk/steprun/conformance/conformance_test.go +++ b/modules/mesh-delivery-sdk/steprun/conformance/conformance_test.go @@ -4,6 +4,8 @@ import ( "context" "encoding/json" "errors" + "os" + "path/filepath" "slices" "strings" "testing" @@ -301,3 +303,22 @@ func TestRunsCountedRefusesAPullerThatDoesNotReadTheStepsState(t *testing.T) { } } } + +// H-A-593 (3): the shared pack gives one digest from two folders; one that writes a folder's name into its bytes does not. +func TestTheSharedPackIsReproducible(t *testing.T) { + fill := func(dir string) error { + if err := os.MkdirAll(filepath.Join(dir, "src"), 0o755); err != nil { + return err + } + for name, body := range map[string]string{"b.txt": "b", "src/a.txt": "a", "a.txt": "a"} { + if err := os.WriteFile(filepath.Join(dir, name), []byte(body), 0o644); err != nil { + return err + } + } + return nil + } + Reproducible(t, fill, func(dir string) (map[string]string, error) { + _, digest, err := steprun.Pack(dir) + return map[string]string{"archive": digest}, err + }) +} diff --git a/modules/mesh-delivery-sdk/steprun/publish.go b/modules/mesh-delivery-sdk/steprun/publish.go index a5141188a..7d4617135 100644 --- a/modules/mesh-delivery-sdk/steprun/publish.go +++ b/modules/mesh-delivery-sdk/steprun/publish.go @@ -78,7 +78,13 @@ func SentHow(n int) func(parts.Sent) string { // PublishParts publishes in with ps as its parts on seat, through that seat's client: in's fields are the seat's own // (the four registry seats share the publish verb's input, design 51), the parts are written by the client. func PublishParts(ctx context.Context, call SeatCall, seat string, in reg.PublishInput, ps []parts.Part) (parts.Sent, error) { + if a := publishOf(ctx); a != nil && in.Fingerprint == "" { + in.Fingerprint = a.fingerprint // the ask's own: the holder keeps it for the version (H-A-589 (2)) + } sent, err := publishParts(ctx, call, seat, in, ps) + if err == nil && sent.Other != nil { + err = heldAnswer(ctx, seat, in.Name, in.Version, in.Digest, sent.Other.Digest, sent.Other.Fingerprint, in.Fingerprint) + } return sent, PublishFault(err) } diff --git a/modules/mesh-delivery-sdk/steprun/publish_test.go b/modules/mesh-delivery-sdk/steprun/publish_test.go new file mode 100644 index 000000000..a18424c17 --- /dev/null +++ b/modules/mesh-delivery-sdk/steprun/publish_test.go @@ -0,0 +1,59 @@ +package steprun + +import ( + "context" + "encoding/json" + "fmt" + "strings" + "testing" + + reg "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/containerimageregistry" + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/parts" +) + +// Design 47 H2 H-A-589 (4), H-A-738 (1): a publish answered other-bytes carrying the publish's own fingerprint is answered +// as published with the held digest: the ask's record names it, the step log names both digests, and nothing is sent; with +// another or no fingerprint it is refused naming both. +func TestAPublishOfAHeldVersionIsAnsweredWithTheHeldDigest(t *testing.T) { + const built, held = "sha256:aaaa", "sha256:bbbb" + for _, c := range []struct { + name, kept, ask string + answered string + refused bool + }{ + {"the same fingerprint", "src2:f1", "src2:f1", held, false}, + {"another fingerprint", "src2:f2", "src2:f1", "", true}, + {"no kept fingerprint", "", "src2:f1", "", true}, + {"no fingerprint of its own", "src2:f1", "", "", true}, + } { + t.Run(c.name, func(t *testing.T) { + var log []string + ctx := context.WithValue(context.Background(), phaseKey{}, &phases{logf: func(f string, a ...any) { log = append(log, fmt.Sprintf(f, a...)) }}) + ctx, record := withPublish(ctx, c.ask) + calls := 0 + call := func(key string, in any) (json.RawMessage, error) { + calls++ + raw, _ := json.Marshal(in) + if want := c.ask; want != "" && !strings.Contains(string(raw), want) && strings.HasSuffix(key, ".publish") { + t.Errorf("the publish %s names no fingerprint %s of the ask", raw, want) + } + other := map[string]any{"digest": held} + if c.kept != "" { + other["fingerprint"] = c.kept + } + return json.Marshal(map[string]any{"other-bytes": other}) + } + in := reg.PublishInput{Name: "x/y", Kind: reg.PublishInputKindArchive, Version: "0.1.0", Digest: built, Transfer: "t"} + sent, err := PublishParts(ctx, call, GoSeat, in, []parts.Part{{Digest: built, Size: 1, Open: nil}}) + if (err != nil) != c.refused || record.Answered() != c.answered || calls != 1 || sent.Other == nil { + t.Fatalf("answered %q, err %v after %d calls (other %+v), want answered %q and refused %v with the one publish call", record.Answered(), err, calls, sent.Other, c.answered, c.refused) + } + if c.refused && !(strings.Contains(err.Error(), built) && strings.Contains(err.Error(), held)) { + t.Errorf("the refusal %v does not name both digests", err) + } + if !c.refused && !(strings.Contains(strings.Join(log, "\n"), built) && strings.Contains(strings.Join(log, "\n"), held)) { + t.Errorf("the step log %q does not name both digests", log) + } + }) + } +} From 69ed0d95f41ef1ac1e2b43f72b192f24933f2de9 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:32:44 +0100 Subject: [PATCH 31/44] I5 digests-from-the-publisher: a Go package artifact's entry keeps its packages' digests, an importer's fingerprint reads them from the publishing entry, the import form takes no accepted-series override Builds: design 47 H2 H-A-580, H-A-672 (DQ-21), H-A-521, H-A-530 --- .../internal/index/artifacts.go | 29 ++++++++++++++ .../internal/index/imports_test.go | 25 +++++++++++- .../internal/index/importset.go | 39 ++++++++++++++++++- .../internal/index/series.go | 30 ++++++-------- .../internal/index/toolchains.go | 9 +++-- 5 files changed, 105 insertions(+), 27 deletions(-) diff --git a/modules/mesh-delivery-indexer/internal/index/artifacts.go b/modules/mesh-delivery-indexer/internal/index/artifacts.go index 0473a6548..25e2e2831 100644 --- a/modules/mesh-delivery-indexer/internal/index/artifacts.go +++ b/modules/mesh-delivery-indexer/internal/index/artifacts.go @@ -37,6 +37,7 @@ func (ix *Indexer) withArtifacts(ctx context.Context, e meshcatalog.CatalogEntry art := meshcatalog.Artifact{Ref: ArtifactRefOf(e.Module, a.Name), Language: a.Language, Kind: a.Kind} if pkg := ix.packageOf(ctx, e, a); pkg != nil { art.Package = pkg + art.Digests = ix.digestsOf(ctx, pkg) } e.Artifacts = append(e.Artifacts, art) } @@ -82,3 +83,31 @@ func (ix *Indexer) packageOf(ctx context.Context, e meshcatalog.CatalogEntry, a } return &meshcatalog.ArtifactPackage{Ecosystem: ecosystem, Name: name} } + +// digestsOf are the digests of the packages of a package artifact's module, one item per package, kept on the artifact of +// the entry so an importer reads each imported package's digest from the entry that publishes it (design 47 H2 H-A-580): +// those of the packages state's value of a Go module the artifact names, sorted by package; nil for an artifact of +// another ecosystem, or while the state holds none of its module. +func (ix *Indexer) digestsOf(ctx context.Context, pkg *meshcatalog.ArtifactPackage) []meshcatalog.ArtifactDigestsItem { + if pkg.Ecosystem != EcosystemGo || ix.Packages == nil { + return nil + } + key, err := PackagesKey(pkg.Name) + if err != nil { + return nil + } + value, _, found, err := ix.Packages.Get(ctx, key) + if err != nil || !found { + return nil + } + p, err := DecodePublishedPackages(value) + if err != nil { + return nil + } + var out []meshcatalog.ArtifactDigestsItem + for _, d := range p.Packages { + out = append(out, meshcatalog.ArtifactDigestsItem{Package: d.Package, Digest: d.Digest}) + } + slices.SortFunc(out, func(a, b meshcatalog.ArtifactDigestsItem) int { return strings.Compare(a.Package, b.Package) }) + return out +} diff --git a/modules/mesh-delivery-indexer/internal/index/imports_test.go b/modules/mesh-delivery-indexer/internal/index/imports_test.go index 116ef8920..6e6aaa1e2 100644 --- a/modules/mesh-delivery-indexer/internal/index/imports_test.go +++ b/modules/mesh-delivery-indexer/internal/index/imports_test.go @@ -3,6 +3,7 @@ package index import ( "context" "errors" + "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/graph" "strings" "testing" @@ -491,8 +492,10 @@ func anAcceptedSeriesPinsItsNewest(t *testing.T) { return ix.HearImportsReported(ctx, buildEnd(t, "avahi", before.Fp2, meshSDK, meshSDK+"/announce")) }) pinned := step("0.1.15 published from c3", hear("0.1.15", c3)) - if pinned.Fp2 == before.Fp2 || pinned.Packages[meshSDK] != "v0.1.15" { - t.Fatalf("after 0.1.15: fp2 %q (was %q), versions %v; want moved by c3's announce, pinned to v0.1.15", pinned.Fp2, before.Fp2, pinned.Packages) + // The import form takes no accepted-series override (design 47 H2 H-A-672): the series' contents (c3) move nothing, the + // digests are the trunk entry's (c1) and the version is pinned. + if pinned.Fp2 != before.Fp2 || pinned.Packages[meshSDK] != "v0.1.15" { + t.Fatalf("after 0.1.15: fp2 %q (was %q), versions %v; want unmoved by the series' contents, pinned to v0.1.15", pinned.Fp2, before.Fp2, pinned.Packages) } // A publish in a series avahi does not accept pins nothing and moves nothing (H-A-184). if m := step("0.2.0 published from c1", hear("0.2.0", c1)); m.Fp2 != pinned.Fp2 || m.Packages[meshSDK] != "v0.1.15" { @@ -501,6 +504,24 @@ func anAcceptedSeriesPinsItsNewest(t *testing.T) { if m := step("trunk at c2", trunk(c2)); m.Fp2 != pinned.Fp2 || m.Packages[meshSDK] != "v0.1.15" { t.Errorf("a trunk merge moved avahi off its accepted series' newest: %q %v", m.Fp2, m.Packages) } + // A trunk merge that changes announce, a package it imports, moves it: its digest is read from the publisher's entry + // of the revision, whatever series it accepts (design 47 H2 H-A-580, H-A-672). + if m := step("trunk at c3", trunk(c3)); m.Fp2 == pinned.Fp2 || m.Packages[meshSDK] != "v0.1.15" { + t.Errorf("a change of an imported package at the trunk did not move avahi: %q (was %q) %v", m.Fp2, pinned.Fp2, m.Packages) + } + // The publisher's entry keeps the digest of each package of its package artifact (design 47 H2 H-A-580). + held, _ := ix.heldModules(ctx) + raw, man, err := ix.manifestRaw(ctx, held["mesh-sdk"].Manifest) + if err != nil { + t.Fatal(err) + } + digests := 0 + for _, a := range ix.withArtifacts(ctx, CatalogEntryOf("mesh-sdk", held["mesh-sdk"], man, raw, graph.Node{}), man).Artifacts { + digests += len(a.Digests) + } + if digests == 0 { + t.Errorf("the entry of mesh-sdk keeps no digest of its packages") + } // mesh-sdk's module releases 0.3.0: a module's release number is never a package's pin (H-A-183). ix.Versions = newMem() ix.Versions.(*memStore).put(meshcatalog.VersionsByModuleVersionKey("mesh-sdk", "0.3.0"), []byte(`{}`)) diff --git a/modules/mesh-delivery-indexer/internal/index/importset.go b/modules/mesh-delivery-indexer/internal/index/importset.go index 962e484d4..c49337089 100644 --- a/modules/mesh-delivery-indexer/internal/index/importset.go +++ b/modules/mesh-delivery-indexer/internal/index/importset.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "maps" "slices" "strings" @@ -216,13 +217,21 @@ func (ix *Indexer) meshPackages(ctx context.Context, held map[string]meshcatalog // packagesPublishedBy are the packages meshPackages names, each with the repository of the module that publishes it, so a // take-in tells the packages its repository publishes (design 47 H2 H-A-520, H-A-539). func (ix *Indexer) packagesPublishedBy(ctx context.Context, held map[string]meshcatalog.ModulesByModuleValue) (map[string]string, error) { + names, _, err := ix.publishedByEntries(ctx, held) + return names, err +} + +// publishedByEntries are packagesPublishedBy's names, and with them the digests each Go package artifact of those entries +// keeps, by the package's name (an artifact's `digests`, design 47 H2 H-A-580): what an importer's fingerprint reads. +func (ix *Indexer) publishedByEntries(ctx context.Context, held map[string]meshcatalog.ModulesByModuleValue) (map[string]string, map[string][]meshcatalog.ArtifactDigestsItem, error) { if held == nil { var err error if held, err = ix.heldModules(ctx); err != nil { - return nil, err + return nil, nil, err } } names := map[string]string{} + digests := map[string][]meshcatalog.ArtifactDigestsItem{} for name, cur := range held { if cur.Manifest == "" { continue @@ -234,10 +243,36 @@ func (ix *Indexer) packagesPublishedBy(ctx context.Context, held map[string]mesh for _, a := range ix.withArtifacts(ctx, CatalogEntryOf(name, cur, m, raw, graph.Node{}), m).Artifacts { if p := a.Package; p != nil && p.Name != "" && (p.Ecosystem == EcosystemGo || p.Ecosystem == EcosystemNpm) { names[p.Name] = cur.Repository + if len(a.Digests) > 0 { + digests[p.Name] = a.Digests + } } } } - return names, nil + return names, digests, nil +} + +// fromEntries is published with the packages of each module an entry of the revision computed publishes taken at the +// digests that entry keeps (design 47 H2 H-A-580): an importer's fingerprint reads a package's digest from the entry that +// publishes it, so a publisher that moves in the same take-in is read at its new digests; a module no entry keeps digests +// of stays as the state holds it. Nothing of published is changed in place. +func fromEntries(published map[string]meshcatalog.PackagesByModuleValue, digests map[string][]meshcatalog.ArtifactDigestsItem) map[string]meshcatalog.PackagesByModuleValue { + if len(digests) == 0 { + return published + } + out := maps.Clone(published) + for module, items := range digests { + p, ok := out[module] + if !ok { + continue + } + p.Packages = make([]meshcatalog.PackagesByModuleValuePackagesItem, len(items)) + for i, d := range items { + p.Packages[i] = meshcatalog.PackagesByModuleValuePackagesItem{Package: d.Package, Digest: d.Digest} + } + out[module] = p + } + return out } // inTheMesh are the imports a package of names holds, the package itself or a path under it (I9's reading); any other diff --git a/modules/mesh-delivery-indexer/internal/index/series.go b/modules/mesh-delivery-indexer/internal/index/series.go index 00e9a5091..5c54542b0 100644 --- a/modules/mesh-delivery-indexer/internal/index/series.go +++ b/modules/mesh-delivery-indexer/internal/index/series.go @@ -165,15 +165,13 @@ func (ix *Indexer) SeriesAll(ctx context.Context) map[string]SeriesPackage { return out } -// acceptedSeries is the packages state as a module of repository whose manifest is m is fingerprinted against (DLV-I6; -// ADR 0606 §4, ADR 0609 §1; design 32 *A package, its series, and the series its users accept*): each mesh Go module of -// another repository whose package's series the module accepts (Manifest.AcceptedSeries) and a seat published, by that -// series' newest version, its digests read at that version's commit, and pinned to the version itself (Go's form, -// `v0.1.15`). A series with no published version yet, or whose contents the forge did not list, leaves the module's -// latest published commit (the commit form, milestone § 2 item 4). A module of the same repository takes its sibling by -// path, never by a series. With nothing to pin, published is answered as it is. -func acceptedSeries(series map[string]SeriesPackage, m catalogue.Manifest, repository string, published map[string]meshcatalog.PackagesByModuleValue) (map[string]meshcatalog.PackagesByModuleValue, sdkstep.PackageVersions) { - var out map[string]meshcatalog.PackagesByModuleValue +// acceptedSeries are the pins of a module of repository whose manifest is m (DLV-I6; ADR 0606 §4, ADR 0609 §1; design 32 +// *A package, its series, and the series its users accept*): each mesh Go module of another repository whose package's +// series the module accepts (Manifest.AcceptedSeries) and a seat published, pinned to the series' newest version (Go's form, +// `v0.1.15`). The import form takes no accepted-series override of the packages' digests: it reads each digest from the +// entry that publishes the package, whatever series the module accepts (design 47 H2 H-A-672, H-A-580), so only the version +// line takes the pins. A module of the same repository takes its sibling by path, never by a series. +func acceptedSeries(series map[string]SeriesPackage, m catalogue.Manifest, repository string) sdkstep.PackageVersions { var pins sdkstep.PackageVersions for _, key := range slices.Sorted(maps.Keys(series)) { s := series[key] @@ -184,18 +182,12 @@ func acceptedSeries(series map[string]SeriesPackage, m catalogue.Manifest, repos if repo, _, ok := trunk.PackageRepository(s.GoModule); !ok || trunk.SameRepository(repo, repository) { continue } - if out == nil { - out, pins = maps.Clone(published), sdkstep.PackageVersions{} + if pins == nil { + pins = sdkstep.PackageVersions{} } - p := publishedOfContents(*pinned.Contents) - version := "v" + pinned.Version - p.Commit = version - out[s.GoModule], pins[s.GoModule] = p, version + pins[s.GoModule] = "v" + pinned.Version } - if out == nil { - return published, nil - } - return out, pins + return pins } // pinnedVersion is the version of a series its users are pinned to: its newest released one, never a reservation's diff --git a/modules/mesh-delivery-indexer/internal/index/toolchains.go b/modules/mesh-delivery-indexer/internal/index/toolchains.go index fab63fd28..7560e9350 100644 --- a/modules/mesh-delivery-indexer/internal/index/toolchains.go +++ b/modules/mesh-delivery-indexer/internal/index/toolchains.go @@ -236,7 +236,8 @@ func (ix *Indexer) recomputeLocked(ctx context.Context, overlay map[string]meshc return fmt.Errorf("no fingerprint is written: %w", err) } // The packages the module graph's entries publish: a reported import set counts only those (design 47 H2 H-A-539, H-A-540). - publishedBy, err := ix.packagesPublishedBy(ctx, held) + publishedBy, entryDigests, err := ix.publishedByEntries(ctx, held) + published = fromEntries(published, entryDigests) // an importer reads the digests of the entry that publishes (H-A-580) mesh, ofRepository := map[string]bool{}, map[string]bool{} for name, repo := range publishedBy { mesh[name] = true @@ -313,7 +314,7 @@ func (ix *Indexer) recomputeLocked(ctx context.Context, overlay map[string]meshc toolchains[artifact] = t.tc } var r result - pub, pins := acceptedSeries(series, k.manifest, k.cur.Repository, published) + pins := acceptedSeries(series, k.manifest, k.cur.Repository) switch { case k.contexts: r.none = None2Context @@ -321,11 +322,11 @@ func (ix *Indexer) recomputeLocked(ctx context.Context, overlay map[string]meshc r.none = strings.Join(missing, "; ") case noToolchain != "": r.none = noToolchain - if fp, pkgs, ok := stillComputed(module, kept, k, toolchains, held, pub, pins, series, mesh); ok { + if fp, pkgs, ok := stillComputed(module, kept, k, toolchains, held, published, pins, series, mesh); ok { r = result{fp: fp, tcs: k.held.Toolchains, pkgs: pkgs} } default: - f := formOf(module, k.cur.Repository, &kept, k.reported, mesh, toolchains, k.held, held, pub, pins, ix.logf) + f := formOf(module, k.cur.Repository, &kept, k.reported, mesh, toolchains, k.held, held, published, pins, ix.logf) r.fp, r.none = f.fp, f.none if r.fp != "" { // a pin is a released version, never a commit (H-A-161), and the version line's fingerprint takes it (H-A-167) From c9de0c62453990f77ac9716cd87ec75326e089e6 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:33:49 +0100 Subject: [PATCH 32/44] DC9 step-result-held-at: StepResult gains held-at, when the step was held (same form raise of mesh-pipeline-runner) Builds: design 47 H2 H-A-738 (2), H-A-599 --- .../go/seats/meshpipelinerunner/contract.go | 4 +++- .../go/seats/meshpipelinerunner/contract_test.go | 2 +- .../seats/mesh-pipeline-runner/fixtures/states.json | 3 ++- .../seats/mesh-pipeline-runner/seat.json | 5 +++++ .../ts/seats/meshpipelinerunner/index.d.ts | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index 1d7b491f4..5d4766a17 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go @@ -20,7 +20,7 @@ const Form = 13 // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "13" - generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=6de094f5329f Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=bdaa8bbfbcab StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=90066504aaa7 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 FailedStep=cd7184342136 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=284210b3c054 LogEntry=b059967b2ae4 Member=8a103baec01f Mover=5db376275bcf MoverAdded=6966283f6909 MoverAddedEvent=b24ae82030ab MoverEnded=4b35095f6829 MoverRow=6de094f5329f Pipeline=2663792125bf PipelineEnded=e3f4c58f93c8 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineRow=397a8219a855 PipelineStarted=d5fc3ee236c7 PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionAgainNValue=693580eed498 PipelinesByBranchRevisionUnfinishedModuleValue=693580eed498 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 PlaceUnfinishedAnswer=69998ea62147 PlaceUnfinishedAnswerFailedItem=d9b89913b9bf PlaceUnfinishedAnswerPlacedItem=9ff9288125e5 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RePinnedEvent=92fd04bfa6d3 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=8609ff359791 StandsAnswer=e05cecdde456 StartAnswer=ed94ced4513a StartedMover=4450a94e6ca3 StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepResult=9db5cfcb26bb StepStartedEvent=799020642c19 TestCounts=9c1332427159 TestRun=ca5a87f3b6b8 TestRunPackage=a7d30558470d TestRunReader=c9b30cc4d0d0 TestRunsAnswer=7ab81a45ca33 TestRunsDropAnswer=8ee70b35469d ToolchainUsed=43b6d42376fb Wait=90066504aaa7 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0 Waiting=ed94ced4513a WhyCarriedAnswer=8e2fcea6479f Widening=e2790a307466" ) const ( @@ -1109,6 +1109,8 @@ type StepResult struct { Ended *time.Time `json:"ended,omitempty"` // the artifact's build-input fingerprint the step ran at Fingerprint string `json:"fingerprint,omitempty"` + // when the step was held, written at the hold and cleared at its end; absent when it holds no wait, so the ended wait, stands and the watchman's seed read the same time (design 47 H2 H-A-738 (2)) + HeldAt *time.Time `json:"held-at,omitempty"` // the mover the step is of (design 47 H-A-35) Module string `json:"module,omitempty"` // the node whose holder ended it diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go index 9b46e9b0f..1ad030227 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -61,7 +61,7 @@ func TestFixtures(t *testing.T) { err := json.Unmarshal(b, &v) return v, err }, subjectIs: nil}, - {name: "a running pipeline whose build waits on the revision view for the revision that superseded it (H-A-561, H-A-562)", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}", + {name: "a running pipeline whose build waits on the revision view for the revision that superseded it (H-A-561, H-A-562)", subject: "", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"held-at\":\"2026-11-10T10:00:30Z\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"form\":12,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"repository\":\"mesh-networking\",\"tier\":1}],\"outcome\":\"running\",\"pipeline\":\"main.3590\",\"revision\":13,\"source\":3590,\"started\":\"2026-11-10T10:00:00Z\",\"steps\":[{\"fingerprint\":\"fp-0123\",\"held-at\":\"2026-11-10T10:00:30Z\",\"module\":\"nats\",\"on\":\"revision view\",\"outcome\":\"waiting\",\"revision\":14,\"seat\":\"mesh-builds\",\"status\":\"required\",\"step\":\"build\",\"why\":\"nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch\"}],\"v\":1}", decode: func(b []byte) (any, error) { var v PipelinesByBranchRevisionValue err := json.Unmarshal(b, &v) diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/states.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/states.json index 1e21b7505..ecb98df80 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/states.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/fixtures/states.json @@ -103,7 +103,8 @@ "why": "nats at fp-0123 is superseded by fp-0456, the newest entry heard on its first branch", "fingerprint": "fp-0123", "seat": "mesh-builds", - "module": "nats" + "module": "nats", + "held-at": "2026-11-10T10:00:30Z" } ], "started": "2026-11-10T10:00:00Z", diff --git a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json index ec7b3bfbc..a68c17d11 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -1327,6 +1327,11 @@ "type": "string", "description": "for a carried result, the pipeline it was carried from" }, + "held-at": { + "type": "string", + "format": "date-time", + "description": "when the step was held, written at the hold and cleared at its end; absent when it holds no wait, so the ended wait, stands and the watchman's seed read the same time (design 47 H2 H-A-738 (2))" + }, "rerun": { "type": "boolean", "description": "the step was asked again by the runner's rerun" diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts index 9c26b027e..8b467b173 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -602,6 +602,8 @@ export interface StepResult { "ended"?: string; /** the artifact's build-input fingerprint the step ran at */ "fingerprint"?: string; + /** when the step was held, written at the hold and cleared at its end; absent when it holds no wait, so the ended wait, stands and the watchman's seed read the same time (design 47 H2 H-A-738 (2)) */ + "held-at"?: string; /** the mover the step is of (design 47 H-A-35) */ "module"?: string; /** the node whose holder ended it */ From c7c65556db6e98483cec32e4d8a778f7289f9d54 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:34:12 +0100 Subject: [PATCH 33/44] K4b reserved-other-bytes: RunReserved's held-under-another-digest row is answered other-bytes, nothing stored Builds: design 47 H2 H-A-738 (1), H-A-729 --- .../publishconformance/publishconformance.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-sdk/publishconformance/publishconformance.go b/modules/mesh-delivery-sdk/publishconformance/publishconformance.go index 2d535edbc..26499ef7a 100644 --- a/modules/mesh-delivery-sdk/publishconformance/publishconformance.go +++ b/modules/mesh-delivery-sdk/publishconformance/publishconformance.go @@ -151,7 +151,7 @@ func RunReserved(t *testing.T, fresh func(t *testing.T) ReservedBed) { }{ {name: "reserved, no digest yet: published", reserve: NoDigestYet, ok: true}, {name: "reserved with the digest: published", reserve: SameDigest, ok: true}, - {name: "reserved with no digest yet, the version held under another digest: refused, nothing published", reserve: NoDigestYet, held: true, words: "is published with"}, + {name: "reserved with no digest yet, the version held under another digest: answered other-bytes, nothing stored", reserve: NoDigestYet, held: true}, {name: "reserved for another digest: refused, naming the reservation", reserve: OtherDigest, words: "did not reserve"}, {name: "nothing reserved: refused", words: "did not"}, } { @@ -165,9 +165,10 @@ func RunReserved(t *testing.T, fresh func(t *testing.T) ReservedBed) { } o := b.PublishWhole() if c.held { - // Refused whether it ends with an error or only with the event refused, and never said published. - if o.Event != "refused" || !strings.Contains(o.Reason, c.words) { - t.Fatalf("answered %+v; want refused with %q in its reason, and nothing published", o, c.words) + // A version held under another digest is answered other-bytes, the held digest named: no error, never said + // published and nothing stored; the reader compares its fingerprint (design 47 H2 H-A-729, H-A-738 (1)). + if o.Err != nil || o.Other == nil || o.Other.Digest == "" || o.Event == "published" { + t.Fatalf("answered %+v; want no error and other-bytes naming the held digest, and nothing published", o) } return } From f1f2d352e5cd3b23915a1bf3c931ed9988d99f6f Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:36:32 +0100 Subject: [PATCH 34/44] I7 failed-record: a mover not delivered at a failed or cancelled end, or named in unfinished, pins its entry's revision and that revision's base under failed.., freed when it passes, a newer revision moves it or its module or branch leaves the registrations Builds: design 47 H2 H-A-566, H-A-572 (1) (2), H-A-595, H-A-608, H-A-649 (af09bb9a taken as new code, H-A-565 (2) (3) not) --- .../cmd/mesh-delivery-indexer/main.go | 6 + .../internal/index/pins.go | 241 +++++++++++++++++- .../internal/index/pins_test.go | 81 +++++- 3 files changed, 325 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go index df3617cd5..dedbddff3 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go @@ -649,6 +649,12 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro hear(meshcatalog.StreamRegistrationChanged, "a newly watched branch's source revisions are not taken in until the indexer starts again", func(m jetstream.Msg) { _ = m.Ack() sources.refresh() + // A module that left the registrations, or a branch that left its registration, frees its failed record (H-A-572 (2)). + if registered, err := registry.RegisteredFailedRecords(ctx); err != nil { + logger.Printf("the failed records are not freed after a registration changed: %v", err) + } else if err := ix.FreeFailedRecords(ctx, registered); err != nil { + logger.Printf("the failed records are not freed after a registration changed: %v", err) + } }) // The held take-ins are taken in again from the state held at the start, before a branch's consumer gives a later one // (design 47 H, H-A-114, H-A-118); a chain's key a stop left is deleted first (H2 H-A-497 addendum). diff --git a/modules/mesh-delivery-indexer/internal/index/pins.go b/modules/mesh-delivery-indexer/internal/index/pins.go index eb29829b2..48cc0b60a 100644 --- a/modules/mesh-delivery-indexer/internal/index/pins.go +++ b/modules/mesh-delivery-indexer/internal/index/pins.go @@ -22,7 +22,8 @@ import ( // The indexer keeps the records pinning each catalog graph revision and removes a revision only on an event (design 47 G §153, // §178, §189, §215, §216, §579, A-169, A-171): its state pins holds one key per revision, `.` (the watched branch // and the revision's number, the branch escaped as a name is), whose value lists the records that pin it: a take-in's, each -// running pipeline's (design 47 H §743, §749) and each passed pipeline's release until a newer one is the want (H-A-168, H-A-170). +// running pipeline's (design 47 H §743, §749), each passed pipeline's release until a newer one is the want (H-A-168, H-A-170), +// and each failed pipeline's mover that did not pass until it passes or a newer revision moves it (H2 H-A-565, H-A-566). const ( // PinsState is the state's name; PinsCapMiB is its cap in the manifest (about 1,800 keys of about 0.2 KiB). PinsState = "pins" @@ -74,7 +75,9 @@ func pinObject(key string) (string, bool) { // HeardPins applies one event of the seat mesh-pipeline-runner the indexer's durable consumers gave it (design 47 H §749): a // pipeline-started pins the revision it names, and each revision its movers are kept at (design 47 H2 H-A-496), under the -// record `pipeline.`, its pipeline-ended frees it and every other revision the record pins (H-A-147). A body +// record `pipeline.`, its pipeline-ended frees it and every other revision the record pins (H-A-147); a failed +// one first pins them under `failed..` for each mover that did not pass, freed when the mover passes in a +// later pipeline or a pipeline of a newer revision moves it (H-A-565 (1), H-A-566). A body // that is no such event, or names no revision, changes nothing; an error leaves the event unacknowledged, so the bus gives it // again; one applied twice changes nothing. func (ix *Indexer) HeardPins(ctx context.Context, started *runner.PipelineStarted, ended *runner.PipelineEnded) error { @@ -94,6 +97,16 @@ func (ix *Indexer) HeardPins(ctx context.Context, started *runner.PipelineStarte if err := ix.pinKept(ctx, started.Branch, started.Revision, started.Kept, record); err != nil { return err } + // A delivering pipeline of a newer revision that moves a mover a failed pipeline left, carried or at a newer + // fingerprint, frees that mover's failed record from every older revision of the branch: its own pin covers it now + // (design 47 H2 H-A-565 (1), H-A-566). + if started.Run == "" { + for _, m := range started.Movers { + if err := ix.unpinOlder(ctx, started.Branch, started.Revision, FailedRecord(started.Branch, m.Module)); err != nil { + return err + } + } + } // The reservations of the pipeline's revision settle at its start, if they gather (design 47 H2 §805, H-A-424 (1)). if err := ix.Settle(ctx, BranchObject(started.Branch, started.Revision)); err != nil { ix.logf("versions: the reservations of %s are not re-pinned at its pipeline-started: %v", BranchObject(started.Branch, started.Revision), err) @@ -125,6 +138,24 @@ func (ix *Indexer) HeardPins(ctx context.Context, started *runner.PipelineStarte } } record := PipelineRecord(ended.Pipeline) + if ended.Run == "" { + // A mover that passed frees its failed record from every older revision of the branch; a delivering pipeline that + // ended failed keeps its own revision and each kept revision its record pins under failed.. for + // each mover that did not pass, before its own record is freed, so a rerun or a carry still reads them (design 47 + // H2 H-A-565 (1), H-A-566). + for _, m := range ended.Movers { + if ended.Outcome == runner.PipelineEndedOutcomePassed || moverPassed(m) { + if err := ix.unpinOlder(ctx, ended.Branch, ended.Revision, FailedRecord(ended.Branch, m.Module)); err != nil { + return err + } + } + } + if ended.Outcome == runner.PipelineEndedOutcomeFailed || ended.Outcome == runner.PipelineEndedOutcomeCancelled { + if err := ix.pinFailed(ctx, ended, record); err != nil { + return err + } + } + } if err := ix.unpin(ctx, PinKey(ended.Branch, ended.Revision), record); err != nil { return err } @@ -139,6 +170,212 @@ func ReleaseRecord(branch, module string) string { return "release." + keys.EscapeName(branch) + "." + keys.EscapeName(module) } +// FailedRecord is the record a failed pipeline pins its own and its kept revisions under, one per mover that did not pass: +// `failed..`, each name escaped as a key's name is (design 47 H2 H-A-565 (1), H-A-566). +func FailedRecord(branch, module string) string { + return "failed." + keys.EscapeName(branch) + "." + keys.EscapeName(module) +} + +// moverPassed says whether a mover of a pipeline-ended passed: it holds steps and each required one passed, was carried or +// had nothing to run, as the runner counts a step passed. +func moverPassed(m runner.MoverEnded) bool { + if len(m.Steps) == 0 { + return false + } + for _, s := range m.Steps { + if s.Status != runner.StepResultStatusRequired { + continue + } + switch s.Outcome { + case runner.StepResultOutcomePassed, runner.StepResultOutcomeCarried, runner.StepResultOutcomeNothingToRun: + default: + return false + } + } + return true +} + +// movedOut says whether a mover of a pipeline-ended left it for a newer revision: a required step of it is superseded. +func movedOut(m runner.MoverEnded) bool { + return slices.ContainsFunc(m.Steps, func(s runner.StepResult) bool { + return s.Status == runner.StepResultStatusRequired && s.Outcome == runner.StepResultOutcomeSuperseded + }) +} + +// pinFailed pins, for each mover a pipeline-ended that failed or was cancelled did not deliver (a mover with a required +// step that did not pass, and each module its `unfinished` names, not one moved out of it for a newer revision), the revision +// the mover's entry comes from and that revision's `base`, under the mover's failed record: the kept revision the mover's +// entry is at, else the pipeline's own (design 47 H2 H-A-566, H-A-572 (1), H-A-595, H-A-608). At most two revisions per record. +func (ix *Indexer) pinFailed(ctx context.Context, ended *runner.PipelineEnded, record string) error { + var failed []string + fingerprint := map[string]string{} + for _, m := range ended.Movers { + fingerprint[m.Module] = m.Fingerprint + if !moverPassed(m) && !movedOut(m) { + failed = append(failed, m.Module) + } + } + for _, module := range ended.Unfinished { + if !slices.Contains(failed, module) { + failed = append(failed, module) + } + } + if len(failed) == 0 { + return nil + } + slices.Sort(failed) + pinKeys, err := ix.Pins.Keys(ctx) + if err != nil { + return err + } + slices.Sort(pinKeys) + var kept []int64 // the revisions the pipeline's record pins above its own: where its movers are kept + for _, k := range pinKeys { + b, r, ok := ParsePinKey(k) + if !ok || b != ended.Branch || r <= ended.Revision { + continue + } + v, _, found, err := ix.Pins.Get(ctx, k) + if err != nil { + return err + } + var pv PinValue + if found && json.Unmarshal(v, &pv) == nil && slices.Contains(pv.Records, record) { + kept = append(kept, r) + } + } + slices.Reverse(kept) // the newest first + for _, module := range failed { + at := ended.Revision + for _, r := range kept { + if ix.entryAt(ctx, ended.Branch, r, module) == fingerprint[module] && fingerprint[module] != "" { + at = r + break + } + } + revisions := []string{PinKey(ended.Branch, at)} + if base := ix.baseOf(ctx, ended.Branch, at); base > 0 && base != at { + revisions = append(revisions, PinKey(ended.Branch, base)) + } + for _, k := range revisions { + if err := ix.pin(ctx, k, FailedRecord(ended.Branch, module)); err != nil { + // A write the full state refuses is said, and the event is left unacknowledged so the bus gives it again at its + // kept-call pace (H-A-572 (1)). + ix.logf("pins: %s is not written to %s, so %s is heard again: %v", FailedRecord(ended.Branch, module), k, ended.Pipeline, err) + return err + } + } + ix.logf("pins: %s ended %s: %s keeps %s until it passes in a later pipeline or a newer revision moves it (H-A-566, H-A-608)", + ended.Pipeline, ended.Outcome, FailedRecord(ended.Branch, module), strings.Join(revisions, ", ")) + } + return nil +} + +// entryAt is the fingerprint of module's entry in revision r of branch, empty when the revision or the entry is not read. +func (ix *Indexer) entryAt(ctx context.Context, branch string, r int64, module string) string { + _, entries, err := ReadRevision(ctx, ix.Revisions, RevisionObject(meshcatalog.CatalogRevision{Branch: branch, Revision: r})) + if err != nil { + return "" + } + for _, e := range entries { + if e.Module == module { + return e.Fp + } + } + return "" +} + +// baseOf is the revision revision r of branch names as its base (H-A-151), zero when it names none or is not read. +func (ix *Indexer) baseOf(ctx context.Context, branch string, r int64) int64 { + rev, _, err := ReadRevision(ctx, ix.Revisions, RevisionObject(meshcatalog.CatalogRevision{Branch: branch, Revision: r})) + if err != nil { + return 0 + } + return rev.Base +} + +// FreeFailedRecords frees every failed record (`failed..`) from every pin that holds it when no registration +// of its module names its branch any more: the module left the registrations, or, until a change of a module's branch is a +// take-in of that branch's head for that module alone, its branch left the module's registration. registered says the +// registrations as a set of records (design 47 H2 H-A-572 (2), heard on registration-changed, ADR 0666 section 2). +func (ix *Indexer) FreeFailedRecords(ctx context.Context, registered map[string]bool) error { + pinKeys, err := ix.Pins.Keys(ctx) + if err != nil { + return err + } + for _, k := range pinKeys { + v, _, found, err := ix.Pins.Get(ctx, k) + if err != nil { + return err + } + var pv PinValue + if !found || json.Unmarshal(v, &pv) != nil { + continue + } + for _, record := range pv.Records { + if strings.HasPrefix(record, "failed.") && !registered[record] { + if err := ix.unpin(ctx, k, record); err != nil { + return err + } + ix.logf("pins: %s is freed from %s: its module is no longer registered on that branch (H-A-572 (2))", record, k) + } + } + } + return nil +} + +// RegisteredFailedRecords are the failed records every registration of the registry names, one per module and branch. +func (r *Registry) RegisteredFailedRecords(ctx context.Context) (map[string]bool, error) { + all, err := r.Registrations.Keys(ctx) + if err != nil { + return nil, err + } + out := map[string]bool{} + for _, k := range all { + v, _, found, err := r.Registrations.Get(ctx, k) + if err != nil { + return nil, err + } + var reg meshcatalog.Registration + if !found || json.Unmarshal(v, ®) != nil { + continue + } + if reg.Module == "" { + return nil, fmt.Errorf("the registration %s names no module, so no failed record is freed by this read", k) + } + for _, b := range reg.Branches { + out[FailedRecord(b, reg.Module)] = true + } + } + return out, nil +} + +// unpinOlder frees record from every revision of branch older than revision (H-A-566). +func (ix *Indexer) unpinOlder(ctx context.Context, branch string, revision int64, record string) error { + pinKeys, err := ix.Pins.Keys(ctx) + if err != nil { + return err + } + for _, k := range pinKeys { + b, r, ok := ParsePinKey(k) + if !ok || b != branch || r >= revision { + continue + } + v, _, found, err := ix.Pins.Get(ctx, k) + if err != nil { + return err + } + var pv PinValue + if !found || json.Unmarshal(v, &pv) != nil || !slices.Contains(pv.Records, record) { + continue + } + if err := ix.unpin(ctx, k, record); err != nil { + return err + } + } + return nil +} + // HeardPipelineWanted applies one pipeline-wanted of the seat mesh-wants, said when a pipeline's wants are written to the end // (design 47 H §751, H-A-168, H-A-170, H-A-173, H-A-174). Outcome running: a module whose release record the pipeline's own // kept revision holds released its newer version there, and that is the want everywhere, so the module's record is freed from diff --git a/modules/mesh-delivery-indexer/internal/index/pins_test.go b/modules/mesh-delivery-indexer/internal/index/pins_test.go index f8c203b0b..706fe6ebe 100644 --- a/modules/mesh-delivery-indexer/internal/index/pins_test.go +++ b/modules/mesh-delivery-indexer/internal/index/pins_test.go @@ -52,6 +52,58 @@ func TestAPipelinesKeptRevisionsArePinnedUntilItEnds(t *testing.T) { heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.1", Revision: 1, Kept: []int64{3, 4}}, nil, "main.1", "main.3", "main.4", "main.6") heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.1", Revision: 1, Outcome: runner.PipelineEndedOutcomeFailed}, "main.6") + + // H-A-565 (1), H-A-566: a failed delivering pipeline keeps its own and its kept revisions under failed.main. for + // each mover that did not pass (app failed, lib never ran; ok passed, gone was superseded); a pipeline of a newer + // revision moving lib frees lib's, app passing in a later pipeline frees app's, and only then the revisions go. + pending = 1 + for source := int64(7); source <= 10; source++ { + e := reader + e.Commit = fmt.Sprintf("c%d", source) + if err := ix.KeepBranchEntries(ctx, "main", source, map[string]meshcatalog.CatalogEntry{"reader": e}, nil); err != nil { + t.Fatal(err) + } + } + pending = 0 + step := func(outcome string) []runner.StepResult { + return []runner.StepResult{{Step: runner.StepResultStepUnit, Status: runner.StepResultStatusRequired, Outcome: outcome}} + } + heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.7", Revision: 7, Kept: []int64{8}}, nil, "main.10", "main.7", "main.8") + heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.7", Revision: 7, Outcome: runner.PipelineEndedOutcomeFailed, + Movers: []runner.MoverEnded{{Module: "app", Steps: step(runner.StepResultOutcomeFailed)}, {Module: "lib", Steps: step(runner.StepResultOutcomeNotAsked)}, + {Module: "ok", Steps: step(runner.StepResultOutcomePassed)}, {Module: "gone", Steps: step(runner.StepResultOutcomeSuperseded)}}}, + "main.10", "main.7") + for _, k := range []string{"main.7"} { + if v, _, _, _ := ix.Pins.Get(ctx, k); !slices.Equal(mustRecords(t, v), []string{"failed.main.app", "failed.main.lib"}) { + t.Errorf("the pin of %s holds %s, want app's and lib's failed records", k, v) + } + } + heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.10", Revision: 10, Movers: []runner.StartedMover{{Module: "lib"}}}, nil, + "main.10", "main.7") + if v, _, _, _ := ix.Pins.Get(ctx, "main.7"); !slices.Equal(mustRecords(t, v), []string{"failed.main.app"}) { + t.Errorf("the pin of main.7 holds %s after main.10 moved lib, want app's failed record alone", v) + } + heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.10", Revision: 10, Outcome: runner.PipelineEndedOutcomeFailed, + Movers: []runner.MoverEnded{{Module: "app", Steps: step(runner.StepResultOutcomePassed)}, {Module: "lib", Steps: step(runner.StepResultOutcomePassed)}}}, + "main.10") + + // H-A-595, H-A-608: a cancelled end pins as a failed one does, for a mover its `unfinished` names as for one whose step + // failed, so the revision its entry comes from stays after the pipeline's end. + pending = 1 + for source := int64(11); source <= 12; source++ { + e := reader + e.Commit = fmt.Sprintf("c%d", source) + if err := ix.KeepBranchEntries(ctx, "main", source, map[string]meshcatalog.CatalogEntry{"reader": e}, nil); err != nil { + t.Fatal(err) + } + } + pending = 0 + heard(&runner.PipelineStarted{Branch: "main", Pipeline: "main.11", Revision: 11}, nil, "main.11", "main.12") + heard(nil, &runner.PipelineEnded{Branch: "main", Pipeline: "main.11", Revision: 11, Outcome: runner.PipelineEndedOutcomeCancelled, + Unfinished: []string{"carried"}}, "main.11", "main.12") + if v, _, _, _ := ix.Pins.Get(ctx, "main.11"); !slices.Equal(mustRecords(t, v), []string{"failed.main.carried"}) { + t.Errorf("the pin of main.11 holds %s after a cancelled end naming carried unfinished, want its failed record", v) + } } // Design 47 H §749 (G §579, A-169, A-171): the indexer pins a revision on a pipeline-started that names it and frees it on its @@ -227,6 +279,7 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) { unreleased bool // its mover released no version there, so nothing pins main.5 (H-A-173) then []int64 // sources taken in with no mover after the end released []string + failed []string // main.5's mover did not pass in the failed pipeline: its failed record keeps these (H-A-565 (1), H-A-566) }{ {name: "the previous revision kept and pinned", before: []int64{3, 4}, at: 3, whileRuns: []string{"main.2", "main.3"}, afterTheEnd: []string{"main.3"}, base: 2}, {name: "the newest kept before, whatever its source", before: []int64{2}, at: 2, whileRuns: []string{"main.1", "main.2"}, afterTheEnd: []string{"main.2"}, base: 1}, @@ -237,6 +290,8 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) { base: 1, passed: true, unreleased: true, then: []int64{6}, afterTheEnd: []string{"main.3"}}, {name: "a failed pipeline's revision goes once no longer current", before: []int64{4}, at: 2, whileRuns: []string{"main.1", "main.2"}, base: 1, then: []int64{6}, afterTheEnd: []string{"main.3"}}, + {name: "a failed pipeline's mover that did not pass keeps its revisions", before: []int64{4}, at: 2, whileRuns: []string{"main.1", "main.2"}, + base: 1, then: []int64{6}, afterTheEnd: []string{"main.1", "main.2", "main.3"}, failed: []string{"main.1", "main.2"}}, } { t.Run(tc.name, func(t *testing.T) { ix := &Indexer{Module: testSelf, Revisions: newMemObjects(1 << 20), Pins: newMem(), Findings: newFindings(), @@ -273,7 +328,11 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) { } } end := runner.PipelineEnded{Branch: "main", Pipeline: at, Revision: tc.at, Outcome: runner.PipelineEndedOutcomeFailed, - Movers: []runner.MoverEnded{{Module: "reader", Fingerprint: "f", Version: "0.1.5"}}} + Movers: []runner.MoverEnded{{Module: "reader", Fingerprint: "f", Version: "0.1.5", + Steps: []runner.StepResult{{Step: runner.StepResultStepUnit, Status: runner.StepResultStatusRequired, Outcome: runner.StepResultOutcomePassed}}}}} + if tc.failed != nil { + end.Movers[0].Steps[0].Outcome = runner.StepResultOutcomeFailed + } if tc.unreleased { end.Movers[0].Version = "" } @@ -296,6 +355,9 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) { if slices.Contains(tc.released, k) { want = []string{ReleaseRecord("main", "reader")} } + if slices.Contains(tc.failed, k) { + want = []string{FailedRecord("main", "reader")} + } if v, _, _, _ := ix.Pins.Get(ctx, k); !slices.Equal(append([]string{}, mustRecords(t, v)...), want) { t.Errorf("after the pipeline's end the pin of %s holds %s, want %v", k, v, want) } @@ -304,3 +366,20 @@ func TestATakeInPinsTheBranchsPreviousRevisionForItsPipeline(t *testing.T) { }) } } + +// Design 47 H2 H-A-572 (2): a failed record is freed from every pin when no registration of its module names its branch. +func TestAFailedRecordIsFreedWhenItsModuleLeavesTheRegistrations(t *testing.T) { + ctx := context.Background() + ix := &Indexer{Module: testSelf, Revisions: newMemObjects(1 << 20), Pins: newMem(), Findings: newFindings()} + for _, r := range []string{FailedRecord("main", "gone"), FailedRecord("main", "stays"), PipelineRecord("main.1")} { + if err := ix.pin(ctx, "main.3", r); err != nil { + t.Fatal(err) + } + } + if err := ix.FreeFailedRecords(ctx, map[string]bool{FailedRecord("main", "stays"): true}); err != nil { + t.Fatal(err) + } + if v, _, _, _ := ix.Pins.Get(ctx, "main.3"); !slices.Equal(mustRecords(t, v), []string{FailedRecord("main", "stays"), PipelineRecord("main.1")}) { + t.Errorf("the pin holds %s, want the registered module's failed record and the pipeline's alone", v) + } +} From 5922da0a928b56645d4809939954bcac6baf740f Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:37:22 +0100 Subject: [PATCH 35/44] I8 pin-drop-record: indexer_pin_drop with record drops that one record from every pin holding it, the pins' other records staying Builds: design 47 H2 H-A-572 (3) --- .../cmd/mesh-delivery-indexer/takein.go | 4 ++ .../cmd/mesh-delivery-indexer/takein_test.go | 3 + .../internal/index/pins.go | 70 +++++++++++++++++-- .../internal/index/pins_test.go | 11 +++ .../internal/index/takein.go | 3 + 5 files changed, 87 insertions(+), 4 deletions(-) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein.go index b86f544c9..94ad1c86a 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein.go @@ -20,6 +20,7 @@ type takerIn interface { DropCandidateGraph(ctx context.Context, group, heads, by, why string) index.TakenIn NamedDrop(ctx context.Context, fingerprint, member, by, why string) index.TakenIn PinDrop(ctx context.Context, key, by, why string) index.TakenIn + PinDropRecord(ctx context.Context, record, by, why string) index.TakenIn DropRunByHand(ctx context.Context, run, by, why string) index.TakenIn RegistryAct(ctx context.Context, a index.TakeInAsk) index.TakenIn // HeldAgain and HeldSkip act on a watched branch's held source-moved (design 47 H §744). @@ -70,6 +71,9 @@ func takenIn(ctx context.Context, ix takerIn, kv jetstream.KeyValue, e jetstream } else if a.NamedFingerprint != "" && a.Drop { asked, r = "drop of a member of a fingerprint's names", ix.NamedDrop(ctx, a.NamedFingerprint, a.NamedMember, a.By, a.Why) a.Module = r.Module + } else if a.PinDropRecord != "" { + asked, r = "drop of a record from the pins of the catalog graph revisions", ix.PinDropRecord(ctx, a.PinDropRecord, a.By, a.Why) + a.Module = r.Module } else if a.PinDrop != "" { asked, r = "drop of a pin of the catalog graph revisions", ix.PinDrop(ctx, a.PinDrop, a.By, a.Why) a.Module = r.Module diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_test.go index 495844ebf..a04fc28e0 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_test.go @@ -39,6 +39,9 @@ func (s *askedBy) NamedDrop(context.Context, string, string, string, string) ind func (s *askedBy) PinDrop(context.Context, string, string, string) index.TakenIn { return s.did("pin-drop") } +func (s *askedBy) PinDropRecord(context.Context, string, string, string) index.TakenIn { + return s.did("pin-drop-record") +} func (s *askedBy) DropRunByHand(context.Context, string, string, string) index.TakenIn { return s.did("run-drop") } diff --git a/modules/mesh-delivery-indexer/internal/index/pins.go b/modules/mesh-delivery-indexer/internal/index/pins.go index 48cc0b60a..c10ba1999 100644 --- a/modules/mesh-delivery-indexer/internal/index/pins.go +++ b/modules/mesh-delivery-indexer/internal/index/pins.go @@ -799,6 +799,48 @@ func (ix *Indexer) PinDrop(ctx context.Context, key, by, why string) TakenIn { return r } +// PinDropRecord drops one record, by its name, from every pin of the state pins that holds it, leaving each pin's other records +// (indexer_pin_drop with record, design 47 H2 H-A-572 (3)); the removal rule then applies. +func (ix *Indexer) PinDropRecord(ctx context.Context, record, by, why string) TakenIn { + r := TakenIn{Module: "pins record " + record} + if ix.Pins == nil { + r.Answer = "the indexer keeps no state " + PinsState + ": nothing dropped" + return r + } + pinKeys, err := ix.Pins.Keys(ctx) + if err != nil { + r.Answer = "the state " + PinsState + " cannot be read: " + err.Error() + return r + } + slices.Sort(pinKeys) + dropped := 0 + for _, k := range pinKeys { + if _, _, ok := ParsePinKey(k); !ok { + continue + } + v, _, found, err := ix.Pins.Get(ctx, k) + if err != nil { + r.Answer = "the pin " + k + " cannot be read, so the drop stops there: " + err.Error() + return r + } + var pv PinValue + if !found || json.Unmarshal(v, &pv) != nil || !slices.Contains(pv.Records, record) { + continue + } + if err := ix.unpin(ctx, k, record); err != nil { + r.Answer = "the record " + record + " could not be dropped from " + k + ": " + err.Error() + ix.logf("%s", r.Answer) + return r + } + dropped++ + } + r.Stored = dropped > 0 + r.Answer = fmt.Sprintf("the record %s is dropped from %d pins by %s (%s)", record, dropped, by, why) + ix.logf("%s", r.Answer) + ix.JudgePins(ctx) + return r +} + // PinnedRevision is one revision of the state pins as indexer_pins lists it. type PinnedRevision struct { Revision string `json:"revision"` @@ -881,14 +923,34 @@ func PinsTools(pins Store, o Objects, ask func(key string, value []byte) (TakeIn "running pipeline (design 47 H §765); the removal rule then applies (a revision no record pins and not current goes). A hand " + "act, recorded through mesh-hand-acts before it is asked. Clears the finding pin-missing of the key. indexer_pins names the keys. " + "With all true and no key, every pin of the state goes, each recorded and asked as one: the clean state's tool, run while no " + - "pipeline runs (design 47 H-A-121, H-A-124); it answers the count dropped and the pipelines they named.", + "pipeline runs (design 47 H-A-121, H-A-124); it answers the count dropped and the pipelines they named. With record " + + "and no key, that one record (`failed..`, as indexer_pins names it) is dropped from every pin that holds it " + + "and the pins' other records stay (design 47 H2 H-A-572 (3)).", Input: map[string]any{"type": "object", "required": []string{"why"}, "properties": map[string]any{ - "key": map[string]any{"type": "string", "description": "the pin's key `.`, as indexer_pins names it"}, - "all": map[string]any{"type": "boolean", "description": "true drops every pin of the state pins, naming no key"}, - "why": map[string]any{"type": "string", "description": "why it is dropped, in plain words"}}}, + "key": map[string]any{"type": "string", "description": "the pin's key `.`, as indexer_pins names it"}, + "all": map[string]any{"type": "boolean", "description": "true drops every pin of the state pins, naming no key"}, + "record": map[string]any{"type": "string", "description": "one record, as indexer_pins names it, dropped from every pin that holds it; the pins' other records stay"}, + "why": map[string]any{"type": "string", "description": "why it is dropped, in plain words"}}}, Run: func(args map[string]any) (any, error) { str := func(k string) string { s, _ := args[k].(string); return strings.TrimSpace(s) } key, why := str("key"), str("why") + if rec := str("record"); rec != "" { + if key != "" || str("all") == "true" || why == "" { + return nil, errors.New("name a record (record) with no key and no all, and say why (why): a drop is a hand act, recorded through mesh-hand-acts") + } + data, err := json.Marshal(TakeInAsk{V: 1, PinDropRecord: rec, Why: why, By: stdio.CallerOf(args), At: now().UTC()}) + if err != nil { + return nil, err + } + if err := record("dropped the record "+rec+" from the pins of the catalog graph revisions by hand", why); err != nil { + return nil, fmt.Errorf("the hand act was not recorded through mesh-hand-acts, so nothing was dropped: %w", err) + } + a, err := ask("pin-drop-record."+keys.EscapeName(rec), data) + if err != nil { + return nil, err + } + return a.Result, nil + } if all, _ := args["all"].(bool); all || str("all") == "true" { if key != "" { return nil, errors.New("the all form drops every pin: name no key with it") diff --git a/modules/mesh-delivery-indexer/internal/index/pins_test.go b/modules/mesh-delivery-indexer/internal/index/pins_test.go index 706fe6ebe..42ef466a8 100644 --- a/modules/mesh-delivery-indexer/internal/index/pins_test.go +++ b/modules/mesh-delivery-indexer/internal/index/pins_test.go @@ -177,6 +177,17 @@ func TestTheIndexerRemovesARevisionOnlyWhenNoRecordPinsItAndItIsNotCurrent(t *te if f := ix.Findings.Held(); len(f) != 1 || f[0].Kind != PinMissingKind { t.Fatalf("findings %v, want one %s", f, PinMissingKind) } + // H-A-572 (3): a record dropped by name leaves its pin's other records. + if err := ix.pin(ctx, "main.3", FailedRecord("main", "x")); err != nil { + t.Fatal(err) + } + before, _, _, _ := ix.Pins.Get(ctx, "main.3") + if r := ix.PinDropRecord(ctx, FailedRecord("main", "x"), "operator", "a hand act"); !r.Stored { + t.Fatalf("the record drop answered %q", r.Answer) + } + if v, _, _, _ := ix.Pins.Get(ctx, "main.3"); len(mustRecords(t, v)) != len(mustRecords(t, before))-1 || slices.Contains(mustRecords(t, v), FailedRecord("main", "x")) { + t.Errorf("the pin holds %s after the record drop, was %s: want the one record gone and the others staying", v, before) + } if r := ix.PinDrop(ctx, "main.1", "operator", "names no running pipeline"); !r.Stored { t.Fatalf("the pin drop answered %q", r.Answer) } diff --git a/modules/mesh-delivery-indexer/internal/index/takein.go b/modules/mesh-delivery-indexer/internal/index/takein.go index 5e7074c31..d6f063142 100644 --- a/modules/mesh-delivery-indexer/internal/index/takein.go +++ b/modules/mesh-delivery-indexer/internal/index/takein.go @@ -45,6 +45,9 @@ type TakeInAsk struct { NamedFingerprint string `json:"named-fingerprint,omitempty" takein:"act"` // PinDrop asks one pin of the state pins, by its key, to be dropped (indexer_pin_drop, design 47 H §765). PinDrop string `json:"pin-drop,omitempty" takein:"act"` + // PinDropRecord asks one record, by its name, to be dropped from every pin that holds it, the pins' other records staying + // (indexer_pin_drop with record, design 47 H2 H-A-572 (3)). + PinDropRecord string `json:"pin-drop-record,omitempty" takein:"act"` // Held names the watched branch whose held source-moved is taken in again now (indexer_take_in_pending) or, with Skip and // HeldSource, ended unwritten (indexer_take_in_skip; design 47 H §744). Held string `json:"held,omitempty" takein:"act"` From 1b4d7e5c8d2f73d98822d3953afbb973b83e33f2 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 25 Nov 2026 17:42:54 +0100 Subject: [PATCH 36/44] I15 starting-indexer-answers: the starting indexer answers away while its start's read of the trunk holds the view, and says its start's phases KeptTrunk.Unread and current answer the fault away naming "the trunk's revision " while the start's read holds the view, and never wait behind it; the verb revision asks it first; the tools' watched copies (seat-definitions, config readers) ask WatchedStates.Unread before they read and are watched from the bundle's start. The indexer's start says each step as a phase of mesh-sdk's ProcessReader (BeginPhase, EndPhase), kept at start-phase of the state first-views. Rows: a unit test of the held read, one of the watched copy, and TestIndexerWhole's phases and held-read case. Builds: design 47 H2 H-A-708 (1) (2), H-A-717 DQ-54, H-A-733 (2) --- .../mesh-delivery-indexer-tools/catalog.go | 19 ++++- .../cmd/mesh-delivery-indexer-tools/main.go | 5 ++ .../cmd/mesh-delivery-indexer-tools/views.go | 3 + .../watched_test.go | 54 +++++++++++++++ .../cmd/mesh-delivery-indexer/main.go | 30 ++++++-- .../takein_integration_test.go | 68 +++++++++++++++++- .../internal/index/catalog_revisions.go | 69 ++++++++++++++++--- .../internal/index/kept_trunk_test.go | 65 +++++++++++++++++ .../internal/index/revision_verb.go | 6 ++ 9 files changed, 300 insertions(+), 19 deletions(-) create mode 100644 modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/watched_test.go diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/catalog.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/catalog.go index e6688fb00..c779eaa17 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/catalog.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/catalog.go @@ -72,9 +72,19 @@ type watchedSource struct { state string } -func (s watchedSource) Keys() ([]string, error) { return s.w.Keys(s.state) } +// Each read asks Unread first, so a call made before the copy has its state answers the fault away at once (design 47 H2 +// H-A-708 (2)); the bundle's own start keeps the waiting read (main). +func (s watchedSource) Keys() ([]string, error) { + if err := s.w.Unread(s.state); err != nil { + return nil, err + } + return s.w.Keys(s.state) +} func (s watchedSource) Get(key string) (*views.Entry, bool, error) { + if err := s.w.Unread(s.state); err != nil { + return nil, false, err + } v, ok, err := s.w.Get(s.state, key) if err != nil || !ok { return nil, false, err @@ -82,4 +92,9 @@ func (s watchedSource) Get(key string) (*views.Entry, bool, error) { return &views.Entry{Value: v}, true, nil } -func (s watchedSource) Values() (map[string][]byte, error) { return s.w.Values(s.state) } +func (s watchedSource) Values() (map[string][]byte, error) { + if err := s.w.Unread(s.state); err != nil { + return nil, err + } + return s.w.Values(s.state) +} diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go index 0945d469d..efdbc0bb0 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/main.go @@ -194,6 +194,11 @@ func main() { } follow.Start(context.Background()) watched := stdio.NewWatchedStates() + // The copies the handlers read are watched from the start, beside the answers: a handler asks Unread first and is answered + // the fault away until its state is in (design 47 H2 H-A-708 (2)). + for _, state := range []string{index.SeatDefinitionsState, "manifests"} { + go watched.Follow(state, nil) + } tools = append(tools, catalogTools(trunk.State, kept, watched)...) // The seat mesh-catalog's verb revision, a first view of the catalog half answered in this runtime of its own to exactly // the parts whose entry declares it (novox/hq ADR 0663). diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/views.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/views.go index f7922ec81..1eb2d65cd 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/views.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/views.go @@ -62,6 +62,9 @@ func configReadersTool(watched *stdio.WatchedStates, modules views.Source) stdio } } kept := map[string]meshcatalog.ManifestsByDigestValue{} + if err := watched.Unread("manifests"); err != nil { + return nil, err + } raws, err := watched.Values("manifests") if err != nil { return nil, fmt.Errorf("the manifests state cannot be read: %w", err) diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/watched_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/watched_test.go new file mode 100644 index 000000000..d931f9c26 --- /dev/null +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer-tools/watched_test.go @@ -0,0 +1,54 @@ +package main + +import ( + "errors" + "runtime" + "testing" + "time" + + stdio "git.novox.be/novox/mesh-sdk/go" + "git.novox.be/novox/mesh-sdk/go/busretry" + + "mesh-delivery-indexer/internal/index" +) + +// Design 47 H2 H-A-708 (2): a handler on a watched copy asks Unread first, so the verb seat-definitions, asked before the copy +// has its state (the watch not handing its values yet), answers the fault away at once and answers its values after. +func TestASeatDefinitionsReadIsAnsweredAwayUntilItsStateIsWatched(t *testing.T) { + release := make(chan struct{}) + w := stdio.WatchedStatesOver(func(state string, handle func(stdio.StateChange) error) error { + <-release + return handle(stdio.StateChange{State: state, Key: "git.trunk", Op: stdio.OpPut, Value: []byte(`{"digest":"d"}`), Revision: 1, Current: true}) + }, nil) + src := watchedSource{w, index.SeatDefinitionsState} + var away *busretry.Away + if _, err := src.Keys(); !errors.As(err, &away) { + t.Fatalf("Keys before the copy is asked for = %v, want away", err) + } + go w.Follow(index.SeatDefinitionsState, nil) // the bundle's start asks for the copy + deadline := time.Now().Add(5 * time.Second) + for { + _, err := src.Values() + if errors.As(err, &away) && away.Part == "the state "+index.SeatDefinitionsState { + break // asked for and not handed yet + } + if time.Now().After(deadline) { + t.Fatalf("Values while the watch is held = %v, want away naming the state", err) + } + runtime.Gosched() + } + close(release) + for { + keys, err := src.Keys() + if err == nil { + if len(keys) != 1 || keys[0] != "git.trunk" { + t.Fatalf("Keys after the copy has its state = %v, want its one key", keys) + } + return + } + if time.Now().After(deadline) { + t.Fatalf("Keys still %v after the watch handed its values", err) + } + runtime.Gosched() + } +} diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go index dedbddff3..ceb36376b 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/main.go @@ -18,6 +18,7 @@ import ( "os" "os/signal" "strings" + "sync" "sync/atomic" "syscall" "time" @@ -397,12 +398,34 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro } return ix.SeedModulesFrom(ctx, r.Definitions(), stepsVia(calls.CallKeptWhileOpen, ix.SeedEntryHeld, logger.Printf)) } + // The indexer's one pull of its durable on the shared events stream (process.EventHub): every handler is registered + // before it starts. + hub := process.NewEventHub(logger.Printf) + reader := &views.ProcessReader{Module: cred.Module, Call: calls.Call, Logf: logger.Printf, Hub: hub, + Findings: func() views.WireWriter { return writer }} // Each step of the start says when it begins and how long it took, so a start that does not end is read in the journal // and not guessed (lead-47 2026-11-16: two starts on novox ran 25 minutes at one CPU with no line). + // Each is also the phase the start is in, said in the reader's journal and kept for the first-view tool (design 47 H2 + // H-A-708 (1), H-A-717 DQ-54), and ended only by its own end, so a pass that runs beside the start's (the publish at + // start) never ends another's. + var phaseMu sync.Mutex + phase := "" step := func(name string) func() { began := time.Now() logger.Printf("start: %s", name) - return func() { logger.Printf("start: %s done in %s", name, time.Since(began).Round(time.Millisecond)) } + phaseMu.Lock() + phase = name + phaseMu.Unlock() + reader.BeginPhase(name) + return func() { + logger.Printf("start: %s done in %s", name, time.Since(began).Round(time.Millisecond)) + phaseMu.Lock() + defer phaseMu.Unlock() + if phase == name { + phase = "" + reader.EndPhase() + } + } } // A module of the current trunk graph with no registration is registered once at the start, as a kept trunk revision // registers one entering the graph (design 47 H H-A-262, H-A-264 (1)); said loudly, whatever it answers. @@ -452,11 +475,6 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro buildModules.refresh() // The assignments is the seat mesh-module-assigner's: read through its holder's first view and views family, never its bucket (DLV-F1r). assignmentsErrs := make(chan error) - // The indexer's one pull of its durable on the shared events stream (process.EventHub): every handler is registered - // before it starts. - hub := process.NewEventHub(logger.Printf) - reader := &views.ProcessReader{Module: cred.Module, Call: calls.Call, Logf: logger.Printf, Hub: hub, - Findings: func() views.WireWriter { return writer }} // The holder function (A-302): the seat-holders view of the claimant of mesh-module-assigner in the indexer's own catalog, // followed again at each refresh of the build modules (a seat list change, a catalog revision). seatHolders := &seatHoldersFollow{ctx: ctx, ix: ix, reader: reader, logf: logger.Printf} diff --git a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go index 9650b2a6f..e5b9e6d8b 100644 --- a/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go +++ b/modules/mesh-delivery-indexer/cmd/mesh-delivery-indexer/takein_integration_test.go @@ -26,7 +26,9 @@ import ( "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildgo" stdio "git.novox.be/novox/mesh-sdk/go" + "git.novox.be/novox/mesh-sdk/go/busretry" "git.novox.be/novox/mesh-sdk/go/keys" + "git.novox.be/novox/mesh-sdk/go/views" "mesh-delivery-indexer/internal/index" ) @@ -412,7 +414,7 @@ func TestIndexerWhole(t *testing.T) { ) var forge *forgeCommits var heard *takeIns - var pins, held, takeinsKV, regs, runs jetstream.KeyValue + var pins, held, takeinsKV, regs, runs, status jetstream.KeyValue js, ctx, candidates, _, restart := startIndexerRun(t, func(context.Context, buildLog) {}, func(ctx context.Context, js jetstream.JetStream) { heard = hearTakeIns(t, js.Conn()) forge = serveCommits(t, js.Conn()) @@ -423,8 +425,8 @@ func TestIndexerWhole(t *testing.T) { for _, b := range []struct { state string kv *jetstream.KeyValue - }{{index.HeldState, &held}, {index.TakeInsState, &takeinsKV}, {index.RunsState, &runs}} { - if *b.kv, err = js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.Bucket(testIndexer, b.state), History: 1}); err != nil { + }{{index.HeldState, &held}, {index.TakeInsState, &takeinsKV}, {index.RunsState, &runs}, {views.StatusState, &status}} { + if *b.kv, err = js.CreateKeyValue(ctx, jetstream.KeyValueConfig{Bucket: index.Bucket(testIndexer, b.state), History: 64}); err != nil { t.Fatal(err) } } @@ -649,6 +651,66 @@ func TestIndexerWhole(t *testing.T) { if hq := heard.next(t, "delta", 2); len(hq.Entries) != 0 || hq.Revision != 2 { t.Errorf("the move of novox/hq on delta said %+v, want revision 2 with no movers", hq) } + + // Design 47 H2 H-A-708 (1), H-A-717 DQ-54: the start's phases are kept at start-phase of the state first-views, and the + // start's last phase ended is null. + untilKey(t, ctx, status, views.StartPhaseKey, func(v []byte) bool { return string(v) == "null" }) + phases, err := status.History(ctx, views.StartPhaseKey) + if err != nil { + t.Fatal(err) + } + var said []string + for _, e := range phases { + var p *views.StartPhase + if json.Unmarshal(e.Value(), &p) == nil && p != nil { + said = append(said, p.Name) + } + } + for _, want := range []string{"following the assignments", "computing the fingerprints"} { + if !slices.Contains(said, want) { + t.Errorf("the start's phases kept %q, want %q among them", said, want) + } + } + + // Design 47 H2 H-A-708 (2) (AC-I15): while the start's read of the trunk is held, the verb revision, asked of the tools' + // view of the trunk, answers the fault away naming the trunk's revision within seconds, never waiting behind the read. + hold := &holdEntries{Objects: objects, reading: make(chan struct{}), release: make(chan struct{})} + kept := &index.KeptTrunk{} + readEnded := make(chan error, 1) + go func() { readEnded <- kept.Reread(ctx, hold) }() + <-hold.reading + answered := make(chan error, 1) + go func() { + _, err := toolNamed(t, []stdio.Tool{index.RevisionTool(hold, kept)}, meshcatalog.Seat+"."+meshcatalog.VerbRevision).Run(map[string]any{}) + answered <- err + }() + select { + case err := <-answered: + var away *busretry.Away + if !errors.As(err, &away) || !strings.HasPrefix(away.Part, "the trunk's revision ") { + t.Errorf("revision while the start's read is held answered %v, want away naming the trunk's revision", err) + } + case <-time.After(waitBound): + t.Error("revision waited behind the start's read of the trunk") + } + close(hold.release) + if err := <-readEnded; err != nil { + t.Errorf("the held read of the trunk ended with %v", err) + } +} + +// holdEntries is the indexer's objects whose first read of an entry waits until release is closed: a read of the trunk held. +type holdEntries struct { + index.Objects + reading, release chan struct{} + once sync.Once +} + +func (h *holdEntries) Get(ctx context.Context, name string) ([]byte, error) { + if strings.HasPrefix(name, "entry.") { + h.once.Do(func() { close(h.reading); <-h.release }) + } + return h.Objects.Get(ctx, name) } // toolNamed is the tool of that name. diff --git a/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go b/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go index 05d812b8a..e7f11e026 100644 --- a/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go +++ b/modules/mesh-delivery-indexer/internal/index/catalog_revisions.go @@ -16,6 +16,7 @@ import ( "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshcatalog" runner "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner" "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/graph" + "git.novox.be/novox/mesh-sdk/go/busretry" "git.novox.be/novox/mesh-sdk/go/catalogue" "git.novox.be/novox/mesh-sdk/go/keys" "git.novox.be/novox/mesh-sdk/go/process" @@ -223,9 +224,17 @@ func newestOf(ctx context.Context, o Objects, branch string) (meshcatalog.Catalo // while the newest is newer than the one that failed; the same revision failing twice is the read's failure. Progress bounds // the loop. No revision kept is false. func readNewestOf(ctx context.Context, o Objects, branch string) (meshcatalog.CatalogRevision, []meshcatalog.CatalogEntry, bool, error) { + return readNewestOfSaying(ctx, o, branch, nil) +} + +// readNewestOfSaying is readNewestOf telling said the revision each pass found as the newest, before it reads its entries. +func readNewestOfSaying(ctx context.Context, o Objects, branch string, said func(revision int64)) (meshcatalog.CatalogRevision, []meshcatalog.CatalogEntry, bool, error) { var failed int64 for { newest, any, err := newestOf(ctx, o, branch) + if err == nil && any && said != nil { + said(newest.Revision) + } if err == nil && !any { return newest, nil, false, nil } @@ -649,11 +658,16 @@ type KeptTrunk struct { read sync.Mutex // one re-read at a time; a read of the view never holds it mu sync.Mutex started bool - at int64 - mods Store - held Store - rev meshcatalog.CatalogRevision - entries []meshcatalog.CatalogEntry + // reading is whether a read of the trunk runs now, readingRev the revision it reads (0 while the newest is not known + // yet) and readingSince when it began: a call that meets the start's read says them as the fault away (Unread). + reading bool + readingRev int64 + readingSince time.Time + at int64 + mods Store + held Store + rev meshcatalog.CatalogRevision + entries []meshcatalog.CatalogEntry // manifests are the manifests the revision's entries carry whole, as JSON, by their digest as a module's value names it // (A-487c: the verbs module and provides answer them from here, never from the manifests state). manifests map[string]string @@ -668,13 +682,25 @@ func (k *KeptTrunk) Reread(ctx context.Context, o Objects) error { func (k *KeptTrunk) reread(ctx context.Context, o Objects) error { began := time.Now() + k.mu.Lock() + k.reading, k.readingRev, k.readingSince = true, 0, began + k.mu.Unlock() + defer func() { + k.mu.Lock() + k.reading = false + k.mu.Unlock() + }() fail := func(err error) error { if k.Say != nil { k.Say("the view of the trunk is BEHIND, its re-read failed after %s (the view held stays, the next heard catalog-revision reads again): %v", time.Since(began).Round(time.Millisecond), err) } return err } - newest, entries, any, err := readNewestOf(ctx, o, TrunkBranch) + newest, entries, any, err := readNewestOfSaying(ctx, o, TrunkBranch, func(revision int64) { + k.mu.Lock() + k.readingRev = revision + k.mu.Unlock() + }) if err != nil { return fail(err) } @@ -762,13 +788,40 @@ func (t TrunkStates) view() (modules, nodes Store, at int64, err error) { return t.Kept.current(context.Background(), t.Objects) } -// current is the view held; before the start's read it reads the newest revision once. +// Unread is the fault away (busretry.Away, design 47 H2 H-A-708 (2)) naming "the trunk's revision " with "not read yet +// since