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.

Use shared policy fallback in resource drawer

rcourtmanbb36f387e0ba
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 3038f3704a..3068c08ad5 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -334,6 +334,10 @@ The frontend unified-resource hook now trusts backend canonical `policy` and
`aiSafeSummary` values directly, so the canonical summary and policy posture
stay aligned with the same resource-policy boundary that governs
policy-aware routing and redaction without any frontend-local re-normalization.
+The resource detail drawer now also resolves the visible AI-safe summary
+through the same shared policy helper, so governed resources still show the
+canonical redacted label if the backend summary is missing instead of
+silently dropping the summary block.
The per-resource intelligence payload returned from
`/api/ai/intelligence?resource_id=...` now carries recent changes,
dependencies, dependents, correlations, and knowledge only; policy posture
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 5981ab26cb..8cd0f3e50b 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -285,6 +285,10 @@ governed display label through the same policy-aware helper, and they suppress
the raw alternate name when policy requires governed handling, so the visible
label stays aligned with the backend redaction boundary instead of
reconstructing a local name fallback.
+The resource detail drawer now also resolves its AI-safe summary through that
+same helper, so governed resources still present the canonical redacted label
+when the backend summary is missing instead of dropping the governed summary
+block entirely.
The shared frontend resource identity helper now owns that policy-aware
display contract, so infrastructure surfaces that ask for the preferred
resource label no longer need to re-encode the governed summary boundary by
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index 832309098f..98a48be466 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -14,6 +14,7 @@ import type {
ResourceChangeSourceAdapter,
ResourceChangeSourceType,
} from '@/types/resource';
+import { requiresGovernedResourceDisplay } from '@/types/resource';
import { formatUptime, formatRelativeTime, formatAbsoluteTime } from '@/utils/format';
import { StatusDot } from '@/components/shared/StatusDot';
import { TagBadges } from '@/components/Dashboard/TagBadges';
@@ -56,6 +57,7 @@ import { getServiceHealthPresentation } from '@/utils/serviceHealthPresentation'
import { ResourceAPI } from '@/api/resources';
import {
getResourcePolicyBadges,
+ getResourcePolicyDisplayLabel,
getResourcePolicyRedactionLabels,
getResourceRoutingScopeLabel,
getResourceSensitivityLabel,
@@ -165,8 +167,13 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
const policyRedactions = createMemo(() =>
getResourcePolicyRedactionLabels(props.resource.policy),
);
+ const governanceSummary = createMemo(() =>
+ requiresGovernedResourceDisplay(props.resource.policy)
+ ? getResourcePolicyDisplayLabel(props.resource)
+ : props.resource.aiSafeSummary?.trim() ?? '',
+ );
const hasGovernanceData = createMemo(
- () => policyBadges().length > 0 || Boolean(props.resource.aiSafeSummary),
+ () => policyBadges().length > 0 || Boolean(governanceSummary()),
);
const platformData = createMemo(() => props.resource.platformData as PlatformData | undefined);
const agentMeta = createMemo(
@@ -1032,11 +1039,11 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
</div>
</div>
</Show>
- <Show when={props.resource.aiSafeSummary}>
+ <Show when={governanceSummary()}>
<div class="flex flex-col gap-1">
<span class="text-muted">AI-Safe Summary</span>
<div class="rounded border border-border bg-surface-hover px-2 py-1.5 text-[10px] text-base-content">
- {props.resource.aiSafeSummary}
+ {governanceSummary()}
</div>
</div>
</Show>
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
index 1c1754cc6b..18e4b9b7a9 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
@@ -309,6 +309,26 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
expect(queryByText('sensitive-host')).toBeNull();
});
+ it('uses the governed policy helper when aiSafeSummary is absent', () => {
+ const resource = baseResource({
+ id: 'governed-resource-1',
+ name: 'governed-host',
+ displayName: 'Governed Host',
+ policy: {
+ sensitivity: 'restricted',
+ routing: {
+ scope: 'local-only',
+ redact: ['hostname'],
+ },
+ },
+ });
+
+ const { getAllByText, getByText } = render(() => <ResourceDetailDrawer resource={resource} />);
+
+ expect(getByText('AI-Safe Summary')).toBeInTheDocument();
+ expect(getAllByText('redacted by policy').length).toBeGreaterThan(1);
+ });
+
it('surfaces canonical AI intelligence for the resource overview', async () => {
const resource = baseResource({});
const { getByRole, getByText } = render(() => <ResourceDetailDrawer resource={resource} />);