mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-29 03:50:18 +00:00
Adds detailed architecture documentation for Pulse Patrol and Pulse Assistant. Updates AI.md and PULSE_PRO.md. Also includes additional tests.
28 lines
1,009 B
Go
28 lines
1,009 B
Go
package chat
|
|
|
|
import "testing"
|
|
|
|
func TestAIMetricsRecording(t *testing.T) {
|
|
m := GetAIMetrics()
|
|
if sanitizeLabel("") != "unknown" {
|
|
t.Fatalf("expected empty label to be sanitized")
|
|
}
|
|
if sanitizeLabel("has space") != "has_space" {
|
|
t.Fatalf("expected spaces to be replaced")
|
|
}
|
|
|
|
m.RecordFSMToolBlock(StateReading, "pulse_query", ToolKindResolve)
|
|
m.RecordFSMFinalBlock(StateResolving)
|
|
m.RecordStrictResolutionBlock("validateResolvedResource", "restart")
|
|
m.RecordRoutingMismatchBlock("pulse_control", "node", "vm")
|
|
m.RecordPhantomDetected("provider", "model")
|
|
m.RecordAutoRecoveryAttempt("STRICT_RESOLUTION", "pulse_query")
|
|
m.RecordAutoRecoverySuccess("STRICT_RESOLUTION", "pulse_query")
|
|
m.RecordAgenticIteration("provider", "model")
|
|
|
|
cb := NewAIMetricsTelemetryCallback()
|
|
cb.RecordStrictResolutionBlock("validateResolvedResource", "start")
|
|
cb.RecordAutoRecoveryAttempt("ERR", "tool")
|
|
cb.RecordAutoRecoverySuccess("ERR", "tool")
|
|
cb.RecordRoutingMismatchBlock("pulse_control", "node", "vm")
|
|
}
|