Skip to content

mdcode: binding profiles design doc (proposed) - #357

Merged
libei merged 7 commits into
GoogleCloudPlatform:mainfrom
libei:mdcode-binding-profiles-doc
Aug 29, 2026
Merged

mdcode: binding profiles design doc (proposed)#357
libei merged 7 commits into
GoogleCloudPlatform:mainfrom
libei:mdcode-binding-profiles-doc

Conversation

@libei

@libei libei commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

What

Adds toolbox/mdcode/docs/semantic-model/profiles.md — a proposed design for binding profiles on semantic models, written as the user guide first so we can iterate on how it reads before building.

Marked Status: proposed; nothing is implemented and the README nav is untouched.

The idea

Keep one logical model; swap its physical binding at push time via named profiles.

  • Base + overrides. The model file is the base (its inline bindings are the default profile). A profile is a subclass in the identical schema carrying only its deltas; kcmd push --profile <name> deep-merges it onto the base (matched by name) and deploys the union.
  • Physical-only contract. A profile may override source, field columns, keys, and the deployment target — never labels, dimensions, ai_context, or metrics. Guarantee: switching profiles moves the data but never changes what the model means.
  • File layout. One file per profile under <model>.profiles/, so a profile can be edited, reviewed, and owned in isolation.
  • CLI. --profile (which binding) is orthogonal to the existing --target bq|kc (which destination); default_profile: in catalog.yaml; new kcmd profiles to list.

Scope notes

  • Covers same-layout environment swaps (dev/staging/prod) and differently-shaped copies (different table/column/key names).
  • Different execution backends and per-profile SQL dialect are explicitly deferred.
  • Requires one format change: promoting the deployment target to a first-class deployment_target: key (old GOOGLE custom-extension form still accepted).

Draft for review of the design/wording; implementation to follow.

libei added 7 commits August 29, 2026 15:08
Proposes binding profiles for semantic models: keep one logical model and
swap its physical binding (sources, columns, keys, deployment target) at
push time via named profiles. Written as the user guide first, marked
Status: proposed, to iterate on before implementation.
Remove antithesis appositions and empty intensifiers per the house
writing checklist.
…tive

Describe the capability directly (drop today-vs-tomorrow framing), lead
with the one-ontology operational-vs-analytical story from the OSI
Extended proposal, use URI sources and bare-string expressions, and note
partial binding as under consideration.
Reframe the profile contract around declaration (logical, base-owned) vs
binding (physical, per-profile), and add the availability rule: a metric,
action, relationship, or traversal is available under a profile only when
every field it depends on is bound there, unbound propagating up the
dependency graph. Distinguish an unbound field from a data null, make
leaving a field unbound explicit, and rework the example so a field is
bound under one profile and absent under the other.
…in the example

Title becomes "One logical model, many physical bindings". The worked
example now shows a standalone logical model file (declarations, grain,
graph shape, metrics — no physical facets) and two binding files in a
profiles directory (BigQuery and Spanner), so the decoupling of logical
and physical is the thing on display. Grain and join columns name fields
and stay in the logical model; bindings carry only source, column, and
deployment target.
…d-neutral

The multi-file split is one layout; a binding can also sit inline in the
logical model, and a single-binding model needs nothing more. Genericize
product references in the structural prose (warehouse / operational store)
while the example keeps its concrete BigQuery and Spanner bindings.
Retitle "One model, many stores" to "Why a model gets more than one
binding" so it no longer echoes the document title. Reframe the section
so operational and analytical are one illustration among several axes
(different backends, environments, physical layouts); a profile is a
named binding whose meaning is the author's to decide.
@libei
libei marked this pull request as ready for review August 29, 2026 16:35
@libei
libei merged commit 02317b8 into GoogleCloudPlatform:main Aug 29, 2026
7 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