Skip to content

docs(adr-0021): analytics — one semantic dataset layer, report/dashboard as pure presentation#1415

Merged
xuyushun441-sys merged 1 commit into
mainfrom
docs/adr-0021-analytics-dataset-semantic-layer
May 31, 2026
Merged

docs(adr-0021): analytics — one semantic dataset layer, report/dashboard as pure presentation#1415
xuyushun441-sys merged 1 commit into
mainfrom
docs/adr-0021-analytics-dataset-semantic-layer

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

What

Proposes ADR-0021: redesign the analytics surface from a clean sheet.

  • Introduce one semantic layer — dataset — a thin wrapper over the existing QuerySchema engine (packages/spec/src/data/query.zod.ts), declaring named dimensions and measures.
  • Collapse report (pivot grid) and dashboard (widget canvas) into pure presentations that bind to a dataset by reference and pick dimensions/measures by name — never re-declaring object / field / aggregate.

Why

Today three surfaces each re-implement their own crippled, single-object inline query: Report.columns/groupings, DashboardWidget.category/value/aggregate, and ListChartConfig. That means no joins (half of enterprise reporting impossible), triple metric drift (revenue defined 3×), and no single source of truth (no drill-through / certification / reuse) — while a full join/aggregation/window engine already exists, unused, one layer down.

Key decisions recorded

  • D1 add dataset; D2 report → pivot over a dataset; D3 dashboard widgets reference a dataset, select measures/dimensions by name.
  • Why dataset, not reportdashboard→report is a symptom of having no semantic layer (Salesforce/ServiceNow); mature stacks (Power BI/Looker/dbt) bind tiles to the semantic layer. Includes maturity table + 4-point rationale + a report-embed widget for genuine table-in-dashboard composition.
  • Airtable ergonomics preserved via inline-dataset desugaring.
  • Big-bang migration, no back-compat; one-time codemod (§6).

Status: Proposed — discussion doc only, no code/schema changes in this PR.

…ard as pure presentation

Redesign the analytics surface from a clean sheet: introduce a single
semantic `dataset` layer (a thin wrapper over the existing QuerySchema
engine, declaring named dimensions + measures), and collapse `report`
(pivot) and `dashboard` (canvas) into pure presentations that bind to a
dataset by reference and select dimensions/measures by name.

Kills the three inline single-object query grammars (Report.columns/
groupings, Widget.category/value/aggregate, ListChartConfig), unlocks
joins everywhere, gives one source of truth per metric, and keeps
Airtable-style ergonomics via inline-dataset desugaring.

Records the dashboard→dataset (not dashboard→report) rationale and a
report-embed widget for table-in-dashboard composition. Big-bang
migration, no back-compat; one-time codemod.
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment May 31, 2026 3:19pm

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation size/m labels May 31, 2026
@xuyushun441-sys
xuyushun441-sys merged commit 9c34a54 into main May 31, 2026
10 of 11 checks passed
@xuyushun441-sys
xuyushun441-sys deleted the docs/adr-0021-analytics-dataset-semantic-layer branch May 31, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants