G findings: the view-only modules write their reader's findings through mesh-sdk's stdio writer
nfs-server, minio object-store, claude-code, mesh-watcher, mesh-provisioner and mesh-build-go hand their views reader views.WriterFindings over views.NewStdioWriter and start it; the removed meshconditionsclient.FindingWriter goes. Builds: design 47 G §686, §687, §689, A-3, A-16, A-17 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
mesh "git.novox.be/novox/mesh-contracts/go/seats/meshmoduleassigner"
|
||||
"os"
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient"
|
||||
seat "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions"
|
||||
stdio "git.novox.be/novox/mesh-sdk/go"
|
||||
|
||||
"git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshhandactsclient"
|
||||
@@ -30,7 +30,13 @@ const (
|
||||
)
|
||||
|
||||
func main() {
|
||||
seats := &views.Reader{Module: "minio", Findings: meshconditionsclient.FindingWriter{State: stdio.State("findings")}, Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}, Logf: func(f string, a ...any) { fmt.Fprintf(os.Stderr, "[object-store] "+f+"\n", a...) }}
|
||||
seats := &views.Reader{Module: "minio", Acts: meshhandactsclient.Recorder{Ask: stdio.Ask}, Logf: func(f string, a ...any) { fmt.Fprintf(os.Stderr, "[object-store] "+f+"\n", a...) }}
|
||||
findings, err := newFindingsWriter()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[object-store] %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
seats.Findings = views.WriterFindings{Writer: findings}
|
||||
seats.Follow(assignerModule, mesh.StateSeatHolders, SeatHoldersTool)
|
||||
s, err := newServer(os.Getenv(ConfigWord), os.Getenv(LinksWord), os.Getenv(ReceivesWord),
|
||||
func() (map[string][]byte, error) { return seats.Values(assignerModule + "." + mesh.StateSeatHolders) })
|
||||
@@ -38,6 +44,10 @@ func main() {
|
||||
fmt.Fprintf(os.Stderr, "[object-store] %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := findings.Start(context.Background()); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[object-store] %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
seats.Start(context.Background())
|
||||
if err := stdio.Serve("", append(tools(s), seats.Tools("object_store")...)); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[object-store] %v\n", err)
|
||||
@@ -52,6 +62,16 @@ const assignerModule = "mesh-delivery-assigner"
|
||||
|
||||
const SeatHoldersTool = assignerModule + ".assigner_read_seat_holders"
|
||||
|
||||
// newFindingsWriter is this module's finding writer (design 47 G §689, A-16): it states the findings of its views reader and
|
||||
// observes none of its own.
|
||||
func newFindingsWriter() (*views.Writer[seat.Finding, seat.FindingCleared, seat.FindingsStated, seat.FindingsAskedEvent], error) {
|
||||
return views.NewStdioWriter(views.WriterConfig[seat.Finding, seat.FindingCleared, seat.FindingsStated, seat.FindingsAskedEvent]{
|
||||
Module: "minio", State: stdio.State("findings"),
|
||||
Observe: func(context.Context) (views.Observed[seat.Finding], error) {
|
||||
return views.Observed[seat.Finding]{}, nil
|
||||
}})
|
||||
}
|
||||
|
||||
func tools(s *server) []stdio.Tool {
|
||||
return []stdio.Tool{{
|
||||
Name: "object-store.link",
|
||||
|
||||
Reference in New Issue
Block a user