From b40745534f8c0f84c5b0dededf64d4449193cd3b Mon Sep 17 00:00:00 2001 From: jochen Date: Sat, 21 Nov 2026 23:17:31 +0100 Subject: [PATCH] D2: the runner's seat says phases, unfinished and re-pinned, and pages show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A step keeps asked-at and taken-at; pipeline-ended carries phases and unfinished; show takes step and state filters and the cursor next, and answers capped and total; re-pinned is declared. The seat's form rises to 2. Builds: design 47 H2 §778, §785, §786, §789, §821; H-A-349 DQ-13 --- .../go/seats/meshpipelinerunner/contract.go | 147 ++++++++++++- .../seats/meshpipelinerunner/contract_test.go | 4 + .../mesh-pipeline-runner/fixtures/events.json | 136 ++++++++++++ .../seats/mesh-pipeline-runner/seat.json | 197 +++++++++++++++++- .../ts/seats/meshpipelinerunner/index.d.ts | 105 ++++++++++ .../ts/seats/meshpipelinerunner/index.js | 3 + 6 files changed, 581 insertions(+), 11 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract.go index 08bb86a4e..e4b34e038 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 = 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 = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=75717fd670a7 LogEntry=b5c78894cc5b Member=8a103baec01f Mover=5659e54b6dd0 MoverEnded=4b35095f6829 Pipeline=2663792125bf PipelineEnded=7affe524ce3c PipelineEndedEvent=cb44007f7173 PipelineStarted=a3d000f095db PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 Published=d9af3024dacc QueueByQueueNextValue=765a2918a728 QueueByRunningPipelineValue=ed94ced4513a QueueByWaitingSequenceValue=99605298ae13 RerunAnswer=9b7efd0df344 ReviewAnswer=f397b8965179 RoomEvent=5bd4df78ed84 RunAnswer=96bd45aa2e62 RunStarted=b280617410c3 RunStartedEvent=0767a9358fa3 Shared=c981cf6aa860 SharedAskedBy=c9b30cc4d0d0 ShowAnswer=2d61e1983cf4 StandsAnswer=0afa3693bf3b StartAnswer=ed94ced4513a StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepOutputsByPipelineStepArtifactValue=a2f06147f4b6 StepResult=efc001a9bd75 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 = "2" + generatedFieldsDigest = "AcceptAnswer=224df0394653 Accepted=d2b011e5090f AskAgainAnswer=224df0394653 CancelAnswer=a0dcc32b3f57 EndAgainAnswer=a0dcc32b3f57 Fill=7a76c9ceb157 FillingEvent=5bd4df78ed84 FullEvent=5bd4df78ed84 KeptAnswer=dfe0d48bc169 KeptByLevelDigestValue=f06c90f7da7f KeptResult=af5f81f189b7 ListAnswer=75717fd670a7 LogEntry=b5c78894cc5b Member=8a103baec01f Mover=5659e54b6dd0 MoverEnded=4b35095f6829 Pipeline=2663792125bf PipelineEnded=523f8fc0fe41 PipelineEndedEvent=cb44007f7173 PipelineEndedPhases=9d1c33ce4cc4 PipelineEndedPhasesBuild=a08d49692a09 PipelineEndedPhasesComposition=a08d49692a09 PipelineEndedPhasesIntegration=a08d49692a09 PipelineEndedPhasesLint=a08d49692a09 PipelineEndedPhasesUnit=a08d49692a09 PipelineEndedPhasesValidate=a08d49692a09 PipelineStarted=a3d000f095db PipelineStartedEvent=eaa401af4117 PipelinesByBranchRevisionValue=693580eed498 PipelinesByBranchRunRunValue=693580eed498 PipelinesByBranchSourcePublishedPackageVersionValue=693580eed498 PipelinesByStepsPipelineMoverValue=94de99db7816 PlaceAnswer=a0dcc32b3f57 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=5beff763f531 StandsAnswer=0afa3693bf3b StartAnswer=ed94ced4513a StepEndedEvent=799020642c19 StepEvent=64f18c40ed5d StepLogByPipelineValue=ffdde090a101 StepOutputsByPipelineStepArtifactValue=a2f06147f4b6 StepResult=94c2bea6ddcd 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 ( @@ -50,6 +50,7 @@ const ( EventStepEnded = "step-ended" EventWaitHeld = "wait-held" EventWaitEnded = "wait-ended" + EventRePinned = "re-pinned" EventFilling = "filling" EventFull = "full" EventRoom = "room" @@ -62,7 +63,7 @@ func Verbs() []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, EventFilling, EventFull, EventRoom} + return []string{EventPipelineStarted, 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. @@ -148,6 +149,9 @@ func SubjectWaitEnded(branch, revision string) string { // SubjectWaitEndedAll hears every wait-ended. const SubjectWaitEndedAll = "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*" +// SubjectRePinned is where re-pinned is published. +const SubjectRePinned = "mesh.seat.mesh-pipeline-runner.event.re-pinned" + // SubjectFilling is where filling is published. const SubjectFilling = "mesh.seat.mesh-pipeline-runner.event.filling" @@ -675,6 +679,76 @@ const ( PipelineOutcomeCancelled = "cancelled" ) +// PipelineEndedPhasesBuild is the build steps' span across the movers. +type PipelineEndedPhasesBuild struct { + // the latest end across the movers + End *time.Time `json:"end,omitempty"` + // the earliest start across the movers + Start *time.Time `json:"start,omitempty"` +} + +// PipelineEndedPhasesComposition is the composition steps' span across the movers. +type PipelineEndedPhasesComposition struct { + // the latest end across the movers + End *time.Time `json:"end,omitempty"` + // the earliest start across the movers + Start *time.Time `json:"start,omitempty"` +} + +// PipelineEndedPhasesIntegration is the integration steps' span across the movers. +type PipelineEndedPhasesIntegration struct { + // the latest end across the movers + End *time.Time `json:"end,omitempty"` + // the earliest start across the movers + Start *time.Time `json:"start,omitempty"` +} + +// PipelineEndedPhasesLint is the lint steps' span across the movers. +type PipelineEndedPhasesLint struct { + // the latest end across the movers + End *time.Time `json:"end,omitempty"` + // the earliest start across the movers + Start *time.Time `json:"start,omitempty"` +} + +// PipelineEndedPhasesUnit is the unit steps' span across the movers. +type PipelineEndedPhasesUnit struct { + // the latest end across the movers + End *time.Time `json:"end,omitempty"` + // the earliest start across the movers + Start *time.Time `json:"start,omitempty"` +} + +// PipelineEndedPhasesValidate is the validate steps' span across the movers. +type PipelineEndedPhasesValidate struct { + // the latest end across the movers + End *time.Time `json:"end,omitempty"` + // the earliest start across the movers + Start *time.Time `json:"start,omitempty"` +} + +// PipelineEndedPhases is the pipeline's phases: the take-in, its placing, its end, and for each step kind the earliest start and the latest end across its movers; each mover's own step times stay in the step log (design 47 H2 §785). +type PipelineEndedPhases struct { + // the build steps' span across the movers + Build *PipelineEndedPhasesBuild `json:"build,omitempty"` + // the composition steps' span across the movers + Composition *PipelineEndedPhasesComposition `json:"composition,omitempty"` + // when the pipeline ended + Ended *time.Time `json:"ended,omitempty"` + // the integration steps' span across the movers + Integration *PipelineEndedPhasesIntegration `json:"integration,omitempty"` + // the lint steps' span across the movers + Lint *PipelineEndedPhasesLint `json:"lint,omitempty"` + // when the pipeline was placed + Placed *time.Time `json:"placed,omitempty"` + // when the take-in took the pipeline's revision in + Taken *time.Time `json:"taken,omitempty"` + // the unit steps' span across the movers + Unit *PipelineEndedPhasesUnit `json:"unit,omitempty"` + // the validate steps' span across the movers + Validate *PipelineEndedPhasesValidate `json:"validate,omitempty"` +} + // PipelineEnded is a pipeline's end, said once, with per mover its released version, step results and tier (design 47 H §746); the assigner writes wants only from a passed one. type PipelineEnded struct { // the watched branch, or the branch of a run on request @@ -689,6 +763,8 @@ type PipelineEnded struct { // per mover its fingerprint, released version, step results and tier, in the delivery order (design 47 H §746, H-A-2) Movers []MoverEnded `json:"movers"` Outcome string `json:"outcome"` + // the pipeline's phases: the take-in, its placing, its end, and for each step kind the earliest start and the latest end across its movers; each mover's own step times stay in the step log (design 47 H2 §785) + Phases *PipelineEndedPhases `json:"phases,omitempty"` // 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"` // the catalog graph revision of the branch the pipeline runs for @@ -698,8 +774,10 @@ type PipelineEnded 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"` - V int64 `json:"v"` - Why string `json:"why,omitempty"` + // the movers left unfinished by another's failure, each kept in the state unfinished and put in a pipeline again (design 47 H2 §786) + Unfinished []string `json:"unfinished,omitempty"` + V int64 `json:"v"` + Why string `json:"why,omitempty"` } // The values of PipelineEnded's outcome. @@ -808,6 +886,8 @@ type StepResult struct { Artifact string `json:"artifact,omitempty"` // the step's ask on the serving seat's work queue Ask string `json:"ask,omitempty"` + // when the step's ask was put on its seat's work queue (design 47 H2 §778) + AskedAt *time.Time `json:"asked-at,omitempty"` // for a rerun, the caller the runtime proved By string `json:"by,omitempty"` // for a carried result, the pipeline it was carried from @@ -833,9 +913,11 @@ type StepResult struct { Shared []Shared `json:"shared,omitempty"` Started *time.Time `json:"started,omitempty"` // the step's status in the module's policy - Status string `json:"status"` - Step string `json:"step"` - Tests *TestCounts `json:"tests,omitempty"` + Status string `json:"status"` + Step string `json:"step"` + // when the seat's holder took the ask, from its ask-taken; the unanswered bound counts from it (design 47 H2 §778) + TakenAt *time.Time `json:"taken-at,omitempty"` + Tests *TestCounts `json:"tests,omitempty"` // what the outcome rests on: the part not heard, the seat with no holder, what a waiting step waits on Why string `json:"why,omitempty"` } @@ -1059,19 +1141,43 @@ type StartAnswer struct { type ShowInput struct { // a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187) Mover string `json:"mover,omitempty"` + // the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789) + Next string `json:"next,omitempty"` // the pipeline's key Pipeline string `json:"pipeline"` + // only the steps whose outcome is this, applied while reading (design 47 H2 §789) + State string `json:"state,omitempty"` + // only the steps of this kind, applied while reading (design 47 H2 §789) + Step string `json:"step,omitempty"` } +// The values of ShowInput's step. +const ( + ShowInputStepValidate = "validate" + ShowInputStepBuild = "build" + ShowInputStepLint = "lint" + ShowInputStepUnit = "unit" + ShowInputStepIntegration = "integration" + ShowInputStepComposition = "composition" + ShowInputStepReview = "review" + ShowInputStepApproval = "approval" +) + // ShowAnswer is what show answers. type ShowAnswer struct { - Fill []Fill `json:"fill,omitempty"` + // yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789) + 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"` + // the cursor of the next page, opaque; empty at the end (design 47 H2 §779) + Next string `json:"next,omitempty"` // the outputs' names in step-outputs Outputs []string `json:"outputs,omitempty"` Pipeline Pipeline `json:"pipeline"` + // how many steps the filters hold in all (design 47 H2 §789) + Total int64 `json:"total,omitempty"` } // ListInput is what list takes. @@ -1357,6 +1463,18 @@ type WaitHeldEvent = Wait // WaitEndedEvent is the body of the event wait-ended. type WaitEndedEvent = Wait +// RePinnedEvent is the body of the event re-pinned. +type RePinnedEvent struct { + // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). + Form int64 `json:"form,omitempty"` + // the mover's module + Mover string `json:"mover"` + // the pipeline's key + Pipeline string `json:"pipeline"` + // the catalog revision it is re-pinned at + Revision int64 `json:"revision"` +} + // FillingEvent is the body of the event filling. type FillingEvent = Fill @@ -1615,6 +1733,15 @@ func DecodeWaitEndedEvent(raw []byte) (WaitEndedEvent, int, error) { return v, formRead(raw), nil } +// DecodeRePinnedEvent reads a RePinnedEvent 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 DecodeRePinnedEvent(raw []byte) (RePinnedEvent, int, error) { + var v RePinnedEvent + if err := json.Unmarshal(raw, &v); err != nil { + return v, 0, err + } + return v, formRead(raw), nil +} + // DecodeFillingEvent reads a FillingEvent 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 DecodeFillingEvent(raw []byte) (FillingEvent, int, error) { var v FillingEvent 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 4aaa6d53c..1cba1b75d 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshpipelinerunner/contract_test.go @@ -21,6 +21,8 @@ func TestFixtures(t *testing.T) { 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 ended passed: per mover its version, steps and tier, an optional step failed", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.main.3589", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"steps\":[{\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"validate\"}],\"tier\":1,\"version\":\"0.1.21\",\"widens\":[{\"name\":\"seat:mesh-wants.input\",\"what\":\"grant\"}]},{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"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\"}],\"tier\":2,\"version\":\"0.1.15\"}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"steps\":[{\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"validate\"}],\"tier\":1,\"version\":\"0.1.21\",\"widens\":[{\"name\":\"seat:mesh-wants.input\",\"what\":\"grant\"}]},{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"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\"}],\"tier\":2,\"version\":\"0.1.15\"}],\"outcome\":\"passed\",\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"v\":1}", 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 of two movers ended with its phases and one mover left unfinished", subject: "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.main.3589", given: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"form\":2,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"steps\":[{\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"validate\"}],\"tier\":1,\"version\":\"0.1.21\",\"widens\":[{\"name\":\"seat:mesh-wants.input\",\"what\":\"grant\"}]},{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"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\"}],\"tier\":2,\"version\":\"0.1.15\"}],\"outcome\":\"passed\",\"phases\":{\"build\":{\"end\":\"2026-11-21T22:02:00Z\",\"start\":\"2026-11-21T22:00:06Z\"},\"composition\":{\"end\":\"2026-11-21T22:06:00Z\",\"start\":\"2026-11-21T22:04:01Z\"},\"ended\":\"2026-11-21T22:06:00Z\",\"placed\":\"2026-11-21T22:00:05Z\",\"taken\":\"2026-11-21T22:00:00Z\",\"unit\":{\"end\":\"2026-11-21T22:04:00Z\",\"start\":\"2026-11-21T22:02:01Z\"}},\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"unfinished\":[\"mesh-delivery-view\"],\"v\":1}", wire: "{\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"end-count\":1,\"ended\":\"2026-11-10T10:20:00Z\",\"form\":2,\"movers\":[{\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-sdk\",\"module\":\"mesh-sdk\",\"steps\":[{\"module\":\"mesh-sdk\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"status\":\"required\",\"step\":\"validate\"}],\"tier\":1,\"version\":\"0.1.21\",\"widens\":[{\"name\":\"seat:mesh-wants.input\",\"what\":\"grant\"}]},{\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"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\"}],\"tier\":2,\"version\":\"0.1.15\"}],\"outcome\":\"passed\",\"phases\":{\"build\":{\"end\":\"2026-11-21T22:02:00Z\",\"start\":\"2026-11-21T22:00:06Z\"},\"composition\":{\"end\":\"2026-11-21T22:06:00Z\",\"start\":\"2026-11-21T22:04:01Z\"},\"ended\":\"2026-11-21T22:06:00Z\",\"placed\":\"2026-11-21T22:00:05Z\",\"taken\":\"2026-11-21T22:00:00Z\",\"unit\":{\"end\":\"2026-11-21T22:04:00Z\",\"start\":\"2026-11-21T22:02:01Z\"}},\"pipeline\":\"main.3589\",\"revision\":12,\"source\":3589,\"started\":\"2026-11-10T10:00:00Z\",\"unfinished\":[\"mesh-delivery-view\"],\"v\":1}", + 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}", @@ -43,6 +45,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-pipeline-runner\\.event\\.step-ended\\.[^.*> ]+\\.[^.*> ]+\\.[^.*> ]+$")}, {name: "C1 a composition step ended with mesh-wants' runs as they came", subject: "mesh.seat.mesh-pipeline-runner.event.step-ended.nats.main.0123456789abcdef0123456789abcdef01234567", given: "{\"at\":\"2026-11-17T10:05:00Z\",\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"pipeline\":\"main.3589\",\"result\":{\"fingerprint\":\"fp-0123\",\"node\":\"laptop\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"shared\":[{\"ask\":\"r1a2b3\",\"machine\":\"anchor\",\"run\":\"main.12.anchor\"}],\"status\":\"required\",\"step\":\"composition\"},\"revision\":12,\"source\":3589,\"v\":1}", wire: "{\"at\":\"2026-11-17T10:05:00Z\",\"branch\":\"main\",\"commit\":\"0123456789abcdef0123456789abcdef01234567\",\"fingerprint\":\"fp-0123\",\"module\":\"nats\",\"pipeline\":\"main.3589\",\"result\":{\"fingerprint\":\"fp-0123\",\"node\":\"laptop\",\"outcome\":\"passed\",\"seat\":\"mesh-wants\",\"shared\":[{\"ask\":\"r1a2b3\",\"machine\":\"anchor\",\"run\":\"main.12.anchor\"}],\"status\":\"required\",\"step\":\"composition\"},\"revision\":12,\"source\":3589,\"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-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 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 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 7a3b716b9..2ed2a9a25 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 @@ -134,6 +134,132 @@ ] } }, + { + "name": "a pipeline of two movers ended with its phases and one mover left unfinished", + "of": "event:pipeline-ended", + "subject": "mesh.seat.mesh-pipeline-runner.event.pipeline-ended.main.3589", + "given": { + "pipeline": "main.3589", + "branch": "main", + "revision": 12, + "source": 3589, + "end-count": 1, + "v": 1, + "outcome": "passed", + "started": "2026-11-10T10:00:00Z", + "ended": "2026-11-10T10:20:00Z", + "call": "0123456789abcdef", + "movers": [ + { + "module": "mesh-sdk", + "fingerprint": "fp-sdk", + "commit": "0123456789abcdef0123456789abcdef01234567", + "widens": [ + { + "what": "grant", + "name": "seat:mesh-wants.input" + } + ], + "version": "0.1.21", + "tier": 1, + "steps": [ + { + "module": "mesh-sdk", + "step": "validate", + "status": "required", + "outcome": "passed", + "seat": "mesh-wants" + } + ] + }, + { + "module": "nats", + "fingerprint": "fp-0123", + "steps": [ + { + "step": "lint", + "artifact": "nats:program", + "status": "required", + "outcome": "passed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "anchor", + "ask": "m2kx9a1b3c4d5e", + "module": "nats" + }, + { + "step": "unit", + "artifact": "nats:program", + "status": "required", + "outcome": "carried", + "fingerprint": "fp-0123", + "carried-from": "main.3588", + "tests": { + "unit": 42 + }, + "module": "nats" + }, + { + "step": "integration", + "artifact": "nats:program", + "status": "optional", + "outcome": "failed", + "why": "TestTheBusWhole failed", + "fingerprint": "fp-0123", + "seat": "node-build-go", + "node": "home-server", + "tests": { + "integration": 3 + }, + "module": "nats" + }, + { + "step": "composition", + "status": "required", + "outcome": "passed", + "seat": "mesh-wants", + "module": "nats" + }, + { + "step": "review", + "status": "bypass", + "outcome": "bypassed", + "module": "nats" + }, + { + "step": "approval", + "status": "required", + "outcome": "passed", + "module": "nats" + } + ], + "tier": 2, + "version": "0.1.15" + } + ], + "form": 2, + "phases": { + "taken": "2026-11-21T22:00:00Z", + "placed": "2026-11-21T22:00:05Z", + "ended": "2026-11-21T22:06:00Z", + "build": { + "start": "2026-11-21T22:00:06Z", + "end": "2026-11-21T22:02:00Z" + }, + "unit": { + "start": "2026-11-21T22:02:01Z", + "end": "2026-11-21T22:04:00Z" + }, + "composition": { + "start": "2026-11-21T22:04:01Z", + "end": "2026-11-21T22:06:00Z" + } + }, + "unfinished": [ + "mesh-delivery-view" + ] + } + }, { "name": "a pipeline ended failed, naming the step that held it, no version released", "of": "event:pipeline-ended", @@ -418,5 +544,15 @@ }, "at": "2026-11-17T10:05:00Z" } + }, + { + "name": "a kept mover re-pinned", + "of": "event:re-pinned", + "subject": "mesh.seat.mesh-pipeline-runner.event.re-pinned", + "given": { + "pipeline": "main.3589", + "mover": "mesh-sdk", + "revision": 412 + } } ] 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 fd84b289c..68e7c9497 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-pipeline-runner/seat.json @@ -97,6 +97,28 @@ "mover": { "type": "string", "description": "a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187)" + }, + "step": { + "type": "string", + "enum": [ + "validate", + "build", + "lint", + "unit", + "integration", + "composition", + "review", + "approval" + ], + "description": "only the steps of this kind, applied while reading (design 47 H2 §789)" + }, + "state": { + "type": "string", + "description": "only the steps whose outcome is this, applied while reading (design 47 H2 §789)" + }, + "next": { + "type": "string", + "description": "the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789)" } }, "required": [ @@ -127,6 +149,18 @@ "items": { "$ref": "#/defs/Fill" } + }, + "capped": { + "type": "boolean", + "description": "yes when the answer stopped at 768 KB; the rest is read from next (design 47 H2 §789)" + }, + "total": { + "type": "integer", + "description": "how many steps the filters hold in all (design 47 H2 §789)" + }, + "next": { + "type": "string", + "description": "the cursor of the next page, opaque; empty at the end (design 47 H2 §779)" } }, "required": [ @@ -747,6 +781,32 @@ "max-mib": 32 } }, + { + "name": "re-pinned", + "body": { + "type": "object", + "description": "a kept mover re-pinned at a revision (design 47 H2 §821; H-A-349 DQ-13)", + "properties": { + "pipeline": { + "type": "string", + "description": "the pipeline's key" + }, + "mover": { + "type": "string", + "description": "the mover's module" + }, + "revision": { + "type": "integer", + "description": "the catalog revision it is re-pinned at" + } + }, + "required": [ + "pipeline", + "mover", + "revision" + ] + } + }, { "name": "filling", "body": { @@ -1139,6 +1199,16 @@ "$ref": "#/defs/Shared" }, "description": "the run the step read or asked for every step that reads it: a composition step's per machine, as mesh-wants' step-ended names them; a test step's one, with asked-by when another step asked it (design 47 G §726, §729; A-468d, A-468e, A-469t)" + }, + "asked-at": { + "type": "string", + "format": "date-time", + "description": "when the step's ask was put on its seat's work queue (design 47 H2 §778)" + }, + "taken-at": { + "type": "string", + "format": "date-time", + "description": "when the seat's holder took the ask, from its ask-taken; the unanswered bound counts from it (design 47 H2 §778)" } }, "description": "one step of a pipeline: its status in the policy and its outcome (design 47 *Pipeline steps and the policy*)", @@ -1371,6 +1441,130 @@ "ended": { "type": "string", "format": "date-time" + }, + "phases": { + "type": "object", + "description": "the pipeline's phases: the take-in, its placing, its end, and for each step kind the earliest start and the latest end across its movers; each mover's own step times stay in the step log (design 47 H2 §785)", + "properties": { + "taken": { + "type": "string", + "format": "date-time", + "description": "when the take-in took the pipeline's revision in" + }, + "placed": { + "type": "string", + "format": "date-time", + "description": "when the pipeline was placed" + }, + "ended": { + "type": "string", + "format": "date-time", + "description": "when the pipeline ended" + }, + "build": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "the earliest start across the movers" + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the latest end across the movers" + } + }, + "description": "the build steps' span across the movers" + }, + "lint": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "the earliest start across the movers" + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the latest end across the movers" + } + }, + "description": "the lint steps' span across the movers" + }, + "unit": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "the earliest start across the movers" + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the latest end across the movers" + } + }, + "description": "the unit steps' span across the movers" + }, + "integration": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "the earliest start across the movers" + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the latest end across the movers" + } + }, + "description": "the integration steps' span across the movers" + }, + "validate": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "the earliest start across the movers" + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the latest end across the movers" + } + }, + "description": "the validate steps' span across the movers" + }, + "composition": { + "type": "object", + "properties": { + "start": { + "type": "string", + "format": "date-time", + "description": "the earliest start across the movers" + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the latest end across the movers" + } + }, + "description": "the composition steps' span across the movers" + } + } + }, + "unfinished": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the movers left unfinished by another's failure, each kept in the state unfinished and put in a pipeline again (design 47 H2 §786)" } }, "description": "a pipeline's end, said once, with per mover its released version, step results and tier (design 47 H §746); the assigner writes wants only from a passed one", @@ -1986,5 +2180,6 @@ "pipeline" ] } - } + }, + "form": 2 } 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 7134cebf5..1108ddefe 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.d.ts @@ -31,6 +31,7 @@ export declare const events: { readonly stepEnded: "step-ended"; readonly waitHeld: "wait-held"; readonly waitEnded: "wait-ended"; + readonly rePinned: "re-pinned"; readonly filling: "filling"; readonly full: "full"; readonly room: "room"; @@ -80,6 +81,8 @@ export declare function waitEndedSubject(branch: string, revision: string): stri export declare const waitEndedSubjectAll: "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*"; +export declare const rePinnedSubject: "mesh.seat.mesh-pipeline-runner.event.re-pinned"; + export declare const fillingSubject: "mesh.seat.mesh-pipeline-runner.event.filling"; export declare const fullSubject: "mesh.seat.mesh-pipeline-runner.event.full"; @@ -296,6 +299,76 @@ export interface Pipeline { "why"?: string; } +/** the build steps' span across the movers */ +export interface PipelineEndedPhasesBuild { + /** the latest end across the movers */ + "end"?: string; + /** the earliest start across the movers */ + "start"?: string; +} + +/** the composition steps' span across the movers */ +export interface PipelineEndedPhasesComposition { + /** the latest end across the movers */ + "end"?: string; + /** the earliest start across the movers */ + "start"?: string; +} + +/** the integration steps' span across the movers */ +export interface PipelineEndedPhasesIntegration { + /** the latest end across the movers */ + "end"?: string; + /** the earliest start across the movers */ + "start"?: string; +} + +/** the lint steps' span across the movers */ +export interface PipelineEndedPhasesLint { + /** the latest end across the movers */ + "end"?: string; + /** the earliest start across the movers */ + "start"?: string; +} + +/** the unit steps' span across the movers */ +export interface PipelineEndedPhasesUnit { + /** the latest end across the movers */ + "end"?: string; + /** the earliest start across the movers */ + "start"?: string; +} + +/** the validate steps' span across the movers */ +export interface PipelineEndedPhasesValidate { + /** the latest end across the movers */ + "end"?: string; + /** the earliest start across the movers */ + "start"?: string; +} + +/** the pipeline's phases: the take-in, its placing, its end, and for each step kind the earliest start and the latest end across its movers; each mover's own step times stay in the step log (design 47 H2 §785) */ +export interface PipelineEndedPhases { + /** the build steps' span across the movers */ + "build"?: PipelineEndedPhasesBuild; + /** the composition steps' span across the movers */ + "composition"?: PipelineEndedPhasesComposition; + /** when the pipeline ended */ + "ended"?: string; + /** the integration steps' span across the movers */ + "integration"?: PipelineEndedPhasesIntegration; + /** the lint steps' span across the movers */ + "lint"?: PipelineEndedPhasesLint; + /** when the pipeline was placed */ + "placed"?: string; + /** when the take-in took the pipeline's revision in */ + "taken"?: string; + /** the unit steps' span across the movers */ + "unit"?: PipelineEndedPhasesUnit; + /** the validate steps' span across the movers */ + "validate"?: PipelineEndedPhasesValidate; +} + /** a pipeline's end, said once, with per mover its released version, step results and tier (design 47 H §746); the assigner writes wants only from a passed one */ export interface PipelineEnded { /** the watched branch, or the branch of a run on request */ @@ -310,6 +383,8 @@ export interface PipelineEnded { /** per mover its fingerprint, released version, step results and tier, in the delivery order (design 47 H §746, H-A-2) */ "movers": MoverEnded[]; "outcome": "waiting" | "running" | "passed" | "failed" | "refused" | "superseded" | "cancelled"; + /** the pipeline's phases: the take-in, its placing, its end, and for each step kind the earliest start and the latest end across its movers; each mover's own step times stay in the step log (design 47 H2 §785) */ + "phases"?: PipelineEndedPhases; /** 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; /** the catalog graph revision of the branch the pipeline runs for */ @@ -319,6 +394,8 @@ export interface PipelineEnded { /** the source revision of the watched branch; the pipeline is keyed by it (ADR 0666 section 9) */ "source": number; "started"?: string; + /** the movers left unfinished by another's failure, each kept in the state unfinished and put in a pipeline again (design 47 H2 §786) */ + "unfinished"?: string[]; "v": number; "why"?: string; } @@ -418,6 +495,8 @@ export interface StepResult { "artifact"?: string; /** the step's ask on the serving seat's work queue */ "ask"?: string; + /** when the step's ask was put on its seat's work queue (design 47 H2 §778) */ + "asked-at"?: string; /** for a rerun, the caller the runtime proved */ "by"?: string; /** for a carried result, the pipeline it was carried from */ @@ -445,6 +524,8 @@ export interface StepResult { /** the step's status in the module's policy */ "status": "required" | "optional" | "bypass"; "step": "validate" | "build" | "lint" | "unit" | "integration" | "composition" | "review" | "approval"; + /** when the seat's holder took the ask, from its ask-taken; the unanswered bound counts from it (design 47 H2 §778) */ + "taken-at"?: string; "tests"?: TestCounts; /** what the outcome rests on: the part not heard, the seat with no holder, what a waiting step waits on */ "why"?: string; @@ -594,19 +675,31 @@ export interface StartAnswer { export interface ShowInput { /** a mover's module: the answer's pipeline then holds that mover's steps alone (H-A-187) */ "mover"?: string; + /** the cursor the previous page answered, opaque; absent for the first page (design 47 H2 §779, §789) */ + "next"?: string; /** the pipeline's key */ "pipeline": string; + /** only the steps whose outcome is this, applied while reading (design 47 H2 §789) */ + "state"?: string; + /** only the steps of this kind, applied while reading (design 47 H2 §789) */ + "step"?: "validate" | "build" | "lint" | "unit" | "integration" | "composition" | "review" | "approval"; } /** 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) */ + "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[]; + /** the cursor of the next page, opaque; empty at the end (design 47 H2 §779) */ + "next"?: string; /** the outputs' names in step-outputs */ "outputs"?: string[]; "pipeline": Pipeline; + /** how many steps the filters hold in all (design 47 H2 §789) */ + "total"?: number; } /** is what list takes. */ @@ -843,6 +936,18 @@ export type WaitHeldEvent = Wait; /** is the body of the event wait-ended. */ export type WaitEndedEvent = Wait; +/** is the body of the event re-pinned. */ +export interface RePinnedEvent { + /** is the form of what this value carries, left out while it is 1 (design 47 H2 §780). */ + "form"?: number; + /** the mover's module */ + "mover": string; + /** the pipeline's key */ + "pipeline": string; + /** the catalog revision it is re-pinned at */ + "revision": number; +} + /** is the body of the event filling. */ export type FillingEvent = Fill; diff --git a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js index d8ff25e62..f1004d04f 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js +++ b/modules/mesh-delivery-contracts/ts/seats/meshpipelinerunner/index.js @@ -31,6 +31,7 @@ export const events = { stepEnded: "step-ended", waitHeld: "wait-held", waitEnded: "wait-ended", + rePinned: "re-pinned", filling: "filling", full: "full", room: "room", @@ -94,6 +95,8 @@ export function waitEndedSubject(branch, revision) { export const waitEndedSubjectAll = "mesh.seat.mesh-pipeline-runner.event.wait-ended.*.*"; +export const rePinnedSubject = "mesh.seat.mesh-pipeline-runner.event.re-pinned"; + export const fillingSubject = "mesh.seat.mesh-pipeline-runner.event.filling"; export const fullSubject = "mesh.seat.mesh-pipeline-runner.event.full";