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.

Centralize policy posture redaction labels

rcourtman1b64bf9e3f75
diff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.md
index 973e880711..d20b4a132e 100644
--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md
+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md
@@ -195,6 +195,10 @@ Its sensitivity and routing counts must also follow the canonical
unified-resource order and shared human-readable count summaries, so both the
backend summary and the frontend policy card stay aligned on the same
presentation sequence.
+The unified AI resource data-governance block must also use the shared
+unified-resource redaction-label helper directly, so the same canonical
+policy labels back both the posture summary and the governed prompt context
+without an AI-local wrapper.
The resource-intelligence payload used by the resource drawer also carries
the same canonical policy posture snapshot, so the detail surface can show
governed posture context without inventing a second posture contract.
diff --git a/internal/ai/intelligence_coverage_test.go b/internal/ai/intelligence_coverage_test.go
index dcc7dfa0d1..0271534a46 100644
--- a/internal/ai/intelligence_coverage_test.go
+++ b/internal/ai/intelligence_coverage_test.go
@@ -278,7 +278,7 @@ func TestIntelligence_summarizePolicyPosture(t *testing.T) {
t.Fatal("expected hostname redaction count")
}
- labels := policyPostureRedactionLabels(summary)
+ labels := ur.ResourcePolicyRedactionLabelsFromCounts(summary.RedactionCounts)
if !reflect.DeepEqual(labels, []string{"Hostname", "IP Address", "Platform ID", "Alias"}) {
t.Fatalf("redaction labels = %#v, want %#v", labels, []string{"Hostname", "IP Address", "Platform ID", "Alias"})
}
diff --git a/internal/ai/policy_posture.go b/internal/ai/policy_posture.go
index 6c5a13a0e6..7930ef6cb3 100644
--- a/internal/ai/policy_posture.go
+++ b/internal/ai/policy_posture.go
@@ -46,10 +46,3 @@ func summarizePolicyPosture(resources []unifiedresources.Resource) *PolicyPostur
return summary
}
-
-func policyPostureRedactionLabels(summary *PolicyPostureSummary) []string {
- if summary == nil || len(summary.RedactionCounts) == 0 {
- return nil
- }
- return unifiedresources.ResourcePolicyRedactionLabelsFromCounts(summary.RedactionCounts)
-}
diff --git a/internal/ai/resource_context.go b/internal/ai/resource_context.go
index d7f1b1b2b6..dc584de2c9 100644
--- a/internal/ai/resource_context.go
+++ b/internal/ai/resource_context.go
@@ -129,7 +129,7 @@ func (s *Service) buildUnifiedResourceContextForModel(destinationModel string) s
routingParts := unifiedresources.ResourcePolicyRoutingSummaryFromCounts(routingCounts)
sections = append(sections, fmt.Sprintf("- Routing: %s", strings.Join(routingParts, ", ")))
sections = append(sections, fmt.Sprintf("- Local-only resources: %d", localOnlyCount))
- if redactionLabels := policyPostureRedactionLabels(policyPosture); len(redactionLabels) > 0 {
+ if redactionLabels := unifiedresources.ResourcePolicyRedactionLabelsFromCounts(policyPosture.RedactionCounts); len(redactionLabels) > 0 {
sections = append(sections, "\n### Policy Redaction Hints")
sections = append(sections, fmt.Sprintf("- Redactions in use: %s", strings.Join(redactionLabels, ", ")))
}