G19 started-decoded-by-contract: the gate reads pipeline-started with the contract's decoder

A pipeline-started of the earlier form, whose movers carry fields the new StartedMover leaves out, is
taken as the new form is: a field this reader does not know is left unread, never refused.

Builds: design 47 H2 H-A-709 (3)
This commit is contained in:
2026-11-25 17:20:47 +01:00
parent c055c82bd8
commit cdae0e0339
2 changed files with 13 additions and 2 deletions
@@ -47,9 +47,12 @@ func strictly(body json.RawMessage, into any) error {
return dec.Decode(into)
}
// decodePipelineStarted reads a pipeline-started with the contract's decoder, so a field of the runner's other form that this
// reader does not know is left unread and the movers of the earlier form and of the new are taken alike (design 47 H2
// H-A-709 (3)).
func decodePipelineStarted(body json.RawMessage, _ time.Time) ([]StepOutcome, error) {
var p runner.PipelineStartedEvent
if err := strictly(body, &p); err != nil {
p, _, err := runner.DecodePipelineStartedEvent(body)
if err != nil {
return nil, err
}
return nil, namesSource(p.Branch, p.Source, p.Run)
@@ -62,6 +62,14 @@ func TestARecordFollowsItsPipelineToTheMachines(t *testing.T) {
if _, ok := r.Entries[EntryKey("app", "f", "")]; !ok || len(r.Entries) != 1 {
t.Fatalf("entries %v: the mover is one, a run's none", r.Entries)
}
// Design 47 H2 H-A-709 (3): a pipeline-started of the earlier form, whose movers carry fields the new form's StartedMover
// leaves out, is taken as the new form is: its movers are entries.
hear(t, c, "mesh-pipeline-runner.pipeline-started.main.1", "",
`{"v":1,"branch":"main","source":1,"pipeline":"main.1","call":"0000000000000001","movers":[{"module":"older","commit":"c","fingerprint":"o","repository":"novox/older","tier":1,"published":true,"widens":["x"],"tests":{"passed":3},"over-budget":false}]}`)
if _, ok := r.Entries[EntryKey("older", "o", "")]; !ok || len(r.Entries) != 2 {
t.Fatalf("entries %v: the earlier form's mover is one too", r.Entries)
}
delete(r.Entries, EntryKey("older", "o", ""))
hear(t, c, "mesh-pipeline-runner.wait-held.main.1", "",
`{"v":1,"branch":"main","source":1,"pipeline":"main.1","module":"app","fingerprint":"f","step":"approval","on":"person","who":"the operator","since":"2026-11-20T03:01:00Z"}`)
held := r.Outcomes[OutcomeKey("app", "f", "", "approval")]