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.

fix(alerts): keep TrueNAS information out of actionable incidents

pulse-triage[bot]7726539f8390
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index c9042d2fc0..580755dba6 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -19,6 +19,15 @@
## Purpose
+Incident timeline summaries must distinguish provider conditions from metric
+threshold evidence. For `resource-incident` alert events, numeric value and
+threshold placeholders must not render as a measured comparison; retain the
+alert type and severity instead. Numeric metric alerts retain their comparison
+format. This applies to reconstructed event summaries, not a migration of
+already persisted summary strings.
+`TestProviderIncidentSummaryDoesNotInventThreshold` in
+`internal/ai/memory/provider_incident_summary_test.go` verifies both boundaries.
+
Own the Pulse Intelligence Core: canonical context, governed actions, safety
gates, approval state, action audit, and verification. That core backs Pulse
Patrol as the primary built-in operator that checks infrastructure, investigates
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 324b7aa083..d0e417a6eb 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -15,6 +15,14 @@
## Purpose
+TrueNAS provider incidents mapped to informational alert level remain on the
+canonical resource but do not enter the actionable active-alert lifecycle.
+Warning and critical incidents retain normal routing; downgrade to information
+clears an existing actionable incident through normal synchronisation.
+`TestSyncUnifiedResourceIncidentsTrueNASInformation` in
+`internal/alerts/unified_incidents_test.go` pins information, warning, recovery,
+and preservation of provider resource evidence.
+
Own alert identity, alert specs, evaluation, persistence semantics, and
operator-facing alert routing behavior for live runtime alerts.
Alert-history investigations on narrow layouts render in a shared drawer
diff --git a/internal/ai/memory/incidents.go b/internal/ai/memory/incidents.go
index 88e979d3d2..d8fbd4ea4a 100644
--- a/internal/ai/memory/incidents.go
+++ b/internal/ai/memory/incidents.go
@@ -1124,7 +1124,8 @@ func incidentEventSummaryFromChange(change unifiedresources.ResourceChange, even
level, _ := stringMetadata(change.Metadata, unifiedresources.MetadataAlertLevel)
value, hasValue := floatMetadata(change.Metadata, unifiedresources.MetadataAlertValue)
threshold, hasThreshold := floatMetadata(change.Metadata, unifiedresources.MetadataAlertThreshold)
- if hasValue || hasThreshold {
+ // Resource incidents carry numeric zero placeholders, not threshold evidence.
+ if alertType != "resource-incident" && (hasValue || hasThreshold) {
return fmt.Sprintf("Alert triggered: %s (%s %.1f >= %.1f)", alertType, level, value, threshold)
}
if level != "" {
diff --git a/internal/ai/memory/provider_incident_summary_test.go b/internal/ai/memory/provider_incident_summary_test.go
new file mode 100644
index 0000000000..77812107c4
--- /dev/null
+++ b/internal/ai/memory/provider_incident_summary_test.go
@@ -0,0 +1,24 @@
+package memory
+
+import (
+ "github.com/rcourtman/pulse-go-rewrite/internal/unifiedresources"
+ "testing"
+)
+
+func TestProviderIncidentSummaryDoesNotInventThreshold(t *testing.T) {
+ for _, typ := range []string{"resource-incident", "cpu"} {
+ change := unifiedresources.ResourceChange{Metadata: map[string]interface{}{
+ unifiedresources.MetadataAlertType: typ,
+ unifiedresources.MetadataAlertLevel: "warning",
+ unifiedresources.MetadataAlertValue: float64(0),
+ unifiedresources.MetadataAlertThreshold: float64(0),
+ }}
+ want := "Alert triggered: resource-incident (warning)"
+ if typ == "cpu" {
+ want = "Alert triggered: cpu (warning 0.0 >= 0.0)"
+ }
+ if got := incidentEventSummaryFromChange(change, IncidentEventAlertFired); got != want {
+ t.Fatalf("%s: got %q, want %q", typ, got, want)
+ }
+ }
+}
diff --git a/internal/alerts/unified_incidents.go b/internal/alerts/unified_incidents.go
index 9b68c77916..71c50d4cf2 100644
--- a/internal/alerts/unified_incidents.go
+++ b/internal/alerts/unified_incidents.go
@@ -82,6 +82,11 @@ func (m *Manager) SyncUnifiedResourceIncidents(resources []unifiedresources.Reso
if !ok {
continue
}
+ // TrueNAS informational conditions remain visible on the resource,
+ // but do not require acknowledgement as actionable incidents.
+ if strings.EqualFold(strings.TrimSpace(incident.Provider), "truenas") && level == AlertLevelInfo {
+ continue
+ }
alert := unifiedIncidentAlert(resource, incident, level, now)
applyCanonicalIdentity(alert, spec.ID, string(spec.Kind))
storageKey := canonicalTrackingKeyForSpec(spec, alert.ID)
diff --git a/internal/alerts/unified_incidents_test.go b/internal/alerts/unified_incidents_test.go
index c0ba4842eb..d4d9f39f96 100644
--- a/internal/alerts/unified_incidents_test.go
+++ b/internal/alerts/unified_incidents_test.go
@@ -1138,3 +1138,31 @@ func TestDeriveCanonicalIdentityDoesNotMutateLegacyAlert(t *testing.T) {
t.Fatalf("deriveCanonicalIdentity mutated legacy alert: %+v", alert)
}
}
+
+// Provider information remains available on the resource without becoming an
+// acknowledgement-required incident. Warnings still activate and clear.
+func TestSyncUnifiedResourceIncidentsTrueNASInformation(t *testing.T) {
+ m := newTestManager(t)
+ configureUnifiedEvalManager(t, m, unifiedEvalBaseConfig())
+ resource := unifiedresources.Resource{
+ ID: "storage:replication", Type: unifiedresources.ResourceTypeStorage,
+ Incidents: []unifiedresources.ResourceIncident{{
+ Provider: "truenas", NativeID: "replication-1", Code: "replication",
+ Severity: storagehealth.RiskMonitor, Summary: "Replication succeeded.",
+ }},
+ }
+ for _, severity := range []storagehealth.RiskLevel{storagehealth.RiskMonitor, storagehealth.RiskWarning, storagehealth.RiskMonitor} {
+ resource.Incidents[0].Severity = severity
+ m.SyncUnifiedResourceIncidents([]unifiedresources.Resource{resource})
+ want := 0
+ if severity == storagehealth.RiskWarning {
+ want = 1
+ }
+ if got := len(m.GetActiveAlerts()); got != want {
+ t.Fatalf("severity %s: active alerts = %d, want %d", severity, got, want)
+ }
+ }
+ if len(resource.Incidents) != 1 {
+ t.Fatal("provider information removed")
+ }
+}