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
Scope Patrol findings controls to selected runs
rcourtman32f01e7df9ce
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 714e60b104..4845012253 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -202,12 +202,6 @@ the latest completed activity was only a scoped run, the summary should labelthat timestamp as `Last activity` instead of `Last patrol`; `Last full patrol`belongs only to the most recent completed full Patrol run.That same recency contract also applies to the header metadata row. The top-That same empty-state contract must become run-snapshot-aware when the user is-filtering findings to an explicit Patrol run. A selected run with an explicit-empty `finding_ids` snapshot should explain that no findings were recorded for-that run and, when applicable, carry the canonical run coverage summary and-issue caveat instead of falling back to the generic `No Patrol findings to-display` copy.header must not revert to a generic `Last:` timestamp when the rest of Patrolis explicitly distinguishing activity from full verification recency.That summary surface must also avoid reintroducing a second compact assessment@@ -251,6 +245,16 @@ Patrol page, `frontend-modern/src/components/AI/FindingsPanel.tsx` shouldexplain the absence of active findings without repeating `Last activity`,`Next run`, or interval schedule details that already belong to the header andverification hierarchy above.+That same empty-state contract must become run-snapshot-aware when the user is+filtering findings to an explicit Patrol run. A selected run with an explicit+empty `finding_ids` snapshot should explain that no findings were recorded for+that run and, when applicable, carry the canonical run coverage summary and+issue caveat instead of falling back to the generic `No Patrol findings to+display` copy.+That same snapshot scoping must apply to the findings control bar too. When the+user is looking at an explicit run snapshot, filter pills and their attention+or approval counts must derive from that snapshot-scoped finding set rather+than borrowing global Patrol finding counts from outside the selected run.That same findings surface should keep its section chrome functional ratherthan promotional. Inside the Patrol findings tab, the selected tab alreadynames the surface, so the findings card should not add another in-card product@@ -372,11 +376,6 @@ and the resource drawer both reflect the same learned edge evidence insteadof each page fetching its own copy. Both surfaces now render that evidencethrough the shared `frontend-modern/src/components/Infrastructure/ResourceCorrelationSummary.tsx`card, so the correlation layout stays governed by one component instead of-Within that same run-history surface, coverage copy must stay canonical across-the header chips, narrative summary, and selected-run snapshot. Scoped runs-must not present scope size and checked-resource count as contradictory-independent facts; the shared run presenter should collapse them into one-coverage statement such as `Checked 1 of 2 scoped resources`.two page-local card implementations. That shared card also owns thecorrelation ordering and truncation rule, so the page and drawer hand it rawcorrelation lists instead of slicing or re-sorting them locally.@@ -423,20 +422,25 @@ dedicated `frontend-modern/src/features/patrol/patrolInvestigationContextModel.towner, so the Patrol hook composes one canonical payload-to-summary derivationinstead of rebuilding recent-change, correlation, and governed-resource countcopy inline.+The Patrol page's run-history tab label is now also tightened to `Runs`, while+the underlying run-history panel remains canonical for snapshot filtering and+tool-call inspection. That copy change is intentional: run history is support+context for Patrol findings, not a peer primary workflow beside findings.+Within that same run-history surface, coverage copy must stay canonical across+the header chips, narrative summary, and selected-run snapshot. Scoped runs+must not present scope size and checked-resource count as contradictory+independent facts; the shared run presenter should collapse them into one+coverage statement such as `Checked 1 of 2 scoped resources`, and zero-coverage+scoped runs should fail closed as `Checked 0 of N scoped resources` rather+than drifting back to a scope-only headline.That same normalization applies to supporting effort strips inside the expanded-Zero-coverage scoped runs must also fail closed as `Checked 0 of N scoped-resources` rather than drifting back to a scope-only headline.run card. Once the run presenter is already carrying canonical coverage copy,secondary chips must not reintroduce a raw `Scoped to N resources` variant that+re-opens the same ambiguity.That same zero-coverage rule also applies to the expanded narrative sentence.When Patrol checked none of a known scoped set, the run summary must still say`Checked 0 of N scoped resources` rather than reverting to a generic `Patrolcompleted` sentence that hides the failed coverage.-re-opens the same ambiguity.-The Patrol page's run-history tab label is now also tightened to `Runs`, while-the underlying run-history panel remains canonical for snapshot filtering and-tool-call inspection. That copy change is intentional: run history is support-context for Patrol findings, not a peer primary workflow beside findings.The Patrol page and resource drawer now also share the canonical`frontend-modern/src/utils/resourceChangePresentation.ts` formatter sorecent-change kind and headline wording stays aligned wherever the canonicaldiff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsxindex efe48d9ec5..926e9777b9 100644--- a/frontend-modern/src/components/AI/FindingsPanel.tsx+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx@@ -68,6 +68,10 @@ interface FindingsPanelProps {showControls?: boolean;scopeResourceIds?: string[];scopeResourceTypes?: string[];+ showScopeWarnings?: boolean;+ runtimeState?: PatrolRuntimeState;+ blockedReason?: string;+ overallHealth?: IntelligenceHealthScore;runSnapshot?: Pick<PatrolRunRecord,| 'resources_checked'@@ -77,10 +81,6 @@ interface FindingsPanelProps {| 'status'| 'error_count'>;- showScopeWarnings?: boolean;- runtimeState?: PatrolRuntimeState;- blockedReason?: string;- overallHealth?: IntelligenceHealthScore;}export const FindingsPanel: Component<FindingsPanelProps> = (props) => {@@ -233,6 +233,26 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {(f) => f.source !== 'threshold' && !f.isThreshold && !hasTriggeringAlert(f),),);+ const runSnapshotScopedPatrolFindings = createMemo(() => {+ if (props.filterFindingIds === undefined) {+ return allPatrolFindings();+ }+ const snapshotFindingIds = new Set(props.filterFindingIds);+ return allPatrolFindings().filter((finding) => snapshotFindingIds.has(finding.id));+ });+ const useRunSnapshotScopedControls = createMemo(+ () => props.runSnapshot !== undefined && props.filterFindingIds !== undefined,+ );+ const scopedNeedsAttentionCount = createMemo(() => {+ const attentionIds = new Set(aiIntelligenceStore.findingsNeedingAttention.map((f) => f.id));+ return runSnapshotScopedPatrolFindings().filter((finding) => attentionIds.has(finding.id)).length;+ });+ const scopedPendingApprovalCount = createMemo(() => {+ const approvalIds = new Set(+ aiIntelligenceStore.findingsWithPendingApprovals.map((finding) => finding.id),+ );+ return runSnapshotScopedPatrolFindings().filter((finding) => approvalIds.has(finding.id)).length;+ });const patrolFindings = createMemo(() =>filteredFindings().filter((f) => f.source !== 'threshold' && !f.isThreshold && !hasTriggeringAlert(f),@@ -240,9 +260,12 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {);const filterOptions = createMemo(() =>buildFindingFilterOptions({- needsAttentionCount: aiIntelligenceStore.needsAttentionCount,- pendingApprovalCount: aiIntelligenceStore.pendingApprovalCount,- runSnapshot: props.runSnapshot,+ needsAttentionCount: useRunSnapshotScopedControls()+ ? scopedNeedsAttentionCount()+ : aiIntelligenceStore.needsAttentionCount,+ pendingApprovalCount: useRunSnapshotScopedControls()+ ? scopedPendingApprovalCount()+ : aiIntelligenceStore.pendingApprovalCount,}),);const emptyStateCopy = createMemo(() =>@@ -251,15 +274,20 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {overallHealth: props.overallHealth,runtimeState: props.runtimeState,blockedReason: props.blockedReason,+ runSnapshot: props.runSnapshot,}),);const emptyStateTone = createMemo(() => getSemanticTonePresentation(emptyStateCopy().tone));const showFilterControls = createMemo(() =>props.showControls !== false &&- (allPatrolFindings().length > 0 ||- aiIntelligenceStore.needsAttentionCount > 0 ||- aiIntelligenceStore.pendingApprovalCount > 0),+ (useRunSnapshotScopedControls()+ ? runSnapshotScopedPatrolFindings().length > 0 ||+ scopedNeedsAttentionCount() > 0 ||+ scopedPendingApprovalCount() > 0+ : allPatrolFindings().length > 0 ||+ aiIntelligenceStore.needsAttentionCount > 0 ||+ aiIntelligenceStore.pendingApprovalCount > 0),);const isOutOfScope = (finding: UnifiedFinding): boolean => {diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.tsindex de18910dcb..7a288ead8f 100644--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts@@ -462,6 +462,10 @@ describe('aiFindingPresentation', () => {it('hides the filter bar when there are no Patrol findings or special buckets to navigate', () => {expect(findingsPanelSource).toContain('const showFilterControls = createMemo(');+ expect(findingsPanelSource).toContain('const useRunSnapshotScopedControls = createMemo(');+ expect(findingsPanelSource).toContain('const runSnapshotScopedPatrolFindings = createMemo(');+ expect(findingsPanelSource).toContain('scopedNeedsAttentionCount()');+ expect(findingsPanelSource).toContain('scopedPendingApprovalCount()');expect(findingsPanelSource).toContain('allPatrolFindings().length > 0');expect(findingsPanelSource).toContain('aiIntelligenceStore.needsAttentionCount > 0');expect(findingsPanelSource).toContain('aiIntelligenceStore.pendingApprovalCount > 0');