TLS-5, TLS-6: the views package is mesh-sdk's (go/views), and mesh_first_view_again is recorded through mesh-hand-acts before it is done (ADR 0615 §6, ADR 0565 §10, issue 1966)
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -2,10 +2,11 @@ package console
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"git.novox.be/novox/mesh-delivery/sdk/views"
|
||||
"git.novox.be/novox/mesh-sdk/go/views"
|
||||
)
|
||||
|
||||
// FirstViewer is the tool runner's four first views as the console shows them (novox/hq ADR 0615 §6; issue 1966 TLS-6): a
|
||||
@@ -29,9 +30,14 @@ func (s *Surface) firstViewsAnswer(ctx context.Context, name string, args map[st
|
||||
if why = strings.TrimSpace(why); why == "" {
|
||||
why = "asked by hand with no reason given"
|
||||
}
|
||||
// A hand act, recorded in the runner's log with who asked and why (novox/hq ADR 0615 §6).
|
||||
// A hand act, recorded through the seat mesh-hand-acts (novox/hq ADR 0615 §6, ADR 0565 §10) before it is done, and in the
|
||||
// runner's log. One that cannot be recorded is said, and the ask is not made.
|
||||
log.Printf("[mesh-tools] hand act: %s asked the four first views again: %s", s.who, why)
|
||||
out := map[string]any{"asked again": why}
|
||||
if err := s.recordAct(map[string]any{"what": "asked the tool runner's four first views again", "why": why,
|
||||
"cause": "first-view-again", "verb": verbFirstAgain}); err != nil {
|
||||
return failure("the hand act was not recorded through mesh-hand-acts, so the first views were not asked again: " + err.Error())
|
||||
}
|
||||
out := map[string]any{"asked again": why, "recorded": "mesh-hand-acts.hand-act"}
|
||||
if errs := fv.Again(ctx, why); len(errs) > 0 {
|
||||
var msgs []string
|
||||
for _, e := range errs {
|
||||
@@ -42,3 +48,18 @@ func (s *Surface) firstViewsAnswer(ctx context.Context, name string, args map[st
|
||||
out["first views"] = fv.Status()
|
||||
return answerText(out)
|
||||
}
|
||||
|
||||
// recordAct records one act done by hand through the seat mesh-hand-acts (its verb hand-act); Surface.Record replaces the call
|
||||
// in a test.
|
||||
func (s *Surface) recordAct(args map[string]any) error {
|
||||
if s.Record != nil {
|
||||
return s.Record(args)
|
||||
}
|
||||
if s.conn == nil {
|
||||
return errNoBus
|
||||
}
|
||||
_, err := s.conn.Ask("mesh-hand-acts.hand-act", args, "")
|
||||
return err
|
||||
}
|
||||
|
||||
var errNoBus = errors.New("no bus connection")
|
||||
|
||||
Reference in New Issue
Block a user