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.

Simplify Patrol supporting metrics

rcourtman7d3c482a0a89
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 0512487911..b541f56537 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -170,6 +170,7 @@ Own canonical runtime payload shapes between backend and frontend.
5. Keep `/api/resources` policy metadata aligned across backend payload tests and canonical frontend resource consumers whenever sensitivity or routing fields change
6. Keep Patrol status payloads explicit enough that the frontend can present blocked runtime state without treating a previously healthy summary snapshot as current runtime truth
7. Keep Patrol summary payload consumers aligned on one assessment hierarchy: transport-driven Patrol summary surfaces may show supporting counts and outcomes, but the canonical assessment and verification states must remain singular and not be repeated as a second compact verdict strip
+8. Treat Patrol summary supporting metrics as readouts, not reinterpretations: when frontend consumers derive cards such as active findings, criticals, warnings, or fixes from the canonical payloads, those cards must stay numeric and must not synthesize new assessment labels like `Issues detected` or verification labels like `Partial verification` beneath the primary summary contract
## Current State
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 28fb5a9854..51dd208917 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -196,6 +196,10 @@ The same hierarchy also applies inside the Patrol summary shell: once the
primary summary card states Patrol's assessment and verification basis,
supporting metric strips under that card must stay metric-oriented and must
not repeat assessment or verification labels as a second compact verdict row.
+Those supporting cards must also keep their content factual and count-based:
+active findings, critical findings, warnings, and fixes are valid secondary
+readouts, while labels such as `Issues detected` or `Partial verification`
+belong only to the primary Patrol assessment and verification surfaces.
`frontend-modern/src/components/shared/TagBadges.tsx` is now also the
canonical tag-badge primitive. Dashboard workload rows and the unified-resource
detail drawer must import that shared owner instead of keeping a dashboard-local
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 584393b8e5..be66d43307 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -128,6 +128,12 @@ supporting evidence. Secondary metric strips must not render `No issues found`
when the same governed overall-health summary says coverage is incomplete or
health still requires attention; that compact summary state now belongs to the
shared `frontend-modern/src/utils/patrolSummaryPresentation.ts` helper.
+That summary surface must also avoid reintroducing a second compact assessment
+or verification layer beneath the primary card. Supporting metric strips
+belong to counts and outcomes such as active findings, critical findings,
+warnings, and fixes; they must not repeat Patrol assessment labels or
+verification labels in a second row that competes with the primary governed
+assessment and verification copy above.
That same summary surface must also explain what Patrol actually verified.
Recent run history should drive a visible verification summary that tells the
operator whether Patrol recently completed a successful full patrol, only ran
diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx
index 6ac9d1c081..8fa36a322e 100644
--- a/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx
+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx
@@ -50,14 +50,14 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat
const assessmentTonePresentation = createMemo(() =>
getSemanticTonePresentation(assessment().tone),
);
- const assessmentSummaryPresentation = createMemo(() =>
+ const activeFindingsSummaryPresentation = createMemo(() =>
getPatrolSummaryPresentation(
- assessment().tone === 'error'
+ summaryStats().criticalFindings > 0
? 'critical'
- : assessment().tone === 'warning'
+ : summaryStats().totalActive > 0
? 'warning'
- : 'success',
- true,
+ : 'warning',
+ summaryStats().totalActive > 0,
),
);
const verification = createMemo(() =>
@@ -67,15 +67,8 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat
blockedReason: state.blockedReason(),
}),
);
- const verificationSummaryPresentation = createMemo(() =>
- getPatrolSummaryPresentation(
- verification().tone === 'error'
- ? 'critical'
- : verification().tone === 'warning'
- ? 'warning'
- : 'success',
- true,
- ),
+ const fixedSummaryPresentation = createMemo(() =>
+ getPatrolSummaryPresentation('success', summaryStats().fixedCount > 0),
);
return (
@@ -272,28 +265,34 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat
<div class="bg-surface rounded-md border border-border p-3">
<div class="flex items-center gap-2">
<div
- class={`p-1.5 rounded-md border ${assessmentSummaryPresentation().iconContainerClass}`}
+ class={`p-1.5 rounded-md border ${activeFindingsSummaryPresentation().iconContainerClass}`}
>
<Show
- when={assessment().tone === 'success'}
+ when={summaryStats().criticalFindings > 0}
fallback={
<Show
- when={assessment().tone === 'error'}
+ when={summaryStats().totalActive > 0}
fallback={
- <AlertTriangleIcon class={`w-4 h-4 ${assessmentSummaryPresentation().iconClass}`} />
+ <ActivityIcon
+ class={`w-4 h-4 ${activeFindingsSummaryPresentation().iconClass}`}
+ />
}
>
- <ShieldAlertIcon class={`w-4 h-4 ${assessmentSummaryPresentation().iconClass}`} />
+ <AlertTriangleIcon
+ class={`w-4 h-4 ${activeFindingsSummaryPresentation().iconClass}`}
+ />
</Show>
}
>
- <CheckCircleIcon class={`w-4 h-4 ${assessmentSummaryPresentation().iconClass}`} />
+ <ShieldAlertIcon
+ class={`w-4 h-4 ${activeFindingsSummaryPresentation().iconClass}`}
+ />
</Show>
</div>
<div>
- <p class="text-xs text-muted">Assessment</p>
- <p class={`text-sm font-semibold ${assessmentSummaryPresentation().valueClass}`}>
- {assessment().compactLabel}
+ <p class="text-xs text-muted">Active findings</p>
+ <p class={`text-lg font-bold ${activeFindingsSummaryPresentation().valueClass}`}>
+ {summaryStats().totalActive}
</p>
</div>
</div>
@@ -302,32 +301,14 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat
<div class="bg-surface rounded-md border border-border p-3">
<div class="flex items-center gap-2">
<div
- class={`p-1.5 rounded-md border ${verificationSummaryPresentation().iconContainerClass}`}
+ class={`p-1.5 rounded-md border ${criticalSummaryPresentation().iconContainerClass}`}
>
- <Show
- when={verification().tone === 'success'}
- fallback={
- <Show
- when={verification().tone === 'error'}
- fallback={
- <AlertTriangleIcon
- class={`w-4 h-4 ${verificationSummaryPresentation().iconClass}`}
- />
- }
- >
- <ShieldAlertIcon
- class={`w-4 h-4 ${verificationSummaryPresentation().iconClass}`}
- />
- </Show>
- }
- >
- <CheckCircleIcon class={`w-4 h-4 ${verificationSummaryPresentation().iconClass}`} />
- </Show>
+ <ShieldAlertIcon class={`w-4 h-4 ${criticalSummaryPresentation().iconClass}`} />
</div>
<div>
- <p class="text-xs text-muted">Verification</p>
- <p class={`text-sm font-semibold ${verificationSummaryPresentation().valueClass}`}>
- {verification().compactLabel}
+ <p class="text-xs text-muted">Critical</p>
+ <p class={`text-lg font-bold ${criticalSummaryPresentation().valueClass}`}>
+ {state.summaryStats().criticalFindings}
</p>
</div>
</div>
@@ -352,19 +333,18 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat
<div class="bg-surface rounded-md border border-border p-3">
<div class="flex items-center gap-2">
<div
- class={`p-1.5 rounded-md border ${warningSummaryPresentation().iconContainerClass}`}
+ class={`p-1.5 rounded-md border ${fixedSummaryPresentation().iconContainerClass}`}
>
- <ActivityIcon class={`w-4 h-4 ${warningSummaryPresentation().iconClass}`} />
+ <CheckCircleIcon class={`w-4 h-4 ${fixedSummaryPresentation().iconClass}`} />
</div>
<div>
- <p class="text-xs text-muted">Warnings</p>
- <p class={`text-lg font-bold ${warningSummaryPresentation().valueClass}`}>
- {state.summaryStats().warningFindings}
+ <p class="text-xs text-muted">Fixed</p>
+ <p class={`text-lg font-bold ${fixedSummaryPresentation().valueClass}`}>
+ {state.summaryStats().fixedCount}
</p>
</div>
</div>
</div>
-
</div>
</Show>
</>
diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
index fd631a019c..1cdc66e24d 100644
--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
@@ -813,10 +813,10 @@ describe('AIIntelligence entitlement gating', () => {
await waitFor(() => {
expect(screen.getAllByText('Coverage incomplete').length).toBeGreaterThan(0);
expect(screen.getByText('No recent full patrol')).toBeInTheDocument();
- expect(screen.getByText('Partial verification')).toBeInTheDocument();
});
expect(screen.queryByText('No issues found')).not.toBeInTheDocument();
+ expect(screen.queryByText('Partial verification')).not.toBeInTheDocument();
});
it('treats a selected zero-finding run as an empty snapshot and uses effective scope ids', async () => {