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:
@@ -1,6 +1,7 @@
|
||||
package runtime
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/approval"
|
||||
@@ -75,6 +76,48 @@ func (r *runner) unservedMarks(module string, regs []launch.Registration) []stri
|
||||
return r.events.gate.Unserved(module, r.fingerprintOf(module), registered)
|
||||
}
|
||||
|
||||
// WithSeatDefinitionsAgain gives the runner the way to read the seat list again (the seat list reader's Reload): a seat verb a bundle asks
|
||||
// that the definitions held do not name is looked up again after it, never taken for a verb that sends no chunks.
|
||||
func WithSeatDefinitionsAgain(again func() error) Option {
|
||||
return func(c *consumers) { c.reread = again }
|
||||
}
|
||||
|
||||
// chunkedAsked is chunked for a verb a bundle asks, where the answer decides whether the runner chooses the `call` the holder
|
||||
// requires (AskAsChunked): a seat verb the definitions held do not name is not taken for one that sends no chunks, since the
|
||||
// holder then refuses an ask that carries no call and the bundle sees only that refusal. The seat list is read again once, and
|
||||
// a verb it still does not name is an error that says why. A runner that holds no definitions (nil) asks no chunks.
|
||||
func (c *consumers) chunkedAsked(key string) (bool, error) {
|
||||
if c.definitions == nil || !strings.HasPrefix(key, "seat:") {
|
||||
return false, nil
|
||||
}
|
||||
name, _, _ := strings.Cut(key, "@")
|
||||
seat, verb, ok := strings.Cut(strings.TrimPrefix(name, "seat:"), ".")
|
||||
if !ok {
|
||||
return false, nil
|
||||
}
|
||||
find := func() (chunks, found bool) {
|
||||
for _, v := range c.definitions()[seat].Verbs {
|
||||
if v.Name == verb {
|
||||
return v.Chunks, true
|
||||
}
|
||||
}
|
||||
return false, false
|
||||
}
|
||||
if chunks, found := find(); found {
|
||||
return chunks, nil
|
||||
}
|
||||
var why string
|
||||
if c.reread != nil {
|
||||
if err := c.reread(); err != nil {
|
||||
why = ": reading the seat list again failed: " + err.Error()
|
||||
}
|
||||
if chunks, found := find(); found {
|
||||
return chunks, nil
|
||||
}
|
||||
}
|
||||
return false, fmt.Errorf("the seat list this runner holds does not name the verb %s, so it cannot tell whether the verb sends its answer in chunks (the ask is not sent)%s", key, why)
|
||||
}
|
||||
|
||||
// chunked says whether key names a seat's verb whose definition says `chunks` (design 47 G A-249): its answer is received in
|
||||
// chunks by the runner, whose call hands the bundle the whole.
|
||||
func (c *consumers) chunked(key string) bool {
|
||||
|
||||
Reference in New Issue
Block a user