Skip to content

feat(dashboard)!: agent-built dashboards, milestone 1 - #285

Merged
vishr merged 2 commits into
mainfrom
feat/agent-dashboards
Oct 5, 2026
Merged

vishr merged 2 commits into
mainfrom
feat/agent-dashboards

Conversation

@vishr

@vishr vishr commented Oct 5, 2026

Copy link
Copy Markdown
Member

What changed

From one sentence, Fanout's agent now builds a dashboard: it checks every query against the engine, previews the result on live data and saves a versioned spec. It edits that dashboard by conversation. The browser renders the same spec. Every panel type is driven by the agent, so nobody writes queries or picks chart settings by hand. This is milestone 1 of four in docs/superpowers/specs/2026-10-04-agent-dashboards-design.md.

  • Spec and engine (internal/panel).
    • Dashboard spec v1 with typed validation.
    • A filter guard that has DuckDB parse and re-render every author expression before it reaches a query.
    • SQL panels with bound parameters behind the read-only telemetry boundary.
    • A structured query compiler and an executor that returns columnar frames, totals and the previous period.
    • Empty-panel diagnosis that names the filter which emptied the panel.
    • Cost bounds: per-panel and per-batch timeouts, row and cell budgets, filter and SQL length caps, and a 20 s validation deadline.
  • Storage (internal/dashboard, internal/db).
    • Dashboards are stored as specs with version history and restore.
    • Typed edit operations: add_panel, update_panel, remove_panel, move_panel, set_variable, remove_variable, set_time, rename.
    • First-fit layout that keeps user coordinates.
  • API and MCP.
    • New routes: /api/panels/query, /api/variables/resolve, /api/telemetry/schema, and the /api/dashboards routes with PATCH, /versions and /versions/{version}/restore.
    • MCP tools: get_telemetry_schema, preview_panels, list_dashboards, get_dashboard, create_dashboard, replace_dashboard, edit_dashboard.
  • Agent (internal/agent).
    • Dashboard-shaped questions build a dashboard; a single factual question still gets a short answer.
    • The OpenAI provider uses the Responses API, so current reasoning models can call tools. It replays each step's output verbatim.
    • Anthropic requests use prompt caching.
    • Default models: claude-sonnet-5-5 and gpt-6.1-sol.
  • Browser (ui/panels, ui/host/src/dashboards).
    • A shared compile layer and canvas ECharts.
    • The dashboard page: time range, refresh, comparison and variables, with URL state.
    • The grid with stat, gauge, timeseries, bar, table and text panels.
    • Inspect, full-screen view, Duplicate, Explain in chat, a per-panel stale status, and layout editing.
    • The widget dashboard is removed.

Breaking contracts

  • Migration 20261004000000_dashboard_specs drops dashboards and dashboard_widgets and creates the spec and version tables. Saved widget dashboards are not carried over; the product is pre-release.
  • HTTP. The dashboard request and response bodies change to {spec, base_version, message} and typed operations. DELETE requires Fanout-Confirm-Delete: <id>.
  • MCP. The dashboard tools take spec v1. edit_dashboard and preview_panels are new.
  • AI providers.
    • The OpenAI provider no longer uses Chat Completions.
    • Model defaults change. Deployments that set FANOUT_AI_MODEL keep their configured model.

Measured on 24 hours of fanout-demo telemetry

Full results are in docs/benchmarks/2026-10-agent-dashboards-m1.md.

Criterion Target Measured
S6: first full render, 12 panels, 24 h ≤ 1.5 s p95 397 ms
S7: panel query, warm cache ≤ 500 ms p95 121 ms
S8: requests per refresh 1 batch 1
S1: benchmark prompts saved, claude-sonnet-5-5 10/10 10/10 in each of 2 runs
S4: median time to a saved dashboard ≤ 45 s 21–28 s

On 16 held-out prompts that were never used for tuning, Sonnet chose correctly between a dashboard and a short answer in 94–100% of cases across two runs. The OpenAI provider built dashboards live on gpt-6.1-sol, gpt-6-astra, gpt-6-luna and gpt-5.6-terra.

Milestones 2–4 come next: analysis (drill-down, heatmaps, log patterns, deploy markers), authoring quality (the build receipt in chat, version history in the UI), and finish (performance in CI, a visual review, and parity with the capability preview).

Verification

  • just check passes: fmt, lint, release and wrapper tests, UI audit, UI asset freshness, notices, go test ./..., 237 UI tests, docs check and site build.
  • just test-race passes.
  • User-facing behavior and configuration docs are current: AI settings reference, MCP scope guide, generated route and tool references.
  • No credentials, private telemetry, host details, or enterprise-only source are included. gitleaks is clean, and the plan carries no host details.
  • API, migration, MCP/AG-UI, and provider contract changes are called out above.
  • Per-task reviews ran with live probes on the security boundaries: the filter guard, owner isolation, OAuth scope, Markdown rendering and provider errors. A whole-branch review and two re-reviews followed, each fix confirmed by mutation tests.
  • Manual checks:
    • browser verification on replayed demo data in both themes;
    • a live model comparison of Sonnet 5.5, Opus 5.5 and GPT-6.1 Sol, graded by two models outside the comparison;
    • a live OpenAI model matrix.

Before deploying

Production and the demo run 2026.9.8, with an Atlas control database and format-2 telemetry. Main already refuses both, since #270 and #272. Plan a data reset or conversion before the next deploy, and check FANOUT_AI_MODEL in each environment.

vishr added 2 commits October 5, 2026 14:38
The agent builds a professional dashboard from one sentence, checks every
query against the engine, previews it on live data, saves it as a
versioned spec, and edits it by conversation. The browser renders the
same spec with time, comparison, variables, inspect, full-screen view and
layout editing.

- internal/panel: dashboard spec v1, validation, a filter guard that
  canonicalizes author text through DuckDB, SQL panels with bound
  parameters, structured query compiler, executor with columnar frames,
  totals, previous-period comparison, empty-panel diagnosis and bounded
  cost.
- internal/dashboard and internal/db: dashboards stored as specs with
  version history, typed edit operations, first-fit layout. The Goose
  migration replaces the widget tables.
- internal/api and internal/mcp: /api/panels/query, /api/variables/resolve,
  /api/telemetry/schema, the /api/dashboards routes with PATCH, versions
  and restore; MCP tools get_telemetry_schema, preview_panels and
  list/get/create/replace/edit_dashboard.
- internal/agent: the prompt builds dashboards for dashboard-shaped
  questions; the OpenAI provider uses the Responses API; Anthropic
  requests use prompt caching; defaults are claude-sonnet-5-5 and
  gpt-6.1-sol.
- ui/panels and ui/host/src/dashboards: shared compile layer, canvas
  charts, the dashboard page, grid, six visualizations, inspect and edit
  mode. The widget dashboard is removed.
- docs: design spec, milestone 1 plan, and measured results on demo data
  (docs/benchmarks/2026-10-agent-dashboards-m1.md).
The container build compiled ui/host without ui/panels, which the new
dashboard page imports.
@vishr
vishr merged commit 2c208c8 into main Oct 5, 2026
12 checks passed
@vishr
vishr deleted the feat/agent-dashboards branch October 5, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant