R-7: mesh_first_views names the tool runner's own build, or says own build unknown
Builds: design 47 G §205, §424 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/process"
|
||||
"git.novox.be/novox/mesh-sdk/go/views"
|
||||
)
|
||||
|
||||
@@ -14,12 +15,16 @@ import (
|
||||
type viewer struct {
|
||||
busSource
|
||||
asked []string
|
||||
build process.Build
|
||||
}
|
||||
|
||||
func (v *viewer) Status() []views.Status {
|
||||
return []views.Status{{Owner: "mesh-delivery-assigner", Tool: "assignments", State: "assignments", Revision: 4, Asks: 1}}
|
||||
}
|
||||
|
||||
// OwnBuild is the build the viewer was started with.
|
||||
func (v *viewer) OwnBuild() process.Build { return v.build }
|
||||
|
||||
// Entries are the entries by fingerprint the viewer keeps (design 47 G A-103).
|
||||
func (v *viewer) Entries() any { return []string{"fp:a asked"} }
|
||||
|
||||
@@ -41,6 +46,13 @@ func TestTheConsoleShowsAndAsksAgainTheRunnersFirstViews(t *testing.T) {
|
||||
if got := text(s.discover(context.Background(), "mesh_first_views", nil)); !strings.Contains(got, "mesh-delivery-assigner") || !strings.Contains(got, "assignments") || !strings.Contains(got, "fp:a asked") {
|
||||
t.Errorf("mesh_first_views shows %s", got)
|
||||
}
|
||||
// The tool runner's own build is named, or said unknown with the reason (design 47 G §205, §424).
|
||||
for build, want := range map[string]string{"abcd1234": "abcd1234", "": "own build unknown"} {
|
||||
v.build = process.ReadOwnBuild(func(string) string { return build })
|
||||
if got := text(s.discover(context.Background(), "mesh_first_views", nil)); !strings.Contains(got, `own build`) || !strings.Contains(got, want) {
|
||||
t.Errorf("mesh_first_views with the build %q shows %s", build, got)
|
||||
}
|
||||
}
|
||||
got := s.discover(context.Background(), "mesh_first_view_again", map[string]any{"why": "doubted"})
|
||||
if len(v.asked) != 1 || v.asked[0] != "doubted" || !strings.Contains(text(got), "asked again") {
|
||||
t.Errorf("mesh_first_view_again asked %v and answered %s", v.asked, text(got))
|
||||
|
||||
Reference in New Issue
Block a user