Compute a proposed report widget to inspect its output before saving a report. Use when the user wants to check a widget's output before saving it to a report. Does not save a report or send messages. Pass the same `reportContext` + widget object you will later hand to create_report. Returns a token-bounded, per-type result. By type: DIGEST → resolvedPeriod, comparison totals, largest changes, root nodes, summary markdown (when display is "summary"), recommendations; TOP_FLOP → bounded top/flop rows; GRAPH_SNAPSHOT → bounded series sample and explorerUrl (the chart image is omitted); DASHBOARD_PDF/TEXT → validity pointer; DIVIDER → Slack thread cut (no compute). Widgets inherit shared `reportContext` settings; specify only overrides. DIGEST hierarchy: `reportContext.groupBy` (default root) + `additionalGroupBy` (deeper levels). Per-widget override: set `useDashboardGroupBy: false` to ignore `reportContext.groupBy` for this widget — the first `additionalGroupBy` item (or `queries[0].groupBy`) becomes the root; `false` requires at least one dimension. DIGEST threshold defaults: 100 absolute / 5% relative / 20 changes (`topLargestAbsoluteChange` integer 1–100, applied at every tree level). DIGEST `display`: "tree" (default), "table", or "summary" (opt-in LLM narrative). Preview never starts a per-node AI investigation; `enableAiInvestigation` only applies during delivery of a saved, scheduled report. DIGEST `aggBy` is Month or Week — never Period (Period is TOP_FLOP).
Effects: Read-only preview of saved Costory data. Computes widget output without creating or modifying a saved report or sending messages. A GRAPH_SNAPSHOT may render a temporary PNG, but the preview does not return its image URL. Scope: Authorized Costory workspace data only; no chart is posted or sent to a recipient.
EXAMPLES:
• Monthly DIGEST by env → project → service (AI summary) → { reportContext: { datePreset: "LAST_MONTH", groupBy: "cos_environment", metricId: "cost", currency: "USD" }, widget: { type: "DIGEST", queries: [{ type: "cost", name: "a" }], aggBy: "Month", additionalGroupBy: ["cos_sub_account_id", "cos_service_name"], minAbsoluteDiff: 100, minRelativeDiff: 5, topLargestAbsoluteChange: 20, display: "summary", enableAiInvestigation: false } }
• Kubernetes-only weekly DIGEST (per-widget filterCel) → { reportContext: { datePreset: "LAST_WEEK", groupBy: "cos_namespace_reallocated", metricId: "cost", currency: "USD" }, widget: { type: "DIGEST", title: "Kubernetes", queries: [{ type: "cost", name: "a", filterCel: "cos_cluster_name != null" }], aggBy: "Week", additionalGroupBy: ["cos_workload_name"] } }
• Namespace-rooted DIGEST overriding the report group-by → { reportContext: { datePreset: "LAST_MONTH", groupBy: "cos_environment", metricId: "cost", currency: "USD" }, widget: { type: "DIGEST", title: "Kubernetes", useDashboardGroupBy: false, queries: [{ type: "cost", name: "a" }], aggBy: "Month", additionalGroupBy: ["cos_namespace_reallocated", "cos_workload_name"] } }
• Weekly TOP_FLOP → { reportContext: { datePreset: "LAST_WEEK", groupBy: "cos_service_name", metricId: "cost", currency: "USD" }, widget: { type: "TOP_FLOP", queries: [{ type: "cost", name: "a" }], aggBy: "Period", topN: 5, flopN: 5 } }