fix(modeler): dedup a multi-active satellite's CDK from its attributes#13
Merged
Conversation
Re-running the health_insurance demo to refresh the walkthrough figures exposed that it FAILED validation 4/4: every run tripped E_SAT_DUP_ATTR on the multi-active sat_insured_person_address, because the modeler listed the child_dependent_key (address_type) ALSO among the satellite's attributes. Attributes and child_dependent_key share one column namespace (src_payload + src_cdk), so the generated satellite would emit that column twice and cannot build. The re-model loop couldn't recover within MAX_MODELING_ATTEMPTS. Fix (both, since LLM steering alone failed 4/4 even with the error fed back through the retry loop): - A [GUIDE] line in DV_MODELING_RULES: a multi-active CDK is a key column, not payload — never also list it among the satellite's attributes. - Deterministic rules.attributes_without_cdk(attributes, child_dependent_key), applied by dv2_modeler in _validate_model: drops payload attributes normalising to a CDK label (order-preserving; the CDK column still ships via src_cdk). Meaning-preserving — genuine attribute-vs-attribute duplicates are left for E_SAT_DUP_ATTR to flag. After the fix the health_insurance demo PASSES 3/3 (0 issues, was 0/4); a representative run is 4 hubs / 3 links / 8 satellites -> 15 raw-vault + 8 staging models, matching the walkthrough. Refreshed the walkthrough's dbt-model figure (now incl. the staging count). 333 tests green (+2: attributes_without_cdk unit + modeler-dedup integration), ruff clean, mypy strict clean (32 files). Co-Authored-By: Claude Opus 4.8 (1M context) <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
Re-running the
health_insurancedemo to refresh the walkthrough figures exposed that it failed validation 4/4: every run trippedE_SAT_DUP_ATTR on sat_insured_person_address. The modeler listed the multi-active satellite's child dependent key (address_type) also among its attributes; attributes +child_dependent_keyshare one column namespace (src_payload+src_cdk), so the generated satellite would emit that column twice and cannot build. The re-model loop couldn't recover withinMAX_MODELING_ATTEMPTS.Fix
Both, since LLM steering alone failed 4/4 even with the error fed back through the retry loop:
[GUIDE]line inDV_MODELING_RULES: a multi-active CDK is a key column, not payload — never also list it among the attributes.rules.attributes_without_cdk(attributes, child_dependent_key), applied bydv2_modeler._validate_model— drops payload attributes normalising to a CDK label (order-preserving; the CDK column still ships viasrc_cdk). Meaning-preserving — genuine attribute-vs-attribute duplicates are left forE_SAT_DUP_ATTRto flag.Verification
attributes_without_cdkunit + modeler-dedup integration),ruffclean,uv run mypyclean (32 files).docs/demos/health-insurance-walkthrough.md(staging count in the figures).Note
A separate, sporadic gate (
E_SAT_ATTR_OVERLAPonhub_policy) appeared once pre-fix and not in the post-fix runs — a different, lower-frequency modeler-quality issue, not addressed here.🤖 Generated with Claude Code