From 6d4ad2c2492e8b12b80671d6b249c3f3905a4fd4 Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 11 Nov 2026 14:48:07 +0100 Subject: [PATCH] Test that the operator's Approve says accepted, by whom and on which warrant (issue 595, W15.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ (Joined from 65c6ca40.) Builds: design 47 G ยง319, test 59 (KB1) Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ --- modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go b/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go index caea95c34..ac8379afb 100644 --- a/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go +++ b/modules/mesh-knowledge/cmd/mesh-knowledge/review_test.go @@ -2,6 +2,7 @@ package main import ( "context" + "fmt" "strings" "testing" "time" @@ -283,6 +284,12 @@ func TestARecordThatNeedsTheOperatorIsAcceptedOnlyOnTheWarrant(t *testing.T) { if last := vs[len(vs)-1]; !strings.Contains(last.Why, "warrant") || last.By != "the operator" { t.Fatalf("the accepting version: %+v", last) } + // Issue 595: a session waiting on the Approve wakes on this event (node-tools' `waits` names it); it says who + // accepted and on which warrant. + if got := w.said.of(EventAccepted); len(got) != 1 || got[0]["by"] != "the operator" || got[0]["record"] != itoaKey(n) || + !strings.Contains(fmt.Sprint(got[0]["what"]), "warrant") { + t.Fatalf("the accepted event: %v", got) + } if said, _ := w.k.Reconcile(); len(said) != 0 { t.Fatalf("decided twice: %v", said) }