fix(volition): rest an action on the belief about that action

An intention's supporting beliefs came from a text search on the target,
and ties on rank and confidence had no order, so a verification miss could
revise an unrelated belief about the same service. Beliefs that mention the
proposed action now come first, and belief search breaks ties by id.

The incident scenario asserts the first support is the belief about
restarting, and waits for the blocked intention and the procedural memory
instead of reading them once.
This commit is contained in:
Andy Dixon
2026-10-04 19:46:55 +01:00
parent f609fae746
commit edcc6580b6
3 changed files with 24 additions and 10 deletions
+8
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"sort"
"strings"
"time"
@@ -495,6 +496,13 @@ func supportingBeliefs(ctx context.Context, s *brain.State, w volition.Want) []i
if err != nil {
return nil
}
// A belief about the proposed action itself ("restarting atlas-worker
// clears the queue") is what the action rests on, so it comes first; the
// first supporting belief is the one a verification outcome revises.
action := strings.ToLower(w.Proposal.Capability[strings.LastIndex(w.Proposal.Capability, ".")+1:])
sort.SliceStable(bs, func(i, j int) bool {
return action != "" && strings.Contains(strings.ToLower(bs[i].Proposition), action) && !strings.Contains(strings.ToLower(bs[j].Proposition), action)
})
var out []ids.ID
for _, b := range bs {
if len(out) == 3 {