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:
@@ -90,7 +90,8 @@ func main() {
|
||||
Build: os.Getenv(runtime.FingerprintWord), Hear: hearOne(conn)})
|
||||
// A failed read or write of the state approvals is made again at the next membership change the runner hears (A-157).
|
||||
conn.OnMembership(func(bus.Membership) { go gate.StateAgain() })
|
||||
opts = append(opts, runtime.WithGate(gate), runtime.WithSeatDefinitions(definitionsOf(seatList)))
|
||||
opts = append(opts, runtime.WithGate(gate), runtime.WithSeatDefinitions(definitionsOf(seatList)),
|
||||
runtime.WithSeatDefinitionsAgain(rereadOf(seatList)))
|
||||
// A run still unrecorded is asked again at each start and when the hand-act seat's holder is heard again (lead answer A-157).
|
||||
if stopBounds, err := gate.WatchBounds(); err != nil {
|
||||
log.Printf("[mesh-tools] the gate's bound keys are not watched (%v): an unanswered hand-act is said in the log only", err)
|
||||
|
||||
@@ -66,6 +66,12 @@ func startSeatListOn(b seatlist.Bus, bound <-chan time.Time, logf func(string, .
|
||||
select {
|
||||
case <-reader.Ready():
|
||||
catalogue.UseSeats(reader.Seats())
|
||||
// a first read that ended without an answer is no failure of the reader, which holds the bootstrap and waits for the seat's
|
||||
// next event: so it is said here, where nothing else would say it (the runner then reads again where a bundle asks a verb
|
||||
// its definitions do not name)
|
||||
if st := reader.Status(); !st.Heard {
|
||||
logf("node-tools: the first read of the seat list ended without an answer (%s); the runner serves with the bootstrapped seats and reads again when a bundle asks a verb they do not name", st.LastError)
|
||||
}
|
||||
case <-bound:
|
||||
logf("node-tools: the seat list is not read yet; the runner serves with the bootstrapped seats and reads on")
|
||||
}
|
||||
@@ -82,3 +88,14 @@ func definitionsOf(reader *seatlist.Reader) func() map[string]seatdef.Definition
|
||||
return reader.Definitions()
|
||||
}
|
||||
}
|
||||
|
||||
// rereadOf is how the runner reads the seat list again where a verb is not named by the definitions it holds; it reads nothing
|
||||
// while the reader did not start.
|
||||
func rereadOf(reader *seatlist.Reader) func() error {
|
||||
return func() error {
|
||||
if reader == nil {
|
||||
return fmt.Errorf("the seat list reader did not start")
|
||||
}
|
||||
return reader.Reload()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestTheRunnerWaitsForTheFirstReadOfTheSeatListOnlyToItsBound(t *testing.T)
|
||||
wantSaid string
|
||||
wantReady bool
|
||||
}{
|
||||
{"the first read ends before the bound", true, "", true},
|
||||
{"the first read ends before the bound, unanswered", true, "the first read of the seat list ended without an answer", true},
|
||||
{"the bound passes with the seat silent", false, "the seat list is not read yet", false},
|
||||
} {
|
||||
t.Run(row.name, func(t *testing.T) {
|
||||
@@ -57,7 +57,7 @@ func TestTheRunnerWaitsForTheFirstReadOfTheSeatListOnlyToItsBound(t *testing.T)
|
||||
if ended != row.wantReady {
|
||||
t.Errorf("first read ended = %v, want %v", ended, row.wantReady)
|
||||
}
|
||||
if got := strings.Join(said, ";"); !strings.Contains(got, row.wantSaid) || (row.wantSaid == "" && got != "") {
|
||||
if got := strings.Join(said, ";"); !strings.Contains(got, row.wantSaid) {
|
||||
t.Errorf("said %q, want %q", got, row.wantSaid)
|
||||
}
|
||||
if !row.release {
|
||||
|
||||
Reference in New Issue
Block a user