diff --git a/modules/mesh-delivery-sdk/steprun/askers.go b/modules/mesh-delivery-sdk/steprun/askers.go index 2bc497e7..3a59a9be 100644 --- a/modules/mesh-delivery-sdk/steprun/askers.go +++ b/modules/mesh-delivery-sdk/steprun/askers.go @@ -71,10 +71,11 @@ func (p *Puller) askerRefusal(msg *Pulled, ask sdkstep.StepAsk) (why string, jud } kind := KindOf(ask) if asker == "" { - if (ask.Build != nil && ask.Kind == sdkstep.AskDelivery) || kind == "run" { + // Main's subject takes a build, a run and, until it goes, the checker's check and recheck (design 47 G A-184, §543). + if (ask.Build != nil && ask.Kind == sdkstep.AskDelivery) || kind == "run" || kind == sdkstep.AskCheck || kind == sdkstep.AskRecheck { return "", true } - return fmt.Sprintf("the kind %s is not taken on main's subject, which takes only a build and a run (asker: none named)", kind), true + return fmt.Sprintf("the kind %s is not taken on main's subject, which takes only a build, a run and the checker's check and recheck (asker: none named)", kind), true } if p.Callers == nil { return "", true diff --git a/modules/mesh-delivery-sdk/steprun/askers_test.go b/modules/mesh-delivery-sdk/steprun/askers_test.go index 72377fef..d88584a3 100644 --- a/modules/mesh-delivery-sdk/steprun/askers_test.go +++ b/modules/mesh-delivery-sdk/steprun/askers_test.go @@ -15,7 +15,8 @@ func callersFor(table map[string][]string) func(string) ([]string, bool) { } // Design 47 G §543 (BG2, BG3, A-163, A-170): an ask whose kind its asker, the last token of its subject, is no caller of is -// answered error naming the kind and the asker and ended failed; a step on main's subject is refused as well; one the +// answered error naming the kind and the asker and ended failed; a step on main's subject is refused as well (its check and recheck +// taken, A-184); one the // seat list does not judge yet is given back. func TestPullRefusesAKindItsAskerMayNotAsk(t *testing.T) { step := testAsk(sdkstep.AskStep) @@ -34,6 +35,9 @@ func TestPullRefusesAKindItsAskerMayNotAsk(t *testing.T) { {"the runner's step", "mesh.seat.node-build-go.accept.check.mesh-pipeline-runner", step, callersFor(table), ""}, {"a step on main's subject", "mesh.seat.node-build-go.accept.check", step, callersFor(table), "refused"}, {"a build on main's subject", "mesh.seat.node-build-go.accept.delivery", build, callersFor(table), ""}, + // A-184: until main's subject goes, it also takes the checker's check and recheck asks. + {"the checker's check on main's subject", "mesh.seat.node-build-go.accept.check", testAsk(sdkstep.AskCheck), callersFor(table), ""}, + {"the checker's recheck on main's subject", "mesh.seat.node-build-go.accept.recheck", testAsk(sdkstep.AskRecheck), callersFor(table), ""}, {"a kind the seat list does not hold", "mesh.seat.node-build-go.accept.check.mesh-pipeline-runner", step, callersFor(nil), "back"}, } { t.Run(c.name, func(t *testing.T) {