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
Trim policy summary duplication
rcourtmane7a6e05c63ca
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex fb496f6f32..9ea31428b3 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -143,6 +143,10 @@ only the routing scope and the redaction hints derived from canonicalsensitivity, and the cloud-summary decision is derived from that scopeinstead of being stored as a second boolean in the owned resource-policycontract.+The canonical policy summary formatter also mirrors that shape now: it reports+the sensitivity and routing scope directly, then lists redactions, so+governed mention blocks no longer repeat a derived cloud-summary boolean in+their owned summary line.The backend AI and Patrol correlation context renderers now derive their canonicalrelationship labels, direction, provenance, freshness, and metadata flagsfrom `internal/unifiedresources/relationship_presentation.go`, so the correlationdiff --git a/internal/ai/chat/context_prefetch_additional_test.go b/internal/ai/chat/context_prefetch_additional_test.goindex 4e592f6f64..2956508e74 100644--- a/internal/ai/chat/context_prefetch_additional_test.go+++ b/internal/ai/chat/context_prefetch_additional_test.go@@ -449,7 +449,7 @@ func TestContextPrefetcher_FormatContextSummary_GovernedMention(t *testing.T) {if !strings.Contains(summary, "Governed resource") {t.Fatalf("expected governed heading, got %q", summary)}- if !strings.Contains(summary, "Policy: sensitivity=Restricted, routing=Local Only, cloud_summary=false") {+ if !strings.Contains(summary, "Policy: sensitivity=Restricted, routing=Local Only") {t.Fatalf("expected canonical policy line, got %q", summary)}if !strings.Contains(summary, "Redactions: Hostname, Alias, Path") {diff --git a/internal/unifiedresources/code_standards_test.go b/internal/unifiedresources/code_standards_test.goindex fc9617107d..899bacd3a9 100644--- a/internal/unifiedresources/code_standards_test.go+++ b/internal/unifiedresources/code_standards_test.go@@ -271,7 +271,7 @@ func TestResourcePolicySummaryContractOmitsRawSignals(t *testing.T) {}summary := strings.Join(ResourcePolicySummaryLines(&policy), "\n")- if strings.Contains(summary, "Raw Signals") || strings.Contains(summary, "allowCloudRawSignals") {+ if strings.Contains(summary, "Raw Signals") || strings.Contains(summary, "allowCloudRawSignals") || strings.Contains(summary, "cloud_summary=") {t.Fatalf("resource policy summary leaked raw-signals wording: %q", summary)}}@@ -458,7 +458,7 @@ func TestResourcePolicyLabelHelpersUsedByAIConsumers(t *testing.T) {"func ResourcePolicyLabel(name, aiSafeSummary string, policy *ResourcePolicy) string","if ResourcePolicyRequiresGovernedSummary(policy) {","return ResourcePolicyRedactedLabel",- "Policy: sensitivity=%s, routing=%s, cloud_summary=%t",+ "Policy: sensitivity=%s, routing=%s","func ResourcePolicyRedactedValue(value string, policy *ResourcePolicy, hints ...ResourceRedactionHint) string","const ResourcePolicyRedactedLabel = \"redacted by policy\"","func ResourceRedactionLabelsFromHints(hints []ResourceRedactionHint) []string",diff --git a/internal/unifiedresources/policy_metadata_test.go b/internal/unifiedresources/policy_metadata_test.goindex 168cae005f..d06d323570 100644--- a/internal/unifiedresources/policy_metadata_test.go+++ b/internal/unifiedresources/policy_metadata_test.go@@ -264,7 +264,7 @@ func TestResourcePolicySummaryLines(t *testing.T) {got := ResourcePolicySummaryLines(policy)want := []string{- "Policy: sensitivity=Restricted, routing=Local Only, cloud_summary=false",+ "Policy: sensitivity=Restricted, routing=Local Only","Redactions: Hostname, Alias, Path",}if len(got) != len(want) {@@ -299,7 +299,7 @@ func TestFormatResourcePolicyGovernedSummary(t *testing.T) {}got := FormatResourcePolicyGovernedSummary("system container resource; status online; local-only context", policy)- want := "## Governed resource\nsystem container resource; status online; local-only context\nPolicy: sensitivity=Restricted, routing=Local Only, cloud_summary=false\nRedactions: Hostname, Alias\nRaw routing coordinates, bind mounts, hostnames, and discovery file paths withheld by canonical resource policy.\n\n"+ want := "## Governed resource\nsystem container resource; status online; local-only context\nPolicy: sensitivity=Restricted, routing=Local Only\nRedactions: Hostname, Alias\nRaw routing coordinates, bind mounts, hostnames, and discovery file paths withheld by canonical resource policy.\n\n"if got != want {t.Fatalf("FormatResourcePolicyGovernedSummary() = %q, want %q", got, want)}@@ -486,7 +486,7 @@ func TestResourcePolicySummaryLinesOmitRawSignals(t *testing.T) {})joined := strings.Join(got, "\n")- if strings.Contains(joined, "Raw Signals") || strings.Contains(joined, "allowCloudRawSignals") {+ if strings.Contains(joined, "Raw Signals") || strings.Contains(joined, "allowCloudRawSignals") || strings.Contains(joined, "cloud_summary=") {t.Fatalf("policy summary leaked raw-signals wording: %q", joined)}}diff --git a/internal/unifiedresources/policy_presentation.go b/internal/unifiedresources/policy_presentation.goindex fe4c005217..1094dd1b27 100644--- a/internal/unifiedresources/policy_presentation.go+++ b/internal/unifiedresources/policy_presentation.go@@ -67,15 +67,6 @@ func ResourceRoutingScopeLabel(scope ResourceRoutingScope) string {}}-func resourcePolicyAllowsCloudSummary(scope ResourceRoutingScope) bool {- switch scope {- case ResourceRoutingScopeCloudSummary, ResourceRoutingScopeLocalFirst:- return true- default:- return false- }-}-// ResourceRedactionHintLabel returns the canonical human-readable redaction label.func ResourceRedactionHintLabel(hint ResourceRedactionHint) string {switch hint {@@ -196,10 +187,9 @@ func ResourcePolicySummaryLines(policy *ResourcePolicy) []string {}lines := []string{- fmt.Sprintf("Policy: sensitivity=%s, routing=%s, cloud_summary=%t",+ fmt.Sprintf("Policy: sensitivity=%s, routing=%s",ResourceSensitivityLabel(policy.Sensitivity),ResourceRoutingScopeLabel(policy.Routing.Scope),- resourcePolicyAllowsCloudSummary(policy.Routing.Scope),),}