From 0be19196d75f8af1fb10587b594726bbb380e184 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 06:16:42 +0100 Subject: [PATCH] A-231: one reader of the invoke by which an asker names a build seat's queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit catalogue.QueueInvoke reads seat:.accept., the form an asker names the queue it asks in its manifest's invokes; the validator, the indexer's served-verb edge and the grants part read it here. Builds: design 47 G §544, §601, A-231 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h --- go/catalogue/invokes_test.go | 9 +++++++++ go/catalogue/seat_invokes.go | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/go/catalogue/invokes_test.go b/go/catalogue/invokes_test.go index dd0a1aa1..52039e73 100644 --- a/go/catalogue/invokes_test.go +++ b/go/catalogue/invokes_test.go @@ -17,6 +17,15 @@ func TestAManifestMaySayWhatItInvokes(t *testing.T) { if len(m.Invokes) != 2 || m.Invokes[1] != "*" { t.Fatalf("invokes not read: %v", m.Invokes) } + // An asker names a build seat's queue as seat:.accept. (design 47 G A-231), and nothing else reads as one. + for invoke, want := range map[string]string{"seat:node-build-go.accept.check": "node-build-go/check", + "seat:node-build-go.run": "", "node-build-go.accept.check": "", "seat:node-build-go.accept.": "", + "seat:node-build-go.accept.check.mesh-catalog": "", "*": ""} { + seat, queue, ok := QueueInvoke(invoke) + if got := seat + "/" + queue; ok != (want != "") || ok && got != want { + t.Errorf("QueueInvoke(%q) = %s, %v; want %q", invoke, got, ok, want) + } + } // And that its own secrets are the core's credentials (issue 774): read, and written back as said. for raw, core := range map[string]bool{`{"module":"bus","version":"1","core-credentials":true}`: true, `{"module":"app","version":"1"}`: false} { m, err := decodeForTest([]byte(raw)) diff --git a/go/catalogue/seat_invokes.go b/go/catalogue/seat_invokes.go index d16a0b1d..cbb2b3cc 100644 --- a/go/catalogue/seat_invokes.go +++ b/go/catalogue/seat_invokes.go @@ -18,3 +18,15 @@ func SeatInvoke(invoke string) (seat, verb string, ok bool) { seat, verb, ok = strings.Cut(rest, ".") return seat, verb, ok && seat != "" && verb != "" } + +// QueueInvoke splits an invoke `seat:.accept.`, by which an asker names a build seat's queue it asks (design 47 G +// §544, §601, A-231), into its seat and queue; ok is false for anything else. The one reader of that form: the manifest +// validator, the indexer's served-verb edge and the grants part read it here. +func QueueInvoke(invoke string) (seat, queue string, ok bool) { + seat, verb, ok := SeatInvoke(invoke) + if !ok { + return "", "", false + } + queue, ok = strings.CutPrefix(verb, "accept.") + return seat, queue, ok && queue != "" && !strings.Contains(queue, ".") +}