Commit Graph

11 Commits

Author SHA1 Message Date
rcourtman
9bd1b6e582 Let only POST narrate single-resource reports with Pulse Assistant
GET /api/admin/reports/generate resolved the tenant's AI narrator, so a
PDF requested with GET made a paid provider call and appended a usage
event to the AI cost ledger. GET passes the demo-mode guard and the
CSRF check, and a SameSite=Lax session cookie rides a cross-site
top-level GET navigation, so a link could spend a signed-in admin's AI
budget.

POST with a JSON body, decoded with the generate-multi rules, is now
the canonical single-resource transport and the only one that may use
the AI narrator. The settings UI sends it, following a new
performanceReport.singleResourceMethod catalog field; a catalog without
the field, and the legacy fallback catalog, keep the GET transport that
older backends accept. GET stays available with the same query
parameters but narrates deterministically, printing a note in place of
the "Configure Pulse Assistant" tip, and other methods get 405 with
Allow: GET, POST. GET also stops resolving the AI service at all: it
reads Patrol findings through a new ExistingAIService lookup, because
GetAIService constructs a tenant service on first use and that can list
provider models or start background discovery. The router's reporting
wiring moves into wireReportingAIResolvers so a test can drive it.

Keeping GET rather than answering 405 avoids breaking documented API
scripts (MSP.md pointed providers at it) for no security gain: CSV is
never narrated and GET no longer reaches the provider.
2026-10-07 21:00:34 +01:00
rcourtman
5a7fde7b39 Refresh advanced_reporting paywall and guidance copy
The locked-state description advertised the v5 capability set ("PDF
and CSV performance reports plus current-state VM inventory
exports") and never caught up with what the v6 reporting feature
actually delivers behind the gate: AI-narrated executive summary,
fleet outlier detection with named resources, period-over-period
comparison, and Patrol findings rolled into the narrative.

Update both the LockedState (what non-Pro users see on the upsell)
and Guidance (what Pro users see on the enabled surface) copy so
they match what ships. The locked-state copy is honest about the
AI being optional — narration uses Pulse Assistant when configured
and falls back to a deterministic summary otherwise — so users who
haven't set up Assistant don't think the Pro feature is gated
behind a separate AI configuration.

No structural change to the catalog: same fields, same JSON shape,
same downstream consumers. Frontend renders these strings directly
from the catalog endpoint, so the copy update propagates without
any frontend code change.
2026-05-11 10:16:27 +01:00
rcourtman
daf825dee6 Remove customer commercial analytics wrappers 2026-04-30 11:46:16 +01:00
rcourtman
6dcfca9831 Canonicalize reporting single-file fallback subject 2026-03-26 09:31:32 +00:00
rcourtman
1886f7fca4 Canonicalize reporting fallback filename date style 2026-03-26 09:28:17 +00:00
rcourtman
a490ba2b7e Canonicalize reporting transport filenames and format errors 2026-03-26 09:15:15 +00:00
rcourtman
78ba7dcc2a Move reporting guidance into catalog 2026-03-25 23:47:00 +00:00
rcourtman
51067ed034 Move reporting locked copy into catalog 2026-03-25 23:28:26 +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