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
Attribute operator-driven Mark resolved closures as "Resolved by you"
rcourtman2bd4621b7690
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex fbfb60106c..e4b212528c 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -924,6 +924,13 @@ persistence-recovery resync must copy `f.RemindAt` onto the unifiedfinding so the operator's commitment survives a reboot or processrestart instead of silently lapsing into the canonical findings storewithout being mirrored on the API surface.+The same router boundary now also threads `Finding.AutoResolved`+through to `UnifiedFinding.AutoResolved` so an operator who manually+clicked Mark resolved before a restart keeps that attribution after+the agent reloads findings from disk. Without that mirror the+recovery sync would flatten every prior closure into Pulse's+auto-detection bucket and erase the operator-vs-Pulse distinction+across process restarts.Linux agent privilege hardening is now part of the installer/runtime contract.The supported full-telemetry systemd agent may still run as `root`, butdiff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 3e76760128..875232f1b6 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -1561,3 +1561,13 @@ canonical `/api/ai/patrol/resolve` endpoint owned by`HandleResolveFinding` in `internal/api/ai_handlers.go`, mirroring theacknowledge / snooze / dismiss client surface so the same Patrol servicecontract drives every operator-feedback action.+The `unified.UnifiedFinding` mirror also carries an explicit+`AutoResolved` flag alongside `ResolvedAt`, set by the canonical+`Finding.AutoResolved` field. The AddFromAI dedup-merge path must+mirror that flag (allowing flips between auto-detected closure and+operator-driven closure as the canonical store transitions), and the+Finding to UnifiedFinding conversion in `internal/api/router.go` must+copy `f.AutoResolved` on both the live wire-up callback and the+persistence-recovery resync, so the frontend can honestly attribute who+closed the loop instead of flattening every resolution into a generic+"resolved" state.diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex d7c2417026..1e86d7bbc9 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -1037,7 +1037,19 @@ the canonical monitored-system blocked payload.must post `{finding_id}` to that endpoint and surface the booleanresult through `aiIntelligenceStore.resolveFinding` so the operatorsurface gets uniform refresh and error UX with acknowledge / snooze- / dismiss+ / dismiss.+ The same `UnifiedFindingRecord` shape also carries `auto_resolved`,+ the operator-vs-Pulse attribution flag set by the canonical findings+ store. The store normalizer must promote it to camelCase+ `autoResolved` on `UnifiedFinding`, the Finding to UnifiedFinding+ conversion in `internal/api/router.go` must copy `f.AutoResolved`,+ and the AddFromAI dedup-merge path must mirror it onto the existing+ record. The frontend resolution-reason helper must use that flag to+ attribute operator-driven Mark resolved closures as "Resolved by+ you" instead of generic auto-detection copy, while keeping Patrol's+ own fix outcomes (`fix_verified`, `fix_executed`, `resolved`)+ priority because those describe Pulse's actual remediation rather+ than mere auto-detectionand the Assistant finding-context request contract, so `/api/ai/chat`payloads carrying `finding_id` may hydrate a structured investigationsummary from the unified finding, but raw proposed-fix commands must staydiff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 3ef623c7cc..5ee919e8a0 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -1124,3 +1124,12 @@ to `status === 'active'` (the server rejects double-resolves) and isvisually distinct (emerald accent) from the destructive dismisscontrols; it must route through the shared store action so the refreshand error UX stays uniform with acknowledge, snooze, and dismiss.+That same surface must also attribute closures honestly using the+`autoResolved` flag now plumbed through `UnifiedFinding`. Resolution+copy reads "Resolved by you <time>" when `autoResolved === false` and+the finding is not a Patrol fix outcome (`fix_verified`, `fix_executed`,+`resolved`), so the operator timeline reads as "you closed this" rather+than "auto-resolved" when the operator clicked Mark resolved+themselves. Patrol-driven fix outcomes keep their existing copy because+those describe Pulse's actual remediation, which is more specific than+mere auto-detection.diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex 66f178b2d1..f41248a677 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -1250,4 +1250,7 @@ will_fix_later remind-at deadline scoped to a single optional pointer(`*time.Time`) per finding on both API write paths, so adding theoperational-commitment field does not regress the unified-findings hotpath with a per-row allocation when the dismissal reason is anything-other than `will_fix_later`.+other than `will_fix_later`. The newer `AutoResolved` attribution flag+on the same UnifiedFinding shape stays a fixed-size `bool` in the same+struct, so the operator-vs-Pulse closure attribution adds no per-row+allocation pressure on the same hot path.diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex abe8ee6512..ebd5eb8006 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -953,6 +953,12 @@ durable state when re-hydrating findings from disk into the unifiedstore. Persisted `Finding.RemindAt` values must round-trip through thatrecovery path so an operator commitment recorded before a processrestart is not silently dropped when findings reload.+That same recovery path also preserves the operator-vs-Pulse+attribution captured in `Finding.AutoResolved`. The router boundary+must copy that flag onto `UnifiedFinding.AutoResolved` during both+live wire-up and persistence resync so a finding the operator+manually closed before a restart still reads as "Resolved by you"+afterward, instead of being misattributed to Pulse's auto-detection.`StorageSummary.tsx`, `StoragePageSummary.tsx`, and `useStoragePageSummary.ts`now surface `poolsDegraded` and `disksFailing` health indicators alongsidediff --git a/frontend-modern/src/api/__tests__/ai.test.ts b/frontend-modern/src/api/__tests__/ai.test.tsindex 7b536cef0f..583c4f74dc 100644--- a/frontend-modern/src/api/__tests__/ai.test.ts+++ b/frontend-modern/src/api/__tests__/ai.test.ts@@ -520,4 +520,51 @@ describe('AIAPI', () => {}),);});++ it('preserves auto_resolved on UnifiedFinding payloads for operator-vs-Pulse closure attribution', async () => {+ // The TS UnifiedFindingRecord must round-trip the auto_resolved boolean+ // verbatim from the backend so the surface can attribute Mark resolved+ // closures (auto_resolved=false) distinctly from Pulse's auto-detection+ // (auto_resolved=true). Without this the operator timeline flattens+ // "you closed this" into generic "condition cleared" copy.+ apiFetchJSONMock.mockResolvedValueOnce({+ findings: [+ {+ id: 'f-manual-close',+ resource_id: 'vm-101',+ resource_name: 'db-01',+ resource_type: 'vm',+ source: 'threshold',+ severity: 'warning',+ category: 'performance',+ title: 'CPU high',+ description: 'CPU usage was high',+ detected_at: '2026-05-09T10:00:00Z',+ last_seen_at: '2026-05-09T10:30:00Z',+ resolved_at: '2026-05-09T11:00:00Z',+ auto_resolved: false,+ },+ {+ id: 'f-auto-close',+ resource_id: 'vm-102',+ resource_name: 'web-01',+ resource_type: 'vm',+ source: 'threshold',+ severity: 'warning',+ category: 'performance',+ title: 'CPU high',+ description: 'CPU usage was high',+ detected_at: '2026-05-09T10:00:00Z',+ last_seen_at: '2026-05-09T10:30:00Z',+ resolved_at: '2026-05-09T11:00:00Z',+ auto_resolved: true,+ },+ ],+ count: 2,+ } as never);++ const result = await AIAPI.getUnifiedFindings();+ expect(result.findings[0]?.auto_resolved).toBe(false);+ expect(result.findings[1]?.auto_resolved).toBe(true);+ });});diff --git a/frontend-modern/src/api/ai.ts b/frontend-modern/src/api/ai.tsindex ffe250a9a8..bf222cb957 100644--- a/frontend-modern/src/api/ai.ts+++ b/frontend-modern/src/api/ai.ts@@ -457,6 +457,10 @@ export interface UnifiedFindingRecord {detected_at: string;last_seen_at?: string;resolved_at?: string;+ // auto_resolved distinguishes Pulse's own auto-detection of the condition+ // clearing (true) from an operator-driven manual "Mark resolved" (false),+ // so the surface can attribute who closed the loop.+ auto_resolved?: boolean;acknowledged_at?: string;snoozed_until?: string;dismissed_reason?: string;diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.tsindex ec16ebebed..0fdaf628a7 100644--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts@@ -989,5 +989,57 @@ describe('aiFindingPresentation', () => {),).toBe('Fixed by Patrol 1h ago');});++ it('attributes operator-driven Mark resolved closures to "Resolved by you"', () => {+ // Slice 22 added the manual Mark resolved button which sets+ // auto_resolved=false. The resolution-reason copy must distinguish+ // operator-driven closure from Pulse's auto-detection so the timeline+ // reads honestly. This branch must take priority over the+ // category-specific "Condition cleared" / "CPU returned to normal"+ // copy (those describe Pulse's auto-detection).+ expect(+ getFindingResolutionReason(+ {+ isThreshold: true,+ source: 'threshold',+ alertType: 'cpu',+ investigationOutcome: undefined,+ autoResolved: false,+ } as never,+ '5m ago',+ ),+ ).toBe('Resolved by you 5m ago');++ expect(+ getFindingResolutionReason(+ {+ isThreshold: false,+ source: 'ai-patrol',+ alertType: undefined,+ investigationOutcome: 'cannot_fix',+ autoResolved: false,+ } as never,+ '20m ago',+ ),+ ).toBe('Resolved by you 20m ago');+ });++ it('keeps Patrol fix-applied copy when Pulse closed the loop autonomously', () => {+ // Patrol's own fix outcomes (fix_verified, fix_executed, resolved) are+ // more specific than "auto-resolved" — they describe Pulse's actual+ // remediation. The autoResolved branch must NOT override those.+ expect(+ getFindingResolutionReason(+ {+ isThreshold: false,+ source: 'ai-patrol',+ alertType: undefined,+ investigationOutcome: 'fix_verified',+ autoResolved: true,+ } as never,+ '2h ago',+ ),+ ).toBe('Fixed by Patrol 2h ago');+ });});});diff --git a/frontend-modern/src/stores/__tests__/aiIntelligence.test.ts b/frontend-modern/src/stores/__tests__/aiIntelligence.test.tsindex 88585e89d4..a2228b416b 100644--- a/frontend-modern/src/stores/__tests__/aiIntelligence.test.ts+++ b/frontend-modern/src/stores/__tests__/aiIntelligence.test.ts@@ -143,6 +143,40 @@ describe('aiIntelligenceStore', () => {});});+ it('promotes auto_resolved to camelCase autoResolved on the unified-finding store record', async () => {+ // The store-level UnifiedFinding is what render code reads when it asks+ // "who closed this loop?" If the normalizer drops auto_resolved, the+ // resolution-reason copy can't differentiate operator-driven Mark+ // resolved from Pulse's own auto-detection. Pin the field promotion so+ // the attribution doesn't silently regress.+ vi.mocked(AIAPI.getUnifiedFindings).mockResolvedValueOnce({+ findings: [+ {+ id: 'unified-manual-close',+ source: 'threshold',+ severity: 'warning',+ category: 'performance',+ resource_id: 'vm-101',+ resource_name: 'db-01',+ resource_type: 'vm',+ title: 'CPU high',+ description: 'CPU high',+ detected_at: '2026-05-09T10:00:00Z',+ last_seen_at: '2026-05-09T10:30:00Z',+ resolved_at: '2026-05-09T11:00:00Z',+ auto_resolved: false,+ },+ ],+ } as never);++ await aiIntelligenceStore.loadFindings();+ expect(aiIntelligenceStore.findings).toHaveLength(1);+ expect(aiIntelligenceStore.findings[0]).toMatchObject({+ id: 'unified-manual-close',+ autoResolved: false,+ });+ });+it('routes Mark resolved through the canonical patrol resolve client and refreshes both finding sources', async () => {// The Patrol surface's manual Mark resolved button must go through// aiIntelligenceStore.resolveFinding so the refresh and error UX staysdiff --git a/frontend-modern/src/stores/aiIntelligence.ts b/frontend-modern/src/stores/aiIntelligence.tsindex 6742ca516a..a03c883c36 100644--- a/frontend-modern/src/stores/aiIntelligence.ts+++ b/frontend-modern/src/stores/aiIntelligence.ts@@ -156,6 +156,10 @@ export interface UnifiedFinding {// the deadline at dismiss time and (b) badge dismissed rows with "Reminding// <date>" so the operator sees their pending commitment.remindAt?: string;+ // autoResolved is true when Pulse's own detection logic auto-cleared the+ // condition; false when the operator manually clicked Mark resolved. The+ // resolution-reason copy uses this to attribute who closed the loop.+ autoResolved?: boolean;status: 'active' | 'resolved' | 'dismissed' | 'snoozed';correlatedFindingIds?: string[];remediationPlanId?: string;@@ -222,6 +226,7 @@ function normalizeUnifiedFindingRecord(item: UnifiedFindingRecord, now: number):dismissedReason: item.dismissed_reason,userNote: item.user_note,remindAt: item.remind_at,+ autoResolved: item.auto_resolved,status: normalizeFindingStatus(item, now),correlatedFindingIds: item.correlated_ids,remediationPlanId: item.remediation_id,@@ -263,6 +268,7 @@ function normalizePatrolFindingRecord(item: PatrolFinding, now: number): UnifieddismissedReason: item.dismissed_reason,userNote: item.user_note,remindAt: item.remind_at,+ autoResolved: item.auto_resolved,status: normalizeFindingStatus(item, now),investigationSessionId: item.investigation_session_id || '',investigationStatus: validateInvestigationStatus(item.investigation_status),diff --git a/frontend-modern/src/utils/aiFindingPresentation.ts b/frontend-modern/src/utils/aiFindingPresentation.tsindex a81637f79f..c1ba774d8c 100644--- a/frontend-modern/src/utils/aiFindingPresentation.ts+++ b/frontend-modern/src/utils/aiFindingPresentation.ts@@ -627,9 +627,26 @@ export const formatFindingLifecycleType = (value: string): string =>FINDING_LIFECYCLE_LABELS[value] || formatIdentifierLabel(value);export const getFindingResolutionReason = (- finding: Pick<UnifiedFinding, 'isThreshold' | 'source' | 'alertType' | 'investigationOutcome'>,+ finding: Pick<+ UnifiedFinding,+ 'isThreshold' | 'source' | 'alertType' | 'investigationOutcome' | 'autoResolved'+ >,resolvedTime: string,): string => {+ // Operator-driven manual resolution takes priority over the+ // category-specific copy: "Resolved by you" tells the operator (and any+ // teammate revisiting the timeline) that this closure was their action,+ // not Pulse's auto-detection. Patrol auto-resolution paths (fix_verified,+ // fix_executed) keep their existing copy because they describe Pulse's own+ // remediation outcome, which is more specific than "auto-resolved by Pulse".+ if (+ finding.autoResolved === false &&+ finding.investigationOutcome !== 'fix_verified' &&+ finding.investigationOutcome !== 'fix_executed' &&+ finding.investigationOutcome !== 'resolved'+ ) {+ return `Resolved by you ${resolvedTime}`;+ }if (finding.isThreshold || finding.source === 'threshold') {switch (finding.alertType || '') {case 'powered-off':diff --git a/internal/ai/unified/alerts.go b/internal/ai/unified/alerts.goindex da54edf9a0..d796d81b3a 100644--- a/internal/ai/unified/alerts.go+++ b/internal/ai/unified/alerts.go@@ -115,6 +115,12 @@ type UnifiedFinding struct {DetectedAt time.Time `json:"detected_at"`LastSeenAt time.Time `json:"last_seen_at"`ResolvedAt *time.Time `json:"resolved_at,omitempty"`+ // AutoResolved distinguishes Pulse's auto-detection of the condition+ // clearing from an operator-driven manual "Mark resolved" action. Used by+ // the surface to attribute who closed the loop ("Resolved by you" vs+ // "Pulse auto-resolved") so operational memory of operator actions is+ // preserved instead of being flattened into a single "resolved" state.+ AutoResolved bool `json:"auto_resolved"`// User feedbackAcknowledgedAt *time.Time `json:"acknowledged_at,omitempty"`@@ -170,6 +176,7 @@ type unifiedFindingJSON struct {DetectedAt time.Time `json:"detected_at"`LastSeenAt time.Time `json:"last_seen_at"`ResolvedAt *time.Time `json:"resolved_at,omitempty"`+ AutoResolved bool `json:"auto_resolved"`AcknowledgedAt *time.Time `json:"acknowledged_at,omitempty"`SnoozedUntil *time.Time `json:"snoozed_until,omitempty"`DismissedReason string `json:"dismissed_reason,omitempty"`@@ -221,6 +228,7 @@ func (f UnifiedFinding) MarshalJSON() ([]byte, error) {DetectedAt: f.DetectedAt,LastSeenAt: f.LastSeenAt,ResolvedAt: f.ResolvedAt,+ AutoResolved: f.AutoResolved,AcknowledgedAt: f.AcknowledgedAt,SnoozedUntil: f.SnoozedUntil,DismissedReason: f.DismissedReason,@@ -277,6 +285,7 @@ func (f *UnifiedFinding) UnmarshalJSON(data []byte) error {DetectedAt: payload.DetectedAt,LastSeenAt: payload.LastSeenAt,ResolvedAt: payload.ResolvedAt,+ AutoResolved: payload.AutoResolved,AcknowledgedAt: payload.AcknowledgedAt,SnoozedUntil: payload.SnoozedUntil,DismissedReason: payload.DismissedReason,@@ -656,6 +665,7 @@ func (s *UnifiedStore) AddFromAI(finding *UnifiedFinding) (*UnifiedFinding, bool}// Allow reopening by clearing ResolvedAt if the incoming finding is active again.existing.ResolvedAt = finding.ResolvedAt+ existing.AutoResolved = finding.AutoResolved// Investigation fields (allow clearing)existing.InvestigationSessionID = finding.InvestigationSessionIDdiff --git a/internal/ai/unified/alerts_test.go b/internal/ai/unified/alerts_test.goindex bd12fafe0d..56be5dfe99 100644--- a/internal/ai/unified/alerts_test.go+++ b/internal/ai/unified/alerts_test.go@@ -557,6 +557,70 @@ func TestCategoryMapping(t *testing.T) {}}+func TestUnifiedStore_AddFromAI_MirrorsAutoResolved(t *testing.T) {+ // AutoResolved distinguishes Pulse's own auto-detection of the condition+ // clearing from an operator-driven manual Mark resolved. The unified+ // store mirror must propagate that flag onto the existing record so the+ // API surface can attribute the closure honestly. This test pins the+ // dedup-merge AutoResolved propagation.+ store := NewUnifiedStore(DefaultAlertToFindingConfig())+ store.AddFromAI(&UnifiedFinding{+ ID: "ai-auto",+ Source: SourceAIPatrol,+ Severity: SeverityWarning,+ Category: CategoryReliability,+ ResourceID: "vm-101",+ ResourceName: "db-01",+ ResourceType: "vm",+ Title: "CPU sustained high",+ })+ resolved := time.Date(2026, 5, 9, 11, 0, 0, 0, time.UTC)++ // First resolution: Pulse's auto-detection cleared the condition.+ store.AddFromAI(&UnifiedFinding{+ ID: "ai-auto",+ Source: SourceAIPatrol,+ Severity: SeverityWarning,+ Category: CategoryReliability,+ ResourceID: "vm-101",+ ResourceName: "db-01",+ ResourceType: "vm",+ Title: "CPU sustained high",+ ResolvedAt: &resolved,+ AutoResolved: true,+ })+ got := store.Get("ai-auto")+ if got == nil {+ t.Fatal("expected finding to exist after merge")+ }+ if !got.AutoResolved {+ t.Errorf("AutoResolved must mirror true through dedup-merge; got %v", got.AutoResolved)+ }++ // Second resolution: operator manually re-resolved (e.g. after a+ // regression they fixed out-of-band). The flag must flip to false so+ // the surface stops attributing closure to Pulse's auto-detection.+ store.AddFromAI(&UnifiedFinding{+ ID: "ai-auto",+ Source: SourceAIPatrol,+ Severity: SeverityWarning,+ Category: CategoryReliability,+ ResourceID: "vm-101",+ ResourceName: "db-01",+ ResourceType: "vm",+ Title: "CPU sustained high",+ ResolvedAt: &resolved,+ AutoResolved: false,+ })+ got = store.Get("ai-auto")+ if got == nil {+ t.Fatal("expected finding to still exist after manual close")+ }+ if got.AutoResolved {+ t.Errorf("AutoResolved must mirror false on manual close; got %v", got.AutoResolved)+ }+}+func TestUnifiedStore_AddFromAI_MirrorsRemindAt(t *testing.T) {// RemindAt is the will_fix_later wake-up deadline persisted on the// canonical findings store. The unified store mirrors finding state fordiff --git a/internal/api/router.go b/internal/api/router.goindex fccc491701..ff66b3cbc7 100644--- a/internal/api/router.go+++ b/internal/api/router.go@@ -1725,6 +1725,7 @@ func (r *Router) startPatrolForContext(ctx context.Context, orgID string) bool {DetectedAt: f.DetectedAt,LastSeenAt: f.LastSeenAt,ResolvedAt: f.ResolvedAt,+ AutoResolved: f.AutoResolved,InvestigationSessionID: f.InvestigationSessionID,InvestigationStatus: f.InvestigationStatus,InvestigationOutcome: f.InvestigationOutcome,@@ -1790,6 +1791,7 @@ func (r *Router) startPatrolForContext(ctx context.Context, orgID string) bool {DetectedAt: f.DetectedAt,LastSeenAt: f.LastSeenAt,ResolvedAt: f.ResolvedAt,+ AutoResolved: f.AutoResolved,InvestigationSessionID: f.InvestigationSessionID,InvestigationStatus: f.InvestigationStatus,InvestigationOutcome: f.InvestigationOutcome,