-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcoherence_test_v2.jl
More file actions
81 lines (70 loc) · 2.03 KB
/
Copy pathcoherence_test_v2.jl
File metadata and controls
81 lines (70 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env julia --project=.
using Pkg; Pkg.instantiate()
using Dates
using JSON
include("src/GrugBot420.jl")
using .GrugBot420
import .GrugBot420:
process_mission, load_specimen_from_file!,
_LAST_VOICE_OUTPUT, _LAST_VOICE_OUTPUT_LOCK
const SPEC_PATH = joinpath(@__DIR__, "comprehensive_specimen_v758_patched.json")
function read_last_output()::String
lock(_LAST_VOICE_OUTPUT_LOCK) do; _LAST_VOICE_OUTPUT[]; end
end
function run_mission(text::String)
lock(_LAST_VOICE_OUTPUT_LOCK) do; _LAST_VOICE_OUTPUT[]=""; end
try; process_mission(text); catch e; @warn "err: $e"; end
return read_last_output()
end
# Disable chatter for clean single responses
ENV["GRUG_CHATTER_ENABLED"] = "false"
load_specimen_from_file!(SPEC_PATH)
# Expanded test set: 20 queries covering multiple domains
queries = [
# Core knowledge queries
"what is fire",
"what is water",
"what is air",
"what is earth",
"what is sky",
# Causal queries
"why does fire burn",
"why is sky blue",
"why does water flow",
# Process/method queries
"how does grug think",
"how does fire work",
# Math queries
"what is 2 plus 2",
"what is 3 times 4",
# Social/greeting
"hello",
"who are you",
# Abstract queries
"what is love",
"what is courage",
"what is beauty",
# Specimen-gap queries (should produce graceful no-match)
"tell me about rocks",
"what is a computer",
]
results = Dict{String, String}()
for q in queries
result = run_mission(q)
conv = result
ti = findfirst("--- DEBUG TELEMETRY", result)
if ti !== nothing
conv = strip(result[1:first(ti)-1])
end
# Clean up any trailing whitespace/newlines
conv = strip(replace(conv, r"\n{3,}" => "\n\n"))
results[q] = conv
println("Q: $q")
println("A: $conv")
println()
end
# Save results to JSON for analysis
open(joinpath(@__DIR__, "coherence_test_results_v2.json"), "w") do f
JSON.print(f, results, 2)
end
println("\n=== Results saved to coherence_test_results_v2.json ===")