T2 no-callers-hook: the runner admits every caller by serving, with no hook that judges who may call
The `admitted` hook, its parameter of serveSeats and its comments go; the test rows that built definitions with Callers and Class go with the field mesh-sdk removes. A seat's verb is answered for every caller. Builds: design 47 H §752, §764 (Every seat contract), H-A-41 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -68,15 +68,14 @@ func TestACallOnTheCallerNamedSubjectReachesTheModuleWithItsCaller(t *testing.T)
|
||||
}
|
||||
}
|
||||
|
||||
// deskDefined is the seat list's definition of the fixture seat node-desk, its verb who taking its class's default.
|
||||
// deskDefined is the seat list's definition of the fixture seat node-desk, its verb who.
|
||||
var deskDefined = WithSeatDefinitions(func() map[string]seatdef.Definition {
|
||||
return map[string]seatdef.Definition{"node-desk": {Seat: "node-desk", Verbs: []seatdef.Verb{{Name: "who"}}}}
|
||||
})
|
||||
|
||||
// The subject that names no caller is still served for a module's tool, for one release (retired by hq issue 464), and says
|
||||
// so: the module is named no caller, whatever the body claims. A seat's verb refuses it before the bundle runs (design 47 G
|
||||
// §610; lead answers A-165, A-179), and refuses every caller while the seat's definition is unread, names no such verb or
|
||||
// opens it to none.
|
||||
// so: the module is named no caller, whatever the body claims. A seat's verb answers every caller, an unproven one too (design 47
|
||||
// H §752).
|
||||
func TestTheSubjectThatNamesNoCallerStillWorksAndNamesNone(t *testing.T) {
|
||||
mesh := mt.New(t)
|
||||
mesh.Issue(t, mt.MembershipOf("ledger", "anchor", true, map[string][]string{"node-desk": {"who"}}))
|
||||
@@ -104,7 +103,7 @@ func TestTheSubjectThatNamesNoCallerStillWorksAndNamesNone(t *testing.T) {
|
||||
}
|
||||
return err
|
||||
})
|
||||
// Every caller is admitted, an unproven one too (the operator, 2026-11-15 23:25 CET).
|
||||
// Every caller is answered, an unproven one too (design 47 H §752).
|
||||
if strings.HasPrefix(subject, "mesh.seat.") {
|
||||
if reply.Error != "" {
|
||||
t.Errorf("%s: an unproven caller of a seat's verb was refused: %q, want answered", subject, reply.Error)
|
||||
@@ -115,21 +114,6 @@ func TestTheSubjectThatNamesNoCallerStillWorksAndNamesNone(t *testing.T) {
|
||||
t.Errorf("%s: the module was named caller %q (error %q), want none", subject, reply.Result.Caller, reply.Error)
|
||||
}
|
||||
}
|
||||
for _, c := range []struct {
|
||||
defs map[string]seatdef.Definition
|
||||
says string
|
||||
}{
|
||||
{nil, ""},
|
||||
{map[string]seatdef.Definition{"node-desk": {Seat: "node-desk"}}, ""},
|
||||
{map[string]seatdef.Definition{"node-desk": {Seat: "node-desk", Verbs: []seatdef.Verb{{Name: "who", Callers: &seatdef.Callers{List: []string{}}}}}}, ""},
|
||||
{map[string]seatdef.Definition{"node-desk": {Seat: "node-desk", Verbs: []seatdef.Verb{{Name: "who", Class: seatdef.ClassAct}}}}, ""},
|
||||
} {
|
||||
defs := c.defs
|
||||
err := (&consumers{definitions: func() map[string]seatdef.Definition { return defs }}).admitted("node-desk", "who", "workstation.node-tools")
|
||||
if c.says == "" && err != nil || c.says != "" && (err == nil || !strings.Contains(err.Error(), c.says)) {
|
||||
t.Errorf("a proven caller with the definitions %v: %v, want %q", c.defs, err, c.says)
|
||||
}
|
||||
}
|
||||
// Design 47 G A-249: a bundle's seat call is received by the runner in chunks only for a verb whose definition says `chunks`,
|
||||
// of any machine: a verb a node holds is asked of the node that ran the ask (A-254).
|
||||
t.Run("OnlyAChunkedSeatVerbIsAskedInChunks", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user