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.

patrol: add finding-level at-need Pulse Pro handoff for plan-locked installs

rcourtman6b610ebed969
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index fe61c9e727..0971a799d8 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -1767,7 +1767,11 @@ payload shape change when the portal presents compact client rows.
not render a disabled paid-level matrix, compact Pro badges, or any paid-mode
disclosure. The free surface stays clean of paid-feature surfacing; Pro
discovery belongs in Settings, website/docs, and contextual at-need prompts,
- not in the daily-use control surface, and the selector must still avoid Limits
+ not in the daily-use control surface. The one allowed at-need prompt is a
+ single finding-level Pulse Pro capability line in the expanded finding
+ primary-action area for plan-locked installs on active critical or warning
+ findings, with its upgrade action gated by the upgrade-prompt policy, and the
+ selector must still avoid Limits
controls, hard-limit matrices, or absent-feature explainers.
Compact control labels remain understandable decisions such as `Ask first`,
`Safe auto-fix`, and
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index dbe01cb2a3..41526f0984 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1336,7 +1336,10 @@ settings`, and candidate review when discovered sources are waiting. It must
paid-level matrix, compact Pro badges, or any paid-mode disclosure. The free
Patrol working surface stays clear of paid-feature surfacing entirely; Pro
discovery belongs in Settings, website/docs, and contextual at-need prompts,
- not beside the daily-use selector. Visible product copy calls the selector `Patrol mode`; compatibility route and wire identifiers may keep stable names
+ not beside the daily-use selector. The one allowed at-need prompt is a
+ single finding-level Pulse Pro capability line in the expanded finding
+ primary-action area for plan-locked installs on active critical or warning
+ findings, with its upgrade action gated by the upgrade-prompt policy. Visible product copy calls the selector `Patrol mode`; compatibility route and wire identifiers may keep stable names
such as `patrol_control` and `patrolControl*`. The always-visible Patrol mode selector must stay on
the selected mode and one plain summary, without a separate `Limits`
disclosure or hard-limit matrix beside the picker. Shared feature shells must not invent their own Patrol safety
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 95dd428ff3..b79b692347 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -105,7 +105,12 @@ Patrol-specific presentation helpers.
The free Patrol surface stays a complete, clean monitoring tool with no
mention of paid Patrol capabilities; Pro discovery belongs in Settings, the
website/docs, and contextual at-need prompts, not in the daily-use Patrol
- control surface. The selected mode must remain Watch only and the copy must
+ control surface. The single allowed contextual at-need prompt is the
+ finding-level Pulse Pro investigation handoff: it may appear only in the
+ expanded finding primary-action area, only for plan-locked installs, only on
+ active critical or warning findings, only as one non-salesy capability line,
+ with the upgrade action gated by the upgrade-prompt policy, and never as an
+ ambient matrix, badge, or paid-mode disclosure. The selected mode must remain Watch only and the copy must
not become a feature-matrix or absence explainer.
Paid Patrol control handoffs that start or continue the same
journey must reach Patrol through the route-backed
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 7ce8d781e5..7cab44eb78 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -4947,6 +4947,7 @@
"test_prefixes": [],
"exact_files": [
"frontend-modern/src/components/Brand/__tests__/PulsePatrolLogo.test.tsx",
+ "frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts",
"frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts",
"frontend-modern/src/features/patrol/__tests__/patrolInvestigationContextModel.test.ts",
"frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx",
diff --git a/frontend-modern/src/components/AI/FindingsPanel.tsx b/frontend-modern/src/components/AI/FindingsPanel.tsx
index e9291ae8fb..e7d176756b 100644
--- a/frontend-modern/src/components/AI/FindingsPanel.tsx
+++ b/frontend-modern/src/components/AI/FindingsPanel.tsx
@@ -16,6 +16,7 @@ import { Card } from '@/components/shared/Card';
import { FormSelect } from '@/components/shared/FormSelect';
import { LoadingSpinner } from '@/components/shared/LoadingSpinner';
import { MetadataBadge } from '@/components/shared/MetadataBadge';
+import { UpgradeButtonLink } from '@/components/shared/UpgradeLink';
import { aiIntelligenceStore, type UnifiedFinding } from '@/stores/aiIntelligence';
import { notificationStore } from '@/stores/notifications';
import { aiChatStore } from '@/stores/aiChat';
@@ -41,6 +42,7 @@ import { getSemanticTonePresentation } from '@/utils/semanticTonePresentation';
import { formatIdentifierLabel } from '@/utils/textPresentation';
import type { IntelligenceHealthScore } from '@/types/aiIntelligence';
import { getPatrolFindingsEmptyState } from '@/utils/patrolEmptyStatePresentation';
+import type { UpgradeDestination } from '@/utils/upgradeNavigation';
import CheckCircleIcon from 'lucide-solid/icons/check-circle';
import AlertCircleIcon from 'lucide-solid/icons/alert-circle';
import AlertTriangleIcon from 'lucide-solid/icons/alert-triangle';
@@ -105,6 +107,9 @@ interface FindingsPanelProps {
patrolRuns?: PatrolRunRecord[];
findingsSource?: 'unified' | 'patrol';
onAssistantHandoff?: (finding: UnifiedFinding) => void;
+ patrolProHandoff?: (
+ finding: UnifiedFinding,
+ ) => { detail: string; actionLabel?: string; destination?: UpgradeDestination } | undefined;
runSnapshot?: Pick<
PatrolRunRecord,
| 'resources_checked'
@@ -1205,6 +1210,7 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
const relatedFindings = options.relatedFindings ?? [];
const shouldShowAssistantPrimaryAction = !isPatrolFindingsSource();
const shouldShowAssistantManageAction = isPatrolFindingsSource() && !primaryAction;
+ const proHandoff = !primaryAction ? props.patrolProHandoff?.(finding) : undefined;
const shouldShowExpandedManageMenu =
!primaryAction ||
manualControls.acknowledge ||
@@ -1419,6 +1425,22 @@ export const FindingsPanel: Component<FindingsPanelProps> = (props) => {
{getPrimaryAssistantFindingAction(finding).label}
</button>
</Show>
+ <Show when={proHandoff}>
+ <div class="flex flex-wrap items-center gap-2">
+ <span class="text-muted">{proHandoff!.detail}</span>
+ <Show when={proHandoff!.destination} keyed>
+ {(destination) => (
+ <UpgradeButtonLink
+ destination={destination}
+ size="sm"
+ mobileFullWidth={false}
+ >
+ {proHandoff!.actionLabel}
+ </UpgradeButtonLink>
+ )}
+ </Show>
+ </div>
+ </Show>
<Show when={shouldShowExpandedManageMenu}>
<details onClick={(e) => e.stopPropagation()}>
diff --git a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
index 9b8e8ddae3..f546f8c628 100644
--- a/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
+++ b/frontend-modern/src/components/AI/__tests__/FindingsPanel.test.ts
@@ -70,6 +70,14 @@ describe('FindingsPanel assistant handoff', () => {
expect(findingsPanelSource).toContain('<LoadingSpinner size="md" />');
});
+ it('renders the plan-locked at-need Pulse Pro handoff in the finding primary-action area', () => {
+ expect(findingsPanelSource).toContain('patrolProHandoff?:');
+ expect(findingsPanelSource).toContain('{proHandoff!.detail}');
+ expect(findingsPanelSource).toContain('UpgradeButtonLink');
+ expect(patrolWorkspaceSource).toContain('getPatrolProInvestigationHandoff');
+ expect(patrolWorkspaceSource).toContain('patrolProHandoff=');
+ });
+
it('routes Patrol investigation records into the Assistant briefing context', () => {
expect(findingsPanelSource).toContain('buildPatrolAssistantFindingHandoffFromUnifiedFinding');
expect(findingsPanelSource).toContain('buildPatrolAssistantApprovalBriefingInput');
diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx
index cd378cd126..f324283c38 100644
--- a/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx
+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceWorkspace.tsx
@@ -21,6 +21,7 @@ import { MetadataBadge } from '@/components/shared/MetadataBadge';
import { StatusIndicatorBadge } from '@/components/shared/StatusIndicatorBadge';
import { getPatrolProviderSettingsAction } from '@/utils/patrolRuntimeActions';
import {
+ getPatrolProInvestigationHandoff,
getPatrolQueueBadgeLabel,
getPatrolQueueWorkspaceDescription,
getPatrolSetupIssueReason,
@@ -32,6 +33,11 @@ import {
PATROL_WORKSPACE_SETUP_TITLE,
} from './patrolControlPresentation';
import type { PatrolIntelligenceState } from './usePatrolIntelligenceState';
+import { getUpgradeActionDestination } from '@/stores/licenseCommercial';
+import {
+ presentationPolicyHidesCommercialSurfaces,
+ presentationPolicyHidesUpgradePrompts,
+} from '@/stores/sessionPresentationPolicy';
export function PatrolIntelligenceWorkspace(props: { state: PatrolIntelligenceState }) {
const state = props.state;
@@ -237,6 +243,16 @@ export function PatrolIntelligenceWorkspace(props: { state: PatrolIntelligenceSt
runSnapshot={state.selectedRun() ?? undefined}
showControls={!state.selectedRun()}
onAssistantHandoff={(finding) => state.handleAssistantFindingHandoff(finding.id)}
+ patrolProHandoff={(finding) =>
+ getPatrolProInvestigationHandoff({
+ autoFixLocked: state.autoFixLocked(),
+ commercialSurfacesHidden: presentationPolicyHidesCommercialSurfaces(),
+ upgradePromptsHidden: presentationPolicyHidesUpgradePrompts(),
+ upgradeDestination: getUpgradeActionDestination('ai_autofix'),
+ severity: finding.severity,
+ status: finding.status,
+ })
+ }
/>
}
>
diff --git a/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts b/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts
index 389b36ab90..047bc9891c 100644
--- a/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts
+++ b/frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import type { PatrolAutonomyLevel } from '@/api/patrol';
import {
+ getPatrolProInvestigationHandoff,
getPatrolQueueBadgeLabel,
getPatrolQueueWorkspaceDescription,
getPatrolReadyWorkDetail,
@@ -125,4 +126,61 @@ describe('patrolControlPresentation', () => {
);
expect(getPatrolSetupIssueReason({})).toBe('Provider settings need attention');
});
+
+ it('surfaces the Pulse Pro at-need handoff only for actionable active findings on plan-locked installs', () => {
+ const destination = { href: '/settings/billing', external: false };
+ const base = {
+ autoFixLocked: true,
+ commercialSurfacesHidden: false,
+ upgradePromptsHidden: false,
+ upgradeDestination: destination,
+ };
+
+ expect(getPatrolProInvestigationHandoff({ ...base, severity: 'critical', status: 'active' }))
+ .toMatchObject({
+ detail: 'Pulse Pro can investigate and fix issues like this.',
+ actionLabel: 'Learn about Pulse Pro',
+ destination,
+ });
+ expect(getPatrolProInvestigationHandoff({ ...base, severity: 'warning', status: 'active' }))
+ .toBeDefined();
+
+ expect(getPatrolProInvestigationHandoff({ ...base, severity: 'info', status: 'active' }))
+ .toBeUndefined();
+ expect(
+ getPatrolProInvestigationHandoff({ ...base, severity: 'critical', status: 'resolved' }),
+ ).toBeUndefined();
+ expect(
+ getPatrolProInvestigationHandoff({
+ ...base,
+ autoFixLocked: false,
+ severity: 'critical',
+ status: 'active',
+ }),
+ ).toBeUndefined();
+ expect(
+ getPatrolProInvestigationHandoff({
+ ...base,
+ commercialSurfacesHidden: true,
+ severity: 'critical',
+ status: 'active',
+ }),
+ ).toBeUndefined();
+ });
+
+ it('keeps the at-need capability line but drops the upgrade action when upgrade prompts are hidden', () => {
+ const handoff = getPatrolProInvestigationHandoff({
+ autoFixLocked: true,
+ commercialSurfacesHidden: false,
+ upgradePromptsHidden: true,
+ upgradeDestination: { href: '/settings/billing', external: false },
+ severity: 'critical',
+ status: 'active',
+ });
+ expect(handoff).toMatchObject({
+ detail: 'Pulse Pro can investigate and fix issues like this.',
+ });
+ expect(handoff).not.toHaveProperty('actionLabel');
+ expect(handoff).not.toHaveProperty('destination');
+ });
});
diff --git a/frontend-modern/src/features/patrol/patrolControlPresentation.ts b/frontend-modern/src/features/patrol/patrolControlPresentation.ts
index a9b5a45afc..3925376463 100644
--- a/frontend-modern/src/features/patrol/patrolControlPresentation.ts
+++ b/frontend-modern/src/features/patrol/patrolControlPresentation.ts
@@ -1,5 +1,6 @@
import type { PatrolAutonomyLevel } from '@/api/patrol';
import { getPatrolFindingIssueCountLabel } from '@/utils/aiFindingPresentation';
+import type { UpgradeDestination } from '@/utils/upgradeNavigation';
export const PATROL_AUTONOMY_POLICY_PRESENTATION: Record<
PatrolAutonomyLevel,
@@ -149,3 +150,40 @@ export function getPatrolQueueWorkspaceDescription(
return 'Problems Patrol finds appear here.';
}
}
+
+const PATROL_PRO_HANDOFF_ACTIONABLE_SEVERITIES = new Set(['critical', 'warning']);
+
+export interface PatrolProInvestigationHandoff {
+ detail: string;
+ actionLabel?: string;
+ destination?: UpgradeDestination;
+}
+
+export interface PatrolProInvestigationHandoffInput {
+ autoFixLocked: boolean;
+ commercialSurfacesHidden: boolean;
+ upgradePromptsHidden: boolean;
+ upgradeDestination: UpgradeDestination;
+ severity?: string;
+ status?: string;
+}
+
+export function getPatrolProInvestigationHandoff(
+ input: PatrolProInvestigationHandoffInput,
+): PatrolProInvestigationHandoff | undefined {
+ if (!input.autoFixLocked) return undefined;
+ if (input.commercialSurfacesHidden) return undefined;
+ if (input.status && input.status !== 'active') return undefined;
+ if (!input.severity || !PATROL_PRO_HANDOFF_ACTIONABLE_SEVERITIES.has(input.severity)) {
+ return undefined;
+ }
+
+ const handoff: PatrolProInvestigationHandoff = {
+ detail: 'Pulse Pro can investigate and fix issues like this.',
+ };
+ if (!input.upgradePromptsHidden) {
+ handoff.actionLabel = 'Learn about Pulse Pro';
+ handoff.destination = input.upgradeDestination;
+ }
+ return handoff;
+}
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index 75750a7095..ec2058482b 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -14,6 +14,7 @@ RECOVERY_PRODUCT_SURFACE_EXACT_FILES = [
PATROL_PAGE_AND_STATE_EXACT_FILES = [
"frontend-modern/src/components/Brand/__tests__/PulsePatrolLogo.test.tsx",
"frontend-modern/src/features/patrol/__tests__/PatrolIntelligenceHeader.test.ts",
+ "frontend-modern/src/features/patrol/__tests__/patrolControlPresentation.test.ts",
"frontend-modern/src/features/patrol/__tests__/patrolInvestigationContextModel.test.ts",
"frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx",
"frontend-modern/src/stores/__tests__/aiIntelligence.test.ts",