warranted says what the operator chose, never that the module acted (hq ADR 0274 review)
This commit is contained in:
@@ -55,10 +55,10 @@ func warrantedAct(asker, ask, caller, state string, w *asks.Warrant) (link.HandA
|
|||||||
case w.AskDigest == "":
|
case w.AskDigest == "":
|
||||||
return link.HandAct{}, fmt.Errorf("the router's warrant for %s's ask %s names no ask digest", asker, ask)
|
return link.HandAct{}, fmt.Errorf("the router's warrant for %s's ask %s names no ask digest", asker, ask)
|
||||||
}
|
}
|
||||||
return link.HandAct{ID: warrantedID(asker, ask), Verb: handActWarrant, Args: []string{fmt.Sprintf("%s acted on %s, chosen on its ask %s", asker, w.Label, ask)},
|
return link.HandAct{ID: warrantedID(asker, ask), Verb: handActWarrant, Args: []string{fmt.Sprintf("the operator chose %s on %s's ask %s", w.Label, asker, ask)},
|
||||||
Why: fmt.Sprintf("%s (ask %s of %s)", w.Says(), ask, asker), By: byWords(*w), Cause: conditions.CauseOperatorAnswer,
|
Why: fmt.Sprintf("%s (ask %s of %s)", w.Says(), ask, asker), By: byWords(*w), Cause: conditions.CauseOperatorAnswer,
|
||||||
Via: viaWords(*w), Ask: ask, Proofs: w.Proofs, RequestedBy: asker + ", recorded at the word of " + caller,
|
Via: viaWords(*w), Ask: ask, Proofs: w.Proofs, RequestedBy: asker + ", recorded at the word of " + caller,
|
||||||
Outcome: "done by " + asker, At: w.At.UTC()}, nil
|
Outcome: "chosen; what " + asker + " did with it is in its own record", At: w.At.UTC()}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// readRouterRecord reads the router's record of one asker's ask: its state and warrant, or "" when there is none.
|
// readRouterRecord reads the router's record of one asker's ask: its state and warrant, or "" when there is none.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func TestAWarrantIsRecordedFromTheRoutersRecordAlone(t *testing.T) {
|
|||||||
act.By != "the operator, as telegram identity 42" || act.Ask != "instr-1" || !slices.Equal(act.Proofs, []string{"P1"}) ||
|
act.By != "the operator, as telegram identity 42" || act.Ask != "instr-1" || !slices.Equal(act.Proofs, []string{"P1"}) ||
|
||||||
!strings.Contains(act.Why, "the operator, via telegram (user id verified), chose Approve") ||
|
!strings.Contains(act.Why, "the operator, via telegram (user id verified), chose Approve") ||
|
||||||
!strings.Contains(act.RequestedBy, "node-tools.shanks") ||
|
!strings.Contains(act.RequestedBy, "node-tools.shanks") ||
|
||||||
!slices.Equal(act.Args, []string{"claude-code acted on Approve, chosen on its ask instr-1"}) {
|
!slices.Equal(act.Args, []string{"the operator chose Approve on claude-code's ask instr-1"}) {
|
||||||
t.Fatalf("recorded as %+v", act)
|
t.Fatalf("recorded as %+v", act)
|
||||||
}
|
}
|
||||||
for name, c := range map[string]struct {
|
for name, c := range map[string]struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user