Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Adds epidemiology package, auth epidemiology_fix push, strain-based 3D map, and Vitest coverage.
33 lines
841 B
Go
33 lines
841 B
Go
package ai
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestExtractSeerNote(t *testing.T) {
|
|
resp := `{"commands":[{"type":"noop","args":{}}]}
|
|
SEER_NOTE: dns_txt lane succeeded on 10.0.1.0/24 after wsl exhaustion.`
|
|
note, ok := ExtractSeerNote(resp)
|
|
if !ok || note == "" {
|
|
t.Fatalf("expected note, got ok=%v note=%q", ok, note)
|
|
}
|
|
if !strings.Contains(note, "dns_txt") {
|
|
t.Fatalf("unexpected note: %q", note)
|
|
}
|
|
}
|
|
|
|
func TestAugmentUserPromptWithNotes(t *testing.T) {
|
|
got := AugmentUserPromptWithNotes("Agent: id=abc", "- prior note")
|
|
if !strings.Contains(got, "Seer notes") || !strings.Contains(got, "Agent: id=abc") {
|
|
t.Fatalf("augmented prompt: %s", got)
|
|
}
|
|
}
|
|
|
|
func TestAugmentUserPromptEmptyNotes(t *testing.T) {
|
|
base := "Agent: id=abc"
|
|
if AugmentUserPromptWithNotes(base, "") != base {
|
|
t.Fatal("expected unchanged prompt")
|
|
}
|
|
}
|