CALLERS-1: claude-code and mesh-recovery keep no callers list for the seat list

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
This commit is contained in:
2026-11-20 02:51:02 +01:00
parent d7dada57aa
commit 0cafb62d0e
5 changed files with 26 additions and 24 deletions
@@ -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)
}
}
}
})
+5 -10
View File
@@ -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>.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