node-tools: the runner reads the seat list again for a seat verb it does not name, and never asks a chunked verb without its call
A bundle's ask of seat:mesh-wants.input reached the holder with no `call` and was refused ("call is one token of 16 to 64 ..."), so no
composition step passed: the runner chooses the call only for a verb its seat list says sends chunks, and a verb the list did not name
(a list read once, unread, or stale) was taken for one that does not. chunkedAsked reads the list again once and, where the verb is still
not named, refuses the ask saying why. A first read of the list that ended without an answer is now said in the log.
Builds: design 47 G A-249 (the runner receives a chunked seat answer for the bundle), ADR 0636 §1 (the seat list is read, not guessed)
Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -2,6 +2,7 @@ package runtime
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -150,6 +151,40 @@ func TestTheSubjectThatNamesNoCallerStillWorksAndNamesNone(t *testing.T) {
|
||||
t.Error("a runner that holds no seat definitions asks no chunks")
|
||||
}
|
||||
})
|
||||
// A seat verb a bundle asks that the definitions held do not name is read again once, never taken for one that sends no chunks:
|
||||
// the holder refuses an ask that carries no call, and the bundle saw only that refusal (the compositions of 2026-11-19).
|
||||
t.Run("AVerbTheListDoesNotNameIsReadAgainAndNeverAskedWithoutItsCall", func(t *testing.T) {
|
||||
stale := map[string]seatdef.Definition{"mesh-wants": {Verbs: []seatdef.Verb{{Name: "revision"}}}}
|
||||
fresh := map[string]seatdef.Definition{"mesh-wants": {Verbs: []seatdef.Verb{{Name: "revision"}, {Name: "input", Chunks: true}}}}
|
||||
for _, row := range []struct {
|
||||
name string
|
||||
again func(held *map[string]seatdef.Definition) error
|
||||
want bool
|
||||
wantErr string
|
||||
wantRead int
|
||||
}{
|
||||
{"a read that names it", func(h *map[string]seatdef.Definition) error { *h = fresh; return nil }, true, "", 1},
|
||||
{"a read that fails", func(h *map[string]seatdef.Definition) error { return errors.New("the seat does not answer") }, false, "does not answer", 1},
|
||||
{"a read that still does not name it", func(h *map[string]seatdef.Definition) error { return nil }, false, "does not name the verb seat:mesh-wants.input", 1},
|
||||
} {
|
||||
t.Run(row.name, func(t *testing.T) {
|
||||
held, reads := stale, 0
|
||||
c := &consumers{definitions: func() map[string]seatdef.Definition { return held }, reread: func() error { reads++; return row.again(&held) }}
|
||||
got, err := c.chunkedAsked("seat:mesh-wants.input")
|
||||
if got != row.want || reads != row.wantRead || (row.wantErr == "") != (err == nil) || (err != nil && !strings.Contains(err.Error(), row.wantErr)) {
|
||||
t.Errorf("chunkedAsked = %v, %v after %d reads, want %v, %q after %d", got, err, reads, row.want, row.wantErr, row.wantRead)
|
||||
}
|
||||
})
|
||||
}
|
||||
held := fresh
|
||||
c := &consumers{definitions: func() map[string]seatdef.Definition { return held }, reread: func() error { t.Error("a verb the list names is not read again"); return nil }}
|
||||
if got, err := c.chunkedAsked("seat:mesh-wants.input@g14"); !got || err != nil {
|
||||
t.Errorf("a named chunked verb: %v, %v", got, err)
|
||||
}
|
||||
if got, err := (&consumers{}).chunkedAsked("seat:mesh-wants.input"); got || err != nil {
|
||||
t.Errorf("a runner that holds no definitions asks no chunks: %v, %v", got, err)
|
||||
}
|
||||
})
|
||||
// **The tool runner answers a held seat's marked verb by caller and serves the seat's `approvals`** (design 47 G §677; lead
|
||||
// answers A-265, A-271), with zsh's node-login-shell `execute` as the case: the marked verb reaches the gate with the caller
|
||||
// its subject names, and `approvals` is answered from the runner's own record of the calls its gate holds, with the
|
||||
|
||||
Reference in New Issue
Block a user