D1i: a row for the indexer's bind: every counted node's manifest-reads is called once (issue 1966 note 155, ADR 0668 §4)

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-10 03:53:05 +01:00
parent 17dd41696c
commit bd39747c22
@@ -12,6 +12,7 @@ import (
"github.com/nats-io/nats.go/jetstream"
"git.novox.be/novox/mesh-contracts/go/clients/nodeengineclient/enginereads"
"git.novox.be/novox/mesh-delivery/contracts/go/clients/meshdeliveryclient"
"git.novox.be/novox/mesh-delivery/contracts/go/seats/meshdelivery"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-forge-bridge/forgemsg"
@@ -79,6 +80,20 @@ func TestAMessageIsIndexedAndAcked(t *testing.T) { // 1238/AC2 (unit part)
if em := viewsEmitter(context.Background(), nil, process.Account{}, nil, &process.AwaitedBucket{}, nil, t.Logf); em.Findings == nil {
t.Error("the indexer's views emitter writes no view-unsaid finding")
}
t.Run("the consumer bound: every counted node's manifest-reads called once", func(t *testing.T) { // 1966 note 155, ADR 0668 §4
// A manifest-reads-changed said before the indexer's consumer existed is never delivered: the hub's OnBound
// (reads.atBind) calls every node the assignments counts, so a stale statement ends at the bind.
var called []string
reads := &engineReads{known: true, nodes: []string{"ace", "g14"}, keeper: &enginereads.Keeper{Sync: true,
Call: func(node, _ string, _ any) (json.RawMessage, error) {
called = append(called, node)
return nil, errors.New("no responders")
}}}
reads.atBind(time.Unix(0, 0))
if strings.Join(called, ",") != "ace,g14" {
t.Errorf("at the bind called %v, want ace and g14 once each", called)
}
})
t.Run("not a forge message: terminated and logged", func(t *testing.T) { // 1238 (never redelivered)
var logs bytes.Buffer
st := &memStore{vals: map[string][]byte{}}