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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Align Patrol coverage text with run history
rcourtman77d496f70eb2
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 89a5ae4430..0620cbf389 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -469,6 +469,10 @@ derive `Health A` or `100/100` from "no active findings" alone when recentPatrol evidence is limited to alert-scoped runs or includes recent Patrol runerrors; the summary must degrade and explain that overall infrastructure healthis not fully verified until a recent successful full Patrol run exists.+That coverage explanation must also stay faithful to the actual recent run+shape. When the most recent verification evidence includes a full Patrol run+that ended with errors, the health summary must say that a recent full patrol+errored rather than claiming recent activity was limited to scoped runs.The Patrol startup scheduler must preserve that coverage guarantee as well:`internal/ai/patrol_run.go` may skip the startup full patrol only when recentrun history already includes a successful full Patrol run, not merely becausediff --git a/internal/ai/intelligence.go b/internal/ai/intelligence.goindex 75333eb8c5..6e76aec033 100644--- a/internal/ai/intelligence.go+++ b/internal/ai/intelligence.go@@ -1073,11 +1073,15 @@ func summarizeRecentPatrolCoverage(var recentErrors intvar hasSuccessfulFullRun bool+ var hasRecentFullRun boolvar scopedRuns intfor _, run := range relevant {if run.ErrorCount > 0 || strings.EqualFold(strings.TrimSpace(run.Status), "error") {recentErrors++}+ if !isScopedPatrolRun(run) {+ hasRecentFullRun = true+ }if isSuccessfulFullPatrolRun(run) {hasSuccessfulFullRun = true}@@ -1087,6 +1091,12 @@ func summarizeRecentPatrolCoverage(}switch {+ case !hasSuccessfulFullRun && hasRecentFullRun && recentErrors > 0:+ return patrolCoverageFactor{+ name: "Patrol coverage incomplete",+ description: "Patrol coverage is incomplete: a recent full patrol ended with errors, so overall health is not fully verified.",+ impact: 35,+ }, truecase !hasSuccessfulFullRun && recentErrors > 0:return patrolCoverageFactor{name: "Patrol coverage incomplete",diff --git a/internal/ai/intelligence_coverage_test.go b/internal/ai/intelligence_coverage_test.goindex 6a5eb6ee1d..9c27a060b4 100644--- a/internal/ai/intelligence_coverage_test.go+++ b/internal/ai/intelligence_coverage_test.go@@ -199,6 +199,56 @@ func TestIntelligence_GetSummary_DegradesWhenRecentPatrolCoverageIsScopedAndErro}}+func TestIntelligence_GetSummary_DegradesWhenRecentFullPatrolErrored(t *testing.T) {+ intel := NewIntelligence(IntelligenceConfig{})+ runHistory := NewPatrolRunHistoryStore(10)+ now := time.Now()+ runHistory.Add(PatrolRunRecord{+ ID: "patrol-error-1",+ Type: "patrol",+ TriggerReason: "startup",+ CompletedAt: now.Add(-1 * time.Minute),+ ErrorCount: 1,+ Status: "error",+ ResourcesChecked: 58,+ })+ runHistory.Add(PatrolRunRecord{+ ID: "scoped-error-1",+ Type: "scoped",+ TriggerReason: "alert_fired",+ CompletedAt: now.Add(-30 * time.Second),+ ErrorCount: 1,+ Status: "error",+ ResourcesChecked: 1,+ })+ intel.SetRunHistoryStore(runHistory)++ summary := intel.GetSummary()+ if summary.OverallHealth.Score >= 100 {+ t.Fatalf("expected reduced health score, got %f", summary.OverallHealth.Score)+ }+ if summary.OverallHealth.Grade == HealthGradeA {+ t.Fatalf("expected non-A grade, got %s", summary.OverallHealth.Grade)+ }+ want := "Patrol coverage is incomplete: a recent full patrol ended with errors, so overall health is not fully verified."+ if summary.OverallHealth.Prediction != want {+ t.Fatalf("expected full-patrol coverage warning, got %q", summary.OverallHealth.Prediction)+ }+ foundCoverageFactor := false+ for _, factor := range summary.OverallHealth.Factors {+ if factor.Category != "coverage" {+ continue+ }+ foundCoverageFactor = true+ if factor.Description != want {+ t.Fatalf("expected matching coverage factor description, got %q", factor.Description)+ }+ }+ if !foundCoverageFactor {+ t.Fatal("expected coverage factor in overall health")+ }+}+func TestIntelligence_getLearningStats(t *testing.T) {intel := NewIntelligence(IntelligenceConfig{})knowledgeStore, err := knowledge.NewStore(t.TempDir())