From 9b5657a3d6fa9f5de6b00b5a2c273339db48efa5 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 27 Oct 2026 22:49:06 +0100 Subject: [PATCH] =?UTF-8?q?Seat=20mesh-delivery-checker:=20the=20try=20and?= =?UTF-8?q?=20its=20read=20are=20verbs=20of=20the=20checker's=20own=20seat?= =?UTF-8?q?,=20replacing=20sh=20merge-check.sh=20(ADR=200547=20=C2=A710,?= =?UTF-8?q?=20issue=20774)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go/catalogue/checker_seat.go | 32 +++++++++++++++++++++++++++++++ go/catalogue/checker_seat_test.go | 29 ++++++++++++++++++++++++++++ go/catalogue/seats.go | 2 ++ go/catalogue/seats_test.go | 5 +++-- 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 go/catalogue/checker_seat.go create mode 100644 go/catalogue/checker_seat_test.go diff --git a/go/catalogue/checker_seat.go b/go/catalogue/checker_seat.go new file mode 100644 index 0000000..30e8468 --- /dev/null +++ b/go/catalogue/checker_seat.go @@ -0,0 +1,32 @@ +package catalogue + +// The delivery's checker (novox/hq ADR 0547 §10, issue 774): one holder for the mesh, the module +// mesh-delivery-checker, which judges a pull request's head and a pushed head the same way. The try the +// controller forwarded to it is a verb of this seat, answered by the checker with the verdict it gives a pull +// request, so the try outlives the controller. + +// CheckerSeat is the seat mesh-delivery-checker holds. +const CheckerSeat = "mesh-delivery-checker" + +// checkerVerbs are the checker seat's verbs: ask a try, read one. Optional until the checker serves them +// everywhere. +func checkerVerbs() []Verb { + return []Verb{ + {Name: "try", Optional: true, Description: "Try a pushed head before its pull request is opened: the checker " + + "judges it as it judges a pull request's head, merged onto its trunk's head, its unit and integration " + + "levels through the build modules, and owes the forge nothing. Answers the try's id at once; try-read " + + "reads where it stands. A try of the same head that waits or runs is the answer to a second ask; at most " + + "4 wait or run at once, mesh-wide.", + Input: schema(map[string]string{"repository": "/", + "head": "the full commit to try, 40 or 64 hex digits", + "trunk": "the trunk commit to merge it onto, or the trunk's branch for its head now; the trunk's head when absent", + "tests": "a go test -run pattern: only those tests run, and nothing is kept", + "level": "unit or integration: only this level; both when absent"}, + []string{"repository", "head"}), + Replaces: []string{"sh merge-check.sh"}}, + {Name: "try-read", Optional: true, Description: "Where a try stands, as stored: queued, running, or its end " + + "(pass, fail, or error when it could not run), with what was said of it, the head and the trunk commit " + + "it was merged onto, the time it took and what failed first. Read-only.", + Input: schema(map[string]string{"id": "the try's id, try-"}, []string{"id"})}, + } +} diff --git a/go/catalogue/checker_seat_test.go b/go/catalogue/checker_seat_test.go new file mode 100644 index 0000000..f714337 --- /dev/null +++ b/go/catalogue/checker_seat_test.go @@ -0,0 +1,29 @@ +package catalogue + +import ( + "slices" + "testing" +) + +// The try is a verb of the checker's seat and carries the shell command it replaces (ADR 0547 §10, ADR 0245). +func TestTheCheckerSeatServesTheTry(t *testing.T) { + var seat *Seat + for _, s := range defaultSeats { + if s.Name == CheckerSeat { + seat = &s + } + } + if seat == nil || seat.Scope != ScopeMesh { + t.Fatalf("seat = %+v", seat) + } + var names []string + for _, v := range seat.Serves { + names = append(names, v.Name) + if v.Name == "try" && !slices.Equal(v.Replaces, []string{"sh merge-check.sh"}) { + t.Errorf("try replaces %v", v.Replaces) + } + } + if !slices.Equal(names, []string{"try", "try-read"}) { + t.Errorf("verbs = %v", names) + } +} diff --git a/go/catalogue/seats.go b/go/catalogue/seats.go index a6588d6..4ab81dc 100644 --- a/go/catalogue/seats.go +++ b/go/catalogue/seats.go @@ -265,6 +265,8 @@ var defaultSeats = append([]Seat{ // Placement (novox/hq ADR 0567): which module runs on which node, state on the bus held by the assigner, changed only by // a proposal the nodes answer and the operator approves. Its states and events are the holder module's. {Name: PlacementSeat, Scope: ScopeMesh, Serves: placementVerbs(), Decision: "novox/hq ADR 0567"}, + // The delivery's checker (novox/hq ADR 0547 §10, issue 774): the try is its verb, not the controller's. + {Name: CheckerSeat, Scope: ScopeMesh, Serves: checkerVerbs(), Decision: "novox/hq ADR 0547"}, // Deferred renames (novox/hq ADR 0121): these deliver a provision, so renaming them is a // delivering-seat migration with a mesh-wide cascade if a holder stops resolving mid-flight. // They keep their names until that migration is done deliberately, apart from the node-* pass. diff --git a/go/catalogue/seats_test.go b/go/catalogue/seats_test.go index 6f58a11..3144c31 100644 --- a/go/catalogue/seats_test.go +++ b/go/catalogue/seats_test.go @@ -62,8 +62,9 @@ func TestTheSeatsAreAClosedSetAndEachNamesItsDecision(t *testing.T) { // node-container-runtime (ADR 0207); nineteen with node-environment and node-login-shell (ADR 0203, // ADR 0204); seventeen with node-build-agent (ADR 0190). One fewer once the retired // mesh-build-machine row goes, when no registered manifest claims it. - if len(Seats()) != 47 { - t.Errorf("the mesh defines %d seats rather than 47; the set is closed, so a change here is "+ + // Forty-eight with mesh-delivery-checker (novox/hq ADR 0547 §10, issue 774). + if len(Seats()) != 48 { + t.Errorf("the mesh defines %d seats rather than 48; the set is closed, so a change here is "+ "a decision (novox/hq ADR 0110): %s", len(Seats()), seatNames()) } }