feat(default-models): managed default models + dynamic map/JSON access (013, 014)#58
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_runstable, 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 declaredFILTER_PARAMSparameter 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
DEFAULT_MODELS_TARGET_DATASOURCE_NAMEis unset and fails open to gateway auth on any error.503 default_models_unconfiguredwithout config; the cron fires into a harmless no-op.reconciliation_runs, deny-by-default Hasura permissions).query_rewrite_rulesbackstop) — the existing simple query-rewriting security is preserved, verified.Verification
partition.test.jsonmain, unrelated), actions 52/52, error-code lint green.tests/workflows/default-models/), 116 steps.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