diff --git a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go index 7d0a0c843..e6e00d787 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract.go @@ -13,13 +13,13 @@ 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 = 1 +const Form = 2 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( - generatedForms = "1" - generatedFieldsDigest = "AskTakenEvent=6d5d3da7ac39 BuildEntry=3c829a0a3d58 Dependency=90a32b07c563 DropAnswer=7538f2f5e68e PackagePublished=34dd069a6aab PackagePublishedEvent=8e12888c1559 PublishQueueAnswer=0f1326e35e17 PublishQueueAnswerCountsItem=b770db2f0920 PublishQueueAnswerQueueItem=b1eebc09f41e PublishedAnswer=69a801982819 ReservedAnswer=2272a4d6f0f4 ReservedAnswerArtifactsItem=d74eb6e00abb StepAccept=18efeefb6c34 StepEnded=09a07bfbcb15 StepEndedEvent=207787118dac StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07" + generatedForms = "2" + 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 StepAccept=18efeefb6c34 StepEnded=40a0090f7cb5 StepEndedEvent=207787118dac StepRun=dc5893aef7e5 ToolchainAgreed=f3d9ce993734 ToolchainAgreedDigestsItem=1d42893a96b9 ToolchainAgreedEvent=e3502d6f194d VersionReservedEvent=984547d6ad07" ) const ( @@ -163,13 +163,13 @@ type StepEnded struct { ID string `json:"id"` // the node the builder ran it on, as in the subject Node string `json:"node"` - // never passed for a build that built nothing + // never passed for a build that built nothing; superseded for an entry whose fingerprint a newer entry of its branch superseded, built or not (design 47 H2 H-A-508): the mover moved to the newer revision's pipeline, never a failure Outcome string `json:"outcome"` // the pins the step's entries were built with, each mesh package's version by its module path, the ones the builder took from the registry for a package the entry named with none included; the runner asks the entry's held test steps with them (H-A-207) Packages map[string]string `json:"packages,omitempty"` Pipeline string `json:"pipeline"` Rerun bool `json:"rerun,omitempty"` - // why it failed or could not run: the entry not built, the part not heard + // 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"` Started *time.Time `json:"started,omitempty"` Step string `json:"step"` @@ -183,6 +183,7 @@ const ( StepEndedOutcomeFailed = "failed" StepEndedOutcomeNothingToRun = "nothing to run" StepEndedOutcomeCouldNotRun = "could not run" + StepEndedOutcomeSuperseded = "superseded" ) // The values of StepEnded's step. 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 8f92cb7f8..251eaabbf 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshbuilds/contract_test.go @@ -25,6 +25,8 @@ 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-builds\\.event\\.step-ended\\.[^.*> ]+$")}, {name: "the build step failed on its entry", subject: "mesh.seat.mesh-builds.event.step-ended.laptop", given: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"id\":\"m2kx9a1b3c4d6b\",\"node\":\"laptop\",\"outcome\":\"failed\",\"pipeline\":\"main.12.nats\",\"said\":\"nats:program did not build\",\"step\":\"build\",\"v\":1}", wire: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"id\":\"m2kx9a1b3c4d6b\",\"node\":\"laptop\",\"outcome\":\"failed\",\"pipeline\":\"main.12.nats\",\"said\":\"nats:program did not build\",\"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: "the build step ended superseded: a newer entry of its branch superseded its fingerprint (H-A-508)", subject: "mesh.seat.mesh-builds.event.step-ended.laptop", given: "{\"entries\":[{\"fingerprint\":\"fp-0123\",\"module\":\"nats\"}],\"form\":2,\"id\":\"m2kx9a1b3c4d6c\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"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\":2,\"id\":\"m2kx9a1b3c4d6c\",\"node\":\"laptop\",\"outcome\":\"superseded\",\"pipeline\":\"main.12.nats\",\"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: "an ask taken at the pull", subject: "mesh.seat.mesh-builds.event.ask-taken.main-3589-mesh-sdk-unit", given: "{\"ask\":\"main-3589-mesh-sdk-unit\",\"at\":\"2026-11-21T22:00:00Z\",\"node\":\"anchor\"}", wire: "{\"ask\":\"main-3589-mesh-sdk-unit\",\"at\":\"2026-11-21T22:00:00Z\",\"node\":\"anchor\"}", decode: func(b []byte) (any, error) { var v AskTakenEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-builds\\.event\\.ask-taken\\.[^.*> ]+$")}, {name: "a version reserved at a fingerprint", subject: "mesh.seat.mesh-builds.event.version-reserved", given: "{\"artifact\":\"mesh-sdk:go\",\"fingerprint\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"form\":1,\"module\":\"mesh-sdk\",\"path\":\"git.novox.be/novox/mesh-sdk/go\",\"revision\":\"412\",\"version\":\"0.1.21\"}", wire: "{\"artifact\":\"mesh-sdk:go\",\"fingerprint\":\"sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\",\"form\":1,\"module\":\"mesh-sdk\",\"path\":\"git.novox.be/novox/mesh-sdk/go\",\"revision\":\"412\",\"version\":\"0.1.21\"}", 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 174a449b9..f146c1626 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-builds/fixtures/events.json @@ -96,6 +96,27 @@ "said": "nats:program did not build" } }, + { + "name": "the build step ended superseded: a newer entry of its branch superseded its fingerprint (H-A-508)", + "of": "event:step-ended", + "subject": "mesh.seat.mesh-builds.event.step-ended.laptop", + "given": { + "v": 1, + "form": 2, + "id": "m2kx9a1b3c4d6c", + "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" + } + }, { "name": "an ask taken at the pull", "of": "event:ask-taken", diff --git a/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json b/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json index d077cd8c2..0d7612129 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-builds/seat.json @@ -636,13 +636,14 @@ "passed", "failed", "nothing to run", - "could not run" + "could not run", + "superseded" ], - "description": "never passed for a build that built nothing" + "description": "never passed for a build that built nothing; superseded for an entry whose fingerprint a newer entry of its branch superseded, built or not (design 47 H2 H-A-508): the mover moved to the newer revision's pipeline, never a failure" }, "said": { "type": "string", - "description": "why it failed or could not run: the entry not built, the part not heard" + "description": "why it failed, could not run or was superseded: the entry not built, the part not heard, the superseding fingerprint" }, "rerun": { "type": "boolean" @@ -703,5 +704,6 @@ "fingerprint" ] } - } + }, + "form": 2 } 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 5e2903e05..2e6574bba 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshbuilds/index.d.ts @@ -104,13 +104,13 @@ export interface StepEnded { "id": string; /** the node the builder ran it on, as in the subject */ "node": string; - /** never passed for a build that built nothing */ - "outcome": "passed" | "failed" | "nothing to run" | "could not run"; + /** never passed for a build that built nothing; superseded for an entry whose fingerprint a newer entry of its branch superseded, built or not (design 47 H2 H-A-508): the mover moved to the newer revision's pipeline, never a failure */ + "outcome": "passed" | "failed" | "nothing to run" | "could not run" | "superseded"; /** the pins the step's entries were built with, each mesh package's version by its module path, the ones the builder took from the registry for a package the entry named with none included; the runner asks the entry's held test steps with them (H-A-207) */ "packages"?: Record; "pipeline": string; "rerun"?: boolean; - /** why it failed or could not run: the entry not built, the part not heard */ + /** why it failed, could not run or was superseded: the entry not built, the part not heard, the superseding fingerprint */ "said"?: string; "started"?: string; "step": "build";