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
feat(patrol): simplify the decision workspace
rcourtmanac4116e09b85
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 96abccde10..44429a2f58 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -78,6 +78,15 @@ evidence, and observation time. This snapshot is model and audit context only;it is not an API-supplied approval, tool choice, policy factor, or executioncredential. Older persisted runs and findings without the additive field remainvalid.+Patrol attention consumers may derive a resource-first display title from the+canonical title and `subjectResourceName`, but that presentation must not+rewrite the retained record or infer a different issue kind. The canonical+`subjectResourceId` remains the route and copy value even when the browser hides+the raw identifier from ordinary reading. Browser progressive disclosure may+collapse evidence, protection posture, and lifecycle history, but it must not+drop those typed fields or replace their server-authored trust state. Decision,+finding, and approval counts remain distinct API projections and must not be+presented as interchangeable totals.Physical-disk payloads preserve optional SMART counter presence, includingexplicit zero values, and expose provider vendor metadata without convertingmissing data into health. Unified-resource clients may request bounded serverdiff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex f1dd39d868..237ab5456a 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -796,6 +796,16 @@ have left the live registry. It must preserve the server's verified-onlymembership, evidence class, newest-first order, empty state, andlast-truthful-data behavior during a refresh error. Raw executor verificationsummaries stay in Actions history rather than becoming quiet-home copy.+Selected Patrol decisions compose shared `Button`, `ButtonLink`, and+`CopyValueButton` actions with native disclosures rather than introducing a+detail-local control vocabulary. The primary reading order is summary,+contextual Assistant explanation, affected resource, distinct impact, next+step, and current lifecycle action. Raw canonical resource identifiers remain+available through the shared copy affordance instead of occupying the reading+surface. Evidence, protection, and timeline may share one collapsed disclosure+when all typed detail remains reachable, keyboard-operable, and truthfully+labelled. Compact actions retain the shared minimum touch target at phone widths+even when their desktop presentation uses the `xs` or `sm` size.For Patrol, that includes the Open work description: it may use conciserow-level guidance such as review evidence, approve a change, inspect automaticactions, or review verification results, but it must remain descriptive copydiff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 7df83173d6..3109d20801 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -1226,8 +1226,8 @@ attention count; the queue and approval inbox retain their separate canonicalprojections.The default loaded state is a full-width decision inbox with one headline that-states how many current decisions need the operator, one short explanation of-the ordering, one `Start review` action for the highest-priority item, the+states how many current decisions need the operator, one `Start review` action+for the highest-priority item, thecanonical pending-approval handoff when needed, and refresh. It must not repeatthe same facts as a metric strip, generic row state, generic `Review` label, orempty recommended-item preview. A two-pane workspace appears only after the@@ -1238,6 +1238,26 @@ workflow instead of stacking the detail above a second full queue. The commandrow remains compact and visually secondary so the inbox and first decisionsenter the initial viewport.+The default queue now leads generated `kind on resource` titles with the+resource identity so repeated incident families remain scannable without+changing the backend record. The selected context keeps the consequence and+next step primary, moves contextual Assistant explanation beside that summary,+keeps the canonical resource identifier behind a copy affordance, suppresses+impact text that merely repeats the summary, and groups evidence, protection,+and lifecycle history behind one deliberate disclosure. Occurrence controls+remain visible, while durable threshold and finding-management guidance is+secondary disclosure. This is progressive presentation of the same typed+record, not a loss of evidence or lifecycle truth.++Plan-locked Watch-only installs do not render an empty mode disclosure after+the effective mode is already visible in the compact command row. Runtime-+locked and configurable installs retain the mode disclosure and its repair or+choice controls. The empty Protection mode offers bounded example outcomes+that prefill the existing objective form without creating an objective until+the operator reviews and submits it. Activity keeps Actions and Patrol records+as separate subordinate handoffs, but the Patrol-record handoff does not expose+the legacy findings count beside the canonical decision count.+Selecting the first item starts a bounded review session over the loadeddecision order. The selected context shows its current position and exposesprevious/next navigation on desktop and mobile; deterministic identity breaksdiff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.jsonindex f820cc39b8..dd2cfefe40 100644--- a/frontend-modern/browser-verification.json+++ b/frontend-modern/browser-verification.json@@ -1,49 +1,46 @@{"version": 1,- "base_sha": "b396c93785e2e671f29bc295923ab5ad480d579b",- "verified_at": "2026-08-18T10:08:58Z",+ "base_sha": "95c253c4860d704dfdc8b3d743b482182d749fff",+ "verified_at": "2026-08-18T10:49:01Z","result": "passed","changed_paths": [- "frontend-modern/src/AppLayout.tsx",- "frontend-modern/src/components/shared/mobileNavBarModel.ts",- "frontend-modern/src/pages/Actions.tsx",- "frontend-modern/src/utils/assistantPageContext.ts"+ "frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx",+ "frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx",+ "frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx",+ "frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsx"],"content_sha256": {- "frontend-modern/src/AppLayout.tsx": "de3657774c1f5b84297cca22d77f9a9d15956115b2ab4a84a22e0fb3b9e0ba46",- "frontend-modern/src/components/shared/mobileNavBarModel.ts": "3560c932d36e645a14508804dd146146e449c83575ab118b567aa3a9d742c903",- "frontend-modern/src/pages/Actions.tsx": "2ff95733423f2b2577052328232e0c7f927f3db57f0cbdec2093258fae900375",- "frontend-modern/src/utils/assistantPageContext.ts": "bfca19b4e183777ee1535073d48cce92ce31980f4105bab337f33a28538a6a35"+ "frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx": "42d0e595053546270727bcfe57de37b1f9c6e4c721a2bbc6175335136a4e03b2",+ "frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx": "eeaecb901bac67f4b2ba2c442a5f669be50ee2a1bb01928340eef4d83da5532d",+ "frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx": "90a0e1b7b7b75567a6c026d4d6c115b82d06c1f86412f971c0c8989a60562471",+ "frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsx": "fc03c1905afae9aaa684aecd759cd6e409eee5fb987abcdee5e2c83d850352d1"},- "routes": ["/actions", "/patrol"],+ "routes": ["/patrol"],"viewports": [{- "width": 1280,- "height": 720+ "width": 1440,+ "height": 900},{"width": 390,"height": 844- },- {- "width": 320,- "height": 568}],"states": [- "Actions open queue with the first-class desktop navigation state and pending-approval badge",- "Actions history with completed, rejected, and failed outcomes",- "Read-only governed action review dialog open and closed",- "Patrol and Actions with independent attention and approval badges",- "Actions empty state with the fixed mobile navigation destination selected",- "Canonical mobile product routes at compact and modern phone widths"+ "Inbox default queue with resource-first decision titles and no selected detail",+ "Inbox selected decision with compact trust metadata and evidence collapsed",+ "Inbox selected decision with evidence, protection, and timeline expanded",+ "Protection empty state with starter outcomes",+ "Protection create-objective dialog prefilled from a starter outcome",+ "Activity with verified outcomes, Actions handoff, and Patrol records disclosure",+ "Watch-only header with its mode explanation and no empty automation disclosure"],"interactions": [- "Used the live in-app Browser to navigate from Patrol to Actions through the permanent desktop tab and confirmed the Actions URL, page title, selected state, and Assistant context",- "Switched between Open and History and confirmed each Actions list and summary rendered correctly",- "Opened and closed the governed action review dialog and confirmed the canonical decision packet remained available",- "Confirmed phone-width Actions is directly visible and selected in the fixed bottom rail while Patrol remains unselected",- "Passed the mobile Chrome canonical-route overflow sweep at 320x568 and 390x844 with Actions included",- "Ran the copy-style audit and confirmed no user-visible semicolons"+ "Used the live in-app Browser to switch between Inbox, Protection, and Activity",+ "Selected the highest-priority decision and confirmed Assistant, Copy ID, Open resource, lifecycle controls, and progressive disclosure",+ "Expanded Evidence and history and confirmed the latest evidence, older-observation reveal, protection posture, and timeline",+ "Used a Protection starter outcome and confirmed the objective dialog opened with the chosen brief prefilled",+ "Used Claude Code Playwright verification at desktop and phone widths to inspect layout, focus visibility, copy, console output, and dialog behaviour",+ "Confirmed there are no user-visible semicolons or em dashes and no console errors at either viewport"]}diff --git a/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx b/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsxindex 12a90fd36c..2cf06699d8 100644--- a/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx+++ b/frontend-modern/src/features/patrol/PatrolAttentionWorkbench.tsx@@ -36,7 +36,7 @@ import {unsuppressPatrolAttention,} from '@/api/patrolAttention';import { ResourceActionsAPI } from '@/api/resourceActions';-import { Button, ButtonLink } from '@/components/shared/Button';+import { Button, ButtonLink, CopyValueButton } from '@/components/shared/Button';import { LoadingSpinner } from '@/components/shared/LoadingSpinner';import { MetadataBadge, type MetadataBadgeTone } from '@/components/shared/MetadataBadge';import { ActionReviewDialog } from '@/features/actions/ActionReviewDialog';@@ -58,6 +58,7 @@ import type { EvidenceEnvelope } from '@/types/operationalTrust';import type { ActionDetailResponse } from '@/types/actionAudit';import { getAlertResourceIncidentAcknowledgedByLabel } from '@/utils/alertIncidentPresentation';import { formatRelativeTime } from '@/utils/format';+import { copyToClipboard } from '@/utils/clipboard';import type { PatrolAutonomyLevel } from '@/api/patrol';import {partitionPatrolAttention,@@ -68,6 +69,35 @@ import {const PRIMARY_EVIDENCE_LIMIT = 3;const PRIMARY_DECISION_LIMIT = 5;+const normalizeComparableCopy = (value?: string | null) =>+ (value ?? '')+ .trim()+ .replace(/\s+/g, ' ')+ .replace(/[.!?]+$/g, '')+ .toLocaleLowerCase();++export function getPatrolDecisionDisplayTitle(item: AttentionItem): string {+ const title = item.title.trim();+ const resourceName = item.subjectResourceName.trim();+ if (!title || !resourceName) return title || resourceName || 'Current issue';++ const suffix = ` on ${resourceName}`;+ if (title.toLocaleLowerCase().endsWith(suffix.toLocaleLowerCase())) {+ const issue = title.slice(0, -suffix.length).trim();+ if (issue) return `${resourceName} · ${issue}`;+ }++ return title;+}++export function getDistinctPatrolImpact(item: AttentionItem): string {+ const impact = item.impact?.trim() ?? '';+ if (!impact) return '';+ return normalizeComparableCopy(impact) === normalizeComparableCopy(item.plainLanguageSummary)+ ? ''+ : impact;+}+const SEVERITY_PRIORITY: Record<AttentionItem['severity'], number> = {critical: 0,warning: 1,@@ -319,11 +349,11 @@ export function PatrolAttentionWorkbench(<h2 class="text-xl font-semibold tracking-tight text-base-content sm:text-2xl">{briefingHeadline()}</h2>- <p class="mt-1 text-sm leading-5 text-muted">- {attention().needsUser.length > 0- ? 'Highest priority first, based on severity, actionability, and current evidence.'- : autonomyExperience().needsYouDescription}- </p>+ <Show when={attention().needsUser.length === 0}>+ <p class="mt-1 text-sm leading-5 text-muted">+ {autonomyExperience().needsYouDescription}+ </p>+ </Show></div><div class="flex flex-wrap items-center gap-2 sm:justify-end"><Show when={!selectedItemId() && highestPriorityDecision()}>@@ -520,6 +550,11 @@ function AttentionList(props: {<For each={props.decisions}>{(decision) => {const item = decision.item;+ const displayTitle = () => getPatrolDecisionDisplayTitle(item);+ const titleLeadsWithResource = () =>+ displayTitle()+ .toLocaleLowerCase()+ .startsWith(item.subjectResourceName.trim().toLocaleLowerCase());const decisionLabel = () => {if (item.availableActions.some(@@ -544,7 +579,7 @@ function AttentionList(props: {: 'hover:bg-surface-hover'}`}aria-pressed={props.selectedItemId === item.id}- aria-label={`Open ${item.title}`}+ aria-label={`Open ${displayTitle()}`}onClick={() => props.onSelect(item.id)}><div class="flex min-w-0 items-start gap-3">@@ -554,7 +589,7 @@ function AttentionList(props: {{formatLabel(item.severity)}</MetadataBadge><span class="min-w-0 flex-1 truncate text-sm font-semibold text-base-content">- {item.title}+ {displayTitle()}</span></div><p class="mt-1 line-clamp-2 text-xs leading-5 text-muted">@@ -571,9 +606,11 @@ function AttentionList(props: {</span>)}</Show>- <span class="truncate font-medium text-base-content">- {item.subjectResourceName}- </span>+ <Show when={!titleLeadsWithResource()}>+ <span class="truncate font-medium text-base-content">+ {item.subjectResourceName}+ </span>+ </Show><span>Last seen {formatRelativeTime(item.lastObservedAt, { compact: true })}</span>@@ -661,6 +698,7 @@ function AttentionDetail(props: {onUnsuppress: (itemId: string) => Promise<void>;onOpenFindings?: () => void;}) {+ const [copiedResourceId, setCopiedResourceId] = createSignal('');const detail = () => props.detail;const item = () => detail()?.item;const orderedEvidence = createMemo(() =>@@ -735,6 +773,9 @@ function AttentionDetail(props: {},});};+ const copyResourceId = async (value: string) => {+ if (await copyToClipboard(value)) setCopiedResourceId(value);+ };return (<aside@@ -791,7 +832,7 @@ function AttentionDetail(props: {</div></div><h3 id="attention-detail-title" class="mt-1 text-sm font-semibold text-base-content">- {item()?.title ?? 'Loading attention item'}+ {item() ? getPatrolDecisionDisplayTitle(item()!) : 'Loading attention item'}</h3><Show when={props.queuePosition() && props.queueCount() > 1}><div class="mt-3 grid grid-cols-2 gap-2 lg:hidden" aria-label="Review queue navigation">@@ -831,21 +872,55 @@ function AttentionDetail(props: {{(loaded) => (<div class="space-y-5 px-4 py-4 sm:px-5"><section>- <div class="flex flex-wrap items-center gap-2">+ <div class="flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted"><StateBadge item={loaded().item} />- <EvidenceLabel item={loaded().item} badge />- <ProtectionLabel item={loaded().item} badge />+ <span aria-hidden="true">·</span>+ <EvidenceLabel item={loaded().item} detail />+ <span aria-hidden="true">·</span>+ <ProtectionLabel item={loaded().item} detail /></div><p class="mt-3 text-sm leading-6 text-base-content">{loaded().item.plainLanguageSummary}</p>+ <Show when={aiChatStore.enabled === true}>+ <Button+ variant="ghost"+ size="sm"+ class="mt-2 min-h-11 gap-1.5 px-2 text-blue-700 hover:bg-surface-hover hover:underline dark:text-blue-300 sm:min-h-0"+ onClick={openAssistant}+ >+ <SparklesIcon class="h-4 w-4" aria-hidden="true" />+ Explain with Assistant+ </Button>+ </Show></section><DetailSection title="Affected resource">- <p class="text-sm font-medium text-base-content">- {loaded().item.subjectResourceName}- </p>- <p class="mt-1 break-all text-xs text-muted">{loaded().item.subjectResourceId}</p>+ <div class="flex flex-wrap items-center gap-2">+ <p class="text-sm font-medium text-base-content">+ {loaded().item.subjectResourceName}+ </p>+ <CopyValueButton+ value={loaded().item.subjectResourceId}+ copied={copiedResourceId() === loaded().item.subjectResourceId}+ onCopyValue={copyResourceId}+ label="Copy resource identifier"+ variant="ghost"+ size="xs"+ class="min-h-11 sm:min-h-0"+ >+ <span class="text-xs">Copy ID</span>+ </CopyValueButton>+ <ButtonLink+ href={resourceHref()}+ variant="ghost"+ size="xs"+ class="min-h-11 gap-1.5 sm:min-h-0"+ >+ <ExternalLinkIcon class="h-4 w-4" aria-hidden="true" />+ Open resource+ </ButtonLink>+ </div><Show when={loaded().item.relatedResources.length > 0}><p class="mt-2 text-xs text-muted">{loaded().item.relatedResources.length} related{' '}@@ -854,17 +929,20 @@ function AttentionDetail(props: {</Show></DetailSection>- <Show when={loaded().item.impact || loaded().item.recommendedNextStep}>- <DetailSection title="What to do">- <Show when={loaded().item.impact}>- {(impact) => <p class="text-xs leading-5 text-muted">Impact: {impact()}</p>}- </Show>- <Show when={loaded().item.recommendedNextStep}>- {(nextStep) => (- <p class="mt-2 text-sm font-medium leading-5 text-base-content">{nextStep()}</p>- )}- </Show>- </DetailSection>+ <Show when={getDistinctPatrolImpact(loaded().item)}>+ {(impact) => (+ <DetailSection title="Why it matters">+ <p class="text-xs leading-5 text-muted">{impact()}</p>+ </DetailSection>+ )}+ </Show>++ <Show when={loaded().item.recommendedNextStep}>+ {(nextStep) => (+ <DetailSection title="Next step">+ <p class="text-sm font-medium leading-5 text-base-content">{nextStep()}</p>+ </DetailSection>+ )}</Show><Show when={loaded().item.availableActions[0]}>@@ -922,126 +1000,111 @@ function AttentionDetail(props: {onOpenFindings={props.onOpenFindings}/>- <DetailSection title="Evidence">- <Show- when={orderedEvidence().length > 0}- fallback={- <p class="text-xs leading-5 text-amber-700 dark:text-amber-300">- Evidence detail is unavailable. Pulse has not presented this as confirmed.- </p>- }- >- <Show when={olderEvidence().length > 0}>- <p class="mb-2 text-xs text-muted">- Showing the latest {primaryEvidence().length} of {orderedEvidence().length}{' '}- observations.- </p>- </Show>- <ul class="space-y-2">- <For each={primaryEvidence()}>- {(evidence) => <EvidenceObservation evidence={evidence} />}- </For>- </ul>- <Show when={olderEvidence().length > 0}>- <details class="mt-2 rounded-md border border-border-subtle bg-surface-alt/30">- <summary class="flex min-h-11 cursor-pointer items-center px-3 py-2 text-xs font-medium text-base-content focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 sm:min-h-0">- Show {olderEvidence().length} older{' '}- {olderEvidence().length === 1 ? 'observation' : 'observations'}- </summary>- <ul class="space-y-2 border-t border-border-subtle p-2">- <For each={olderEvidence()}>+ <details class="rounded-lg border border-border-subtle bg-surface-alt/20">+ <summary class="flex min-h-11 cursor-pointer items-center justify-between gap-3 px-3 py-2 text-sm font-medium text-base-content focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500">+ <span>Evidence and history</span>+ <span class="text-xs font-normal text-muted">+ {orderedEvidence().length}{' '}+ {orderedEvidence().length === 1 ? 'observation' : 'observations'}+ </span>+ </summary>+ <div class="space-y-5 border-t border-border-subtle px-3 py-4">+ <DetailSection title="Evidence">+ <Show+ when={orderedEvidence().length > 0}+ fallback={+ <p class="text-xs leading-5 text-amber-700 dark:text-amber-300">+ Evidence detail is unavailable. Pulse has not presented this as confirmed.+ </p>+ }+ >+ <ul class="space-y-2">+ <For each={primaryEvidence()}>{(evidence) => <EvidenceObservation evidence={evidence} />}</For></ul>- </details>- </Show>- </Show>- </DetailSection>-- <DetailSection title="Protection">- <Show- when={loaded().item.protectionPosture}- fallback={- <p class="text-xs leading-5 text-muted">- No current protection posture is attached to this resource. This means unknown,- not unprotected.- </p>- }- >- {(posture) => (- <>- <p class="text-xs leading-5 text-muted">{posture().explanation}</p>- <Show when={posture().providerStates.length > 0}>- <ul class="mt-2 space-y-2">- <For each={posture().providerStates}>- {(provider) => (- <li class="rounded-md border border-border-subtle px-3 py-2 text-xs">- <span class="font-medium text-base-content">- {formatProvider(provider.provider)}- </span>- <ProtectionProviderMetadata provider={provider} />- </li>- )}- </For>- </ul>+ <Show when={olderEvidence().length > 0}>+ <details class="mt-2 rounded-md border border-border-subtle bg-surface-alt/30">+ <summary class="flex min-h-11 cursor-pointer items-center px-3 py-2 text-xs font-medium text-base-content focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-500 sm:min-h-0">+ Show {olderEvidence().length} older{' '}+ {olderEvidence().length === 1 ? 'observation' : 'observations'}+ </summary>+ <ul class="space-y-2 border-t border-border-subtle p-2">+ <For each={olderEvidence()}>+ {(evidence) => <EvidenceObservation evidence={evidence} />}+ </For>+ </ul>+ </details></Show>- </>- )}- </Show>- </DetailSection>+ </Show>+ </DetailSection>- <DetailSection title="Timeline">- <Show- when={loaded().timeline.length > 0}- fallback={- <p class="text-xs leading-5 text-muted">- No earlier lifecycle transitions are recorded. This is the first observed state.- </p>- }- >- <ol class="space-y-3">- <For each={loaded().timeline}>- {(transition) => (- <li class="border-l-2 border-border pl-3">- <p class="text-xs font-medium text-base-content">- {formatLabel(transition.from)} to {formatLabel(transition.to)}- </p>- <p class="mt-0.5 text-[11px] text-muted">- {formatRelativeTime(transition.at, { compact: true })} ·{' '}- {formatLabel(transition.cause)}- </p>- <Show when={transition.reason}>- {(reason) => <p class="mt-1 text-xs leading-5 text-muted">{reason()}</p>}+ <DetailSection title="Protection">+ <Show+ when={loaded().item.protectionPosture}+ fallback={+ <p class="text-xs leading-5 text-muted">+ No current protection posture is attached to this resource. This means+ unknown, not unprotected.+ </p>+ }+ >+ {(posture) => (+ <>+ <p class="text-xs leading-5 text-muted">{posture().explanation}</p>+ <Show when={posture().providerStates.length > 0}>+ <ul class="mt-2 space-y-2">+ <For each={posture().providerStates}>+ {(provider) => (+ <li class="rounded-md border border-border-subtle px-3 py-2 text-xs">+ <span class="font-medium text-base-content">+ {formatProvider(provider.provider)}+ </span>+ <ProtectionProviderMetadata provider={provider} />+ </li>+ )}+ </For>+ </ul></Show>- </li>+ </>)}- </For>- </ol>- </Show>- </DetailSection>+ </Show>+ </DetailSection>- <div class="flex flex-wrap gap-2 border-t border-border pt-4">- <ButtonLink- href={resourceHref()}- variant="secondary"- size="sm"- class="min-h-11 gap-1.5 sm:min-h-0"- >- <ExternalLinkIcon class="h-4 w-4" aria-hidden="true" />- Open resource- </ButtonLink>- <Show when={aiChatStore.enabled === true}>- <Button- variant="secondary"- size="sm"- class="min-h-11 gap-1.5 sm:min-h-0"- onClick={openAssistant}- >- <SparklesIcon class="h-4 w-4" aria-hidden="true" />- Explain with Assistant- </Button>- </Show>- </div>+ <DetailSection title="Timeline">+ <Show+ when={loaded().timeline.length > 0}+ fallback={+ <p class="text-xs leading-5 text-muted">+ No earlier lifecycle transitions are recorded. This is the first observed+ state.+ </p>+ }+ >+ <ol class="space-y-3">+ <For each={loaded().timeline}>+ {(transition) => (+ <li class="border-l-2 border-border pl-3">+ <p class="text-xs font-medium text-base-content">+ {formatLabel(transition.from)} to {formatLabel(transition.to)}+ </p>+ <p class="mt-0.5 text-[11px] text-muted">+ {formatRelativeTime(transition.at, { compact: true })} ·{' '}+ {formatLabel(transition.cause)}+ </p>+ <Show when={transition.reason}>+ {(reason) => (+ <p class="mt-1 text-xs leading-5 text-muted">{reason()}</p>+ )}+ </Show>+ </li>+ )}+ </For>+ </ol>+ </Show>+ </DetailSection>+ </div>+ </details></div>)}</Show>@@ -1229,33 +1292,38 @@ function AttentionLifecycleControls(props: {{props.error}</p></Show>- <div class="mt-3 border-t border-border-subtle pt-3 text-xs leading-5 text-muted">- <p>- Mark reviewed removes this occurrence from today's decision inbox while keeping its- record. Suppression hides it only until the selected return time.- </p>- <p class="mt-1">- For a permanent change,{' '}- <A- href={ALERT_THRESHOLDS_PATH}- class="font-medium text-blue-700 hover:underline dark:text-blue-300"- >- adjust alert thresholds- </A>{' '}- to change or turn off this alert for the affected resource- <Show when={props.onOpenFindings} fallback=".">- , or{' '}- <button- type="button"+ <details class="mt-3 border-t border-border-subtle pt-2 text-xs leading-5 text-muted">+ <summary class="min-h-11 cursor-pointer py-2 font-medium text-base-content focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0">+ More ways to manage this issue+ </summary>+ <div class="pb-1">+ <p>+ Mark reviewed removes this occurrence from today's decision inbox while keeping its+ record. Suppression hides it only until the selected return time.+ </p>+ <p class="mt-1">+ For a permanent change,{' '}+ <A+ href={ALERT_THRESHOLDS_PATH}class="font-medium text-blue-700 hover:underline dark:text-blue-300"- onClick={() => props.onOpenFindings?.()}>- review Patrol findings- </button>{' '}- to mark a finding as expected so Patrol stops raising it.- </Show>- </p>- </div>+ adjust alert thresholds+ </A>{' '}+ to change or turn off this alert for the affected resource+ <Show when={props.onOpenFindings} fallback=".">+ , or{' '}+ <button+ type="button"+ class="font-medium text-blue-700 hover:underline dark:text-blue-300"+ onClick={() => props.onOpenFindings?.()}+ >+ review Patrol findings+ </button>{' '}+ to mark a finding as expected so Patrol stops raising it.+ </Show>+ </p>+ </div>+ </details></div></DetailSection>);@@ -1362,7 +1430,7 @@ function StateBadge(props: { item: AttentionItem }) {);}-function EvidenceLabel(props: { item: AttentionItem; badge?: boolean }) {+function EvidenceLabel(props: { item: AttentionItem; badge?: boolean; detail?: boolean }) {const presentation = () =>getPatrolAttentionEvidencePresentation(props.item.evidenceFreshness,@@ -1375,10 +1443,11 @@ function EvidenceLabel(props: { item: AttentionItem; badge?: boolean }) {</MetadataBadge>);}+ if (props.detail) return <span>{presentation().detailLabel}</span>;return <Show when={presentation().rowLabel}>{(label) => <span>{label()}</span>}</Show>;}-function ProtectionLabel(props: { item: AttentionItem; badge?: boolean }) {+function ProtectionLabel(props: { item: AttentionItem; badge?: boolean; detail?: boolean }) {const presentation = () =>getPatrolAttentionProtectionPresentation(props.item.protectionPosture?.state);if (props.badge) {@@ -1388,6 +1457,7 @@ function ProtectionLabel(props: { item: AttentionItem; badge?: boolean }) {</MetadataBadge>);}+ if (props.detail) return <span>{presentation().detailLabel}</span>;return <Show when={presentation().rowLabel}>{(label) => <span>{label()}</span>}</Show>;}diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsxindex f59da76419..91fe7ba455 100644--- a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx@@ -301,7 +301,7 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceStateclass="relative z-[200] mb-3"/>- <section class="border-y border-border">+ <section id={PATROL_CONTROL_ANCHOR} class="border-y border-border"><div class="flex flex-col gap-3 px-1 py-2 sm:px-2 lg:flex-row lg:items-center lg:justify-between"><div class="flex min-w-0 items-start gap-3"><div class="pt-0.5">@@ -330,6 +330,12 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState<Show when={!state.shouldShowPatrolSetupOnly() && triggerStatusSummary()}><p class="mt-1 text-xs leading-5 text-muted">{triggerStatusSummary()}</p></Show>+ <Show when={!shouldShowAutonomyActionColumn()}>+ <div class="mt-1 flex flex-wrap items-baseline gap-x-2 text-xs leading-5 text-muted">+ <span class="font-semibold text-base-content">Patrol mode</span>+ <span>{selectedAutonomyPolicy().detail}</span>+ </div>+ </Show><Show when={!state.shouldShowPatrolSetupOnly() && recency().timestamp}><div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-5 text-muted"><span>@@ -376,19 +382,21 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState</Show></div>- <details id={PATROL_CONTROL_ANCHOR} class="border-t border-border-subtle px-1 py-1 sm:px-2">- <summary class="min-h-11 cursor-pointer text-xs font-medium text-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0">- Mode and automation- </summary>- <div class="pt-3">- <span id={PATROL_OPERATIONS_LOOP_ANCHOR} class="sr-only" aria-hidden="true" />- {renderAutonomyPolicyControl({- ariaLabel: 'Patrol mode',- layoutClass: 'flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between',- controlClass: 'w-full lg:w-[34rem]',- })}- </div>- </details>+ <span id={PATROL_OPERATIONS_LOOP_ANCHOR} class="sr-only" aria-hidden="true" />+ <Show when={shouldShowAutonomyActionColumn()}>+ <details class="border-t border-border-subtle px-1 py-1 sm:px-2">+ <summary class="min-h-11 cursor-pointer text-xs font-medium text-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 sm:min-h-0">+ Mode and automation+ </summary>+ <div class="pt-3">+ {renderAutonomyPolicyControl({+ ariaLabel: 'Patrol mode',+ layoutClass: 'flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between',+ controlClass: 'w-full lg:w-[34rem]',+ })}+ </div>+ </details>+ </Show></section></div>);diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsxindex efece3dd63..25da94f04d 100644--- a/frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx@@ -4,7 +4,6 @@ import ClipboardCheckIcon from 'lucide-solid/icons/clipboard-check';import HistoryIcon from 'lucide-solid/icons/history';import { ButtonLink } from '@/components/shared/Button';import { MetadataBadge } from '@/components/shared/MetadataBadge';-import { aiIntelligenceStore } from '@/stores/aiIntelligence';import { actionInboxStore } from '@/stores/actionInbox';import { usePatrolIntelligenceState } from './usePatrolIntelligenceState';import { PatrolIntelligenceHeader } from './PatrolIntelligenceHeader';@@ -23,7 +22,6 @@ export function PatrolIntelligenceSurface() {const [findingsOpen, setFindingsOpen] = createSignal(false);const workspaceTabs: Partial<Record<PatrolWorkspaceView, HTMLButtonElement>> = {};let findingsPanel: HTMLDetailsElement | undefined;- const openWorkCount = () => aiIntelligenceStore.patrolOpenWorkCount;const activateView = (view: PatrolWorkspaceView, focus = false) => {setActiveView(view);if (focus) queueMicrotask(() => workspaceTabs[view]?.focus());@@ -179,21 +177,9 @@ export function PatrolIntelligenceSurface() {<HistoryIcon class="h-5 w-5" aria-hidden="true" /></span><span class="min-w-0">- <span class="flex flex-wrap items-center gap-2 text-sm font-semibold text-base-content">- Findings and run records- <Show when={openWorkCount() > 0}>- <MetadataBadge- tone="info"- size="xs"- shape="rounded"- aria-label={`${openWorkCount()} open patrol ${openWorkCount() === 1 ? 'finding' : 'findings'}`}- >- {openWorkCount()} open- </MetadataBadge>- </Show>- </span>+ <span class="text-sm font-semibold text-base-content">Patrol records</span><span class="mt-1 block text-xs font-normal leading-5 text-muted">- Inspect finding detail, check results, and historical runs.+ Inspect findings and check history when you need the forensic trail.</span></span></span>@@ -213,7 +199,7 @@ export function PatrolIntelligenceSurface() {open={findingsOpen()}onToggle={(event) => setFindingsOpen(event.currentTarget.open)}>- <summary class="sr-only">Findings and run records</summary>+ <summary class="sr-only">Patrol records</summary><divclass={`space-y-4 border-t border-border p-4 sm:p-5 ${!state.patrolEnabledLocal() ? 'opacity-50 pointer-events-none' : ''}`}>diff --git a/frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsx b/frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsxindex aae5122e87..045f1a4135 100644--- a/frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsx+++ b/frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsx@@ -41,6 +41,12 @@ const coveragePresentation = (const formatObjectiveError = (error: unknown): string =>error instanceof Error ? error.message : 'The objective could not be saved.';+const STARTER_OBJECTIVES = [+ 'Keep my critical services available',+ 'Warn me before storage fills up',+ 'Keep backup protection current',+] as const;+export const PatrolObjectivesPanel: Component = () => {let dialogReturnFocus: HTMLElement | null = null;const { resources } = useResources();@@ -110,9 +116,10 @@ export const PatrolObjectivesPanel: Component = () => {restoreDialogFocus();};- const openCreate = (trigger: HTMLElement) => {+ const openCreate = (trigger: HTMLElement, starterBrief = '') => {dialogReturnFocus = trigger;resetForm();+ setBrief(starterBrief);setDialogOpen(true);};@@ -232,12 +239,26 @@ export const PatrolObjectivesPanel: Component = () => {<Showwhen={objectives().length > 0}fallback={- <div class="flex min-h-24 flex-col justify-center rounded-lg border border-dashed border-border px-4 py-4">+ <div class="rounded-lg border border-dashed border-border px-4 py-4"><p class="text-sm font-semibold text-base-content">Choose what matters most</p>- <p class="mt-1 text-xs leading-5 text-muted">- For example, “Keep my cameras available” or “Keep disk use below 85%”. Patrol- works out how to observe it safely.+ <p class="mt-1 max-w-2xl text-xs leading-5 text-muted">+ Start with an outcome. Patrol works out how to observe it safely and tells you+ when coverage is ready.</p>+ <p class="mt-3 text-xs font-medium text-base-content">Start with</p>+ <div class="mt-2 flex flex-wrap gap-2" aria-label="Example protected outcomes">+ <For each={STARTER_OBJECTIVES}>+ {(starter) => (+ <Button+ variant="secondary"+ size="sm"+ onClick={(event) => openCreate(event.currentTarget, starter)}+ >+ {starter}+ </Button>+ )}+ </For>+ </div></div>}>diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsx b/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsxindex b4641bab6f..8fa07523cd 100644--- a/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsx+++ b/frontend-modern/src/features/patrol/__tests__/PatrolAttentionWorkbench.test.tsx@@ -67,6 +67,8 @@ vi.mock('@/features/actions/ActionReviewDialog', async () => {});import {+ getDistinctPatrolImpact,+ getPatrolDecisionDisplayTitle,PatrolAttentionWorkbench,sortPatrolAttentionDecisions,} from '../PatrolAttentionWorkbench';@@ -234,7 +236,7 @@ describe('PatrolAttentionWorkbench', () => {).toBeInTheDocument();expect(screen.getByRole('button', { name: 'Start review' })).toBeInTheDocument();expect(- screen.getByRole('button', { name: 'Open Disk pressure on Database VM' }),+ screen.getByRole('button', { name: 'Open Database VM · Disk pressure' }),).toBeInTheDocument();expect(screen.queryByText("Today's Patrol briefing")).not.toBeInTheDocument();expect(screen.queryByRole('heading', { name: 'Decision inbox' })).not.toBeInTheDocument();@@ -310,7 +312,7 @@ describe('PatrolAttentionWorkbench', () => {/1 other current issue is continuing without a decision under Safe auto-fix/i,),).toBeInTheDocument();- expect(screen.queryByRole('button', { name: /Open Disk pressure/ })).not.toBeInTheDocument();+ expect(screen.queryByRole('button', { name: /Open Database VM/ })).not.toBeInTheDocument();});it('keeps a long decision queue compact until the operator asks for all of it', async () => {@@ -365,6 +367,17 @@ describe('PatrolAttentionWorkbench', () => {]);});+ it('leads generated decision titles with the resource and removes repeated impact copy', () => {+ const active = item({+ plainLanguageSummary: 'The database disk is nearly full.',+ impact: 'The database disk is nearly full.',+ });++ expect(getPatrolDecisionDisplayTitle(active)).toBe('Database VM · Disk pressure');+ expect(getDistinctPatrolImpact(active)).toBe('');+ expect(getDistinctPatrolImpact(item())).toBe('Writes may fail.');+ });+it('opens deepest typed evidence, protection, and timeline detail from one queue item', async () => {const active = item();apiMocks.getList.mockResolvedValue(@@ -374,14 +387,19 @@ describe('PatrolAttentionWorkbench', () => {renderWorkbench();const openButton = await screen.findByRole('button', {- name: 'Open Disk pressure on Database VM',+ name: 'Open Database VM · Disk pressure',});fireEvent.click(openButton);const detailRegion = await screen.findByRole('complementary', {- name: 'Disk pressure on Database VM',+ name: 'Database VM · Disk pressure',});- expect(within(detailRegion).getByText(/Impact: Writes may fail\./)).toBeInTheDocument();+ expect(within(detailRegion).getByText('Writes may fail.')).toBeInTheDocument();+ expect(within(detailRegion).getByText('Evidence and history')).toBeInTheDocument();+ expect(+ within(detailRegion).getByRole('button', { name: 'Copy resource identifier' }),+ ).toBeInTheDocument();+ expect(within(detailRegion).queryByText('pve:vm:101')).not.toBeInTheDocument();expect(within(detailRegion).getByText(/latest backup has not been verified/i),).toBeInTheDocument();@@ -433,7 +451,7 @@ describe('PatrolAttentionWorkbench', () => {apiMocks.getDetail.mockResolvedValue(detail(unknownTrust));renderWorkbench();- const row = await screen.findByRole('button', { name: 'Open Disk pressure on Database VM' });+ const row = await screen.findByRole('button', { name: 'Open Database VM · Disk pressure' });expect(within(row).queryByText(/Evidence/)).not.toBeInTheDocument();expect(within(row).queryByText(/timing/i)).not.toBeInTheDocument();expect(within(row).queryByText('Unknown / Complete')).not.toBeInTheDocument();@@ -442,7 +460,7 @@ describe('PatrolAttentionWorkbench', () => {fireEvent.click(row);const detailRegion = await screen.findByRole('complementary', {- name: 'Disk pressure on Database VM',+ name: 'Database VM · Disk pressure',});expect(within(detailRegion).getByText('Evidence recorded')).toBeInTheDocument();expect(within(detailRegion).getByText('Protection status unavailable')).toBeInTheDocument();@@ -469,16 +487,17 @@ describe('PatrolAttentionWorkbench', () => {fireEvent.click(await screen.findByRole('button', {- name: 'Open Disk pressure on Database VM',+ name: 'Open Database VM · Disk pressure',}),);const detailRegion = await screen.findByRole('complementary', {- name: 'Disk pressure on Database VM',+ name: 'Database VM · Disk pressure',});+ expect(within(detailRegion).getByText('5 observations')).toBeInTheDocument();expect(- within(detailRegion).getByText('Showing the latest 3 of 5 observations.'),- ).toBeInTheDocument();+ within(detailRegion).queryByText('Showing the latest 3 of 5 observations.'),+ ).not.toBeInTheDocument();expect(within(detailRegion).getByText('Show 2 older observations')).toBeInTheDocument();});@@ -516,7 +535,7 @@ describe('PatrolAttentionWorkbench', () => {fireEvent.click(await screen.findByRole('button', {- name: 'Open Disk pressure on Database VM',+ name: 'Open Database VM · Disk pressure',}),);expect(await screen.findByText('Decision 1 of 2')).toBeInTheDocument();@@ -557,7 +576,7 @@ describe('PatrolAttentionWorkbench', () => {fireEvent.click(await screen.findByRole('button', {- name: 'Open Disk pressure on Database VM',+ name: 'Open Database VM · Disk pressure',}),);fireEvent.click(await screen.findByRole('button', { name: 'Suppress temporarily' }));@@ -618,7 +637,7 @@ describe('PatrolAttentionWorkbench', () => {fireEvent.click(await screen.findByRole('button', {- name: 'Open Disk pressure on Database VM',+ name: 'Open Database VM · Disk pressure',}),);@@ -641,7 +660,7 @@ describe('PatrolAttentionWorkbench', () => {fireEvent.click(await screen.findByRole('button', {- name: 'Open Disk pressure on Database VM',+ name: 'Open Database VM · Disk pressure',}),);diff --git a/frontend-modern/src/features/patrol/__tests__/PatrolObjectivesPanel.test.tsx b/frontend-modern/src/features/patrol/__tests__/PatrolObjectivesPanel.test.tsxindex 7a35ad3dab..a782d79349 100644--- a/frontend-modern/src/features/patrol/__tests__/PatrolObjectivesPanel.test.tsx+++ b/frontend-modern/src/features/patrol/__tests__/PatrolObjectivesPanel.test.tsx@@ -72,6 +72,18 @@ describe('PatrolObjectivesPanel', () => {);});+ it('turns a starter outcome into an editable objective draft', async () => {+ render(() => <PatrolObjectivesPanel />);+ expect(await screen.findByText('Choose what matters most')).toBeInTheDocument();++ fireEvent.click(screen.getByRole('button', { name: 'Warn me before storage fills up' }));++ expect(screen.getByRole('dialog', { name: 'Add a Patrol objective' })).toBeInTheDocument();+ expect(screen.getByLabelText('What should Patrol keep true?')).toHaveValue(+ 'Warn me before storage fills up',+ );+ });+it('shows truthful coverage and supports pause, edit, and delete controls', async () => {api.get.mockResolvedValue([objective]);vi.spyOn(window, 'confirm').mockReturnValue(true);