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.

Forbid the report narrators from acting as parallel detectors

rcourtman41155a796873
diff --git a/internal/ai/report_fleet_narrator.go b/internal/ai/report_fleet_narrator.go
index 2ddd0a559b..354974e556 100644
--- a/internal/ai/report_fleet_narrator.go
+++ b/internal/ai/report_fleet_narrator.go
@@ -42,6 +42,18 @@ You MUST:
- Recommendations are fleet-scoped imperatives ("review memory allocation across the fleet"), not per-resource fixes.
- Keep prose concrete and short. Avoid hedging adverbs.
+DETECTION BOUNDARY — this is critical:
+Pulse Patrol is the canonical detection layer for this product. Resources with critical_alerts > 0, active_alerts > 0, findings > 0, unhealthy_disks > 0, or storage_pools_high > 0 are the ones Patrol has already flagged. Your job is to SUMMARIZE that flagged state, not to function as a parallel detector.
+
+- A resource may be promoted to outlier status (severity "warning" or "critical") only when it is backed by:
+ - critical_alerts > 0 or active_alerts > 0, OR
+ - findings > 0, OR
+ - unhealthy_disks > 0 or storage_pools_high > 0, OR
+ - a hard-threshold breach in its metrics (max_cpu > 90, avg_memory > 85, avg_disk > 85).
+- If a resource looks "trending" or "warm" in the metrics but has none of the above, you may include it as an "info" severity outlier or omit it. Do NOT classify it as warning or critical based on metric inference alone — Patrol owns that classification.
+- Cross-cutting patterns may describe what the data shows ("3 of 8 resources are above 80% memory"), but the same rule applies: classification at warning/critical severity must be backed by Patrol-visible signals, not metric inference alone.
+- Recommendations follow the same rule. Do not recommend remediation for inferred issues that have no finding, alert, or threshold breach to back them.
+
Respond ONLY with a single JSON object matching this exact schema (no markdown fences, no commentary outside the JSON):
{
diff --git a/internal/ai/report_narrator.go b/internal/ai/report_narrator.go
index 135e0fb1ab..0f083cee9b 100644
--- a/internal/ai/report_narrator.go
+++ b/internal/ai/report_narrator.go
@@ -39,6 +39,19 @@ You MUST:
- When prior-period data is supplied, write a period_comparison paragraph describing the most material deltas (resource trends, new or resolved alerts, new findings). When no prior data is supplied, leave period_comparison empty.
- Do NOT invent recommendations for problems that aren't in the data. If everything is healthy, say so plainly.
+DETECTION BOUNDARY — this is critical:
+Pulse Patrol is the canonical detection layer for this product. The patrol_findings array, when populated, contains issues Patrol has already classified with its own severity. Your job is to SUMMARIZE those findings, not to function as a parallel detector competing with them.
+
+- When a patrol_finding exists for an issue, reference it by its title in observations and recommendations. Do not paraphrase it as if you discovered it independently.
+- You may flag a "warning" or "critical" observation only when it is grounded in:
+ - a patrol_finding in the input, OR
+ - an alert in the input, OR
+ - a hard-threshold breach you can point to in metric_stats (e.g. cpu max > 90, memory avg > 85, disk avg > 85), OR
+ - a disk with health = "FAILED" or wear_level <= 30, OR
+ - a storage pool with usage_perc >= 90.
+- If you notice a pattern in the metric data that is NOT covered by any of the above, you may mention it as an "info" severity observation describing what you saw — but you MUST NOT promote it to "warning" or "critical". Classification at those levels is Patrol's job; you are reporting on Patrol's work, not replacing it.
+- This rule applies to recommendations too: do not recommend remediation for an inferred issue that has no finding, alert, or threshold breach to back it.
+
Respond ONLY with a single JSON object matching this exact schema (no markdown fences, no commentary outside the JSON):
{