mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-05-20 17:48:47 +00:00
The reporting engine's synthesis layer was reachable only through Generate/GenerateMulti, which always rendered PDF or CSV. Pulse Assistant needs the same retrospective synthesis (per-resource summary, fleet outliers, period comparison) in a form it can present in chat, not as a downloaded artifact. Add two non-rendering entry points to the Engine interface: NarrativeFor(req MetricReportRequest) (*Narrative, error) FleetNarrativeFor(req MultiReportRequest) (*FleetNarrative, error) Both run the same query path and the same narrator resolution as their rendering counterparts (heuristic by default, AI when the request supplies a narrator, fail-closed-to-heuristic on any narrator error) and return the structured narrative without invoking the fpdf/csv output stage. Test stubs in pkg/reporting and internal/api are updated to implement the extended interface. These are the seams the upcoming pulse_summarize Assistant tools wrap to answer questions like "what's hot on pve1 this week" or "where should I look across my fleet" without round-tripping through report generation. Same synthesis layer, no PDF involved. Also fixes a pre-existing flake in TestEngineGenerate_UsesSuppliedNarrator (metrics writes are async; the first Generate sometimes ran before the raw tier flushed). Wrapped in the same eventually-pattern used by the prior-period and findings-provider tests. |
||
|---|---|---|
| .. | ||
| catalog.go | ||
| catalog_test.go | ||
| csv.go | ||
| csv_additional_test.go | ||
| engine.go | ||
| engine_additional2_test.go | ||
| engine_additional3_test.go | ||
| engine_additional_test.go | ||
| engine_integration_test.go | ||
| engine_narrative_test.go | ||
| engine_test.go | ||
| fleet_narrative.go | ||
| fleet_narrative_test.go | ||
| multi_report_visual_test.go | ||
| narrative.go | ||
| narrative_test.go | ||
| pdf.go | ||
| pdf_additional2_test.go | ||
| pdf_additional_test.go | ||
| pdf_insights_test.go | ||
| reporting.go | ||
| reporting_test.go | ||
| vm_inventory.go | ||
| vm_inventory_test.go | ||