Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Disambiguate Docker service evidence for Patrol

rcourtmanab3416873149
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 40ffa7dfeb..ab39c323b0 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -71,7 +71,12 @@ decision by withholding the proposal. This permission does not relax causal
evidence ordering: when a cross-resource cause remains plausible, Patrol must
test at least one plausible peer or dependency through canonical query,
discovery, or topology evidence before proposing against the symptom resource
-or concluding that root cause is unknown.
+or concluding that root cause is unknown. Investigation reasoning must
+reconcile the concrete resource entries in later topology/query/discovery
+results before asserting that no peer is implicated. The Docker `services`
+operation is explicitly Swarm-only: an empty service list never proves the
+absence of ordinary Docker containers or container dependencies, and its tool
+result must direct the model to topology or search for that evidence.
An investigation cannot complete or submit a typed action proposal before the
model has received at least one successful structured result from an advertised
evidence tool. Until then, core withholds proposal authority while leaving
@@ -7553,4 +7558,7 @@ not a fence. When a cross-resource cause remains plausible, empty logs or a
policy-blocked deep-read attempt cannot justify an unknown-root-cause
conclusion or remediation proposal on the symptom alone; the remaining
read-only budget must prioritize canonical query, discovery, or topology
-evidence for at least one plausible causal peer or dependency.
+evidence for at least one plausible causal peer or dependency. Later
+topology/query/discovery resource entries take precedence over an earlier
+empty Docker Swarm-service result when determining whether a container peer is
+implicated.
diff --git a/internal/ai/chat/agentic_prompt.go b/internal/ai/chat/agentic_prompt.go
index 21a1db9d0a..e973ddcbff 100644
--- a/internal/ai/chat/agentic_prompt.go
+++ b/internal/ai/chat/agentic_prompt.go
@@ -46,7 +46,10 @@ operator. This does not permit an early symptom-only proposal: before proposing
resource or concluding that root cause is unknown, use available canonical query, discovery, or
topology evidence to test at least one plausible causal peer or dependency whenever a cross-resource
cause remains plausible. Only after that test may empty logs or blocked deeper inspection support a
-bounded symptom-resource proposal. If your Recommendation or Conclusion tells the operator to try, consider,
+bounded symptom-resource proposal. Reconcile the actual resource entries returned by later topology,
+query, or discovery calls before concluding that no peer or dependency is implicated. A result saying
+that no Docker services exist covers Swarm services only and never rules out ordinary Docker container
+peers or dependencies; inspect the topology container entries instead. If your Recommendation or Conclusion tells the operator to try, consider,
or perform an advertised remediation, you must call patrol_propose_action for that exact action;
never leave it only as prose. Core policy independently decides whether it may execute. If the
evidence does not support any advertised remediation, state the uncertainty and conclude without
diff --git a/internal/ai/chat/service_tooling_test.go b/internal/ai/chat/service_tooling_test.go
index c91eff7cdf..3cef9a88c9 100644
--- a/internal/ai/chat/service_tooling_test.go
+++ b/internal/ai/chat/service_tooling_test.go
@@ -1029,6 +1029,8 @@ func TestExecutionProfilePromptModes(t *testing.T) {
!strings.Contains(prompt, "hands the exact decision to core policy") ||
!strings.Contains(prompt, "does not permit an early symptom-only proposal") ||
!strings.Contains(prompt, "plausible causal peer or dependency") ||
+ !strings.Contains(prompt, "Reconcile the actual resource entries returned by later topology") ||
+ !strings.Contains(prompt, "no Docker services exist covers Swarm services only") ||
!strings.Contains(prompt, "Tool function names are exact") ||
!strings.Contains(prompt, "action or operation schema are arguments") {
t.Fatalf("investigation prompt must turn supported remediation into a governed proposal, got %q", prompt)
diff --git a/internal/ai/tools/infrastructure_low_coverage_test.go b/internal/ai/tools/infrastructure_low_coverage_test.go
index a66c125af1..937f74ca9f 100644
--- a/internal/ai/tools/infrastructure_low_coverage_test.go
+++ b/internal/ai/tools/infrastructure_low_coverage_test.go
@@ -934,7 +934,7 @@ func TestExecuteListDockerServices(t *testing.T) {
"host": "dock1",
})
require.NoError(t, err)
- assert.Equal(t, "No Docker services found on host 'dock1'. The host may not be a Swarm manager.", result.Content[0].Text)
+ assert.Equal(t, "No Docker Swarm services found on host 'dock1'. This result covers Swarm services only; it does not mean the host has no ordinary Docker containers or container dependencies. Use pulse_query topology or search to inspect those resources. The host may not be a Swarm manager.", result.Content[0].Text)
state.DockerHosts[0].Services = []models.DockerService{
{ID: "svc1", Name: "web", Stack: "stack1", DesiredTasks: 1, RunningTasks: 1},
diff --git a/internal/ai/tools/tools_docker.go b/internal/ai/tools/tools_docker.go
index db3d22055e..e0667c05a6 100644
--- a/internal/ai/tools/tools_docker.go
+++ b/internal/ai/tools/tools_docker.go
@@ -776,7 +776,7 @@ func (e *PulseToolExecutor) executeListDockerServices(_ context.Context, args ma
if host.ID() == hostArg || host.Hostname() == hostArg {
services := host.Services()
if len(services) == 0 {
- return NewTextResult(fmt.Sprintf("No Docker services found on host '%s'. The host may not be a Swarm manager.", host.Hostname())), nil
+ return NewTextResult(fmt.Sprintf("No Docker Swarm services found on host '%s'. This result covers Swarm services only; it does not mean the host has no ordinary Docker containers or container dependencies. Use pulse_query topology or search to inspect those resources. The host may not be a Swarm manager.", host.Hostname())), nil
}
var summaries []DockerServiceSummary