Skip to content

docs(adr-0021): revise after implementation scan — engine join gap, Cube reconciliation, task list - #1417

Merged
os-zhuang merged 2 commits into
mainfrom
docs/adr-0021-revise-after-impl-scan
May 31, 2026
Merged

docs(adr-0021): revise after implementation scan — engine join gap, Cube reconciliation, task list#1417
os-zhuang merged 2 commits into
mainfrom
docs/adr-0021-revise-after-impl-scan

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

Follow-up to #1415. A four-area code scan (spec / runtime / frontend / examples) surfaced three findings that change the plan, now folded into ADR-0021.

What changed in the ADR

  1. Corrected the central premise. The original doc claimed "the engine already does joins/having/window, unused one layer down." The runtime scan shows that's false: groupBy+aggregations execute (single-object only), but joins / having / windowFunctions are schema-only — not executed by IDataEngine or the SQL driver. "Revenue by account.region" cannot run via IDataEngine today. Joins are the gating runtime gap.

  2. Reconcile with a pre-existing semantic layer.CubeSchema + IAnalyticsService are already implemented (Cube.io-style measures/dimensions); its NativeSQLStrategy is the only cross-object JOIN path, but it bypasses RLS/tenant. Recommendation: don't build a third layer — compile datasetAnalyticsQuery / reuse the Cube runtime and harden its RLS.

  3. Naming collisions.Dataset (seed data), Dimension/Metric (Cube) are already taken — the ADR's literal names can't land.

Added

  • Pre-work decisions D-A / D-B / D-C (Cube relationship, naming, join-execution + safety).
  • An Implementation scan section with a workstream task list (WS0–WS5) and rough sizing (~6–8 weeks across both repos; rendering lives in sibling repo objectui — every field change is a two-repo change).
  • Registration touches 4 surfaces (not 1) and 2 inline shapes to migrate across 8 source files.

Status remains Proposed — discussion doc only, no code changes.

…ube reconciliation, naming, task list
A four-area code scan (spec/runtime/frontend/examples) found three things
that change the plan:
- Runtime != schema: groupBy/aggregations execute (single-object), but
joins/having/windowFunctions are schema-only and NOT executed by
IDataEngine or the SQL driver. The headline "revenue by account.region"
cannot run via IDataEngine today — joins are the gating gap.
- A parallel semantic layer already exists and is implemented
(IAnalyticsService + CubeSchema); its NativeSQLStrategy is the only
cross-object JOIN path but bypasses RLS/tenant. Don't build a third
layer — reuse/compile-to Cube.
- Naming collisions: Dataset/Dimension/Metric are already taken.
Corrects the false "engine already does joins" premise, adds the
Cube-reconciliation + naming decisions (D-A/B/C), and appends an
implementation-scan section with a workstream task list and rough sizing
(~6-8 weeks across both repos; rendering lives in sibling repo objectui).
@vercel

vercelBot commented May 31, 2026

Copy link
Copy Markdown

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

ProjectDeploymentActionsUpdated (UTC)
specReadyReadyPreview, CommentMay 31, 2026 4:04pm

Request Review

…view criterion
- D-A: dataset is the ONE author-facing semantic type; compiles to the
existing Cube runtime; retire/absorb the author-facing Cube DSL.
- D-B: take high-prior names dataset/measure/dimension; rename seed
Dataset -> Seed; Cube Dimension/Metric absorbed (collision dissolves).
- D-C: reuse Cube NativeSQLStrategy join path but make RLS + per-joined-
object tenant scoping mandatory; v1 joins only along declared relations.
- Q1: derived measures first-class now, CLOSED (reference measures by
name only; no raw fields/SQL).
- Q2: deferred; runtimeFilter only in v1.
- Q3: deferred; conformed dimensions in a follow-up ADR.
Rewrites D1 schema to a declarative surface smaller than QuerySchema
(object + include relationships + dims/measures + derived), no raw SQL,
joins derived from the object graph. Adds the six AI-author principles
that drive the decisions. WS2 drops XL->L; estimate ~4-6 weeks.
@os-zhuang
os-zhuang merged commit 4d56bfd into mainMay 31, 2026
12 checks passed
os-steve pushed a commit that referenced this pull request Aug 18, 2026
…old, not normalization (#9345)
TenantPlanSchema's doc block claimed unrecognized plan codes fold to free
via "the cloud distribution's normalization." That was wrong on the
mechanism and the citation as of the cloud#1380 ruling (2026-08-16),
landed in cloud PR #1417 (merged 2026-08-17):
- The fold happens at the entitlement layer (isFreePlan), not in
normalization -- sys_environment.plan keeps the raw value (case-
normalized only), so an unrecognized tier stays distinguishable from
the free tier to any reader, log line, or operator (cloud#1389's red
line: normalize the spelling, never the vocabulary).
- Before the ruling, only the control-plane planKey reader folded
unknown to free; the tenant-runtime isFreePlan reader granted paid
access. As of cloud PR #1417 both mirrors fold.
- The two mirrors' vocabularies are not merged into one list (cloud#1380
lands over a pinned copy; unifying them is cloud#1418, ruled but not
landed, and a SHA-pinned image can predate a vocabulary entry even
after that lands).
- Carries the ruling's operational premise -- new tiers are minted
rarely, images roll before a new tier goes on sale -- consistent with
cloud's isFreePlan docstring.
Doc-block prose only. No schema, validation, or behaviour change --
TenantPlanSchema still accepts any string; acceptance is byte-identical.
Fixes#9345
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fs18A2DdXLVN2h8PaaFBcP
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@xuyushun441-sys@os-zhuang