C1: the engine-reads keeper calls every node again at its part's consumer bind (issue 1966, ADR 0668)

A manifest-reads-changed said before the part's consumer existed was never heard (note 155), and the
statement taken while an engine restarted stood. AtBind is registered on the hub's OnBound.

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-10 02:54:44 +01:00
parent 66e0c611bf
commit 5c29bea0b3
2 changed files with 39 additions and 1 deletions
@@ -170,7 +170,8 @@ func Decode(raw []byte) (Statement, error) {
return s, nil
}
// Caller calls a seat's verb on one node: process.Conn.CallOn.
// Caller calls a seat's verb on one node: process.Conn.CallKeptOn, a kept call asked again through a transport fault
// within the bus's retry bound (novox/hq ADR 0668 §1; the verb is a read, safe to call again).
type Caller func(node, key string, body any) (json.RawMessage, error)
// Ask asks node's engine the verb once and says what it answered. An engine that answered the call with an error is
@@ -269,6 +270,22 @@ func (k *Keeper) AskNode(node, why string) {
go k.ask(node, why)
}
// AskAll asks every node of nodes once, each as AskNode does.
func (k *Keeper) AskAll(nodes []string, why string) {
for _, n := range nodes {
k.AskNode(n, why)
}
}
// AtBind is what a part registers with its event hub's OnBound (process.EventHub.OnBound): at each bind of its consumer
// every node nodes names is asked once, so a manifest-reads-changed said before the consumer existed, and a statement
// taken while an engine restarted, end at the bind and not at the next event (novox/hq ADR 0668 §4; issue 1966 note 155).
func (k *Keeper) AtBind(nodes func() []string) func(created time.Time) {
return func(created time.Time) {
k.AskAll(nodes(), "the part's consumer was bound, made "+created.UTC().Format(time.RFC3339))
}
}
func (k *Keeper) ask(node, why string) {
defer func() {
k.mu.Lock()