diff --git a/go/process/call_test.go b/go/process/call_test.go index 77cd6e74..75ba07f7 100644 --- a/go/process/call_test.go +++ b/go/process/call_test.go @@ -169,8 +169,11 @@ func TestUserOfTokenAndAnswerSeatRefusals(t *testing.T) { def func() (seatdef.Definition, bool) says string }{ - {"an unproven caller", "", defined, ""}, // every caller is admitted (the operator, 2026-11-15) + {"an unproven caller", "", defined, ""}, // a read definition admits every caller (the operator, 2026-11-15) {"the definition unread", "novox.mesh-recovery", func() (seatdef.Definition, bool) { return seatdef.Definition{}, false }, ""}, + {"the definition unread, the console's account (A-435)", "novox.node-tools", func() (seatdef.Definition, bool) { return seatdef.Definition{}, false }, "may need approval"}, + {"the definition unread, a person (A-435)", "person.jo", func() (seatdef.Definition, bool) { return seatdef.Definition{}, false }, "may need approval"}, + {"the definition unread, an unproven caller (A-435)", "", func() (seatdef.Definition, bool) { return seatdef.Definition{}, false }, "may need approval"}, {"a verb the definition does not name", "novox.mesh-recovery", func() (seatdef.Definition, bool) { return seatdef.Definition{Seat: "seat"}, true }, ""}, {"a verb open to none", "novox.mesh-recovery", func() (seatdef.Definition, bool) { return seatdef.Definition{Seat: "seat", Verbs: []seatdef.Verb{{Name: "v", Callers: &seatdef.Callers{List: []string{}}}}}, true diff --git a/go/process/serve.go b/go/process/serve.go index 442e3512..6234ddf3 100644 --- a/go/process/serve.go +++ b/go/process/serve.go @@ -121,12 +121,26 @@ func Gated(g *approval.Gate) SeatOption { return func(o *seatOptions) { o.gate = // heldHandler is a verb's handler behind its checks: its answer, the held answer of a kept call, or its error. type heldHandler func(caller string, body json.RawMessage, wait bool) (any, *approval.Held, error) +// moduleAccount says a proven caller is a module's account, `.`: not a person's, not the tool runner's own +// account (`.node-tools`, the one the mesh MCP server's sessions and agents call as), not an unproven caller (A-433, A-435). +func moduleAccount(caller string) bool { + node, module, ok := strings.Cut(caller, ".") + return ok && node != "person" && node != "" && module != "" && module != "node-tools" && !strings.Contains(module, ".") +} + // admitted is h, and for a verb the definition marks, h behind the gate (ยง677). Every caller is admitted, whether or not the // definition is read and whatever callers it names (the operator, 2026-11-15 23:25 CET: every module, agent and operator may // call anything; approval stays as the mark on a verb). func (c *Conn) admitted(seat, verb string, definition func() (seatdef.Definition, bool), h SeatHandler, gate *approval.Gate) heldHandler { return func(caller string, body json.RawMessage, wait bool) (any, *approval.Held, error) { - if def, read := definition(); read { + def, read := definition() + if !read && !moduleAccount(caller) { + // A-435: a verb that may need approval is held while its definition is unread, as before, for a caller that is not + // a module's account (the mesh MCP server's, a person's, an unproven one); a module's account runs it (A-433). + return nil, nil, fmt.Errorf("the definition of the seat %s is not yet read by this process's seat list, so %s.%s, which may "+ + "need approval, is not run for a caller that is no module's account", seat, seat, verb) + } + if read { for _, v := range def.Verbs { if v.Name != verb || !v.NeedsApproval { continue