Pulse/pkg
rcourtman d4463a615c Add fleet-level AI narrative for multi-resource reports
The single-resource AI narrative landed in b2bd9d114 but multi-resource
fleet reports stayed heuristic-only. That left a gap on the exact axis
where AI helps most: a 50-resource fleet PDF is where synthesis is the
difference between useful and unread.

Introduce FleetNarrator as a separate interface from Narrator. The
input shapes are different — single-resource takes one set of metric
stats with a prior window, fleet takes a denormalised cross-resource
view with per-resource summaries plus a fleet aggregate.
HeuristicFleetNarrator owns the deterministic fallback: ranks
resources by severity (critical alerts > unhealthy disks > storage
pressure > memory > CPU > non-critical alerts), picks up to 5
outliers, derives cross-cutting patterns by counting how many of N
resources share a hot signal, and emits fleet-scoped recommendations.

internal/ai.Service implements FleetNarrator through
report_fleet_narrator.go. Distinct use-case label
(report_narrative_fleet) so fleet vs single-resource spend is
separable in the cost ledger and budget gate. The fleet payload is
denormalised through buildReportFleetPayload so prompt cost scales
linearly with fleet size. Same fail-closed invariant — nil provider,
parse failure, or context cancellation falls through to the heuristic.

Single-resource Narrator is intentionally NOT propagated through
engine.GenerateMulti: a 50-resource fleet report performs one AI call
(fleet narrator), not 51. The router resolver returns the AI service
for all three roles (Narrator, FleetNarrator, FindingsProvider).

The fleet PDF renders the FleetNarrative in the fleet summary cover
when present: executive prose, named outliers with severity-coloured
bullets, cross-cutting patterns, recommendations, optional period
comparison, and an AI provenance footer. The deterministic resource
summary table is preserved above so every named outlier is verifiable
against the table immediately below it. Legacy "Highest CPU / Most
alerts" bullets remain as the fallback when no FleetNarrative is
attached.
2026-05-10 21:23:12 +01:00
..
agents Gate RAID rebuild alerts on mdstat operation 2026-04-30 14:31:14 +01:00
aicontracts Plumb operator-state and operational memory into investigation findings 2026-05-09 21:03:15 +01:00
audit Export restricted outbound HTTP security helpers 2026-04-22 10:05:57 +01:00
auth Split audit log access into dedicated token scope 2026-04-22 07:59:12 +01:00
cloudauth fix(hosted): preserve direct handoff membership continuity 2026-03-26 23:40:02 +00:00
db feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
discovery Pin discovery HTTP probes to captured TLS peers 2026-03-29 19:32:56 +01:00
extensions Restore commercial monitored-system admission hook contract 2026-05-06 18:04:59 +01:00
fsfilters Harden agentexec token binding and disk filtering 2026-04-23 15:54:48 +01:00
licensing Track runtime build in license activation 2026-05-06 23:45:37 +01:00
metrics refactor: split alert config and callbacks 2026-05-06 13:01:32 +01:00
pbs Harden outbound URLs and file-backed storage 2026-03-29 12:47:55 +01:00
pmg Harden outbound URLs and file-backed storage 2026-03-29 12:47:55 +01:00
proxmox Surface per-endpoint reasons in cluster "no healthy nodes" error 2026-05-08 21:10:14 +01:00
pulsecli Add action execution safety contract 2026-05-04 23:19:58 +01:00
reporting Add fleet-level AI narrative for multi-resource reports 2026-05-10 21:23:12 +01:00
securityutil Allow insecure dev HTTP agent runtime URLs 2026-04-23 13:48:54 +01:00
server Restore commercial monitored-system admission hook contract 2026-05-06 18:04:59 +01:00
tlsutil Fail closed on auth env hashing and TLS floors 2026-04-22 05:53:02 +01:00