Pulse/pkg/reporting
rcourtman b2bd9d1147 Replace heuristic report narrative with optional AI-generated layer
Performance reports rendered the Executive Summary, Observations, and
Recommendations sections from inline threshold rules in pdf.go. That
narrative looked intelligent but was static templating against alert
counts and metric percentiles, which felt off-brand alongside Patrol
and Pulse Assistant.

Introduce a Narrator interface in pkg/reporting and a FindingsProvider
counterpart that the engine consults at report time. The heuristic
rules are lifted into HeuristicNarrator unchanged so the deterministic
fallback still produces the same observations and recommendations.
The engine now also queries the comparable prior period and threads
its aggregate stats through the narrator so deltas can be expressed.

internal/ai.Service implements both interfaces via report_narrator.go
(single-turn JSON call grounded in the structured ReportData payload,
falling back to the heuristic on any error/timeout) and
report_findings.go (Patrol findings whose lifecycle overlaps the
report window). The reporting handler resolves the per-tenant AI
service when it is configured and supplies it in the request; absent
configuration, reports look identical to the prior heuristic output.

Charts, stats tables, alert lists, storage and disk sections stay
deterministic — sysadmins can verify every AI claim against the data
tables next to it. The PDF renders the AI prose between the health
card and Quick Stats, adds a Period-over-period section after
Recommendations, and prints a provenance footer when the narrative
came from the assistant.

ai-runtime.md and api-contracts.md updates land in a follow-up commit
on this branch; agent-lifecycle / performance-and-scalability /
storage-recovery have no contract delta from this change (router.go
is referenced in their Extension Points but their semantics are
unchanged).
2026-05-10 19:30:54 +01:00
..
catalog.go Remove customer commercial analytics wrappers 2026-04-30 11:46:16 +01:00
catalog_test.go Remove customer commercial analytics wrappers 2026-04-30 11:46:16 +01:00
csv.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
csv_additional_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
engine.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
engine_additional2_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
engine_additional3_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
engine_additional_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
engine_integration_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
engine_narrative_test.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
engine_test.go Add agentless availability targets 2026-05-06 10:35:34 +01:00
multi_report_visual_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
narrative.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
narrative_test.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
pdf.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
pdf_additional2_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
pdf_additional_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
pdf_insights_test.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
reporting.go Replace heuristic report narrative with optional AI-generated layer 2026-05-10 19:30:54 +01:00
reporting_test.go feat: add resource picker and multi-resource report generation 2026-02-04 10:24:23 +00:00
vm_inventory.go Canonicalize reporting fallback filename date style 2026-03-26 09:28:17 +00:00
vm_inventory_test.go Define VM inventory export schema contract 2026-03-25 22:09:37 +00:00