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
Stop stamping Patrol attention rows with evidence-timing noise
rcourtman04d6c43f20c8
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.mdindex 1f0976f498..a33a0cf131 100644--- a/docs/release-control/v6/internal/subsystems/alerts.md+++ b/docs/release-control/v6/internal/subsystems/alerts.md@@ -663,6 +663,14 @@ a second endpoint-only evaluator or alert identity family outsidechecks, the incident `NativeID` selects the exact check evidence envelope thatis copied into the alert and its `OperationalRecord`; the singularcompatibility summary must never substitute evidence from a different target.+An incident with no backing availability check still carries first-class+evidence: the bridge derives a complete/confirmed envelope from the directly+observed incident payload (provider and collector from the incident, digest+payload ref) instead of leaving the alert evidence-less for the legacy partial+shim to backfill. Because each sync re-observes the incident, the bridge merges+the cycle's freshly observed envelopes into the already-active alert, so+raise-time evidence (including availability envelopes with validity windows)+does not age out while the condition is still directly observed.The same lifecycle transition then projects into Patrol like every othercanonical operational record.diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 2dd054903c..30db06b77c 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -969,10 +969,18 @@ explanation-only typed context without action or approval authority. Browserproof is `tests/integration/tests/91-operational-trust-attention-workbench.spec.ts`.The scan row must reduce evidence freshness/completeness into one plain phrase,omit protection posture when its state is unavailable, and use operator language-for meaningful protection states. The selected detail retains the typed evidence-and protection facts, but labels unknown timing, protection state, provider job-state, and history availability explicitly instead of exposing ambiguous raw-value pairs such as `Unknown / Complete`.+for meaningful protection states. Unknown evidence freshness means the backing+source publishes no validity window (only availability-poller evidence does),+so it is not an operator-facing warning: the scan row surfaces an evidence+phrase only for states worth a glance (unavailable, incomplete, stale, or+window-backed current evidence) and stays quiet for complete evidence with+unknown freshness, mirroring the unavailable-protection row rule. The selected+detail retains the typed evidence and protection facts, but labels unknown+timing, protection state, provider job state, and history availability+explicitly instead of exposing ambiguous raw value pairs such as+`Unknown / Complete`; for complete evidence without a validity window it uses+the neutral muted `Evidence recorded` label and must not claim timing is+unavailable while per-envelope observation times render beside it.Attached availability failures use this same queue and detail contract. Theirattention item keeps the owning canonical resource ID, the exactdiff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.jsonindex 40c17880db..92cc058ecb 100644--- a/frontend-modern/browser-verification.json+++ b/frontend-modern/browser-verification.json@@ -1,40 +1,38 @@{"version": 1,- "base_sha": "8bde827941f6c2a0c89da2e1a424e04c175edb5d",- "verified_at": "2026-08-10T05:40:00Z",+ "base_sha": "bcb172c1274b393f1bdd8d51b4fffb7f0585e4bd",+ "verified_at": "2026-08-10T08:55:00Z","result": "passed","changed_paths": [- "frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx",- "frontend-modern/src/stores/updates.ts",- "frontend-modern/src/utils/updatesPresentation.ts"+ "frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx",+ "frontend-modern/src/features/patrol/patrolControlPresentation.ts"],"content_sha256": {- "frontend-modern/src/components/Settings/UpdatesSettingsPanel.tsx": "67dfd5413739e71afff3a8930e5de14a5401f0446ae6a346e2e6354a189715b8",- "frontend-modern/src/stores/updates.ts": "367fc3dcbdedce632209c578b0ba38ecc6aca66800652cf13d6f1a2fb9d0bb83",- "frontend-modern/src/utils/updatesPresentation.ts": "91043539d8b46795d0ded6ead89d11a42d050d86b9662641aa37c8554c0adc6d"+ "frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx": "da3ddd2c2fd5bf94e9642d178c8f60c361b21de3559e6085047e911539301fef",+ "frontend-modern/src/features/patrol/patrolControlPresentation.ts": "1f395d06a16be436f5222cd36259a9585aaa2f7a036399fbfd4ee8b3c98bf12e"},"routes": [- "/settings (System > Pulse server updates panel)"+ "/patrol (Needs attention workbench rows and attention detail drawer)"],"viewports": [{"width": 1280,- "height": 720+ "height": 800},{- "width": 390,- "height": 844+ "width": 744,+ "height": 1024}],"states": [- "Up to date status with no prior check in this browser rendered 'Not checked yet' directly under the status label.",- "Up to date status backed by a three-hour-old cached check (seeded pulse-updates localStorage entry with matching currentVersion, page reloaded) rendered 'Checked 3 hours ago' under the status label.",- "The freshness line rendered on desktop 1280px and mobile 390px viewports without layout breakage next to the existing check-mode footer.",- "Console showed no errors after exercising both states."+ "Attention rows (46 mock alerts, complete + unknown-freshness evidence) render resource name and relative time with no evidence label; the 'Evidence incomplete; timing unavailable' / 'Evidence timing unavailable' warning line is gone from every row.",+ "Attention detail drawer shows the muted 'Evidence recorded' badge next to the state badge, with per-envelope observations reading 'Pulse Complete Confirmed - observed just now'.",+ "Full-page text contains no 'timing unavailable' occurrence in any state exercised at either viewport.",+ "Backend half verified via scratch instance API: /api/ai/patrol/attention returned all 44-46 mock rows with evidenceCompleteness=complete (previously provider-incident rows were partial via the legacy shim)."],"interactions": [- "Logged into the live dev frontend, reached the Pulse server updates panel via settings search.",- "Seeded the pulse-updates localStorage entry with lastCheck three hours in the past and reloaded to exercise the cached-verdict path.",- "Removed the seeded localStorage entry after verification."+ "Ran a scratch mock-mode instance built from this working tree (backend + built dist) on port 7671 with the dev admin bypass.",+ "Opened /patrol at 1280px, read the attention list rows, clicked the vaultwarden memory-limit row, and inspected the detail drawer badges and evidence observations.",+ "Reloaded /patrol at 744px, re-checked the row metadata line, re-opened the detail drawer, and screenshotted the drawer showing 'Evidence recorded'."]}diff --git a/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx b/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsxindex a83e3897be..427108c025 100644--- a/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx+++ b/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx@@ -1099,11 +1099,11 @@ function EvidenceLabel(props: { item: AttentionItem; badge?: boolean }) {if (props.badge) {return (<MetadataBadge tone={presentation().tone} size="xs" shape="rounded">- {presentation().label}+ {presentation().detailLabel}</MetadataBadge>);}- return <span>{presentation().label}</span>;+ return <Show when={presentation().rowLabel}>{(label) => <span>{label()}</span>}</Show>;}function ProtectionLabel(props: { item: AttentionItem; badge?: boolean }) {diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsx b/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsxindex 3168f3fc05..3ce5bdf67e 100644--- a/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsx+++ b/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsx@@ -312,7 +312,8 @@ describe('PatrolAttentionWorkbench', () => {renderWorkbench();const row = await screen.findByRole('button', { name: 'Open Disk pressure on Database VM' });- expect(within(row).getByText('Evidence timing unavailable')).toBeInTheDocument();+ expect(within(row).queryByText(/Evidence/)).not.toBeInTheDocument();+ expect(within(row).queryByText(/timing/i)).not.toBeInTheDocument();expect(within(row).queryByText('Unknown / Complete')).not.toBeInTheDocument();expect(within(row).queryByText(/Protection/)).not.toBeInTheDocument();@@ -321,7 +322,7 @@ describe('PatrolAttentionWorkbench', () => {const detailRegion = await screen.findByRole('complementary', {name: 'Disk pressure on Database VM',});- expect(within(detailRegion).getByText('Evidence timing unavailable')).toBeInTheDocument();+ expect(within(detailRegion).getByText('Evidence recorded')).toBeInTheDocument();expect(within(detailRegion).getByText('Protection status unavailable')).toBeInTheDocument();expect(within(detailRegion).getByText('Job status unavailable')).toBeInTheDocument();expect(within(detailRegion).getByText('History: Complete')).toBeInTheDocument();diff --git a/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.tsindex 42cbc3ebde..cb43247186 100644--- a/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts+++ b/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts@@ -19,25 +19,41 @@ import {describe('patrolControlPresentation', () => {it.each([- ['fresh', 'complete', 'Evidence current', 'success'],- ['stale', 'complete', 'Evidence out of date', 'warning'],- ['unknown', 'complete', 'Evidence timing unavailable', 'warning'],- ['fresh', 'partial', 'Evidence incomplete', 'warning'],- ['stale', 'partial', 'Evidence incomplete and out of date', 'warning'],- ['unknown', 'partial', 'Evidence incomplete; timing unavailable', 'warning'],- ['fresh', 'unavailable', 'Evidence unavailable', 'muted'],- ['stale', 'unavailable', 'Evidence unavailable', 'muted'],- ['unknown', 'unavailable', 'Evidence unavailable', 'muted'],+ ['fresh', 'complete', 'Evidence current', 'Evidence current', 'success'],+ ['stale', 'complete', 'Evidence out of date', 'Evidence out of date', 'warning'],+ ['unknown', 'complete', 'Evidence recorded', undefined, 'muted'],+ ['fresh', 'partial', 'Evidence incomplete', 'Evidence incomplete', 'warning'],+ [+ 'stale',+ 'partial',+ 'Evidence incomplete and out of date',+ 'Evidence incomplete and out of date',+ 'warning',+ ],+ ['unknown', 'partial', 'Evidence incomplete', 'Evidence incomplete', 'warning'],+ ['fresh', 'unavailable', 'Evidence unavailable', 'Evidence unavailable', 'muted'],+ ['stale', 'unavailable', 'Evidence unavailable', 'Evidence unavailable', 'muted'],+ ['unknown', 'unavailable', 'Evidence unavailable', 'Evidence unavailable', 'muted'],] as const)('presents %s/%s evidence as plain operator language',- (freshness, completeness, label, tone) => {- expect(getPatrolAttentionEvidencePresentation(freshness, completeness)).toEqual({- label,- tone,- });+ (freshness, completeness, detailLabel, rowLabel, tone) => {+ const presentation = getPatrolAttentionEvidencePresentation(freshness, completeness);+ expect(presentation.detailLabel).toBe(detailLabel);+ expect(presentation.rowLabel).toBe(rowLabel);+ expect(presentation.tone).toBe(tone);},);+ it('never warns about timing when the evidence source publishes no validity window', () => {+ expect(getPatrolAttentionEvidencePresentation('unknown', 'complete').tone).toBe('muted');+ expect(+ getPatrolAttentionEvidencePresentation('unknown', 'complete').detailLabel,+ ).not.toMatch(/timing/i);+ expect(+ getPatrolAttentionEvidencePresentation('unknown', 'partial').detailLabel,+ ).not.toMatch(/timing/i);+ });+it('keeps meaningful protection states in rows and reserves unavailable state for detail', () => {expect(getPatrolAttentionProtectionPresentation('protected')).toEqual({detailLabel: 'Protected',diff --git a/frontend-modern/src/features/patrol/patrolControlPresentation.ts b/frontend-modern/src/features/patrol/patrolControlPresentation.tsindex a6b0b49cb6..d482d86dd6 100644--- a/frontend-modern/src/features/patrol/patrolControlPresentation.ts+++ b/frontend-modern/src/features/patrol/patrolControlPresentation.ts@@ -55,7 +55,8 @@ export const PATROL_WORKSPACE_QUEUE_TITLE = 'Open work';export const PATROL_WORKSPACE_RUN_RECORD_TITLE = 'Check details';export interface PatrolAttentionEvidencePresentation {- label: string;+ detailLabel: string;+ rowLabel?: string;tone: MetadataBadgeTone;}@@ -65,23 +66,39 @@ export interface PatrolAttentionProtectionPresentation {tone: MetadataBadgeTone;}+// Unknown freshness means the evidence source publishes no validity window+// (only availability probes do today), not that something is wrong — so it+// never warns and never claims "timing unavailable" while the envelope's+// observation time is displayed right next to it. Row labels surface only+// states worth a glance; the expected complete-evidence state stays quiet.export function getPatrolAttentionEvidencePresentation(freshness: EvidenceFreshness,completeness: EvidenceCompleteness,): PatrolAttentionEvidencePresentation {if (completeness === 'unavailable') {- return { label: 'Evidence unavailable', tone: 'muted' };+ return { detailLabel: 'Evidence unavailable', rowLabel: 'Evidence unavailable', tone: 'muted' };}if (completeness === 'complete') {- if (freshness === 'fresh') return { label: 'Evidence current', tone: 'success' };- if (freshness === 'stale') return { label: 'Evidence out of date', tone: 'warning' };- return { label: 'Evidence timing unavailable', tone: 'warning' };+ if (freshness === 'fresh') {+ return { detailLabel: 'Evidence current', rowLabel: 'Evidence current', tone: 'success' };+ }+ if (freshness === 'stale') {+ return {+ detailLabel: 'Evidence out of date',+ rowLabel: 'Evidence out of date',+ tone: 'warning',+ };+ }+ return { detailLabel: 'Evidence recorded', tone: 'muted' };}- if (freshness === 'fresh') return { label: 'Evidence incomplete', tone: 'warning' };if (freshness === 'stale') {- return { label: 'Evidence incomplete and out of date', tone: 'warning' };+ return {+ detailLabel: 'Evidence incomplete and out of date',+ rowLabel: 'Evidence incomplete and out of date',+ tone: 'warning',+ };}- return { label: 'Evidence incomplete; timing unavailable', tone: 'warning' };+ return { detailLabel: 'Evidence incomplete', rowLabel: 'Evidence incomplete', tone: 'warning' };}export function getPatrolAttentionProtectionPresentation(diff --git a/internal/alerts/unified_incidents.go b/internal/alerts/unified_incidents.goindex 542e7ed263..9f21a84cbe 100644--- a/internal/alerts/unified_incidents.go+++ b/internal/alerts/unified_incidents.go@@ -1,6 +1,9 @@package alertsimport (+ "crypto/sha256"+ "encoding/hex"+ "encoding/json""strconv""strings""time"@@ -247,6 +250,14 @@ func (m *Manager) SyncUnifiedResourceIncidents(resources []unifiedresources.Resoexisting.Instance = alert.Instanceexisting.Message = alert.Messageexisting.Metadata = alert.Metadata+ // Each sync re-observes the incident, so carry the cycle's evidence+ // into the live alert. Without this the envelope attached at first+ // raise ages out (availability evidence drifts past its validity+ // window, pre-upgrade alerts keep the legacy partial shim) even+ // though the condition is still directly observed.+ for _, envelope := range alert.Evidence {+ existing.Evidence = appendOperationalEvidence(existing.Evidence, envelope.Clone())+ }applyCanonicalIdentity(existing, alert.CanonicalSpecID, alert.CanonicalKind)m.setActiveAlertNoLock(storageKey, existing)continue@@ -449,10 +460,62 @@ func unifiedIncidentAlert(resource unifiedresources.Resource, incident unifiedrealert.Evidence = []operationaltrust.EvidenceEnvelope{availability.Evidence.Clone(),}+ } else if envelope, ok := unifiedIncidentEvidenceEnvelope(resource, incident, now); ok {+ alert.Evidence = []operationaltrust.EvidenceEnvelope{envelope}}return alert}+// unifiedIncidentEvidenceEnvelope wraps a provider-reported incident in a+// first-class evidence envelope. The incident is the complete, directly+// observed payload backing the alert, so without this the alert would reach+// the operational contract evidence-less and get the legacy partial shim —+// surfacing "Evidence incomplete" on every provider-incident attention row.+func unifiedIncidentEvidenceEnvelope(+ resource unifiedresources.Resource,+ incident unifiedresources.ResourceIncident,+ observedAt time.Time,+) (operationaltrust.EvidenceEnvelope, bool) {+ payload, err := json.Marshal(incident)+ if err != nil {+ return operationaltrust.EvidenceEnvelope{}, false+ }+ digest := sha256.Sum256(payload)+ digestID := hex.EncodeToString(digest[:])+ provider := strings.TrimSpace(incident.Provider)+ if provider == "" {+ provider = "pulse"+ }+ collector := strings.TrimSpace(incident.Source)+ if collector == "" {+ collector = "unified-resource-incident"+ }+ source := operationaltrust.EvidenceSource{+ Provider: provider,+ Collector: collector,+ }+ subject := operationaltrust.EvidenceSubject{ResourceID: resource.ID}+ id, err := operationaltrust.NewEvidenceID(source, subject, observedAt, digestID)+ if err != nil {+ return operationaltrust.EvidenceEnvelope{}, false+ }+ envelope := operationaltrust.EvidenceEnvelope{+ ID: id,+ Source: source,+ Subject: subject,+ ObservedAt: observedAt,+ IngestedAt: observedAt,+ Completeness: operationaltrust.EvidenceComplete,+ Confidence: operationaltrust.EvidenceConfirmed,+ Permissions: operationaltrust.EvidencePermissionsSufficient,+ PayloadRef: &operationaltrust.EvidencePayloadRef{+ Kind: "unified-incident-digest",+ ID: digestID,+ },+ }+ return envelope, envelope.Validate() == nil+}+func unifiedIncidentAlertID(resource unifiedresources.Resource, incident unifiedresources.ResourceIncident) string {keyParts := []string{resource.ID, incident.Provider, incident.NativeID, incident.Code}return unifiedIncidentAlertPrefix + sanitizeAlertKey(strings.Join(keyParts, "-"))diff --git a/internal/alerts/unified_incidents_test.go b/internal/alerts/unified_incidents_test.goindex a94ad3addc..c0ba4842eb 100644--- a/internal/alerts/unified_incidents_test.go+++ b/internal/alerts/unified_incidents_test.go@@ -75,6 +75,81 @@ func TestSyncUnifiedResourceIncidentsCreatesAndClearsAlerts(t *testing.T) {assertAlertMissing(t, m, alertID)}+func TestSyncUnifiedResourceIncidentsAttachesFirstClassIncidentEvidence(t *testing.T) {+ m := newTestManager(t)+ configureUnifiedEvalManager(t, m, unifiedEvalBaseConfig())++ resource := unifiedresources.Resource{+ ID: "storage:tank",+ Type: unifiedresources.ResourceTypeStorage,+ Name: "tank",+ ParentName: "truenas-main",+ Sources: []unifiedresources.DataSource{unifiedresources.SourceTrueNAS},+ Storage: &unifiedresources.StorageMeta{+ Platform: "truenas",+ Topology: "pool",+ Protection: "zfs",+ IsZFS: true,+ },+ Incidents: []unifiedresources.ResourceIncident{{+ Provider: "truenas",+ NativeID: "alert-1",+ Code: "truenas_volume_status",+ Severity: storagehealth.RiskWarning,+ Source: "alerts",+ Summary: "Pool tank is DEGRADED",+ }},+ }++ m.SyncUnifiedResourceIncidents([]unifiedresources.Resource{resource})++ alertID := buildCanonicalStateID(resource.ID, "alertspec:provider-incident:6d90d4cfe0dab6cc")+ m.mu.RLock()+ alert := testRequireActiveAlert(t, m, alertID)+ m.mu.RUnlock()++ if len(alert.Evidence) != 1 {+ t.Fatalf("evidence count = %d, want 1", len(alert.Evidence))+ }+ envelope := alert.Evidence[0]+ if envelope.Completeness != operationaltrust.EvidenceComplete {+ t.Fatalf("completeness = %q, want complete (legacy partial shim must not back a directly observed incident)", envelope.Completeness)+ }+ if envelope.Confidence != operationaltrust.EvidenceConfirmed {+ t.Fatalf("confidence = %q, want confirmed", envelope.Confidence)+ }+ if envelope.Source.Provider != "truenas" || envelope.Source.Collector != "alerts" {+ t.Fatalf("source = %+v, want provider truenas / collector alerts", envelope.Source)+ }+ if envelope.Subject.ResourceID != resource.ID {+ t.Fatalf("subject resource = %q, want %q", envelope.Subject.ResourceID, resource.ID)+ }+ if envelope.PayloadRef == nil || envelope.PayloadRef.Kind != "unified-incident-digest" {+ t.Fatalf("payload ref = %+v, want unified-incident-digest", envelope.PayloadRef)+ }+ if alert.OperationalRecord == nil || len(alert.OperationalRecord.EvidenceIDs) != 1 ||+ alert.OperationalRecord.EvidenceIDs[0] != envelope.ID {+ t.Fatalf("operational record evidence ids = %+v, want [%s]", alert.OperationalRecord, envelope.ID)+ }++ // A later sync re-observes the incident: the live alert keeps accumulating+ // the freshly observed envelopes instead of pinning the raise-time one.+ m.SyncUnifiedResourceIncidents([]unifiedresources.Resource{resource})+ m.mu.RLock()+ refreshed := testRequireActiveAlert(t, m, alertID)+ m.mu.RUnlock()+ if len(refreshed.Evidence) < 1 {+ t.Fatalf("refreshed evidence count = %d, want >= 1", len(refreshed.Evidence))+ }+ latest := refreshed.Evidence[len(refreshed.Evidence)-1]+ if latest.ObservedAt.Before(envelope.ObservedAt) {+ t.Fatalf("latest evidence observedAt %v predates raise-time %v", latest.ObservedAt, envelope.ObservedAt)+ }+ if latest.Completeness != operationaltrust.EvidenceComplete {+ t.Fatalf("refreshed completeness = %q, want complete", latest.Completeness)+ }+}+func TestSyncUnifiedResourceIncidentsRoutesAttachedCheckThroughSourceOwnedLifecycle(t *testing.T) {m := newTestManager(t)configureUnifiedEvalManager(t, m, unifiedEvalBaseConfig())diff --git a/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts b/tests/integration/tests/91-operational-trust-attention-workbench.spec.tsindex 6547aa7496..df3992fee5 100644--- a/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts+++ b/tests/integration/tests/91-operational-trust-attention-workbench.spec.ts@@ -745,9 +745,8 @@ test("makes active operational work primary and preserves the evidence boundary"await expect(queue.getByText("Connection state unknown for pve-edge"),).toBeVisible();- await expect(- queue.getByText("Evidence incomplete; timing unavailable"),- ).toBeVisible();+ await expect(queue.getByText("Evidence incomplete")).toBeVisible();+ await expect(queue.getByText(/timing unavailable/)).toHaveCount(0);await expect(queue.getByText("Protection Unknown")).toHaveCount(0);await expect(queue.getByText("Unknown / Partial")).toHaveCount(0);await selectAttentionState(page, "Recent resolved 1", "resolved");