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
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -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\"}",
|
||||
|
||||
@@ -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, <branch>.<source>
|
||||
|
||||
@@ -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$")},
|
||||
|
||||
@@ -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.<branch>.<revision>.
|
||||
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, <branch>.<module>
|
||||
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, <branch>.<module>; 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
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
"at": "2026-11-09T21:00:00Z",
|
||||
"branch": "main",
|
||||
"source": 1044,
|
||||
"call": "0123456789abcdef"
|
||||
"call": "0123456789abcdef",
|
||||
"ends": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -604,15 +604,18 @@
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string",
|
||||
"description": "the unfinished entry's key, <branch>.<module>"
|
||||
"description": "the unfinished entry's key, <branch>.<module>; 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.<branch>.<revision>",
|
||||
"body": {
|
||||
"$ref": "#/defs/MoverAdded"
|
||||
},
|
||||
"keep": {
|
||||
"max-age-days": 90,
|
||||
"max-mib": 32
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "pipeline-ended",
|
||||
"subject": "pipeline-ended.<branch>.<revision>",
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ export interface StepEnded {
|
||||
"packages"?: Record<string, string>;
|
||||
"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;
|
||||
|
||||
@@ -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, <branch>.<source> */
|
||||
|
||||
@@ -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, <branch>.<module> */
|
||||
"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, <branch>.<module>; 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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user