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
Collapse Patrol assessment readout
rcourtmanf932bc841deb
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 7cc19afc2f..8b208371e4 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -648,7 +648,9 @@ the canonical monitored-system blocked payload.The API contract should stay presentation-neutral here: it supplies thescore, current risk facts, verification facts, and action state needed for acompact operator summary, but it must not imply a hero, card, or duplicate- verdict layout.+ verdict layout. Frontend consumers may keep explanatory assessment and+ recommendation copy behind a details expansion while deriving the collapsed+ readout from the same canonical payloads.17. Keep Pulse Mobile relay credential minting and permission ownership on backend ownership: `internal/api/router_routes_auth_security.go`, `internal/api/security_tokens.go`, `internal/api/auth.go`, `internal/api/relay_mobile_capability.go`, `internal/api/router_routes_ai_relay.go`, and `frontend-modern/src/api/security.ts` may expose the canonical mobile runtime token creator and governed route gates, but browser callers must only consume that route and must not define the mobile runtime scope, compatibility gate list, route inventory, or token-purpose metadata locally.18. Keep hosted tenant browser-session precedence on the shared auth boundary: `internal/api/auth.go`, `internal/api/contract_test.go`, and hosted tenant callers must treat a valid `pulse_session` as authoritative before any API-only token fallback or no-local-auth anonymous fallback, so cloud handoff can continue into protected hosted routes without flattening the operator back to `anonymous` or forcing a browser session through bearer-token-only mode after the tenant has minted API tokens.That same shared auth boundary also owns hosted handoff authorization. `internal/api/cloud_handoff.go`,diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 1589faad7a..75399ddfe7 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -242,8 +242,9 @@ their governed presentation helpers and render them inside the shared neutralPulse surface language rather than introducing page-local verdict bands ornested cards. Patrol's primary recommended next step follows this boundary:the Patrol helper owns the decision text, while the section component only-renders a compact inline accent and one bounded action inside the existing-assessment shell. Feature-owned recommendation actions may use the shared+renders the compact default next-step title and one bounded action inside the+existing assessment shell, with detail copy deferred to the section's details+expansion. Feature-owned recommendation actions may use the sharedbutton/link shape, but they must not create a second full-width action band ornest another card inside the primary Pulse surface. If the same assessmentopens Assistant, the Patrol-to-Assistant handoff must carry that exact@@ -1677,6 +1678,9 @@ The same hierarchy also applies inside the Patrol summary shell: once theprimary assessment strip states Patrol's current risk and verification basis,supporting metrics under that strip must stay metric-oriented and must notrepeat assessment or verification labels as a second compact verdict row.+The collapsed Patrol assessment strip itself must remain a compact readout+rather than a headline-plus-paragraph block; explanatory assessment and+recommendation copy belongs behind the summary details expansion.That same summary shell should also keep the shared Pulse surface neutral:severity belongs in compact accents, inline readouts, and badges rather thanturning the whole assessment into a tinted warning banner, nested card, ordiff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 802e565997..ac487dcc17 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -409,11 +409,13 @@ Patrol-specific presentation helpers.frame Assistant as explanation and next-step review rather than execution orautomatic retry authority.9. Keep the normal Patrol assessment summary plain and operator-first rather- than a hero-style or decorative card surface. The default collapsed state- should show the Patrol assessment, score, concise current-risk copy, one- recommended next step, and one route-owned action. Verification detail,- supporting metrics, and whole-assessment Assistant discussion belong behind- the details expansion unless Assistant itself is the recommended action.+ than a hero-style or decorative card surface. The default collapsed state is+ a compact readout, not a headline block: show the Patrol assessment label,+ score, concise current-risk copy, one recommended next-step title, and one+ route-owned action. Assessment explanation, recommendation detail,+ verification detail, supporting metrics, and whole-assessment Assistant+ discussion belong behind the details expansion unless Assistant itself is+ the recommended action.## Current Statediff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsxindex eeea1a5f5a..25f2418c74 100644--- a/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceSummary.tsx@@ -173,6 +173,34 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStatpendingApprovalCount: aiIntelligenceStore.patrolPendingApprovals.length,}),);+ const compactRiskSummary = createMemo(() => {+ const stats = summaryStats();+ const parts: string[] = [];+ const hasRuntimeIssues =+ metricState().secondaryLabel === 'Runtime issues' && metricState().secondaryValue > 0;++ if (stats.criticalFindings > 0) {+ parts.push(`${stats.criticalFindings} critical`);+ }++ if (stats.warningFindings > 0 && !hasRuntimeIssues) {+ parts.push(`${stats.warningFindings} warning`);+ }++ if (hasRuntimeIssues) {+ parts.push(+ `${metricState().secondaryValue} runtime ${+ metricState().secondaryValue === 1 ? 'issue' : 'issues'+ }`,+ );+ }++ if (parts.length === 0 && stats.totalActive > 0) {+ parts.push(`${stats.totalActive} active`);+ }++ return parts.join(' · ');+ });const recommendedNextStepAction = createMemo(() => recommendedNextStep().action);const recommendedNextStepActionDisabled = createMemo(() => {const action = recommendedNextStepAction();@@ -382,85 +410,80 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat<Show when={!showRuntimeSummary() && !showLoadingSummary()}><Show when={state.intelligenceSummary()}>{(summary) => (- <section class="border-y border-border-subtle py-3">- <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">- <div class="min-w-0 flex-1">- <div class="flex flex-wrap items-center gap-2">- <span- class={`h-2 w-2 rounded-full ${getPatrolAssessmentDotClass(assessment().tone)}`}- aria-hidden="true"- />- <p class="text-[11px] font-semibold uppercase tracking-[0.14em] text-muted">+ <section class="border-y border-border-subtle py-2">+ <div class="flex flex-col gap-2 lg:flex-row lg:items-center lg:justify-between">+ <div class="min-w-0 space-y-1">+ <div class="flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-1 text-sm">+ <span class="text-[11px] font-semibold uppercase tracking-[0.14em] text-muted">{assessment().eyebrow}- </p>+ </span>+ <span class="font-semibold text-base-content">+ {scoreChipLabel()} {summary().overall_health.grade} ·{' '}+ {Math.round(summary().overall_health.score)}/100+ </span>+ <span class="font-semibold text-base-content">{assessment().title}</span>+ <Show when={compactRiskSummary()}>+ {(riskSummary) => (+ <>+ <span class="text-muted" aria-hidden="true">+ ·+ </span>+ <span class="text-muted">{riskSummary()}</span>+ </>+ )}+ </Show></div>- <h2 class="mt-2 text-base font-semibold text-base-content">- {assessment().title}- </h2>- <p class="mt-1 max-w-4xl text-sm leading-6 text-muted">- {assessment().description}- </p>-<divdata-testid="patrol-recommended-next-step"- class={`mt-3 flex flex-col gap-2 border-l-2 pl-3 sm:flex-row sm:items-center ${getPatrolRecommendedNextStepAccentClass(recommendedNextStep().tone)}`}+ class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted">- <p class="min-w-0 flex-1 text-sm leading-6 text-muted">- <span class="font-semibold text-base-content">Next:</span>{' '}- <span class="font-semibold text-base-content">- {recommendedNextStep().title}- </span>- <span> - {recommendedNextStep().description}</span>- </p>- <Show when={recommendedNextStepAction()}>- {(action) => (- <Show- when={action().href}- fallback={- <button- type="button"- data-testid="patrol-recommended-next-step-action"- disabled={recommendedNextStepActionDisabled()}- title={- action().kind === 'run_patrol'- ? state.triggerPatrolDisabledReason()- : undefined- }- class="inline-flex shrink-0 items-center gap-1.5 rounded border border-border-subtle bg-transparent px-2.5 py-1.5 text-xs font-semibold text-base-content transition-colors hover:bg-surface-hover disabled:text-muted"- onClick={() => handleRecommendedNextStepAction(action())}- >- {renderRecommendedNextStepActionIcon(- action(),- state.isTriggeringPatrol() ||- state.manualRunRequested() ||- state.patrolStream.isStreaming(),- )}- <span>{recommendedNextStepActionLabel()}</span>- </button>- }- >- {(href) => (- <a- href={href()}- data-testid="patrol-recommended-next-step-action"- class="inline-flex shrink-0 items-center gap-1.5 rounded border border-border-subtle bg-transparent px-2.5 py-1.5 text-xs font-semibold text-base-content transition-colors hover:bg-surface-hover"- >- {renderRecommendedNextStepActionIcon(action(), false)}- <span>{action().label}</span>- </a>- )}- </Show>- )}- </Show>+ <span class="font-medium text-base-content">Next:</span>+ <span class="font-medium text-base-content">{recommendedNextStep().title}</span></div></div>- <div class="flex shrink-0 flex-wrap items-center gap-3 sm:justify-end">- <p class="text-sm font-semibold text-base-content">- {scoreChipLabel()} {summary().overall_health.grade} ·{' '}- {Math.round(summary().overall_health.score)}/100- </p>+ <div class="flex shrink-0 flex-wrap items-center gap-2 lg:justify-end">+ <Show when={recommendedNextStepAction()}>+ {(action) => (+ <Show+ when={action().href}+ fallback={+ <button+ type="button"+ data-testid="patrol-recommended-next-step-action"+ disabled={recommendedNextStepActionDisabled()}+ title={+ action().kind === 'run_patrol'+ ? state.triggerPatrolDisabledReason()+ : undefined+ }+ class="inline-flex shrink-0 items-center gap-1.5 rounded border border-border-subtle bg-transparent px-2.5 py-1.5 text-xs font-semibold text-base-content transition-colors hover:bg-surface-hover disabled:text-muted"+ onClick={() => handleRecommendedNextStepAction(action())}+ >+ {renderRecommendedNextStepActionIcon(+ action(),+ state.isTriggeringPatrol() ||+ state.manualRunRequested() ||+ state.patrolStream.isStreaming(),+ )}+ <span>{recommendedNextStepActionLabel()}</span>+ </button>+ }+ >+ {(href) => (+ <a+ href={href()}+ data-testid="patrol-recommended-next-step-action"+ class="inline-flex shrink-0 items-center gap-1.5 rounded border border-border-subtle bg-transparent px-2.5 py-1.5 text-xs font-semibold text-base-content transition-colors hover:bg-surface-hover"+ >+ {renderRecommendedNextStepActionIcon(action(), false)}+ <span>{action().label}</span>+ </a>+ )}+ </Show>+ )}+ </Show><buttontype="button"data-testid="patrol-summary-details-toggle"@@ -481,8 +504,29 @@ export function PatrolIntelligenceSummary(props: { state: PatrolIntelligenceStat</div><Show when={state.summaryDetailsExpanded()}>- <div id="patrol-summary-details" class="mt-4 border-t border-border-subtle pt-4">- <div class="grid gap-4 lg:grid-cols-[minmax(0,1.35fr)_minmax(0,1fr)]">+ <div+ id="patrol-summary-details"+ data-testid="patrol-summary-details"+ class="mt-3 border-t border-border-subtle pt-3"+ >+ <div class="grid gap-4 lg:grid-cols-3">+ <div>+ <p class="text-xs font-semibold uppercase tracking-[0.16em] text-muted">+ Assessment+ </p>+ <p class="mt-1 text-sm font-medium text-base-content">{assessment().title}</p>+ <p class="mt-1 text-sm text-muted">{assessment().description}</p>+ <div class="mt-3">+ <p class="text-xs font-semibold uppercase tracking-[0.16em] text-muted">+ Recommended next step+ </p>+ <p class="mt-1 text-sm font-medium text-base-content">+ {recommendedNextStep().title}+ </p>+ <p class="mt-1 text-sm text-muted">{recommendedNextStep().description}</p>+ </div>+ </div>+<div><p class="text-xs font-semibold uppercase tracking-[0.16em] text-muted">Verification@@ -630,36 +674,6 @@ function buildPatrolAssessmentApprovalProposedFixBriefing(approval: ApprovalRequ});}-function getPatrolRecommendedNextStepAccentClass(- tone: ReturnType<typeof getPatrolRecommendedNextStepPresentation>['tone'],-) {- switch (tone) {- case 'success':- return 'border-emerald-400 dark:border-emerald-500';- case 'warning':- return 'border-amber-400 dark:border-amber-500';- case 'error':- return 'border-red-400 dark:border-red-500';- default:- return 'border-blue-400 dark:border-blue-500';- }-}--function getPatrolAssessmentDotClass(- tone: ReturnType<typeof getPatrolAssessmentPresentation>['tone'],-) {- switch (tone) {- case 'success':- return 'bg-emerald-500';- case 'warning':- return 'bg-amber-500';- case 'error':- return 'bg-red-500';- default:- return 'bg-blue-500';- }-}-function renderRecommendedNextStepActionIcon(action: PatrolRecommendedNextStepAction,running: boolean,diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceSummary.test.tsx b/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceSummary.test.tsxindex 3ec1ff4741..15e267561c 100644--- a/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceSummary.test.tsx+++ b/frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceSummary.test.tsx@@ -55,7 +55,7 @@ describe('PatrolIntelligenceSummary', () => {expect(screen.getByTestId('patrol-recommended-next-step').textContent).toContain('Review the pending Patrol approval',);- expect(screen.getByTestId('patrol-recommended-next-step').textContent).toContain(+ expect(screen.getByTestId('patrol-summary-details').textContent).toContain('risk, dry-run posture, and expiry',);diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsxindex 45b876e556..e7bde28a35 100644--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx@@ -1175,7 +1175,7 @@ describe('AIIntelligence entitlement gating', () => {});expect(screen.queryByText('No issues found')).not.toBeInTheDocument();- expect(screen.getByTestId('patrol-recommended-next-step')).toHaveTextContent(+ expect(screen.getByTestId('patrol-summary-details')).toHaveTextContent('Run a full Patrol sweep before treating this assessment as an all-clear; recent evidence is incomplete or limited to targeted activity.',);expect(screen.queryByText(/Last patrol/i)).not.toBeInTheDocument();@@ -1336,11 +1336,6 @@ describe('AIIntelligence entitlement gating', () => {await waitFor(() => {expect(screen.getByText('Patrol runtime issue')).toBeInTheDocument();- expect(- screen.getByText(- 'Patrol has an active runtime issue: Provider billing or quota issue. Recent coverage is also incomplete, so the rest of your infrastructure is not fully verified.',- ),- ).toBeInTheDocument();});// "Runtime issues" and "Latest activity" both live in the collapsible@@ -1348,6 +1343,11 @@ describe('AIIntelligence entitlement gating', () => {fireEvent.click(screen.getByTestId('patrol-summary-details-toggle'));await waitFor(() => {+ expect(+ screen.getByText(+ 'Patrol has an active runtime issue: Provider billing or quota issue. Recent coverage is also incomplete, so the rest of your infrastructure is not fully verified.',+ ),+ ).toBeInTheDocument();expect(screen.getByText('Runtime issues')).toBeInTheDocument();expect(screen.getByText('Latest activity')).toBeInTheDocument();});@@ -1469,12 +1469,11 @@ describe('AIIntelligence entitlement gating', () => {await waitFor(() => {expect(screen.getByText(/verified 58 resources/i)).toBeInTheDocument();- expect(- screen.getByText(- 'Patrol surfaced 1 active warning finding in your infrastructure. Review the active findings for more detail.',- ),- ).toBeInTheDocument();});+ fireEvent.click(screen.getByTestId('patrol-summary-details-toggle'));+ expect(screen.getByTestId('patrol-summary-details')).toHaveTextContent(+ 'Patrol surfaced 1 active warning finding in your infrastructure. Review the active findings for more detail.',+ );expect(screen.queryByText(