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.

Govern shared settings error presentation

rcourtman848ac49561df
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index cd315eed30..5cb90dce9b 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -75,6 +75,7 @@ management, and fleet control surfaces.
51. `frontend-modern/src/components/Settings/infrastructureSettingsModel.ts`
52. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`
53. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`
+54. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts`
## Shared Boundaries
@@ -96,6 +97,7 @@ management, and fleet control surfaces.
16. `frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx` shared with `api-contracts`: the infrastructure reporting state hook is both an agent fleet lifecycle control surface and an API-backed assignment, reporting, and reconnect contract boundary.
17. `frontend-modern/src/components/Settings/useNodeModalState.ts` shared with `api-contracts`: the node setup modal state hook is both an agent lifecycle control surface and a shared API-backed install/setup contract boundary.
18. `frontend-modern/src/utils/agentInstallCommand.ts` shared with `api-contracts`: the shared frontend install-command helper is both an agent lifecycle control surface and a canonical API/install transport contract boundary.
+19. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts` shared with `api-contracts`: the infrastructure settings presentation helper is both an agent lifecycle control surface and an API-backed direct-node/discovery settings boundary.
19. `internal/api/agent_install_command_shared.go` shared with `api-contracts`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.
20. `internal/api/config_setup_handlers.go` shared with `api-contracts`: auto-register and setup handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.
21. `internal/api/unified_agent.go` shared with `api-contracts`: unified agent download and installer handlers are both an agent lifecycle control surface and a canonical API payload contract boundary.
@@ -228,6 +230,11 @@ Lifecycle-adjacent workspace copy must also keep the same commercial framing:
infrastructure operations may point operators to Pulse Pro for billing, but it
must describe that boundary in monitored-system, plan-limit, and license-status
terms rather than reviving legacy agent-allocation language.
+That same direct-workspace boundary now also owns the shared customer-facing
+error copy for discovery and configured-node actions through
+`frontend-modern/src/utils/infrastructureSettingsPresentation.ts`, so direct
+Proxmox settings mutations do not drift back to inline toast text inside the
+runtime hooks.
That same boundary now also assumes canonical resource payloads preserve
shared facet totals through `facetCounts`, so the resource list and detail
surfaces can keep row summaries aligned without re-inferring totals from
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 9e8d5964ee..0aeb2d1f61 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -52,6 +52,8 @@ Own canonical runtime payload shapes between backend and frontend.
29. `frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx`
30. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`
31. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`
+32. `frontend-modern/src/utils/apiTokenPresentation.ts`
+33. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts`
## Shared Boundaries
@@ -81,6 +83,8 @@ Own canonical runtime payload shapes between backend and frontend.
24. `frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx` shared with `agent-lifecycle`: the infrastructure reporting state hook is both an agent fleet lifecycle control surface and an API-backed assignment, reporting, and reconnect contract boundary.
25. `frontend-modern/src/components/Settings/useNodeModalState.ts` shared with `agent-lifecycle`: the node setup modal state hook is both an agent lifecycle control surface and a shared API-backed install/setup contract boundary.
24. `frontend-modern/src/utils/agentInstallCommand.ts` shared with `agent-lifecycle`: the shared frontend install-command helper is both an agent lifecycle control surface and a canonical API/install transport contract boundary.
+25. `frontend-modern/src/utils/apiTokenPresentation.ts` shared with `security-privacy`: the API token presentation helper is both a security/privacy control surface and a canonical API token management boundary.
+26. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts` shared with `agent-lifecycle`: the infrastructure settings presentation helper is both an agent lifecycle control surface and an API-backed direct-node/discovery settings boundary.
25. `internal/api/agent_install_command_shared.go` shared with `agent-lifecycle`: agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary.
26. `internal/api/ai_handler.go` shared with `ai-runtime`: Pulse Assistant handlers are both an AI runtime control surface and a canonical API payload contract boundary.
27. `internal/api/ai_handlers.go` shared with `ai-runtime`: AI settings and remediation handlers are both an AI runtime control surface and a canonical API payload contract boundary.
@@ -1391,6 +1395,10 @@ both sides instead of relying only on broad settings-surface coverage on the
security side: token settings changes must continue to carry the direct
`api-token-management-surface` API-contract proof together with the
security-side surface proof.
+That same boundary now also includes
+`frontend-modern/src/utils/apiTokenPresentation.ts`, so token load/create/
+revoke errors keep one governed customer-facing message source instead of
+reappearing as hook-local strings.
That same token surface, together with `frontend-modern/src/api/security.ts`,
`internal/api/security.go`, `internal/api/security_tokens.go`, and
`internal/api/system_settings.go`, now also follows an explicit shared
@@ -1401,6 +1409,11 @@ The `/api/security/tokens` payload contract now also carries explicit owner
binding: token create/list responses must preserve the originating
`ownerUserId` together with org scope so long-lived automation credentials
cannot appear detached from their intended human identity.
+The shared direct-node/discovery settings boundary now also includes
+`frontend-modern/src/utils/infrastructureSettingsPresentation.ts`, so the
+customer-facing mutation and validation copy used by the governed runtime
+hooks stays explicit under the same API-backed settings proof instead of
+living as an unowned utility.
That same governed token contract must fail closed on mutation. Limited-scope
API tokens may only create, rotate, or delete tokens whose effective scopes
are a subset of the caller's own scopes; token-management routes must not let a
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 595c0daa91..8f6fca5b6c 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -345,6 +345,22 @@
"api-contracts"
]
},
+ {
+ "path": "frontend-modern/src/utils/apiTokenPresentation.ts",
+ "rationale": "the API token presentation helper is both a security/privacy control surface and a canonical API token management boundary",
+ "subsystems": [
+ "api-contracts",
+ "security-privacy"
+ ]
+ },
+ {
+ "path": "frontend-modern/src/utils/infrastructureSettingsPresentation.ts",
+ "rationale": "the infrastructure settings presentation helper is both an agent lifecycle control surface and an API-backed direct-node/discovery settings boundary",
+ "subsystems": [
+ "agent-lifecycle",
+ "api-contracts"
+ ]
+ },
{
"path": "internal/api/agent_install_command_shared.go",
"rationale": "agent install command assembly is both an agent lifecycle control surface and a canonical API payload contract boundary",
@@ -554,6 +570,7 @@
"frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx",
"frontend-modern/src/utils/agentInstallCommand.ts",
"frontend-modern/src/utils/agentProfilesPresentation.ts",
+ "frontend-modern/src/utils/infrastructureSettingsPresentation.ts",
"internal/api/agent_install_command_shared.go",
"internal/api/config_setup_handlers.go",
"internal/api/unified_agent.go",
@@ -809,6 +826,19 @@
"frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts",
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts"
]
+ },
+ {
+ "id": "direct-proxmox-presentation-helper",
+ "label": "direct Proxmox presentation helper proof",
+ "match_prefixes": [],
+ "match_files": [
+ "frontend-modern/src/utils/infrastructureSettingsPresentation.ts"
+ ],
+ "allow_same_subsystem_tests": false,
+ "test_prefixes": [],
+ "exact_files": [
+ "frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts"
+ ]
}
]
}
@@ -1014,7 +1044,9 @@
"frontend-modern/src/components/Settings/useInfrastructureReportingState.tsx",
"frontend-modern/src/components/Settings/useNodeModalState.ts",
"frontend-modern/src/types/api.ts",
- "frontend-modern/src/utils/agentInstallCommand.ts"
+ "frontend-modern/src/utils/agentInstallCommand.ts",
+ "frontend-modern/src/utils/apiTokenPresentation.ts",
+ "frontend-modern/src/utils/infrastructureSettingsPresentation.ts"
],
"verification": {
"allow_same_subsystem_tests": false,
@@ -1147,6 +1179,19 @@
"frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts"
]
},
+ {
+ "id": "api-token-presentation-helper",
+ "label": "API token presentation helper proof",
+ "match_prefixes": [],
+ "match_files": [
+ "frontend-modern/src/utils/apiTokenPresentation.ts"
+ ],
+ "allow_same_subsystem_tests": false,
+ "test_prefixes": [],
+ "exact_files": [
+ "frontend-modern/src/utils/__tests__/apiTokenPresentation.test.ts"
+ ]
+ },
{
"id": "agent-profiles-client-contract",
"label": "agent profiles client API contract proof",
@@ -1262,6 +1307,19 @@
"frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsController.test.tsx",
"frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx"
]
+ },
+ {
+ "id": "infrastructure-settings-presentation-helper",
+ "label": "infrastructure settings presentation helper proof",
+ "match_prefixes": [],
+ "match_files": [
+ "frontend-modern/src/utils/infrastructureSettingsPresentation.ts"
+ ],
+ "allow_same_subsystem_tests": false,
+ "test_prefixes": [],
+ "exact_files": [
+ "frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts"
+ ]
}
]
}
@@ -2999,6 +3057,7 @@
"frontend-modern/src/components/Settings/SecurityOverviewPanel.tsx",
"frontend-modern/src/components/Settings/useAPITokenManagerState.ts",
"frontend-modern/src/components/Settings/useSystemSettingsState.ts",
+ "frontend-modern/src/utils/apiTokenPresentation.ts",
"internal/api/security.go",
"internal/api/security_tokens.go",
"internal/api/system_settings.go",
@@ -3063,6 +3122,19 @@
"frontend-modern/src/stores/__tests__/systemSettings.test.ts"
]
},
+ {
+ "id": "security-api-token-presentation-helper",
+ "label": "security API token presentation helper proof",
+ "match_prefixes": [],
+ "match_files": [
+ "frontend-modern/src/utils/apiTokenPresentation.ts"
+ ],
+ "allow_same_subsystem_tests": false,
+ "test_prefixes": [],
+ "exact_files": [
+ "frontend-modern/src/utils/__tests__/apiTokenPresentation.test.ts"
+ ]
+ },
{
"id": "security-api-surface",
"label": "security API surface proof",
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index 886c51c632..6c662c5518 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -31,10 +31,11 @@ token-management visibility, and privacy controls to operators.
8. `frontend-modern/src/components/Settings/SecurityOverviewPanel.tsx`
9. `frontend-modern/src/components/Settings/useAPITokenManagerState.ts`
10. `frontend-modern/src/components/Settings/useSystemSettingsState.ts`
-11. `internal/api/security.go`
-12. `internal/api/security_tokens.go`
-13. `internal/api/system_settings.go`
-14. `internal/telemetry/telemetry.go`
+11. `frontend-modern/src/utils/apiTokenPresentation.ts`
+12. `internal/api/security.go`
+13. `internal/api/security_tokens.go`
+14. `internal/api/system_settings.go`
+15. `internal/telemetry/telemetry.go`
## Shared Boundaries
@@ -45,6 +46,7 @@ token-management visibility, and privacy controls to operators.
5. `frontend-modern/src/components/Settings/SecurityAuthPanel.tsx` shared with `frontend-primitives`: the authentication settings surface is both a security/privacy control surface and a canonical settings-shell presentation boundary.
6. `frontend-modern/src/components/Settings/SecurityOverviewPanel.tsx` shared with `frontend-primitives`: the security overview settings surface is both a security/privacy control surface and a canonical settings-shell presentation boundary.
7. `frontend-modern/src/components/Settings/useAPITokenManagerState.ts` shared with `api-contracts`: the API token settings state hook is both a security/privacy control surface and a canonical API payload contract boundary.
+8. `frontend-modern/src/utils/apiTokenPresentation.ts` shared with `api-contracts`: the API token presentation helper is both a security/privacy control surface and a canonical API token management boundary.
8. `internal/api/security.go` shared with `api-contracts`: the security handlers are both a security/privacy control surface and a canonical API payload contract boundary.
9. `internal/api/security_tokens.go` shared with `api-contracts`: the security token handlers are both a security/privacy control surface and a canonical API payload contract boundary.
10. `internal/api/system_settings.go` shared with `api-contracts`: the system settings telemetry and auth controls are both a security/privacy control surface and a canonical API payload contract boundary.
@@ -101,6 +103,10 @@ The security transport surfaces remain intentionally shared with
`api-contracts`: token, auth, and telemetry settings payloads are still API
contracts, but they now also count as first-class security/privacy runtime
behavior that `L14` must govern directly.
+That shared token-management boundary now also includes
+`frontend-modern/src/utils/apiTokenPresentation.ts`, so API-token load,
+generate, and revoke errors stay on one governed customer-facing wording path
+instead of drifting back into hook-local notification strings.
That same shared security transport boundary must stay under explicit proof
routing on both sides: `frontend-modern/src/api/security.ts`,
`internal/api/security.go`, `internal/api/security_tokens.go`, and
diff --git a/frontend-modern/src/utils/__tests__/apiTokenPresentation.test.ts b/frontend-modern/src/utils/__tests__/apiTokenPresentation.test.ts
index 9504625545..efda0fb3d7 100644
--- a/frontend-modern/src/utils/__tests__/apiTokenPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/apiTokenPresentation.test.ts
@@ -7,9 +7,9 @@ import {
describe('apiTokenPresentation', () => {
it('returns canonical API token error copy', () => {
- expect(getAPITokensLoadErrorMessage()).toBe('Failed to load API tokens');
- expect(getAPITokenGenerateErrorMessage()).toBe('Failed to generate API token');
- expect(getAPITokenRevokeErrorMessage()).toBe('Failed to revoke API token');
+ expect(getAPITokensLoadErrorMessage()).toBe('Unable to load API tokens.');
+ expect(getAPITokenGenerateErrorMessage()).toBe('Unable to generate the API token.');
+ expect(getAPITokenRevokeErrorMessage()).toBe('Unable to revoke the API token.');
});
it('surfaces token scope denial copy for generate failures', () => {
diff --git a/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts b/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts
index ad42709f13..a8189cea8c 100644
--- a/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/infrastructureSettingsPresentation.test.ts
@@ -29,17 +29,21 @@ describe('infrastructureSettingsPresentation', () => {
expect(getDiscoverySubnetValidEntryRequiredMessage()).toBe(
'Enter at least one valid subnet in CIDR format',
);
- expect(getDiscoveryScanStartErrorMessage()).toBe('Failed to start discovery scan');
- expect(getDiscoverySettingUpdateErrorMessage()).toBe('Failed to update discovery setting');
- expect(getDiscoverySubnetUpdateErrorMessage()).toBe('Failed to update discovery subnet');
+ expect(getDiscoveryScanStartErrorMessage()).toBe('Unable to start the discovery scan.');
+ expect(getDiscoverySettingUpdateErrorMessage()).toBe(
+ 'Unable to update the discovery setting.',
+ );
+ expect(getDiscoverySubnetUpdateErrorMessage()).toBe(
+ 'Unable to update the discovery subnet.',
+ );
});
it('returns canonical infrastructure node management error copy', () => {
expect(getNodeTemperatureMonitoringUpdateErrorMessage()).toBe(
- 'Failed to update temperature monitoring setting',
+ 'Unable to update temperature monitoring.',
);
expect(getNodeTemperatureMonitoringUpdateErrorMessage('forbidden')).toBe('forbidden');
- expect(getNodeDeleteErrorMessage()).toBe('Failed to delete node');
+ expect(getNodeDeleteErrorMessage()).toBe('Unable to delete the node.');
expect(getNodeDeleteErrorMessage('locked')).toBe('locked');
});
});
diff --git a/frontend-modern/src/utils/apiTokenPresentation.ts b/frontend-modern/src/utils/apiTokenPresentation.ts
index c3703ecf04..a0d923d756 100644
--- a/frontend-modern/src/utils/apiTokenPresentation.ts
+++ b/frontend-modern/src/utils/apiTokenPresentation.ts
@@ -1,5 +1,5 @@
export function getAPITokensLoadErrorMessage(): string {
- return 'Failed to load API tokens';
+ return 'Unable to load API tokens.';
}
import { API_SCOPE_LABELS } from '@/constants/apiScopes';
@@ -14,7 +14,7 @@ export function getAPITokenGenerateErrorMessage(error?: unknown): string {
if (error && typeof error === 'object') {
const typedError = error as APITokenErrorShape;
if (typedError.status !== 403 || typeof typedError.message !== 'string') {
- return 'Failed to generate API token';
+ return 'Unable to generate the API token.';
}
const message = typedError.message.trim();
@@ -32,9 +32,9 @@ export function getAPITokenGenerateErrorMessage(error?: unknown): string {
}
}
- return 'Failed to generate API token';
+ return 'Unable to generate the API token.';
}
export function getAPITokenRevokeErrorMessage(): string {
- return 'Failed to revoke API token';
+ return 'Unable to revoke the API token.';
}
diff --git a/frontend-modern/src/utils/infrastructureSettingsPresentation.ts b/frontend-modern/src/utils/infrastructureSettingsPresentation.ts
index a0a15990d5..4ef824dc0c 100644
--- a/frontend-modern/src/utils/infrastructureSettingsPresentation.ts
+++ b/frontend-modern/src/utils/infrastructureSettingsPresentation.ts
@@ -19,21 +19,21 @@ export function getDiscoverySubnetValidEntryRequiredMessage(): string {
}
export function getDiscoveryScanStartErrorMessage(): string {
- return 'Failed to start discovery scan';
+ return 'Unable to start the discovery scan.';
}
export function getDiscoverySettingUpdateErrorMessage(): string {
- return 'Failed to update discovery setting';
+ return 'Unable to update the discovery setting.';
}
export function getDiscoverySubnetUpdateErrorMessage(): string {
- return 'Failed to update discovery subnet';
+ return 'Unable to update the discovery subnet.';
}
export function getNodeTemperatureMonitoringUpdateErrorMessage(message?: string): string {
- return message || 'Failed to update temperature monitoring setting';
+ return message || 'Unable to update temperature monitoring.';
}
export function getNodeDeleteErrorMessage(message?: string): string {
- return message || 'Failed to delete node';
+ return message || 'Unable to delete the node.';
}