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:
@@ -15,7 +15,8 @@ import (
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
"git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/sdk/views"
|
||||
"git.novox.be/novox/mesh-sdk/go/handacts"
|
||||
"git.novox.be/novox/mesh-sdk/go/views"
|
||||
)
|
||||
|
||||
func logf(format string, a ...any) { fmt.Fprintf(os.Stderr, format+"\n", a...) }
|
||||
@@ -73,7 +74,7 @@ func NewChecker() *Checker {
|
||||
// its owner's read tool, then followed by the owner's events. A first view unanswered past its bound is a finding of the
|
||||
// self-check's own (first-view-unanswered), written into its state findings.
|
||||
func newViews() *views.Reader {
|
||||
r := &views.Reader{Module: Module, Logf: logf, Findings: findings{}}
|
||||
r := &views.Reader{Module: Module, Logf: logf, Findings: views.OwnFindings{}, Acts: handacts.Recorder{Ask: stdio.Ask}}
|
||||
r.Follow(delivery.AssignerModule, delivery.PlacementState, PlacementTool)
|
||||
r.Follow(delivery.AssignerModule, delivery.SeatHoldersState, SeatHoldersTool)
|
||||
r.Follow(delivery.IndexerModule, "modules", ModulesTool)
|
||||
@@ -81,15 +82,6 @@ func newViews() *views.Reader {
|
||||
return r
|
||||
}
|
||||
|
||||
// findings writes the self-check's own state findings for the reader.
|
||||
type findings struct{}
|
||||
|
||||
func (findings) Put(key string, value []byte) error {
|
||||
_, err := stdio.State(FindingsState).Put(key, json.RawMessage(value))
|
||||
return err
|
||||
}
|
||||
func (findings) Delete(key string) error { return stdio.State(FindingsState).Delete(key) }
|
||||
|
||||
func main() {
|
||||
c := NewChecker()
|
||||
go func() {
|
||||
|
||||
@@ -33,7 +33,7 @@ const (
|
||||
// Invokes are the tools and seat verbs the probes ask, and Reads the states they read: the manifest's `invokes` and
|
||||
// `reads`, which its test holds to these.
|
||||
var (
|
||||
Invokes = []string{StreamsTool, ClosedTool, SignalsVerb, BannedVerb, PlacementTool, SeatHoldersTool, ModulesTool, ManifestsTool}
|
||||
Invokes = []string{StreamsTool, ClosedTool, SignalsVerb, BannedVerb, PlacementTool, SeatHoldersTool, ModulesTool, ManifestsTool, HandActVerb}
|
||||
Reads = []string{PresenceRead, HealthRead, ReadingsRead, GoodRead}
|
||||
// Consumes are the views families the probes follow (ADR 0615): the indexer's and the assigner's states are asked
|
||||
// once, by their owners' read tools, and then followed by their events, never read.
|
||||
@@ -41,6 +41,9 @@ var (
|
||||
"mesh-delivery-indexer.views.modules", "mesh-delivery-indexer.views.manifests"}
|
||||
)
|
||||
|
||||
// HandActVerb records a re-read of a first view by hand (ADR 0615 §6).
|
||||
const HandActVerb = "seat:mesh-hand-acts.hand-act"
|
||||
|
||||
// The owners' read tools of the states the probes follow, which the manifest invokes.
|
||||
const (
|
||||
PlacementTool = "mesh-delivery-assigner.assigner_read_placement"
|
||||
|
||||
Reference in New Issue
Block a user