feat: add conversation with grounded replies, sample mind and M1 acceptance test

Phase 8, completing milestone M1. A user message is stored and appended
as an observation event carrying trust, actor, channel and reference. The
perceive process analyses it deterministically (intent, introspection
kind, entities, claims, urgency) and, within the per-cycle model
allowance, enriches it through the perceive prompt. Its handler writes a
perception event, an episodic memory with participants, turns claims into
beliefs whose evidence is the message, and builds a response intent from
state: beliefs and memories for the topic, evidence rows for why-questions,
the uncertain band, contested beliefs and their links, recent learning,
status changes, and honest declines for subsystems that do not exist yet
or for requests with no capabilities. The respond prompt phrases the
intent when a model is assigned; otherwise the reply is a direct
rendering of the intent. response_generated cites the message, the
perception, every belief and memory used, the episode and the model call.

API: conversations, messages with optional wait, one-shot ask; chat UI
with live refresh and a per-reply intent view. Sample mind Dani as a
strictly decoded seed document with an import endpoint and noemactl mind
import. tests/m1 drives all fourteen milestone steps including restart.
This commit is contained in:
Andy Dixon
2026-06-25 19:19:24 +01:00
parent d9c6ffa30f
commit 777e8f50b5
34 changed files with 2189 additions and 39 deletions
+44
View File
@@ -0,0 +1,44 @@
package conversation
import "testing"
func TestAnalyseIntents(t *testing.T) {
cases := []struct {
text, intent, intro string
}{
{"What are you thinking about?", "introspection", "thinking"},
{"Why do you believe atlas is slow?", "introspection", "why"},
{"What are you uncertain about?", "introspection", "uncertain"},
{"Which of your beliefs contradict each other?", "introspection", "contradictions"},
{"What did you learn this week?", "introspection", "learned"},
{"What have you changed your mind about?", "introspection", "changed"},
{"What do you currently believe about atlas?", "introspection", "beliefs"},
{"Is atlas slow again since the deploy?", "question", ""},
{"Please check the disk on server-01", "request", ""},
{"No, that's wrong, atlas is on the new rack", "correction", ""},
{"hello", "greeting", ""},
{"Andy prefers Go for deployed services.", "statement", ""},
}
for _, c := range cases {
a := Analyse(c.text)
if a.Intent != c.intent || a.Introspection != c.intro {
t.Errorf("%q: got %s/%s want %s/%s", c.text, a.Intent, a.Introspection, c.intent, c.intro)
}
}
}
func TestAnalyseEntitiesClaimsAndUrgency(t *testing.T) {
a := Analyse("server-01 is down and atlas.local shows SMART errors. I think the SATA cable might be loose.")
if a.Urgency < 0.8 || a.Sentiment >= 0 {
t.Fatalf("urgency/sentiment wrong: %+v", a)
}
if len(a.Entities) < 2 {
t.Fatalf("entities missing: %v", a.Entities)
}
if len(a.Claims) != 2 || a.Claims[0].Certainty != "asserted" || a.Claims[1].Certainty != "hedged" {
t.Fatalf("claims wrong: %+v", a.Claims)
}
if b := Analyse("What do you believe about server-01?"); b.Topic != "server-01" {
t.Fatalf("topic wrong: %q", b.Topic)
}
}