mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
## Summary - Resolve active Patrol estate capabilities from both synchronized configuration snapshots (`Monitor.ConfiguredIntegrationSummary` for PVE, PBS, PMG, and Proxmox guest Docker discovery, plus read-only TrueNAS config) and observed runtime inventory (`ReadState`, snapshot fallback, host RAID/Ceph/Unraid/ZFS/disk metadata, and connection-health records). - Scope optional domain tools (`pulse_docker`, `pulse_kubernetes`, `pulse_pmg`, and `pulse_storage`) in both `ProfilePatrolDetection` and `ProfilePatrolInvestigation` while preserving exact deterministic tool ordering. - Fail open until runtime inventory arrives (so startup and empty test harnesses never drop tools), retain tools for configured-but-disconnected integrations, always keep `pulse_storage` for Proxmox, PBS, TrueNAS, and host RAID/Ceph/disk estates, and keep explicit `PatrolAnalyzeDocker` and `PatrolAnalyzeStorage` flags authoritative. ## Before / After Tool Schema Measurements (JSON bytes / 4 estimate) - **Plain Proxmox estate:** `7 -> 4` Patrol detection tools, `24,210 -> 19,123` bytes (`~6,053 -> ~4,781` tokens, saving `~1,272` tokens/turn or `21.0%` of tool schema overhead, keeping `pulse_storage`). - **Docker-only estate:** `7 -> 4` Patrol detection tools, `24,210 -> 17,685` bytes (`~6,053 -> ~4,422` tokens, saving `~1,631` tokens/turn or `26.9%` of tool schema overhead). - **Mixed estate (Proxmox + Docker + Kubernetes + PMG):** `7 -> 7` tools (`0.0%` change). ## Verification - `go vet` passed across `./internal/ai/tools`, `./internal/ai/chat`, `./internal/api`, and `./internal/monitoring`. - Race-detector tests passed across `./internal/ai/tools`, `./internal/ai/chat`, and `./internal/api` (`TestConfiguredIntegrationsFromSources` and `TestAIHandler`), including RAID-only and Ceph-only host regression cases, configured-but-disconnected PMG/PBS/PVE retention, fail-open startup, and deterministic tool-order assertions. Refs #2118