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
Add evidence cues to Assistant briefings
rcourtmaneb88119a294c
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex abc85db57a..162df1af2e 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -369,12 +369,13 @@ profile and assignment columns, but embedded table framing must route throughlifecycle transition. Unified finding lifecycle facts, latest lifecycleevent briefing lines, and detailed lifecycle context included in Assistanthandoff context remain Patrol/AI review metadata and must not become agent- lifecycle state or fleet-control authority. Primary finding recency facts in- the operator briefing and related root-cause or correlated finding summaries- resolved for the same Assistant handoff follow that same isolation rule,- including any recency or latest lifecycle facts attached to those related- summaries: they may explain Patrol context to the model and seed model-only- handoff resources, but they are not enrollment evidence,+ lifecycle state or fleet-control authority. Primary finding recency,+ evidence, and verification facts in the operator briefing and related+ root-cause or correlated finding summaries resolved for the same Assistant+ handoff follow that same isolation rule, including any recency or latest+ lifecycle facts attached to those related summaries: they may explain Patrol+ context to the model and seed model-only handoff resources, but they are not+ enrollment evidence,command-websocket identity, agent command grants, or auto-approval policy.Structured Assistant handoff action references from the same Patrol findingremain AI/runtime review metadata only; lifecycle code must not treatdiff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 2ed939bb9a..30a197b8f4 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -207,10 +207,11 @@ runtime cost control, and shared AI transport surfaces.resolved timestamps, recurrence, regression, and recent lifecycle events soAssistant explains the current Patrol record rather than only the originalinvestigation narrative. The operator briefing must surface the primary- finding's current recency facts before investigation guidance, may surface- the latest lifecycle event as the current handoff state, and detailed- lifecycle events must stay in a bounded `[Finding Lifecycle Context]` block- with an explicit model-only boundary. Assistant runtime may also hydrate canonical+ finding's current recency facts, bounded evidence snapshot, and verification+ summary before investigation guidance, may surface the latest lifecycle+ event as the current handoff state, and detailed lifecycle events must stay+ in a bounded `[Finding Lifecycle Context]` block with an explicit model-only+ boundary. Assistant runtime may also hydrate canonicalresource-policy context for those handoff resources, using the sameunified-resource resolution and policy presentation helpers that governmention prefetch and provider-bound redaction; that context remains@@ -961,11 +962,11 @@ top-N slices.Assistant finding handoffs now also receive a model-only operator briefingderived from the current unified finding and structured Patrol investigationrecord before the lower-level finding context. That briefing must summarize the-finding, resource, priority, current recency facts, investigation confidence,-recommended next step, latest lifecycle event, and governed action posture as-operator guidance, while leaving detailed lifecycle history,-current resource-state, timeline, related-finding, and action-audit hydration-in the existing canonical AI+finding, resource, priority, current recency facts, bounded evidence and+verification summaries, investigation confidence, recommended next step, latest+lifecycle event, and governed action posture as operator guidance, while+leaving detailed lifecycle history, current resource-state, timeline,+related-finding, and action-audit hydration in the existing canonical AIruntime handoff builders. Related root-cause andcorrelated finding records may be summarized from current unified finding state,including their recency and latest lifecycle facts, and may seed their owndiff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex a42ab8683d..dcde7898d4 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -784,10 +784,11 @@ the canonical monitored-system blocked payload.snoozed/dismissed/suppressed status, detection/last-seen/resolutiontimestamps, recurrence/regression facts, and recent lifecycle events, so APIconsumers do not reduce Assistant context to an outdated investigation- summary. The briefing must carry the primary finding's current recency facts- before investigation guidance and may carry the latest lifecycle event as the- current handoff state, while the detailed lifecycle list must stay bounded- and model-only. Chat execution may also resolve root-cause and correlated finding+ summary. The briefing must carry the primary finding's current recency facts,+ bounded evidence snapshot, and verification summary before investigation+ guidance and may carry the latest lifecycle event as the current handoff+ state, while the detailed lifecycle list must stay bounded and model-only.+ Chat execution may also resolve root-cause and correlated findingIDs from that current unified finding into compact related-finding summariesand structured handoff resources. Those related summaries may include therelated record's current recency and latest lifecycle facts, but those@@ -2933,10 +2934,11 @@ The `/api/ai/chat` finding handoff contract must also include a model-only`[Operator Briefing]` generated from the unified finding and structured Patrolinvestigation record before detailed `[Finding Context]`. The briefing is thecanonical operator-facing frame for Assistant: it carries the finding summary,-resource, priority, current recency facts, investigation confidence,-recommended next step, and approval/proposed-fix posture without raw command-text, and the downstream chat service then hydrates live resource state,-timeline, and action audit context around that same handoff.+resource, priority, current recency facts, bounded evidence and verification+summaries, investigation confidence, recommended next step, and+approval/proposed-fix posture without raw command text, and the downstream chat+service then hydrates live resource state, timeline, and action audit context+around that same handoff.Patrol run-history serialization and persistence must also preserve full fieldparity across API responses and restart boundaries, including`pmg_checked`, `rejected_findings`, `triage_flags`, `triage_skipped_llm`, anddiff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.mdindex 59062ea10d..832af667a7 100644--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md@@ -131,9 +131,10 @@ Patrol-specific presentation helpers.Assistant handoffs from Patrol findings must also include a concise operatorbriefing derived from the unified finding and structured investigation recordbefore the detailed finding context, so Assistant leads with the current risk,- recency, conclusion, latest lifecycle event, recommended next step, and- governed approval/proposed-fix posture instead of behaving like a generic- chat over a pasted incident dump. The assembled handoff must still pass+ recency, evidence snapshot, verification summary, conclusion, latest+ lifecycle event, recommended next step, and governed approval/proposed-fix+ posture instead of behaving like a generic chat over a pasted incident dump.+ The assembled handoff must still passthrough the Assistant runtime'sresource-policy sanitizer before prompt injection, so Patrol-owned prosecannot leak governed resource names, IDs, aliases, nodes, paths, ordiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 873d9951bc..ff7743c919 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -427,14 +427,15 @@ bypass the API fail-closed execution gate.review metadata only. Unified finding lifecycle facts, latest lifecycleevent briefing lines, and detailed lifecycle context carried by the samehandoff remain Patrol/AI review metadata and must not become backup recency,- restore support, or storage-local lifecycle state. Primary finding recency- facts in the operator briefing and related root-cause or correlated finding- summaries resolved for that Assistant handoff are also adjacent AI/runtime- explanation context only, including any recency or latest lifecycle facts- attached to those related summaries; storage and recovery surfaces must not- reinterpret those related records or their seeded handoff resources as- backup freshness, restore eligibility, recovery execution authority, or- storage-local capability truth. Current resource-state, source-health,+ restore support, or storage-local lifecycle state. Primary finding recency,+ evidence, and verification facts in the operator briefing and related+ root-cause or correlated finding summaries resolved for that Assistant+ handoff are also adjacent AI/runtime explanation context only, including+ any recency or latest lifecycle facts attached to those related summaries;+ storage and recovery surfaces must not reinterpret those related records or+ their seeded handoff resources as backup freshness, restore eligibility,+ recovery execution authority, or storage-local capability truth. Current+ resource-state, source-health,incident, metric, and capability summaries carried by that handoff are alsoadjacent AI/runtime context and must not become backup freshness, restoreeligibility, recovery execution authority, or storage-local capabilitydiff --git a/internal/api/ai_handler.go b/internal/api/ai_handler.goindex e41320fc40..6376182529 100644--- a/internal/api/ai_handler.go+++ b/internal/api/ai_handler.go@@ -979,6 +979,12 @@ func appendUnifiedFindingOperatorBriefingContext(b *strings.Builder, f *unified.appendChatContextLine(b, "Priority", formatUnifiedFindingBriefingPriority(f))appendChatContextLine(b, "Recency", formatUnifiedFindingBriefingRecencyFacts(f))appendChatContextLine(b, "Investigation", formatUnifiedFindingBriefingInvestigation(f))+ if evidence := unifiedFindingBriefingEvidence(f); evidence != "" {+ appendChatContextLine(b, "Evidence Snapshot", evidence)+ }+ if verification := unifiedFindingBriefingVerification(f); verification != "" {+ appendChatContextLine(b, "Verification", verification)+ }if latestLifecycle := formatUnifiedFindingLatestLifecycleEvent(f.Lifecycle); latestLifecycle != "" {appendChatContextLine(b, "Latest Lifecycle Event", latestLifecycle)}@@ -1153,6 +1159,25 @@ func unifiedFindingBriefingConclusion(f *unified.UnifiedFinding) string {return ""}+func unifiedFindingBriefingEvidence(f *unified.UnifiedFinding) string {+ if f == nil {+ return ""+ }+ if f.InvestigationRecord != nil {+ if evidence := formatInvestigationRecordEvidenceBriefing(f.InvestigationRecord.Evidence, 2); evidence != "" {+ return evidence+ }+ }+ return strings.TrimSpace(f.Evidence)+}++func unifiedFindingBriefingVerification(f *unified.UnifiedFinding) string {+ if f == nil || f.InvestigationRecord == nil {+ return ""+ }+ return formatBriefingStringList(f.InvestigationRecord.Verification, 2, "verification")+}+func unifiedFindingBriefingNextStep(f *unified.UnifiedFinding) string {if f == nil {return ""@@ -1176,6 +1201,67 @@ func unifiedFindingBriefingNextStep(f *unified.UnifiedFinding) string {return "Explain what Patrol knows and identify the next evidence to verify before remediation."}+func formatInvestigationRecordEvidenceBriefing(evidence []aicontracts.InvestigationRecordEvidence, limit int) string {+ if limit <= 0 || len(evidence) == 0 {+ return ""+ }+ parts := make([]string, 0, limit+1)+ total := 0+ for _, item := range evidence {+ summaryParts := make([]string, 0, 3)+ if kind := strings.TrimSpace(item.Kind); kind != "" {+ summaryParts = append(summaryParts, kind)+ }+ if id := strings.TrimSpace(item.ID); id != "" {+ summaryParts = append(summaryParts, id)+ }+ if summary := strings.TrimSpace(item.Summary); summary != "" {+ summaryParts = append(summaryParts, summary)+ }+ if len(summaryParts) == 0 {+ continue+ }+ total+++ if len(parts) < limit {+ parts = append(parts, strings.Join(summaryParts, ": "))+ }+ }+ if len(parts) == 0 {+ return ""+ }+ if remaining := total - len(parts); remaining > 0 {+ parts = append(parts, fmt.Sprintf("%d more evidence items", remaining))+ }+ return strings.Join(parts, "; ")+}++func formatBriefingStringList(values []string, limit int, itemName string) string {+ if limit <= 0 || len(values) == 0 {+ return ""+ }+ parts := make([]string, 0, limit+1)+ total := 0+ for _, value := range values {+ if normalized := strings.TrimSpace(value); normalized != "" {+ total+++ if len(parts) < limit {+ parts = append(parts, normalized)+ }+ }+ }+ if len(parts) == 0 {+ return ""+ }+ if remaining := total - len(parts); remaining > 0 {+ itemName = strings.TrimSpace(itemName)+ if itemName == "" {+ itemName = "items"+ }+ parts = append(parts, fmt.Sprintf("%d more %s", remaining, itemName))+ }+ return strings.Join(parts, "; ")+}+func unifiedFindingBriefingActionPosture(f *unified.UnifiedFinding) string {if f == nil {return ""diff --git a/internal/api/ai_handler_test.go b/internal/api/ai_handler_test.goindex abccea2bdf..44ca9c7975 100644--- a/internal/api/ai_handler_test.go+++ b/internal/api/ai_handler_test.go@@ -734,6 +734,8 @@ func TestHandleChat_IncludesInvestigationRecordContext(t *testing.T) {assert.Contains(t, reqArg.HandoffContext, "Priority: critical performance; status active; loop awaiting_approval; raised 3 times; regressed 2 times")assert.Contains(t, reqArg.HandoffContext, "Recency: detected 2026-05-06T12:00:00Z; last seen 2026-05-06T12:02:00Z; raised 3 times; regressed 2 times; last regression 2026-05-06T12:06:00Z")assert.Contains(t, reqArg.HandoffContext, "Investigation: completed; outcome fix_queued; confidence high; attempts 1")+ assert.Contains(t, reqArg.HandoffContext, "Evidence Snapshot: metrics: CPU stayed above 95% for 10 minutes")+ assert.Contains(t, reqArg.HandoffContext, "Verification: CPU returned below 50%")assert.Contains(t, reqArg.HandoffContext, "Latest Lifecycle Event: 2026-05-06T12:03:00Z | investigation_completed | Fix queued for approval | investigating -> fix_queued")assert.Contains(t, reqArg.HandoffContext, "Current Conclusion: Backup job saturated CPU.")assert.Contains(t, reqArg.HandoffContext, "Recommended Next Step: Approve a controlled service restart after backup completion.")diff --git a/internal/api/contract_test.go b/internal/api/contract_test.goindex b3255542b1..33bbaa467c 100644--- a/internal/api/contract_test.go+++ b/internal/api/contract_test.go@@ -175,6 +175,10 @@ func TestContract_AssistantFindingContextUsesModelOnlyHandoff(t *testing.T) {"[Operator Briefing]",`appendChatContextLine(b, "Recency", formatUnifiedFindingBriefingRecencyFacts(f))`,"formatUnifiedFindingBriefingRecencyFacts(f)",+ `appendChatContextLine(b, "Evidence Snapshot", evidence)`,+ `appendChatContextLine(b, "Verification", verification)`,+ "formatInvestigationRecordEvidenceBriefing",+ "formatBriefingStringList","Latest Lifecycle Event","Operator Boundary",`return "suppressed"`,