Commit Graph

15 Commits

Author SHA1 Message Date
rcourtman e32d4ede44 Expose engine narrative entry points for non-rendering callers
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.
2026-05-10 22:23:09 +01:00
rcourtman 7adc4d9b55 Harden reporting transport validation 2026-03-26 10:10:58 +00:00
rcourtman 87594e6701 Reject invalid reporting time ranges 2026-03-26 09:58:23 +00:00
rcourtman a490ba2b7e Canonicalize reporting transport filenames and format errors 2026-03-26 09:15:15 +00:00
rcourtman 445c2d49ef Remove redundant inventory definition route 2026-03-25 23:40:22 +00:00
rcourtman 3d85fde176 Drive reporting default ranges from catalog 2026-03-25 22:56:20 +00:00
rcourtman 3a7a39996d Canonicalize reporting handler contract 2026-03-25 22:54:14 +00:00
rcourtman 7728b352c0 Canonicalize reporting settings catalog 2026-03-25 22:27:35 +00:00
rcourtman bb6571fd20 Define VM inventory export schema contract 2026-03-25 22:09:37 +00:00
rcourtman 2b93a08558 Carry Proxmox pool membership into VM inventory export 2026-03-25 21:58:46 +00:00
rcourtman b0e76b00ae Add canonical VM inventory export surface 2026-03-25 21:26:25 +00:00
rcourtman 778a2577b6 feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
rcourtman 5c1487e406 feat: add resource picker and multi-resource report generation
Replace manual resource ID entry with a searchable, filterable resource
picker that uses live WebSocket state. Support selecting multiple
resources (up to 50) for combined fleet reports.

Multi-resource PDFs include a cover page, fleet summary table with
aggregate health status, and condensed per-resource detail pages with
overlaid CPU/memory charts. Multi-resource CSVs include a summary
section followed by interleaved time-series data with resource columns.

New POST /api/admin/reports/generate-multi endpoint handles multi-resource
requests while the existing single-resource GET endpoint remains unchanged.

Also fixes resource ID validation regex to allow colons used in
VM/container IDs (e.g., "instance:node:vmid").
2026-02-04 10:24:23 +00:00
rcourtman 2e4e7b06a8 fix(tests): update reporting handlers tests to match new signature
NewReportingHandlers now requires a MultiTenantMonitor parameter.
Pass nil since the tests don't need the monitor functionality.
2026-02-03 17:48:44 +00:00
rcourtman e60a11116b test(api): comprehensively improve test coverage to Security, Infra, and Features 2026-02-02 18:59:44 +00:00