Skip to content

feat(default-models): managed default models + dynamic map/JSON access (013, 014)#58

Merged
acmeguy merged 1 commit into
mainfrom
feat/mature-default-models
Jul 7, 2026
Merged

feat(default-models): managed default models + dynamic map/JSON access (013, 014)#58
acmeguy merged 1 commit into
mainfrom
feat/mature-default-models

Conversation

@acmeguy

@acmeguy acmeguy commented Jul 7, 2026

Copy link
Copy Markdown

Summary

Two features, both inert until DEFAULT_MODELS_* env is configured — safe to deploy with the keys unset (nothing changes for existing users).

013 — Mature Default Models. Platform-maintained model templates reconciled per team: canary-staged rollout with a halt threshold, per-team in-memory compile validation before publish, provenance-preserving merge (template-owned converges, probe fields regenerate, team-added preserved). Adds a reconciliation_runs table, three admin-gated Actions RPCs (reconcileDefaultModels, reconcileTeamDefaultModels, getDefaultModelsReport), a per-team CubeJS worker (POST /api/v1/internal/reconcile-team), and a pre-validation query pre-processor.

014 — Dynamic Map/JSON Access. Reference any ClickHouse map key by name — Cube.dimensions.<key> — via declared FILTER_PARAMS parameter slots rewritten before validation; a filter-scoped property discovery endpoint (POST /api/v1/meta/dynamic, TTL-cached); and event-scoped explicit-registry templates. No member is ever created implicitly.

Why this is safe to merge & deploy inert

  • The query pre-processor no-ops when DEFAULT_MODELS_TARGET_DATASOURCE_NAME is unset and fails open to gateway auth on any error.
  • The reconcile RPCs return 503 default_models_unconfigured without config; the cron fires into a harmless no-op.
  • The migration is additive (reconciliation_runs, deny-by-default Hasura permissions).
  • Tenant scoping is enforced in three independent layers (baked literal, pre-processor injection, query_rewrite_rules backstop) — the existing simple query-rewriting security is preserved, verified.

Verification

  • cubejs 613/615 (the 2 failures are pre-existing partition.test.js on main, unrelated), actions 52/52, error-code lint green.
  • 6 StepCI suites (tests/workflows/default-models/), 116 steps.
  • Live end-to-end against ClickHouse 26.6 — dynamic queries return real grouped values.

Not included (deliberately)

The 012 on-prem login-allowlist work is excluded from this PR and remains in the working tree for a separate change. No DEFAULT_MODELS_* values are set here.

Docs

docs/dynamic-field-access.md (+ .html), specs/013-mature-default-models/, specs/014-dynamic-map-json-access/.

🤖 Generated with Claude Code

Two features, both inert until DEFAULT_MODELS_* env is configured.

013 Mature Default Models — platform-maintained templates reconciled per
team (canary-staged rollout, per-team compile validation, provenance-
preserving merge), a new reconciliation_runs table, three admin-gated
Actions RPCs, a per-team CubeJS worker route, and a pre-validation query
pre-processor that scopes/adapts default-model queries.

014 Dynamic Map/JSON Access — reference any ClickHouse map key by name
(Cube.dimensions.<key>) via declared FILTER_PARAMS parameter slots
rewritten before validation, a filter-scoped property discovery endpoint
(POST /api/v1/meta/dynamic), and event-scoped explicit-registry templates.

Safety: the pre-processor no-ops when DEFAULT_MODELS_TARGET_DATASOURCE_NAME
is unset and fails open to gateway auth; the migration is additive
(reconciliation_runs, deny-by-default permissions); tenant scoping is
enforced in three independent layers. Verified: cubejs 613/615 (2 pre-
existing failures unrelated), actions 52/52, 6 StepCI suites, live E2E
against ClickHouse. Docs in docs/dynamic-field-access.md, specs/013-*,
specs/014-*.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@acmeguy acmeguy merged commit 1030446 into main Jul 7, 2026
3 checks passed
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