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.

Neutralize monitored-system preview copy

rcourtman39ce61fe9dbc
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index cc646a3743..aca0a92fbe 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -1522,6 +1522,10 @@ setup-local transport fields. `frontend-modern/src/components/Settings/Monitored
is the shared shell for that explanation inside platform-connections settings,
so provider-specific panels must not fork their own monitored-system preview
copy or inline projected-usage rendering.
+That shared shell must use neutral count-impact language for ordinary platform
+connection previews. Finite policy failures may say the active policy would be
+exceeded, but unchanged or removal previews should not describe "capacity" as
+the operator-facing mental model for self-hosted monitoring.
That same commercial readiness boundary now also assumes settled canonical
usage, not the first non-nil monitor view. Lifecycle-owned setup or first-host
surfaces may not seal migrated-v5 continuity, display counted-system totals as
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index a9cd76fd9c..4bb61636f0 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -446,6 +446,10 @@ Community limit enforcement.
value must come from optional extras, hosted convenience, business
workflow, support, or similar non-core surfaces rather than using
monitored-system volume itself as the primary paid gate.
+ Monitored-system admission-preview copy must follow the same rule: ordinary
+ connection previews may describe count impact and active policy checks, but
+ they must not use capacity-style titles that imply self-hosted monitoring
+ volume is the product being sold.
11. Keep migrated self-hosted Community/free billing state uncapped even when
the persisted file still carries legacy v5 commercial limit keys:
`pkg/licensing/billing_state_normalization.go` and
diff --git a/frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx b/frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx
index 9b42df3821..1edf009c1c 100644
--- a/frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx
+++ b/frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx
@@ -3,6 +3,7 @@ import type { MonitoredSystemLedgerPreviewResponse } from '@/api/monitoredSystem
import { CalloutCard } from '@/components/shared/CalloutCard';
import {
formatMonitoredSystemSurfaceAttribution,
+ getMonitoredSystemAdmissionPreviewTitle,
getMonitoredSystemAdmissionPreviewRequiredState,
} from '@/utils/monitoredSystemPresentation';
@@ -27,21 +28,6 @@ const previewUsageDelta = (preview: MonitoredSystemLedgerPreviewResponse): numbe
const previewTone = (preview: MonitoredSystemLedgerPreviewResponse | null) =>
preview?.would_exceed_limit ? 'warning' : 'info';
-const previewTitle = (preview: MonitoredSystemLedgerPreviewResponse | null) => {
- if (!preview) return 'Monitored-system impact';
- if (preview.would_exceed_limit) {
- return 'This change exceeds your monitored-system limit';
- }
- const delta = previewUsageDelta(preview);
- if (delta > 0) {
- return 'This change adds monitored systems';
- }
- if (delta < 0) {
- return 'This change frees monitored-system capacity';
- }
- return 'This change reuses your current monitored-system capacity';
-};
-
const previewSummary = (preview: MonitoredSystemLedgerPreviewResponse): string => {
const before = formatUsage(preview.current_count, preview.limit);
const after = formatUsage(preview.projected_count, preview.limit);
@@ -94,7 +80,7 @@ export const MonitoredSystemAdmissionPreview: Component<MonitoredSystemAdmission
{(preview) => (
<CalloutCard
tone={previewTone(preview())}
- title={previewTitle(preview())}
+ title={getMonitoredSystemAdmissionPreviewTitle(preview())}
description={
<div class="space-y-3 text-sm">
<p>{previewSummary(preview())}</p>
diff --git a/frontend-modern/src/components/Settings/__tests__/MonitoredSystemAdmissionPreview.test.tsx b/frontend-modern/src/components/Settings/__tests__/MonitoredSystemAdmissionPreview.test.tsx
index 95832c6fc0..45e5d83f1c 100644
--- a/frontend-modern/src/components/Settings/__tests__/MonitoredSystemAdmissionPreview.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/MonitoredSystemAdmissionPreview.test.tsx
@@ -25,18 +25,18 @@ describe('MonitoredSystemAdmissionPreview', () => {
cleanup();
});
- it('describes unchanged usage when a preview has no capacity impact', () => {
+ it('describes unchanged usage when a preview has no count impact', () => {
render(() => <MonitoredSystemAdmissionPreview preview={buildPreview()} />);
expect(
- screen.getByText('This change reuses your current monitored-system capacity'),
+ screen.getByText('This change keeps monitored-system count unchanged'),
).toBeInTheDocument();
expect(
screen.getByText('Current usage 4 / 10. Saving this change keeps usage at 4 / 10.'),
).toBeInTheDocument();
});
- it('describes freed capacity when a preview reduces monitored-system usage', () => {
+ it('describes removed systems when a preview reduces monitored-system usage', () => {
render(() => (
<MonitoredSystemAdmissionPreview
preview={buildPreview({
@@ -47,7 +47,7 @@ describe('MonitoredSystemAdmissionPreview', () => {
/>
));
- expect(screen.getByText('This change frees monitored-system capacity')).toBeInTheDocument();
+ expect(screen.getByText('This change removes monitored systems')).toBeInTheDocument();
expect(
screen.getByText('Current usage 1 / 10. Saving this change would move usage to 0 / 10 (-1).'),
).toBeInTheDocument();
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 1e9014357d..fc01ccf1b9 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -17,6 +17,7 @@ import infrastructureSourceManagerSource from '../InfrastructureSourceManager.ts
import infrastructureSourcePickerSource from '../InfrastructureSourcePicker.tsx?raw';
import infrastructureWorkspaceModelSource from '../infrastructureWorkspaceModel.ts?raw';
import connectionsTableSource from '../ConnectionsTable.tsx?raw';
+import monitoredSystemAdmissionPreviewSource from '../MonitoredSystemAdmissionPreview.tsx?raw';
import connectionEditorSource from '../ConnectionEditor/ConnectionEditor.tsx?raw';
import addressProbeStepSource from '../ConnectionEditor/AddressProbeStep.tsx?raw';
import connectionEditorStateSource from '../ConnectionEditor/useConnectionEditor.ts?raw';
@@ -218,6 +219,15 @@ describe('settings architecture guardrails', () => {
expect(infrastructureSourceManagerSource).toContain('Infrastructure systems');
expect(infrastructureSourceManagerSource).toContain('Run discovery');
expect(infrastructureSourceManagerSource).toContain('Discovery settings');
+ expect(monitoredSystemAdmissionPreviewSource).toContain(
+ 'getMonitoredSystemAdmissionPreviewTitle',
+ );
+ expect(monitoredSystemAdmissionPreviewSource).not.toContain(
+ 'reuses your current monitored-system capacity',
+ );
+ expect(monitoredSystemAdmissionPreviewSource).not.toContain(
+ 'frees monitored-system capacity',
+ );
expect(infrastructureSourceManagerSource).toContain(
"Add, discover, and verify the platform APIs plus Pulse Agent telemetry that make up Pulse's infrastructure model.",
);
diff --git a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
index b4bf4685db..dc1f38e821 100644
--- a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
@@ -21,6 +21,7 @@ import {
formatMonitoredSystemSurfaceAttribution,
getMonitoredSystemAdmissionPreviewRequiredState,
getMonitoredSystemAdmissionPreviewSaveBlockedMessage,
+ getMonitoredSystemAdmissionPreviewTitle,
getMonitoredSystemAdmissionPreviewUnavailableTitle,
getMonitoredSystemCountingDetailsToggleLabel,
getMonitoredSystemDisclosureDefinition,
@@ -132,6 +133,11 @@ describe('monitoredSystemPresentation', () => {
requiredTitle: 'Preview monitored-system impact before saving',
requiredMessage:
'Pulse must verify the monitored-system policy for this platform connection before it can be saved.',
+ fallbackTitle: 'Monitored-system impact',
+ exceedsPolicyTitle: 'This change exceeds the active monitored-system policy',
+ addsSystemsTitle: 'This change adds monitored systems',
+ removesSystemsTitle: 'This change removes monitored systems',
+ unchangedTitle: 'This change keeps monitored-system count unchanged',
unavailableTitle: 'Monitored-system verification is temporarily unavailable',
unavailableFallbackMessage:
'Pulse cannot verify monitored-system policy right now, so this connection cannot be saved yet. Retry preview in a moment.',
@@ -496,6 +502,38 @@ describe('monitoredSystemPresentation', () => {
).toBeNull();
});
+ it('returns neutral monitored-system admission preview titles', () => {
+ expect(getMonitoredSystemAdmissionPreviewTitle(null)).toBe('Monitored-system impact');
+ expect(
+ getMonitoredSystemAdmissionPreviewTitle({
+ current_count: 4,
+ projected_count: 5,
+ would_exceed_limit: false,
+ }),
+ ).toBe('This change adds monitored systems');
+ expect(
+ getMonitoredSystemAdmissionPreviewTitle({
+ current_count: 4,
+ projected_count: 3,
+ would_exceed_limit: false,
+ }),
+ ).toBe('This change removes monitored systems');
+ expect(
+ getMonitoredSystemAdmissionPreviewTitle({
+ current_count: 4,
+ projected_count: 4,
+ would_exceed_limit: false,
+ }),
+ ).toBe('This change keeps monitored-system count unchanged');
+ expect(
+ getMonitoredSystemAdmissionPreviewTitle({
+ current_count: 4,
+ projected_count: 11,
+ would_exceed_limit: true,
+ }),
+ ).toBe('This change exceeds the active monitored-system policy');
+ });
+
it('returns canonical monitored-system ledger unavailable copy', () => {
expect(formatMonitoredSystemLedgerUnavailableMessage('supplemental_inventory_unsettled')).toBe(
'Pulse is still collecting the first provider-owned inventory baseline. The monitored-system ledger will appear after that baseline completes.',
diff --git a/frontend-modern/src/utils/monitoredSystemPresentation.ts b/frontend-modern/src/utils/monitoredSystemPresentation.ts
index dbaecfca51..bc64b2ced3 100644
--- a/frontend-modern/src/utils/monitoredSystemPresentation.ts
+++ b/frontend-modern/src/utils/monitoredSystemPresentation.ts
@@ -90,6 +90,11 @@ const MONITORED_SYSTEM_LEDGER_PRESENTATION = {
requiredTitle: 'Preview monitored-system impact before saving',
requiredMessage:
'Pulse must verify the monitored-system policy for this platform connection before it can be saved.',
+ fallbackTitle: 'Monitored-system impact',
+ exceedsPolicyTitle: 'This change exceeds the active monitored-system policy',
+ addsSystemsTitle: 'This change adds monitored systems',
+ removesSystemsTitle: 'This change removes monitored systems',
+ unchangedTitle: 'This change keeps monitored-system count unchanged',
unavailableTitle: 'Monitored-system verification is temporarily unavailable',
unavailableFallbackMessage:
'Pulse cannot verify monitored-system policy right now, so this connection cannot be saved yet. Retry preview in a moment.',
@@ -169,6 +174,12 @@ export type MonitoredSystemAdmissionPreviewSaveState = {
loading?: boolean | null;
};
+export type MonitoredSystemAdmissionPreviewTitleInput = {
+ current_count?: number | null;
+ projected_count?: number | null;
+ would_exceed_limit?: boolean | null;
+};
+
export function getMonitoredSystemLedgerPresentation() {
return MONITORED_SYSTEM_LEDGER_PRESENTATION;
}
@@ -591,6 +602,28 @@ export function getMonitoredSystemAdmissionPreviewRequiredState(): {
};
}
+export function getMonitoredSystemAdmissionPreviewTitle(
+ preview: MonitoredSystemAdmissionPreviewTitleInput | null | undefined,
+): string {
+ const presentation = MONITORED_SYSTEM_LEDGER_PRESENTATION.admissionPreview;
+ if (!preview) return presentation.fallbackTitle;
+ if (preview.would_exceed_limit) return presentation.exceedsPolicyTitle;
+
+ const current =
+ typeof preview.current_count === 'number' && Number.isFinite(preview.current_count)
+ ? preview.current_count
+ : 0;
+ const projected =
+ typeof preview.projected_count === 'number' && Number.isFinite(preview.projected_count)
+ ? preview.projected_count
+ : current;
+ const delta = projected - current;
+
+ if (delta > 0) return presentation.addsSystemsTitle;
+ if (delta < 0) return presentation.removesSystemsTitle;
+ return presentation.unchangedTitle;
+}
+
export function formatMonitoredSystemAdmissionPreviewUnavailableMessage(reason?: string): string {
switch (normalizeMonitoredSystemValue(reason)) {
case 'supplemental_inventory_unsettled':