CAT-RD1..RD10: the readers use mesh-sdk's views.Reader, say an unanswered first view in their own findings (mesh-conditions observes them) and record a re-read through mesh-hand-acts

This commit is contained in:
2026-11-04 12:23:37 +01:00
parent 7843edb1eb
commit 4d597eb9dc
29 changed files with 113 additions and 70 deletions
@@ -8,7 +8,6 @@ package main
import (
"context"
"encoding/json"
"fmt"
"os"
"strings"
@@ -19,9 +18,9 @@ import (
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/asks"
"git.novox.be/novox/mesh-sdk/go/delivery"
"git.novox.be/novox/mesh-sdk/go/health"
"git.novox.be/novox/mesh-delivery/sdk/views"
"git.novox.be/novox/mesh-sdk/go/handacts"
"git.novox.be/novox/mesh-sdk/go/views"
)
// Seat is the role this module holds, once for the mesh, and Verb its one verb.
@@ -182,20 +181,10 @@ const (
ManifestsTool = delivery.IndexerModule + ".indexer_read_manifests"
)
// viewFindings writes the provisioner's finding of a first view unanswered into its own state findings, which the
// condition keeper raises the condition from.
type viewFindings struct{}
func (viewFindings) Put(key string, value []byte) error {
_, err := stdio.State(health.FindingsState).Put(key, json.RawMessage(value))
return err
}
func (viewFindings) Delete(key string) error { return stdio.State(health.FindingsState).Delete(key) }
// newViews is the provisioner's pictures of the assigner's placement and wants and the indexer's modules and manifests:
// each asked once of its owner's read tool, then followed by the owner's events (ADR 0615).
func newViews() *views.Reader {
v := &views.Reader{Module: Module, Logf: logf, Findings: viewFindings{}}
v := &views.Reader{Module: Module, Logf: logf, Findings: views.OwnFindings{}, Acts: handacts.Recorder{Ask: stdio.Ask}}
v.Follow(delivery.AssignerModule, "placement", PlacementTool)
v.Follow(delivery.AssignerModule, "wants", WantsTool)
v.Follow(delivery.IndexerModule, "modules", ModulesTool)
@@ -9,8 +9,8 @@ import (
"sync"
"testing"
"git.novox.be/novox/mesh-delivery/sdk/views"
"git.novox.be/novox/mesh-sdk/go/health"
"git.novox.be/novox/mesh-sdk/go/views"
)
// memStore is the bus as mesh-provisioner reaches it, in memory: the states it keeps.
@@ -345,7 +345,7 @@ func TestTheManifestDeclaresWhatTheCodeKeeps(t *testing.T) {
t.Errorf("the manifest does not read %s, which the holder reads", r)
}
}
if !slices.Equal(m.Invokes, []string{PlacementTool, WantsTool, ModulesTool, ManifestsTool}) ||
if !slices.Equal(m.Invokes, []string{PlacementTool, WantsTool, ModulesTool, ManifestsTool, "seat:mesh-hand-acts.hand-act"}) ||
!slices.Equal(m.Consumes, []string{"mesh-delivery-assigner.views.placement", "mesh-delivery-assigner.views.wants",
"mesh-delivery-indexer.views.modules", "mesh-delivery-indexer.views.manifests"}) {
t.Errorf("invokes %v, consumes %v", m.Invokes, m.Consumes)