feat(engine): enforced config groups — opt-in governance guardrail#918
Merged
Conversation
…uardrail Adds `enforce = true` to a config group. When set, the group's fields are binding rather than defaults: a member model that locally pins a field the group controls (its target `schema` or its `strategy`) fails the load with `ModelError::GroupOverride`, instead of silently routing or materializing itself differently from the rest of the group. The check rides in `resolve_model_config` using sidecar provenance (`raw.<field>.is_some()` ⇒ the model set it locally), so both the `.sql` and `.rocky` loaders enforce through the shared resolver with no extra wiring — verified end-to-end through `rocky emit-sql` (compile path) rejecting an override. Enforcement is strictly opt-in: without `enforce`, groups stay overridable defaults (existing behavior unchanged). A model under an enforced group still supplies its own `[args]` and any field the group doesn't set (e.g. `target.catalog`). This is the governance guarantee for the fan-out — a set of models can be made to share routing and materialization by construction. Documented in reference/model-format.md.
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.
What
Adds
enforce = trueto a config group (built on #917). When set, the group's fields become binding rather than defaults: a member model that locally pins a field the group controls — its targetschemaor itsstrategy— fails the load withModelError::GroupOverride, instead of silently routing or materializing itself differently from the rest of the group.A member that tries to escape:
Design
resolve_model_configusing sidecar provenance (raw.<field>.is_some()⇒ the model set it locally) — no provenance plumbing, no new compiler pass..sqlloader and the.rockysalsa loader enforce with no extra wiring — verified end-to-end throughrocky emit-sql(thecompilepath) rejecting an override.enforce, groups stay overridable defaults (existing behavior unchanged). A model under an enforced group still supplies its own[args]and any field the group doesn't set (e.g.target.catalog).Tests
enforced_group_rejects_local_override(bothstrategyandtarget.schema);enforcement_is_opt_in_and_allows_conforming_models(conforming model under an enforced group loads; the same override under a non-enforced group is allowed).Context
This is the governance "teeth" of the config-groups keystone (C4): a set of models can be made to share routing + materialization by construction. Framed neutrally — it's "a model can't silently escape its group's config," with no domain-specific invariants. Shared tags (→ Dagster) and per-mode computed keys remain follow-ups.
cargo fmt + clippy
--all-targetsclean; no codegen/schema drift.