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 page information hierarchy

rcourtman79a5ee2b3b6a
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 231a994f4d..85cd34ea92 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -77,7 +77,7 @@ Own canonical runtime payload shapes between backend and frontend.
5. Route unified-resource action, lifecycle, and export audit reads through `internal/api/activity_audit_handlers.go`, `internal/api/router_routes_licensing.go`, and `internal/api/contract_test.go` together so the control-plane execution trail stays on a governed API contract instead of a store-only shape
6. Route dedicated unified-resource timeline and facet-bundle reads through `frontend-modern/src/api/resources.ts`, `internal/api/resources.go`, and `internal/api/contract_test.go` together so the backend facet contract and the frontend client stay aligned on one timeline-first surface, while capability and relationship detail stays backend-owned for AI correlation and change detection
7. Route canonical AI intelligence summary and resource-intelligence reads through `frontend-modern/src/api/ai.ts`, `frontend-modern/src/stores/aiIntelligence.ts`, `frontend-modern/src/pages/AIIntelligence.tsx`, `internal/api/ai_handlers.go`, and `internal/api/contract_test.go` together so the summary card, store state, and backend payload stay aligned on one governed surface, including the canonical recent-changes slice
- while keeping the learning counters backend-only coverage, so the summary page keeps the timeline and learned-correlation story primary rather than presenting the supporting counts as a separate product metric
+ while keeping the learning counters backend-only coverage, so the summary page keeps Patrol health and findings primary and renders timeline, correlation, and policy-posture data as secondary investigation context rather than as a separate headline product metric
and the shared `frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx` card, so canonical recent-change timelines stay rendered through one governed frontend card instead of separate page-local list loops
and the shared `frontend-modern/src/utils/resourceChangePresentation.ts` formatter used by the summary page and resource drawer, so canonical change wording does not drift across surfaces
and the `/api/ai/intelligence/changes` route plus `internal/api/contract_test.go`, so the canonical recent-changes endpoint stays on the same intelligence facade and contract snapshot instead of bypassing the shared timeline source
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 88a9fb99f6..e1abae657d 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -158,6 +158,15 @@ The Patrol intelligence page now also renders the canonical
card, so the data-governance posture counts stay rendered from one governed
frontend component on the page instead of being duplicated in the resource
drawer.
+That same Patrol summary surface now keeps health and findings primary while
+rendering recent changes, learned correlations, and policy posture as
+secondary investigation context behind an explicit disclosure, so expansion
+lane concepts stay available for deeper investigation without reading as the
+headline Patrol product story.
+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 so
recent-change kind and headline wording stays aligned wherever the canonical
diff --git a/frontend-modern/src/components/patrol/RunHistoryPanel.tsx b/frontend-modern/src/components/patrol/RunHistoryPanel.tsx
index 94e180f4d2..93e2effaec 100644
--- a/frontend-modern/src/components/patrol/RunHistoryPanel.tsx
+++ b/frontend-modern/src/components/patrol/RunHistoryPanel.tsx
@@ -34,7 +34,7 @@ export function RunHistoryPanel(props: RunHistoryPanelProps) {
<div class="bg-surface rounded-md border border-border p-4">
<div class="flex items-center justify-between mb-4">
<div>
- <h2 class="text-sm font-semibold text-base-content">Patrol Run History</h2>
+ <h2 class="text-sm font-semibold text-base-content">Recent patrol runs</h2>
<p class="text-xs text-muted">Select a run to filter findings to that snapshot</p>
</div>
<Show when={props.selectedRun}>
diff --git a/frontend-modern/src/pages/AIIntelligence.tsx b/frontend-modern/src/pages/AIIntelligence.tsx
index b30f8b4776..8e9b37e07b 100644
--- a/frontend-modern/src/pages/AIIntelligence.tsx
+++ b/frontend-modern/src/pages/AIIntelligence.tsx
@@ -102,6 +102,7 @@ type PatrolTab = 'findings' | 'history';
export function AIIntelligence() {
const [activeTab, setActiveTab] = createSignal<PatrolTab>('findings');
+ const [showInvestigationContext, setShowInvestigationContext] = createSignal(false);
const [findingsFilterOverride, setFindingsFilterOverride] = createSignal<
'all' | 'active' | 'resolved' | 'approvals' | 'attention' | undefined
>(undefined);
@@ -547,6 +548,36 @@ export function AIIntelligence() {
aiIntelligenceStore.correlations?.correlations?.length ??
0,
);
+ const recentChangeCount = createMemo(
+ () =>
+ intelligenceSummary()?.recent_changes_count ?? intelligenceSummary()?.recent_changes?.length ?? 0,
+ );
+ const hasInvestigationContext = createMemo(
+ () =>
+ recentChangeCount() > 0 ||
+ correlationTotal() > 0 ||
+ (policyPosture()?.total_resources ?? 0) > 0,
+ );
+ const investigationContextSummary = createMemo(() => {
+ const parts: string[] = [];
+ if (recentChangeCount() > 0) {
+ parts.push(
+ `${recentChangeCount()} recent change${recentChangeCount() === 1 ? '' : 's'}`,
+ );
+ }
+ if (correlationTotal() > 0) {
+ parts.push(
+ `${correlationTotal()} correlation${correlationTotal() === 1 ? '' : 's'}`,
+ );
+ }
+ const governedResources = policyPosture()?.total_resources ?? 0;
+ if (governedResources > 0) {
+ parts.push(
+ `${governedResources} governed resource${governedResources === 1 ? '' : 's'}`,
+ );
+ }
+ return parts.join(' · ');
+ });
// Live in-progress run entry for history list
const liveRunRecord = createMemo<PatrolRunRecord | null>(() => {
@@ -1248,7 +1279,7 @@ export function AIIntelligence() {
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<p class="text-xs font-semibold uppercase tracking-[0.16em] text-muted">
- Canonical intelligence summary
+ Patrol summary
</p>
<h2 class="mt-1 text-lg font-semibold text-base-content">
Health {summary().overall_health.grade} ·{' '}
@@ -1264,32 +1295,68 @@ export function AIIntelligence() {
<span class="rounded-full border border-border-subtle bg-base px-2.5 py-1 text-xs font-medium text-base-content">
Warning {summary().findings_count.warning}
</span>
- <span class="rounded-full border border-border-subtle bg-base px-2.5 py-1 text-xs font-medium text-base-content">
- Recent changes {summary().recent_changes_count}
- </span>
</div>
</div>
- <div class="mt-4 grid gap-4 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]">
- <ResourceChangeSummary
- class="space-y-0"
- title="Recent changes"
- subtitle="Canonical 24h timeline"
- changes={summary().recent_changes}
- />
-
- <div class="space-y-4">
- <Show when={(aiIntelligenceStore.correlations?.correlations?.length ?? 0) > 0}>
- <ResourceCorrelationSummary
- title="Learned correlations"
- correlations={aiIntelligenceStore.correlations?.correlations ?? []}
- summaryText={`${correlationTotal()} total`}
- />
- </Show>
+ <Show when={hasInvestigationContext()}>
+ <div class="mt-4 rounded-md border border-border-subtle bg-base p-3">
+ <div class="flex flex-wrap items-start justify-between gap-3">
+ <div>
+ <p class="text-xs font-semibold uppercase tracking-[0.16em] text-muted">
+ Investigation context
+ </p>
+ <p class="mt-1 text-sm text-muted">
+ Secondary change and policy signals for deeper investigation.
+ </p>
+ <Show when={investigationContextSummary()}>
+ <p class="mt-1 text-xs text-base-content">
+ {investigationContextSummary()}
+ </p>
+ </Show>
+ </div>
+
+ <button
+ type="button"
+ onClick={() => setShowInvestigationContext((value) => !value)}
+ class="inline-flex items-center rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-base-content transition-colors hover:bg-surface-hover"
+ >
+ {showInvestigationContext() ? 'Hide context' : 'Show context'}
+ </button>
+ </div>
+
+ <Show when={showInvestigationContext()}>
+ <div class="mt-4 grid gap-4 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]">
+ <Show when={recentChangeCount() > 0}>
+ <ResourceChangeSummary
+ class="space-y-0"
+ title="Recent changes"
+ subtitle="Last 24 hours"
+ changes={summary().recent_changes}
+ maxChanges={3}
+ compact
+ />
+ </Show>
- <ResourcePolicySummary posture={policyPosture()} title="Data Governance" />
+ <div class="space-y-4">
+ <Show
+ when={(aiIntelligenceStore.correlations?.correlations?.length ?? 0) > 0}
+ >
+ <ResourceCorrelationSummary
+ title="Correlations"
+ correlations={aiIntelligenceStore.correlations?.correlations ?? []}
+ summaryText={`${correlationTotal()} total`}
+ />
+ </Show>
+
+ <ResourcePolicySummary
+ posture={policyPosture()}
+ title="Policy posture"
+ />
+ </div>
+ </div>
+ </Show>
</div>
- </div>
+ </Show>
</section>
)}
</Show>
@@ -1396,7 +1463,7 @@ export function AIIntelligence() {
: 'border-transparent text-muted hover:text-base-content hover:border-border'
}`}
>
- Run History
+ Runs
<Show when={displayRunHistory().length > 0}>
<span class="ml-1.5 px-1.5 py-0.5 text-xs rounded-full bg-surface-alt text-muted">
{displayRunHistory().length}
diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
index c54caf80fb..c2245144e7 100644
--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
@@ -424,7 +424,13 @@ describe('AIIntelligence entitlement gating', () => {
render(() => <AIIntelligence />);
await waitFor(() => {
- expect(screen.getByRole('heading', { name: 'Learned correlations' })).toBeInTheDocument();
+ expect(screen.getByText('Investigation context')).toBeInTheDocument();
+ });
+
+ expect(screen.queryByRole('heading', { name: 'Correlations' })).not.toBeInTheDocument();
+ fireEvent.click(screen.getByRole('button', { name: 'Show context' }));
+ await waitFor(() => {
+ expect(screen.getByRole('heading', { name: 'Correlations' })).toBeInTheDocument();
});
expect(screen.getByText('2 total')).toBeInTheDocument();
@@ -583,11 +589,20 @@ describe('AIIntelligence entitlement gating', () => {
await waitFor(() => {
expect(getPatrolStatusMock).toHaveBeenCalled();
- expect(screen.getByText('Canonical intelligence summary')).toBeInTheDocument();
+ expect(screen.getByText('Patrol summary')).toBeInTheDocument();
});
expect(screen.getByText(/Health A · 91\/100/)).toBeInTheDocument();
- expect(screen.getByText(/Recent changes 1/)).toBeInTheDocument();
+ expect(screen.getByText('Investigation context')).toBeInTheDocument();
+ expect(screen.getByText('1 recent change · 4 governed resources')).toBeInTheDocument();
+ expect(screen.queryByText('Policy posture')).not.toBeInTheDocument();
+
+ fireEvent.click(screen.getByRole('button', { name: 'Show context' }));
+
+ await waitFor(() => {
+ expect(screen.getByText('Policy posture')).toBeInTheDocument();
+ });
+
expect(screen.getByText('Config update: Updated guest configuration')).toBeInTheDocument();
expect(screen.getByText('Updated guest configuration')).toBeInTheDocument();
expect(
@@ -598,7 +613,7 @@ describe('AIIntelligence entitlement gating', () => {
).toHaveAttribute('href', '/infrastructure?resource=agent-1');
expect(screen.queryByText('Derived signal coverage')).not.toBeInTheDocument();
expect(screen.queryByText(/baselined/)).not.toBeInTheDocument();
- expect(screen.getByText('Data Governance')).toBeInTheDocument();
+ expect(screen.getByText('Recent changes')).toBeInTheDocument();
expect(screen.getByText('4 governed resources')).toBeInTheDocument();
expect(screen.getByText('Public')).toBeInTheDocument();
expect(screen.getByText('Internal')).toBeInTheDocument();
@@ -653,7 +668,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(findingsPanelState.latestProps).not.toBeNull();
});
- fireEvent.click(screen.getByRole('button', { name: 'Run History' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Runs' }));
fireEvent.click(screen.getByRole('button', { name: 'Select mocked run' }));
fireEvent.click(screen.getByRole('button', { name: 'Findings' }));
@@ -712,7 +727,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(findingsPanelState.latestProps).not.toBeNull();
});
- fireEvent.click(screen.getByRole('button', { name: 'Run History' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Runs' }));
fireEvent.click(screen.getByRole('button', { name: 'Select mocked run' }));
fireEvent.click(screen.getByRole('button', { name: 'Findings' }));
@@ -770,7 +785,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(findingsPanelState.latestProps).not.toBeNull();
});
- fireEvent.click(screen.getByRole('button', { name: 'Run History' }));
+ fireEvent.click(screen.getByRole('button', { name: 'Runs' }));
fireEvent.click(screen.getByRole('button', { name: 'Select mocked run' }));
fireEvent.click(screen.getByRole('button', { name: 'Findings' }));