mesh-self-check and mesh-healers give the writer the findings-asked subject of the seat's contract, and the reader the writer itself
Builds: design 47 G A-17, A-16 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient"
|
||||
meshconditions "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions"
|
||||
"git.novox.be/novox/mesh-sdk/go/views"
|
||||
)
|
||||
|
||||
@@ -69,7 +70,7 @@ func NewChecker() *Checker {
|
||||
Ask: func(key string, body any) (json.RawMessage, error) { return stdio.Ask(key, body) },
|
||||
Publish: stdio.SeatPublish}
|
||||
w, err := views.NewStdioWriter(views.WriterConfig[Finding, FindingCleared, FindingsStated, FindingsAsked]{
|
||||
Module: Module, State: stdio.State(FindingsState), Observe: c.Observe, Logf: logf})
|
||||
Module: Module, State: stdio.State(FindingsState), Observe: c.Observe, Asked: meshconditions.SubjectFindingsAsked, Logf: logf})
|
||||
if err != nil {
|
||||
logf("%v", err)
|
||||
os.Exit(1)
|
||||
@@ -83,7 +84,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(w *FindingsWriter) *views.Reader {
|
||||
r := &views.Reader{Module: Module, Logf: logf, Findings: views.WriterFindings{Writer: w}, Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}}
|
||||
r := &views.Reader{Module: Module, Logf: logf, Findings: w, Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}}
|
||||
r.Follow(assignerModule, placing.StateAssignments, AssignmentsTool)
|
||||
r.Follow(assignerModule, placing.StateSeatHolders, SeatHoldersTool)
|
||||
r.Follow(indexerModule, "modules", ModulesTool)
|
||||
|
||||
@@ -127,7 +127,7 @@ func checker(store *memStore, registry ...Probe) (*Checker, *[]string) {
|
||||
return nil
|
||||
}}
|
||||
w, err := views.NewWriter(views.WriterConfig[Finding, FindingCleared, FindingsStated, FindingsAsked]{
|
||||
Module: Module, Node: "novox", State: findingState{store}, Observe: c.Observe, Logf: c.Logf, Now: c.Now,
|
||||
Module: Module, Node: "novox", Asked: "mesh.seat.mesh-conditions.event.findings-asked", State: findingState{store}, Observe: c.Observe, Logf: c.Logf, Now: c.Now,
|
||||
Publish: func(_ context.Context, subject string, _ []byte, _ string) error {
|
||||
store.events = append(store.events, subject)
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user