T1a verb-timeout-ask: a bundle's ask waits the timeout its verb's definition names

The runner reads the `timeout` (whole seconds) of a seat's verb from the seat list's definitions beside `chunked` and hands it to
the bus connection's ask (AskWithin, AskAsWithin, AskAsChunkedWithin); a verb that names none, a seat the definitions do not hold
and a module's tool wait the runner's own bound, RequestTimeout.

Builds: design 47 H §760, H-A-43

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 02:35:28 +01:00
parent 76df3cb420
commit 5314231c0d
8 changed files with 144 additions and 15 deletions
+21
View File
@@ -3,6 +3,7 @@ package runtime
import (
"fmt"
"strings"
"time"
"git.novox.be/novox/mesh-sdk/go/approval"
"git.novox.be/novox/mesh-sdk/go/seatdef"
@@ -179,3 +180,23 @@ func (c *consumers) chunked(key string) bool {
}
return false
}
// withinOf is how long a call of key waits for its answer: the `timeout` the verb's definition names, in whole seconds (design 47
// H §760, H-A-43); zero, which the bus reads as the tool runner's own bound, for a key that is no seat's verb, a seat the
// definitions do not hold, a verb they do not name and a verb that names none.
func (c *consumers) withinOf(key string) time.Duration {
if c.definitions == nil || !strings.HasPrefix(key, "seat:") {
return 0
}
name, _, _ := strings.Cut(key, "@")
seat, verb, ok := strings.Cut(strings.TrimPrefix(name, "seat:"), ".")
if !ok {
return 0
}
for _, v := range c.definitions()[seat].Verbs {
if v.Name == verb && v.Timeout != nil {
return time.Duration(*v.Timeout) * time.Second
}
}
return 0
}