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.

fix(patrol): disambiguate alert-driven AI toggles in config panel

rcourtmana631381abb1b
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index f8e4fc3f0f..ddb0189e31 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -1653,6 +1653,12 @@ critical-only default) and a non-nil `patrol_alert_trigger_types` allowlist
the handler rejects any `patrol_alert_trigger_min_severity` other than `warning`
or `critical` with `400`, and lowercases, trims, drops blanks, and de-duplicates
the types allowlist before persistence so the stored shape is canonical.
+Renaming the operator-facing "Alert-Triggered Analysis" toggle to "Container
+Update Risk" in `PatrolIntelligenceHeader.tsx` is presentation-only and carries
+no wire delta: the persisted settings keys stay `alert_triggered_analysis`,
+`patrol_alert_triggers_enabled`, and `patrol_alert_trigger_min_severity`. The
+operator label and the API field name are deliberately decoupled, so new copy
+must not rename the transport fields to chase the display string.
The shared metrics-history API also treats `metric=temperature` as a canonical
agent/node chart metric for Proxmox node drawers. `resourceType=agent` may serve
the current host-agent CPU package temperature as a live fallback when persisted
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 0634b4799f..dc8dd43d77 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1453,6 +1453,14 @@ primitive (label-for/id wiring, `selectBaseClass` styling hook) rather than a
hand-rolled `<select>`, so its labeling and disabled-state affordances stay
consistent with the rest of the AI settings surface.
+The Patrol configuration toggles in the same surface bind each `Toggle`
+primitive's accessible name through `ariaLabelledBy` pointing at the row's
+heading span, so renaming a control's visible label (for example
+"Alert-Triggered Analysis" to "Container Update Risk") updates the accessible
+name automatically without a parallel `aria-label` string. New Patrol toggle
+copy must keep using the shared `Toggle` `ariaLabelledBy` wiring rather than
+hard-coding a divergent accessible name.
+
Kubernetes RBAC inventory (Roles, ClusterRoles, RoleBindings,
ClusterRoleBindings) is part of the existing Kubernetes platform-page
Configuration tab, not a new sidebar entry or top-level route, and the
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index 24d51590bd..9cad14023f 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -464,6 +464,20 @@ selector reads `patrol_alert_trigger_min_severity` from the settings response,
defaulting to critical-only, and must keep using the shared AI settings shape
rather than forking a patrol-local form.
+That same configuration panel disambiguates the two alert-driven AI toggles by
+scope rather than by near-identical names. The genuinely general path is
+Alert-Triggered Patrols, which runs a focused Patrol investigation of the
+alert's own issue. The Pro-gated `AlertTriggeredAnalysis` toggle now presents as
+"Container Update Risk" with copy scoped to container-update alerts, because the
+enterprise `AlertTriggeredAnalyzer` only assesses `docker-container-update`
+alerts and returns nil for every other alert type. The panel is ordered
+explanatory box first, then Alert-Triggered Patrols plus its severity selector,
+then Anomaly-Triggered Patrols, then Container Update Risk plus its locked
+upgrade note, then Autonomous critical remediation. New copy must keep the
+container-update toggle scoped to its real Docker-update-risk capability instead
+of drifting back to a generically named "Alert-Triggered Analysis" control that
+collides with Patrol's own alert investigation.
+
The route file `frontend-modern/src/pages/AIIntelligence.tsx` is now also a
thin shell that delegates to the feature-owned
`frontend-modern/src/features/patrol/PatrolIntelligenceSurface.tsx`, so Patrol
diff --git a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
index 8555275515..4ddb8e2486 100644
--- a/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
+++ b/frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx
@@ -331,36 +331,6 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
</div>
<div class="space-y-4 pt-4 border-t border-border-subtle">
- <div class="flex items-start justify-between gap-3">
- <div class="flex-1">
- <span
- id={fieldIds.alertTriggeredAnalysis}
- class="text-sm font-medium text-base-content"
- >
- Alert-Triggered Analysis
- </span>
- <p class="text-[11px] text-muted mt-0.5 leading-tight">
- Analyze infrastructure automatically when critical alerts fire.
- </p>
- </div>
- <Toggle
- checked={state.alertTriggeredAnalysis()}
- onChange={(e) =>
- state.handleAlertTriggeredAnalysisChange(e.currentTarget.checked)
- }
- disabled={state.isUpdatingSettings() || state.alertAnalysisLocked()}
- ariaLabelledBy={fieldIds.alertTriggeredAnalysis}
- />
- </div>
-
- <Show
- when={!presentationPolicyHidesUpgradePrompts() && state.alertAnalysisLocked()}
- >
- <div class="-my-1 pl-1 text-[11px]">
- Alert-triggered analysis is not enabled on this plan.
- </div>
- </Show>
-
<div class="rounded-md border border-border-subtle bg-surface-alt/60 px-3 py-2.5">
<p class="text-[11px] font-medium text-base-content">
{state.patrolInterval() === 0
@@ -384,7 +354,8 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
Alert-Triggered Patrols
</span>
<p class="text-[11px] text-muted mt-0.5 leading-tight">
- Run scoped Patrol checks when alerts fire or clear.
+ Run a focused Patrol investigation of the alert's issue when it fires or
+ clears.
</p>
</div>
<Toggle
@@ -442,6 +413,36 @@ export function PatrolIntelligenceHeader(props: { state: PatrolIntelligenceState
/>
</div>
+ <div class="flex items-start justify-between gap-3">
+ <div class="flex-1">
+ <span
+ id={fieldIds.alertTriggeredAnalysis}
+ class="text-sm font-medium text-base-content"
+ >
+ Container Update Risk
+ </span>
+ <p class="text-[11px] text-muted mt-0.5 leading-tight">
+ Assess upgrade risk with AI when a container-update alert fires.
+ </p>
+ </div>
+ <Toggle
+ checked={state.alertTriggeredAnalysis()}
+ onChange={(e) =>
+ state.handleAlertTriggeredAnalysisChange(e.currentTarget.checked)
+ }
+ disabled={state.isUpdatingSettings() || state.alertAnalysisLocked()}
+ ariaLabelledBy={fieldIds.alertTriggeredAnalysis}
+ />
+ </div>
+
+ <Show
+ when={!presentationPolicyHidesUpgradePrompts() && state.alertAnalysisLocked()}
+ >
+ <div class="-my-1 pl-1 text-[11px]">
+ Container update risk analysis is not enabled on this plan.
+ </div>
+ </Show>
+
<div class="flex items-start justify-between gap-3">
<div class="flex-1">
<span
diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
index 13bca6e260..47fb658e07 100644
--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
@@ -704,7 +704,7 @@ describe('AIIntelligence entitlement gating', () => {
),
).toBeInTheDocument();
expect(
- screen.getByText('Alert-triggered analysis is not enabled on this plan.'),
+ screen.getByText('Container update risk analysis is not enabled on this plan.'),
).toBeInTheDocument();
expect(screen.queryByRole('link', { name: 'Upgrade to Pro' })).not.toBeInTheDocument();
expect(screen.queryByRole('link', { name: 'Upgrade' })).not.toBeInTheDocument();
@@ -799,7 +799,7 @@ describe('AIIntelligence entitlement gating', () => {
expect(screen.getByRole('button', { name: 'Investigate' })).not.toBeDisabled();
expect(screen.getByRole('button', { name: 'Remediate' })).not.toBeDisabled();
- expect(screen.getByRole('checkbox', { name: 'Alert-Triggered Analysis' })).toBeInTheDocument();
+ expect(screen.getByRole('checkbox', { name: 'Container Update Risk' })).toBeInTheDocument();
expect(screen.getByRole('checkbox', { name: 'Alert-Triggered Patrols' })).toBeInTheDocument();
expect(screen.getByRole('checkbox', { name: 'Anomaly-Triggered Patrols' })).toBeInTheDocument();
expect(