mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-11-29 09:10:58 +01:00
AI Discovery ran a separate model-backed service scanner beside Patrol and the Assistant: its own store, scheduler, model route, API, tool and drawer UI. No telemetry counter ever measured its use (the telemetry discovery_enabled flag OR'd it with network subnet discovery), the maintainer judged it a flop, and the context it produced is already available to the models through pulse_query, pulse_read and the unified-resource context sections. This deletes internal/servicediscovery, internal/ai/infradiscovery, the pulse_discovery tool, the /api/discovery routes, the mock Discovery fixtures, the Discovery tabs in the resource, guest, node and Docker host drawers, the identified-service cards, readiness badges, provenance markers, suggested web-interface URLs, the Workloads AI Context column, the chat "Discovery is off" hint and the AI Service Context settings page. The old settings route redirects to Assistant settings. The model-bound sanitizer allow-list existed only to pass Discovery context through, so it goes too, along with the CopyableCodeRow primitive that only the Discovery tab used. Network subnet discovery (/api/discover, the Infrastructure discovery settings) and the discoveryTarget agent coordinates are separate features and stay. Stored discovery_enabled, discovery_interval_hours and discovery_model AI settings are ignored on load; the settings API decoder is lenient, so older frontends saving those fields still succeed.
65 lines
2.8 KiB
Go
65 lines
2.8 KiB
Go
package agentcapabilities
|
|
|
|
import (
|
|
"slices"
|
|
"testing"
|
|
)
|
|
|
|
func TestPatrolScopedToolProjectionUsesTypedLeastManifest(t *testing.T) {
|
|
dockerEvidence, ok := PatrolEvidenceToolNamesForResourceTypes([]string{"app-container"})
|
|
if !ok {
|
|
t.Fatal("app-container scope was not recognized")
|
|
}
|
|
if !slices.Equal(dockerEvidence, []string{PulseQueryToolName, PulseReadToolName, PulseDockerToolName}) {
|
|
t.Fatalf("Docker evidence tools = %v", dockerEvidence)
|
|
}
|
|
for _, forbidden := range []string{PulseStorageToolName, PulseKubernetesToolName, PulsePMGToolName, PulseAlertsToolName, PulseKnowledgeToolName, PulseSummarizeToolName} {
|
|
if slices.Contains(dockerEvidence, forbidden) {
|
|
t.Fatalf("Docker evidence surface included unrelated tool %q: %v", forbidden, dockerEvidence)
|
|
}
|
|
}
|
|
|
|
storageInvestigation, ok := PatrolInvestigationToolNamesForResourceTypes([]string{"physical-disk"})
|
|
if !ok {
|
|
t.Fatal("physical-disk scope was not recognized")
|
|
}
|
|
for _, required := range []string{PulseQueryToolName, PulseReadToolName, PulseMetricsToolName, PulseStorageToolName, PatrolActionCapabilitiesToolName, PatrolProposeActionToolName} {
|
|
if !slices.Contains(storageInvestigation, required) {
|
|
t.Fatalf("storage investigation tools missing %q: %v", required, storageInvestigation)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestPatrolScopedToolProjectionFailsOpenToGovernedProfileForUnknownType(t *testing.T) {
|
|
if names, ok := PatrolEvidenceToolNamesForResourceTypes(nil); ok || names != nil {
|
|
t.Fatalf("empty scope = (%v, %v), want no projection", names, ok)
|
|
}
|
|
if names, ok := PatrolEvidenceToolNamesForResourceTypes([]string{"future-resource-kind"}); ok || names != nil {
|
|
t.Fatalf("unknown scope = (%v, %v), want no projection", names, ok)
|
|
}
|
|
if names, ok := PatrolEvidenceToolNamesForResourceTypes([]string{"app-container", "future-resource-kind"}); ok || names != nil {
|
|
t.Fatalf("mixed unknown scope = (%v, %v), want no partial projection", names, ok)
|
|
}
|
|
}
|
|
|
|
func TestPatrolScopedToolProjectionComposesProfileOwnedTools(t *testing.T) {
|
|
detection, ok := PatrolDetectionToolNamesForResourceTypes([]string{"network-endpoint"})
|
|
if !ok {
|
|
t.Fatal("network-endpoint scope was not recognized")
|
|
}
|
|
for _, required := range []string{PulseQueryToolName, PatrolGetFindingsToolName, PatrolReportFindingToolName, PatrolAssessFindingToolName} {
|
|
if !slices.Contains(detection, required) {
|
|
t.Fatalf("detection surface missing %q: %v", required, detection)
|
|
}
|
|
}
|
|
if slices.Contains(detection, PatrolResolveFindingToolName) {
|
|
t.Fatalf("detection surface exposed the legacy direct resolver: %v", detection)
|
|
}
|
|
if slices.Contains(detection, PulseReadToolName) {
|
|
t.Fatalf("detection surface included optional deep-read authority: %v", detection)
|
|
}
|
|
if slices.Contains(detection, PatrolProposeActionToolName) {
|
|
t.Fatalf("detection surface gained investigation proposal authority: %v", detection)
|
|
}
|
|
}
|