From 0cafb62d0e48fcd56465b2cc9eb6e573107b47e2 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 02:51:02 +0100 Subject: [PATCH] CALLERS-1: claude-code and mesh-recovery keep no callers list for the seat list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mesh-sdk's callers set goes in H1, so the seat list's two tools of claude-code answer every caller, and mesh-recovery's seat list part is made with its prefix alone. Builds: design 47 H §752, §764 (every seat contract's callers); H-A-41, H-A-66 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy --- .../cmd/claude-code/insteadof_test.go | 22 ++++++++++++++----- modules/claude-code/cmd/claude-code/main.go | 15 +++++-------- .../mesh-recovery/cmd/mesh-recovery/main.go | 6 ++--- .../cmd/mesh-recovery/main_test.go | 4 ++-- modules/mesh-vault/files/retire-callers.json | 3 --- 5 files changed, 26 insertions(+), 24 deletions(-) delete mode 100644 modules/mesh-vault/files/retire-callers.json diff --git a/modules/claude-code/cmd/claude-code/insteadof_test.go b/modules/claude-code/cmd/claude-code/insteadof_test.go index a403dddf0..6901578a4 100644 --- a/modules/claude-code/cmd/claude-code/insteadof_test.go +++ b/modules/claude-code/cmd/claude-code/insteadof_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "os" + "path/filepath" "reflect" "slices" "strings" @@ -118,12 +119,21 @@ func TestTheMeshsToolsAreReadFromTheBus(t *testing.T) { if got := strings.Join(addresses, ","); got != "mesh-module-assigner.assignments,node-service-manager.status,node-service-manager.journal,docker.docker_logs" { t.Errorf("replacements: %s", got) } - t.Run("the again tool answers the operator and the healers only", func(t *testing.T) { - // An operator's session through the mesh MCP server is proved as its machine's tool runner (issue 627, issue 1966). - for caller, refused := range map[string]bool{"person.jochen": false, "shanks.node-tools": false, "shanks.mesh-healers": false, - "shanks.mesh-config": true} { - if err := seatlist.Refusal("claude_code_seat_list_again", seatListAgainCallers, caller); (err != nil) != refused { - t.Errorf("%s: refused=%v, err %v", caller, refused, err) + t.Run("the again tool answers every caller", func(t *testing.T) { + // H-A-66 (design 47 H §752): no holder keeps a callers list; the seat list's tools answer every caller. + files, _ := filepath.Glob("*.go") + for _, f := range files { + if strings.HasSuffix(f, "_test.go") { + continue + } + raw, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + for _, gone := range []string{"AnyPerson", "seatListAgainCallers", "seatlist.Refusal"} { + if strings.Contains(string(raw), gone) { + t.Errorf("%s still names %s", f, gone) + } } } }) diff --git a/modules/claude-code/cmd/claude-code/main.go b/modules/claude-code/cmd/claude-code/main.go index 407b94b61..c6736cba8 100644 --- a/modules/claude-code/cmd/claude-code/main.go +++ b/modules/claude-code/cmd/claude-code/main.go @@ -734,17 +734,12 @@ func refusals(n int) string { return fmt.Sprintf(" (after %d refusal(s))", n) } -// seatListAgainCallers may read the seat list again: every operator's session and the healers (ADR 0636 §7). A call through -// the mesh MCP server is proved only as its machine's tool runner (.node-tools, issue 627), so node-tools stands for -// an operator's session until a session is proved (issue 1966). -var seatListAgainCallers = []string{stdio.AnyPerson, "node-tools", "mesh-healers"} - -// seatListTools are the seat list reader's two tools: what the list holds and what it waits for, and a read now. The -// reader starts once the runtime serves, after the tools are listed, so each tool finds it when it is called. +// seatListTools are the seat list reader's two tools: what the list holds and what it waits for, and a read now, each +// answering every caller (design 47 H §752, H-A-66). The reader starts once the runtime serves, after the tools are +// listed, so each tool finds it when it is called. func seatListTools() []stdio.Tool { names := []string{"claude_code_seat_list", "claude_code_seat_list_again"} - callers := seatListAgainCallers - shape := seatlist.Tools(&seatlist.Reader{}, names[0], names[1], callers) + shape := seatlist.Tools(&seatlist.Reader{}, names[0], names[1]) for i := range shape { run := i shape[i].Run = func(args map[string]any) (any, error) { @@ -754,7 +749,7 @@ func seatListTools() []stdio.Tool { if r == nil { return nil, errors.New("the seat list reader has not started yet: the runtime has not served this module") } - return seatlist.Tools(r, names[0], names[1], callers)[run].Run(args) + return seatlist.Tools(r, names[0], names[1])[run].Run(args) } } return shape diff --git a/modules/mesh-recovery/cmd/mesh-recovery/main.go b/modules/mesh-recovery/cmd/mesh-recovery/main.go index a713dfdc1..2f9ad82db 100644 --- a/modules/mesh-recovery/cmd/mesh-recovery/main.go +++ b/modules/mesh-recovery/cmd/mesh-recovery/main.go @@ -177,9 +177,9 @@ func run(ctx context.Context, getenv func(string) string, logOut io.Writer) erro for _, x := range e.Start(ctx) { logger.Printf("the aside %s of %s's %s holds data the live bus lacks: recovery_restore_aside puts it back", x.Aside.ID, x.Module, x.Kept) } - // The seat list, read over the connection and heard on the module's event hub (seatlist.Part), which the seat's verbs check - // their callers against (A-179, A-186): registered before the hub starts, read again once its events are live. - seats := seatlist.NewPart("recovery", nil) + // The seat list, read over the connection and heard on the module's event hub (seatlist.Part), from which the seat's verbs + // are answered (A-179, A-186): registered before the hub starts, read again once its events are live. + seats := seatlist.NewPart("recovery") seats.Follow(seatlist.ProcessBus(conn.Call, hub), nil, logger.Printf) if err := hub.StartUntilBound(ctx, js, account, nil, seats.EventsLive); err != nil { logger.Printf("the consumer %s is not bound yet (%v): bound once the bus makes it, the seat list read then", account.EventConsumerName(), err) diff --git a/modules/mesh-recovery/cmd/mesh-recovery/main_test.go b/modules/mesh-recovery/cmd/mesh-recovery/main_test.go index 413076145..5acca9376 100644 --- a/modules/mesh-recovery/cmd/mesh-recovery/main_test.go +++ b/modules/mesh-recovery/cmd/mesh-recovery/main_test.go @@ -40,13 +40,13 @@ func TestWhatTheProcessReads(t *testing.T) { t.Run("the seat's definition from the seat list once read (A-186)", func(t *testing.T) { t.Cleanup(busretry.Waits(20*time.Millisecond, time.Millisecond, 5*time.Millisecond)) follow := func(silent bool) *seatlist.Part { - p := seatlist.NewPart("recovery", nil) + p := seatlist.NewPart("recovery") if r := p.Follow(listingCatalog{silent: silent}, nil, t.Logf); r != nil { <-r.Ready() } return p } - if _, ok := seatlist.Definition(seatlist.NewPart("recovery", nil).Reader, meshbroker.Seat)(); ok { + if _, ok := seatlist.Definition(seatlist.NewPart("recovery").Reader, meshbroker.Seat)(); ok { t.Error("a definition is answered before the seat list's reader started") } if _, ok := seatlist.Definition(follow(true).Reader, meshbroker.Seat)(); ok { diff --git a/modules/mesh-vault/files/retire-callers.json b/modules/mesh-vault/files/retire-callers.json deleted file mode 100644 index 6d0792abe..000000000 --- a/modules/mesh-vault/files/retire-callers.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "callers": ["mesh-config"] -}