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
Explain monitored-system over-plan legitimacy
rcourtman8d703f237199
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 72b1ae421a..ba914b3dca 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -1471,6 +1471,12 @@ capacity posture. `/api/license/runtime-capabilities`,blocked and whether existing monitoring continues, so browser surfaces stopguessing from raw `current / limit` math or inventing a hard-cap model thatthe backend does not enforce.+That same contract must also make over-limit legitimacy explicit. When+`monitored_system_capacity` is at or above a capped plan boundary, the payload+must expose `reason` as `limit_reached`, `preexisting_usage`, or+`legacy_migration_capture_pending` so browser surfaces can distinguish a full+plan boundary from a frozen above-plan carry-forward and from migrated legacy+continuity that is still being verified.That same contract now also owns migrated legacy continuity. When a supportedv5 license auto-exchanges or is activated manually in v6, `/api/license/status`and `/api/license/entitlements` must surface `max_monitored_systems` from thediff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.mdindex 03d4b09063..9df527c940 100644--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md@@ -1145,6 +1145,12 @@ runtime blackout. Community overflow/setup-slot messaging must still explainthe included monitored systems plus the temporary setup slot in customer termsrather than compressing the contract into slash-style quota strings that implyPulse is counting every child device.+That same billing-facing boundary also owns why an installation can be above+plan at all. When the monitored-system posture is `over_limit_frozen`, customer+copy must explain whether the installation was already above the current plan+before new admissions were blocked or whether migrated v5 continuity capture is+still pending. Billing surfaces must not render an unexplained `15 monitored,+plan includes 5` state that looks like Pulse is ignoring its own cap model.Those same billing-facing surfaces must also describe the commercial contract incustomer terms: monitored systems, plan limits, subscription status, andlicense status. They must not revive legacy `installed-agent` wording or vaguediff --git a/frontend-modern/src/api/__tests__/license.test.ts b/frontend-modern/src/api/__tests__/license.test.tsindex be8020ab24..7bfe67f5cf 100644--- a/frontend-modern/src/api/__tests__/license.test.ts+++ b/frontend-modern/src/api/__tests__/license.test.ts@@ -93,6 +93,7 @@ describe('LicenseAPI', () => {current_unavailable_reason: 'supplemental_inventory_unsettled',available_slots: 0,overage: 0,+ reason: 'legacy_migration_capture_pending',blocks_new_systems: false,existing_monitoring_continues: false,},@@ -107,6 +108,7 @@ describe('LicenseAPI', () => {});expect(result.monitored_system_capacity).toMatchObject({mode: 'usage_unavailable',+ reason: 'legacy_migration_capture_pending',current_available: false,});expect(result.limits[0]).toMatchObject({diff --git a/frontend-modern/src/api/license.ts b/frontend-modern/src/api/license.tsindex 7687b1ced4..c079a9fc71 100644--- a/frontend-modern/src/api/license.ts+++ b/frontend-modern/src/api/license.ts@@ -63,6 +63,7 @@ export interface MonitoredSystemCapacityStatus {current_unavailable_reason?: string;available_slots: number;overage: number;+ reason?: string;blocks_new_systems: boolean;existing_monitoring_continues: boolean;}diff --git a/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsxindex 7e9451e401..68e6a18eb9 100644--- a/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/ProLicensePanel.test.tsx@@ -384,6 +384,19 @@ describe('ProLicensePanel', () => {effective_limit: 10,capture_pending: true,},+ monitored_system_capacity: {+ mode: 'usage_unavailable',+ urgency: 'ok',+ current: 0,+ limit: 10,+ current_available: false,+ current_unavailable_reason: 'supplemental_inventory_unsettled',+ available_slots: 0,+ overage: 0,+ reason: 'legacy_migration_capture_pending',+ blocks_new_systems: false,+ existing_monitoring_continues: false,+ },};renderPanel();@@ -393,7 +406,7 @@ describe('ProLicensePanel', () => {});expect(- screen.getByText(/still collecting the first provider-owned inventory baseline/i),+ screen.getByText(/verifying the grandfathered monitored-system floor/i),).toBeInTheDocument();expect(screen.getByText('Verifying…')).toBeInTheDocument();expect(screen.getByText('Unavailable')).toBeInTheDocument();@@ -404,6 +417,57 @@ describe('ProLicensePanel', () => {expect(screen.queryByText('0 / 10')).not.toBeInTheDocument();});+ it('explains why an over-plan migrated installation is still monitoring above the current plan limit', async () => {+ mockEntitlements = {+ capabilities: ['relay'],+ limits: [+ {+ key: 'max_monitored_systems',+ limit: 10,+ current: 23,+ current_available: true,+ state: 'enforced',+ },+ ],+ subscription_state: 'active',+ upgrade_reasons: [],+ tier: 'pro',+ plan_version: 'legacy_migration_fallback',+ licensed_email: '[email protected]',+ trial_eligible: false,+ monitored_system_continuity: {+ plan_limit: 10,+ effective_limit: 10,+ capture_pending: true,+ },+ monitored_system_capacity: {+ mode: 'over_limit_frozen',+ urgency: 'enforced',+ current: 23,+ limit: 10,+ current_available: true,+ available_slots: 0,+ overage: 13,+ reason: 'legacy_migration_capture_pending',+ blocks_new_systems: true,+ existing_monitoring_continues: true,+ },+ };++ renderPanel();++ await waitFor(() => {+ expect(screen.getByText('Migration continuity verification pending')).toBeInTheDocument();+ });++ expect(+ screen.getByText(/already monitoring 23/i),+ ).toBeInTheDocument();+ expect(+ screen.queryByText('Monitoring continues above the current plan limit'),+ ).not.toBeInTheDocument();+ });+it('shows monitored-system continuity once a bounded fallback migration floor is captured', async () => {mockEntitlements = {capabilities: ['relay'],@@ -429,6 +493,18 @@ describe('ProLicensePanel', () => {capture_pending: false,captured_at: 1_768_000_000,},+ monitored_system_capacity: {+ mode: 'at_limit_blocking_new',+ urgency: 'enforced',+ current: 23,+ limit: 23,+ current_available: true,+ available_slots: 0,+ overage: 0,+ reason: 'limit_reached',+ blocks_new_systems: true,+ existing_monitoring_continues: true,+ },};renderPanel();diff --git a/frontend-modern/src/components/Settings/useProLicensePanelState.ts b/frontend-modern/src/components/Settings/useProLicensePanelState.tsindex 22300d8892..8b970163c0 100644--- a/frontend-modern/src/components/Settings/useProLicensePanelState.ts+++ b/frontend-modern/src/components/Settings/useProLicensePanelState.ts@@ -274,7 +274,11 @@ export function useProLicensePanelState() {);const monitoredSystemContinuity = createMemo(() => entitlements()?.monitored_system_continuity);const monitoredSystemContinuityNotice = createMemo(() =>- getMonitoredSystemContinuityNotice(monitoredSystemContinuity(), monitoredSystemLimitStatus()),+ getMonitoredSystemContinuityNotice(+ monitoredSystemContinuity(),+ monitoredSystemLimitStatus(),+ monitoredSystemCapacity(),+ ),);const monitoredSystemCapacityNotice = createMemo(() => {const posture = monitoredSystemCapacityPosture();@@ -289,9 +293,18 @@ export function useProLicensePanelState() {tone: 'border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100',};case 'over_limit_frozen':+ if (+ posture.reason === 'legacy_migration_capture_pending' &&+ monitoredSystemContinuityNotice()+ ) {+ return null;+ }return {title: 'Monitoring continues above the current plan limit',- body: `This installation is monitoring ${posture.current} systems while the current plan includes ${posture.limit}. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`,+ body:+ posture.reason === 'preexisting_usage'+ ? `This installation already exceeded the current plan limit before new monitored systems were blocked. It is currently monitoring ${posture.current} systems while the current plan includes ${posture.limit}. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`+ : `This installation is monitoring ${posture.current} systems while the current plan includes ${posture.limit}. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`,tone: 'border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-100',};default:diff --git a/frontend-modern/src/utils/__tests__/licensePresentation.test.ts b/frontend-modern/src/utils/__tests__/licensePresentation.test.tsindex 0738b90c3c..b605bdf7f9 100644--- a/frontend-modern/src/utils/__tests__/licensePresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/licensePresentation.test.ts@@ -203,10 +203,53 @@ describe('licensePresentation', () => {current_available: false,current_unavailable_reason: 'supplemental_inventory_unsettled',},+ {+ mode: 'usage_unavailable',+ urgency: 'ok',+ current: 0,+ limit: 10,+ current_available: false,+ current_unavailable_reason: 'supplemental_inventory_unsettled',+ available_slots: 0,+ overage: 0,+ blocks_new_systems: false,+ existing_monitoring_continues: false,+ },),).toMatchObject({title: 'Migration continuity verification pending',- body: expect.stringContaining('first provider-owned inventory baseline'),+ body: expect.stringContaining('grandfathered monitored-system floor'),+ tone: expect.stringContaining('amber'),+ });+ expect(+ getMonitoredSystemContinuityNotice(+ {+ plan_limit: 10,+ effective_limit: 10,+ capture_pending: true,+ },+ {+ current: 23,+ limit: 10,+ current_available: true,+ state: 'enforced',+ },+ {+ mode: 'over_limit_frozen',+ urgency: 'enforced',+ current: 23,+ limit: 10,+ current_available: true,+ available_slots: 0,+ overage: 13,+ reason: 'legacy_migration_capture_pending',+ blocks_new_systems: true,+ existing_monitoring_continues: true,+ },+ ),+ ).toMatchObject({+ title: 'Migration continuity verification pending',+ body: expect.stringContaining('already monitoring 23'),tone: expect.stringContaining('amber'),});expect(@@ -221,6 +264,18 @@ describe('licensePresentation', () => {{current_available: true,},+ {+ mode: 'at_limit_blocking_new',+ urgency: 'enforced',+ current: 23,+ limit: 23,+ current_available: true,+ available_slots: 0,+ overage: 0,+ reason: 'limit_reached',+ blocks_new_systems: true,+ existing_monitoring_continues: true,+ },),).toMatchObject({title: 'Grandfathered monitored-system floor',diff --git a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.tsindex e8c8178229..fdea07c6ea 100644--- a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts+++ b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts@@ -235,7 +235,26 @@ describe('monitoredSystemPresentation', () => {'5 of 6 included monitored systems are in use.',);expect(formatMonitoredSystemLimitSummary({ current: 16, limit: 5, state: 'enforced' })).toBe(- '16 monitored systems active. Plan includes 5, and you are over plan by 11. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.',+ '16 monitored systems active. Current plan includes 5, and this installation is already over plan by 11 because it exceeded the limit before new monitored systems were blocked. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.',+ );+ expect(+ formatMonitoredSystemLimitSummary(+ { current: 16, limit: 5, state: 'enforced' },+ {+ mode: 'over_limit_frozen',+ urgency: 'enforced',+ current: 16,+ limit: 5,+ current_available: true,+ available_slots: 0,+ overage: 11,+ reason: 'legacy_migration_capture_pending',+ blocks_new_systems: true,+ existing_monitoring_continues: true,+ },+ ),+ ).toBe(+ '16 monitored systems active. Current plan includes 5, and Pulse is still verifying the migrated v5 continuity floor for this installation. Existing monitoring continues while new monitored systems are temporarily blocked against the current plan limit until continuity capture finishes.',);expect(formatMonitoredSystemLegacyConnectionBreakdown({@@ -323,7 +342,31 @@ describe('monitoredSystemPresentation', () => {state: 'enforced',}),).toBe(- 'Plan includes 5. Over plan by 11. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.',+ 'Plan includes 5. This installation is already over plan by 11 because it exceeded the current plan limit before new monitored systems were blocked. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.',+ );+ expect(+ getMonitoredSystemLimitContextSummary(+ {+ current: 16,+ limit: 5,+ current_available: true,+ state: 'enforced',+ },+ {+ mode: 'over_limit_frozen',+ urgency: 'enforced',+ current: 16,+ limit: 5,+ current_available: true,+ available_slots: 0,+ overage: 11,+ reason: 'legacy_migration_capture_pending',+ blocks_new_systems: true,+ existing_monitoring_continues: true,+ },+ ),+ ).toBe(+ 'Plan includes 5. Pulse is still verifying the migrated v5 continuity floor for this installation. Existing monitoring continues while new monitored systems are temporarily blocked against the current plan limit until continuity capture finishes.',);expect(isMonitoredSystemLimitUrgent({@@ -343,6 +386,7 @@ describe('monitoredSystemPresentation', () => {).toMatchObject({mode: 'over_limit_frozen',overage: 11,+ reason: 'preexisting_usage',blocks_new_systems: true,existing_monitoring_continues: true,});diff --git a/frontend-modern/src/utils/licensePresentation.ts b/frontend-modern/src/utils/licensePresentation.tsindex 125ff714dc..914fbfa45a 100644--- a/frontend-modern/src/utils/licensePresentation.ts+++ b/frontend-modern/src/utils/licensePresentation.ts@@ -9,6 +9,8 @@ import {formatMonitoredSystemUsageUnavailableMessage,getMonitoredSystemLimitUnavailableReason,isMonitoredSystemLimitUsageAvailable,+ resolveMonitoredSystemCapacityStatus,+ type MonitoredSystemCapacityStatus,type MonitoredSystemLimitUsageStatus,} from '@/utils/monitoredSystemPresentation';import { titleCaseDelimitedLabel } from '@/utils/textPresentation';@@ -180,17 +182,42 @@ export const getGrandfatheredPriceContinuityNotice = (export const getMonitoredSystemContinuityNotice = (continuity?: MonitoredSystemContinuityStatus | null,limit?: MonitoredSystemLimitUsageStatus | null,+ capacity?: MonitoredSystemCapacityStatus | null,): LicenseInlineNotice | null => {+ const resolvedCapacity = resolveMonitoredSystemCapacityStatus(capacity, limit);++ if (continuity?.capture_pending) {+ if (!resolvedCapacity?.current_available) {+ return {+ tone: 'border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-900 text-amber-900 dark:text-amber-100',+ title: 'Migration continuity verification pending',+ body: `Pulse is still verifying the grandfathered monitored-system floor for this migrated v5 installation. ${formatMonitoredSystemUsageUnavailableMessage(+ getMonitoredSystemLimitUnavailableReason(limit, capacity),+ )}`,+ };+ }++ if (resolvedCapacity.mode === 'over_limit_frozen') {+ return {+ tone: 'border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-900 text-amber-900 dark:text-amber-100',+ title: 'Migration continuity verification pending',+ body: `Pulse is still verifying the grandfathered monitored-system floor for this migrated v5 installation. The current plan includes ${continuity.plan_limit}, while this installation is already monitoring ${resolvedCapacity.current}. Existing monitoring continues, but new monitored systems are temporarily blocked against the current plan limit until continuity capture finishes.`,+ };+ }++ return {+ tone: 'border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-900 text-amber-900 dark:text-amber-100',+ title: 'Migration continuity verification pending',+ body: 'Pulse is still verifying the grandfathered monitored-system floor for this migrated v5 installation. Existing monitoring continues while Pulse finalizes the effective monitored-system limit.',+ };+ }+if (!isMonitoredSystemLimitUsageAvailable(limit)) {- const title =- continuity?.capture_pending === true- ? 'Migration continuity verification pending'- : 'Monitored-system usage unavailable';return {tone: 'border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-900 text-amber-900 dark:text-amber-100',- title,+ title: 'Monitored-system usage unavailable',body: formatMonitoredSystemUsageUnavailableMessage(- getMonitoredSystemLimitUnavailableReason(limit),+ getMonitoredSystemLimitUnavailableReason(limit, capacity),),};}diff --git a/frontend-modern/src/utils/monitoredSystemPresentation.ts b/frontend-modern/src/utils/monitoredSystemPresentation.tsindex 56b4bbfed7..2af01731e1 100644--- a/frontend-modern/src/utils/monitoredSystemPresentation.ts+++ b/frontend-modern/src/utils/monitoredSystemPresentation.ts@@ -129,6 +129,7 @@ export type MonitoredSystemCapacityStatus = {current_unavailable_reason?: string | null;available_slots?: number | null;overage?: number | null;+ reason?: string | null;blocks_new_systems?: boolean | null;existing_monitoring_continues?: boolean | null;};@@ -142,6 +143,7 @@ type ResolvedMonitoredSystemCapacityStatus = {current_unavailable_reason?: string;available_slots: number;overage: number;+ reason?: string;blocks_new_systems: boolean;existing_monitoring_continues: boolean;};@@ -262,6 +264,7 @@ function deriveMonitoredSystemCapacityStatus(current_unavailable_reason: limit.current_unavailable_reason?.trim() || undefined,available_slots: 0,overage: 0,+ reason: undefined,blocks_new_systems: false,existing_monitoring_continues: false,};@@ -276,6 +279,7 @@ function deriveMonitoredSystemCapacityStatus(current_available: true,available_slots: 0,overage: 0,+ reason: undefined,blocks_new_systems: false,existing_monitoring_continues: true,};@@ -290,6 +294,7 @@ function deriveMonitoredSystemCapacityStatus(current_available: true,available_slots: 0,overage: current - planLimit,+ reason: 'preexisting_usage',blocks_new_systems: true,existing_monitoring_continues: true,};@@ -304,6 +309,7 @@ function deriveMonitoredSystemCapacityStatus(current_available: true,available_slots: 0,overage: 0,+ reason: 'limit_reached',blocks_new_systems: true,existing_monitoring_continues: true,};@@ -317,6 +323,7 @@ function deriveMonitoredSystemCapacityStatus(current_available: true,available_slots: planLimit - current,overage: 0,+ reason: undefined,blocks_new_systems: false,existing_monitoring_continues: true,};@@ -346,6 +353,8 @@ export function resolveMonitoredSystemCapacityStatus(normalizeMonitoredSystemValue(capacity.urgency ?? undefined) ||fallback?.urgency ||deriveMonitoredSystemLimitUrgency(current, planLimit);+ const reason =+ normalizeMonitoredSystemValue(capacity.reason ?? undefined) || fallback?.reason || undefined;return {mode,@@ -365,6 +374,7 @@ export function resolveMonitoredSystemCapacityStatus(typeof capacity.overage === 'number'? capacity.overage: (fallback?.overage ?? Math.max(current - planLimit, 0)),+ reason,blocks_new_systems:typeof capacity.blocks_new_systems === 'boolean'? capacity.blocks_new_systems@@ -428,7 +438,10 @@ export function getMonitoredSystemLimitContextSummary(case 'unlimited':return 'This plan does not cap monitored systems.';case 'over_limit_frozen':- return `Plan includes ${resolved.limit}. Over plan by ${resolved.overage}. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`;+ if (resolved.reason === 'legacy_migration_capture_pending') {+ return `Plan includes ${resolved.limit}. Pulse is still verifying the migrated v5 continuity floor for this installation. Existing monitoring continues while new monitored systems are temporarily blocked against the current plan limit until continuity capture finishes.`;+ }+ return `Plan includes ${resolved.limit}. This installation is already over plan by ${resolved.overage} because it exceeded the current plan limit before new monitored systems were blocked. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`;case 'at_limit_blocking_new':return `Plan includes ${resolved.limit}. Existing monitoring continues, but new monitored systems are blocked until capacity is freed or the plan is upgraded.`;default:@@ -569,9 +582,12 @@ export function formatMonitoredSystemLimitSummary(switch (resolved.mode) {case 'over_limit_frozen':- return `${formatMonitoredSystemCount(resolved.current)} active. Plan includes ${+ if (resolved.reason === 'legacy_migration_capture_pending') {+ return `${formatMonitoredSystemCount(resolved.current)} active. Current plan includes ${resolved.limit}, and Pulse is still verifying the migrated v5 continuity floor for this installation. Existing monitoring continues while new monitored systems are temporarily blocked against the current plan limit until continuity capture finishes.`;+ }+ return `${formatMonitoredSystemCount(resolved.current)} active. Current plan includes ${resolved.limit- }, and you are over plan by ${resolved.overage}. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`;+ }, and this installation is already over plan by ${resolved.overage} because it exceeded the limit before new monitored systems were blocked. Existing monitoring continues, but new monitored systems are blocked until usage is reduced or the plan is upgraded.`;case 'at_limit_blocking_new':return `All ${resolved.limit} included monitored systems are in use. Existing monitoring continues, but new monitored systems are now blocked until capacity is freed or the plan is upgraded.`;case 'unlimited':diff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex b3407e1728..84af86d28b 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -5725,7 +5725,7 @@ func TestContract_LegacyMigrationGrandfatherFloorFallbackJSONSnapshot(t *testing"subscription_state":"active","limits":[{"key":"max_monitored_systems","limit":23,"current":23,"current_available":true,"state":"enforced"}],"monitored_system_continuity":{"plan_limit":10,"grandfathered_floor":23,"effective_limit":23,"capture_pending":false,"captured_at":123},- "monitored_system_capacity":{"mode":"at_limit_blocking_new","urgency":"enforced","current":23,"limit":23,"current_available":true,"available_slots":0,"overage":0,"blocks_new_systems":true,"existing_monitoring_continues":true}+ "monitored_system_capacity":{"mode":"at_limit_blocking_new","urgency":"enforced","current":23,"limit":23,"current_available":true,"available_slots":0,"overage":0,"reason":"limit_reached","blocks_new_systems":true,"existing_monitoring_continues":true}}}`diff --git a/pkg/licensing/entitlement_payload.go b/pkg/licensing/entitlement_payload.goindex 4587424208..2e36ee19e0 100644--- a/pkg/licensing/entitlement_payload.go+++ b/pkg/licensing/entitlement_payload.go@@ -221,6 +221,11 @@ type MonitoredSystemCapacityStatus struct {// is while existing monitoring continues.Overage int64 `json:"overage"`+ // Reason explains why the current monitored-system posture is legitimate.+ // Values: "limit_reached", "preexisting_usage",+ // "legacy_migration_capture_pending"+ Reason string `json:"reason,omitempty"`+// BlocksNewSystems indicates that Pulse will reject net-new monitored// systems until capacity is freed or the plan changes.BlocksNewSystems bool `json:"blocks_new_systems"`@@ -420,6 +425,7 @@ func BuildEntitlementPayloadWithUsage(payload.MonitoredSystemCapacity = buildMonitoredSystemCapacityStatus(int64(status.MaxMonitoredSystems),usage,+ status.MonitoredSystemContinuity,)if payload.Capabilities == nil {@@ -525,6 +531,7 @@ func boolPointer(value bool) *bool {func buildMonitoredSystemCapacityStatus(limit int64,usage EntitlementUsageSnapshot,+ continuity *MonitoredSystemContinuityStatus,) *MonitoredSystemCapacityStatus {currentAvailable := usage.monitoredSystemCountAvailable()if !currentAvailable {@@ -574,11 +581,17 @@ func buildMonitoredSystemCapacityStatus(status.AvailableSlots = limit - currentcase current == limit:status.Mode = "at_limit_blocking_new"+ status.Reason = "limit_reached"status.BlocksNewSystems = truecase current > limit:status.Mode = "over_limit_frozen"status.BlocksNewSystems = truestatus.Overage = current - limit+ if continuity != nil && continuity.CapturePending {+ status.Reason = "legacy_migration_capture_pending"+ } else {+ status.Reason = "preexisting_usage"+ }default:status.Mode = "within_limit"}diff --git a/pkg/licensing/entitlement_payload_test.go b/pkg/licensing/entitlement_payload_test.goindex 5610058b07..948ecc6a33 100644--- a/pkg/licensing/entitlement_payload_test.go+++ b/pkg/licensing/entitlement_payload_test.go@@ -293,6 +293,9 @@ func TestBuildEntitlementPayloadWithUsage_CopiesMonitoredSystemContinuity(t *tesif payload.MonitoredSystemCapacity.Mode != "at_limit_blocking_new" {t.Fatalf("Mode=%q, want at_limit_blocking_new", payload.MonitoredSystemCapacity.Mode)}+ if payload.MonitoredSystemCapacity.Reason != "limit_reached" {+ t.Fatalf("Reason=%q, want limit_reached", payload.MonitoredSystemCapacity.Reason)+ }if !payload.MonitoredSystemCapacity.BlocksNewSystems {t.Fatal("expected at-limit posture to block new monitored systems")}@@ -462,6 +465,39 @@ func TestBuildCommercialPosturePayloadWithUsage_CurrentValues(t *testing.T) {if payload.MonitoredSystemCapacity.Overage != 2 {t.Fatalf("Overage=%d, want 2", payload.MonitoredSystemCapacity.Overage)}+ if payload.MonitoredSystemCapacity.Reason != "preexisting_usage" {+ t.Fatalf("Reason=%q, want preexisting_usage", payload.MonitoredSystemCapacity.Reason)+ }+}++func TestBuildEntitlementPayloadWithUsage_MarksLegacyContinuityCapturePendingOverage(t *testing.T) {+ payload := BuildEntitlementPayloadWithUsage(&LicenseStatus{+ Valid: true,+ Tier: TierPro,+ Features: append([]string(nil), TierFeatures[TierPro]...),+ MaxMonitoredSystems: 10,+ MonitoredSystemContinuity: &MonitoredSystemContinuityStatus{+ PlanLimit: 10,+ EffectiveLimit: 10,+ CapturePending: true,+ },+ }, string(SubStateActive), EntitlementUsageSnapshot{+ MonitoredSystems: 23,+ MonitoredSystemsAvailable: true,+ }, nil)++ if payload.MonitoredSystemCapacity == nil {+ t.Fatal("expected monitored-system capacity posture")+ }+ if payload.MonitoredSystemCapacity.Mode != "over_limit_frozen" {+ t.Fatalf("Mode=%q, want over_limit_frozen", payload.MonitoredSystemCapacity.Mode)+ }+ if payload.MonitoredSystemCapacity.Reason != "legacy_migration_capture_pending" {+ t.Fatalf(+ "Reason=%q, want legacy_migration_capture_pending",+ payload.MonitoredSystemCapacity.Reason,+ )+ }}func TestCommercialPosturePayloadFromEntitlementPayload_StripsBillingIdentityFields(t *testing.T) {diff --git a/tests/integration/tests/54-monitored-system-billing-focus.spec.ts b/tests/integration/tests/54-monitored-system-billing-focus.spec.tsindex 8092802456..a05ea6d2f1 100644--- a/tests/integration/tests/54-monitored-system-billing-focus.spec.ts+++ b/tests/integration/tests/54-monitored-system-billing-focus.spec.ts@@ -15,6 +15,7 @@ const MONITORED_SYSTEM_ENTITLEMENTS = {current_available: true,available_slots: 0,overage: 11,+ reason: "preexisting_usage",blocks_new_systems: true,existing_monitoring_continues: true,},@@ -45,6 +46,7 @@ const MONITORED_SYSTEM_RUNTIME_CAPABILITIES = {current_available: true,available_slots: 0,overage: 11,+ reason: "preexisting_usage",blocks_new_systems: true,existing_monitoring_continues: true,},@@ -108,6 +110,7 @@ const MONITORED_SYSTEM_COMMERCIAL_POSTURE = {current_available: true,available_slots: 0,overage: 11,+ reason: "preexisting_usage",blocks_new_systems: true,existing_monitoring_continues: true,},@@ -252,6 +255,11 @@ async function openPageWithUrgentMonitoredSystemBanner(page: Page) {await expect(page.getByRole("status").filter({ hasText: "over plan by 11" }),).toBeVisible();+ await expect(+ page.getByRole("status").filter({+ hasText: "exceeded the limit before new monitored systems were blocked",+ }),+ ).toBeVisible();}test.describe("Monitored-system billing focus", () => {