Validate all ID unification files against exact templates before deployment
Validates all ID unification files against exact templates before deployment.
/plugin marketplace add treasure-data/aps_claude_tools/plugin install treasure-data-cdp-unification-plugins-cdp-unification@treasure-data/aps_claude_toolsMANDATORY validation gate that checks ALL generated unification files against exact templates from agent prompts. This prevents deployment of incorrect configurations.
⚠️ CRITICAL: This command MUST complete successfully before td wf push or workflow execution.
unification/unif_runner.dig existsunification/dynmic_prep_creation.dig existsunification/id_unification.dig existsunification/enrich_runner.dig existsunification/config/environment.yml existsunification/config/src_prep_params.yml existsunification/config/unify.yml existsunification/config/stage_enrich.yml existsunification/queries/ existunification/enrich/queries/ existunif_runner.dig Validation:
require> operator (NOT call>)echo> operators with subtasks/plugins/cdp-unification/prompt.md lines 186-217_error: section with email_alertconfig/environment.yml and config/src_prep_params.ymlstage_enrich.yml Validation:
unif_input table has column and key both using alias_ascolumn using col.name and key using alias_assrc_prep_params.ymlsrc_tbl (NO _prep suffix)enrich_runner.dig Validation:
unification-staging-enricher.md lines 261-299_exporttd_for_each> for dynamic execution${client_short_name}_${src} database exists${client_short_name}_${stg} database exists${client_short_name}_${gld} database exists (if used)${client_short_name}_${lkup} database existscdp_unification_${unif_name} database exists${client_short_name}_${lkup}.exclusion_list table existsenvironment.yml are definedsrc_prep_params.yml exist in source databasesrc_prep_params.yml exist in source tablesunify.yml merge_by_keys match src_prep_params.yml alias_as columns╔══════════════════════════════════════════════════════════════╗
║ ID UNIFICATION VALIDATION REPORT ║
╚══════════════════════════════════════════════════════════════╝
[1/5] File Existence Check
✅ unification/unif_runner.dig
✅ unification/dynmic_prep_creation.dig
✅ unification/id_unification.dig
✅ unification/enrich_runner.dig
✅ unification/config/environment.yml
✅ unification/config/src_prep_params.yml
✅ unification/config/unify.yml
✅ unification/config/stage_enrich.yml
✅ 3/3 SQL files in queries/
✅ 4/4 SQL files in enrich/queries/
[2/5] Template Compliance Check
✅ unif_runner.dig uses require> operator
✅ unif_runner.dig has no echo> conflicts
✅ stage_enrich.yml RULE 1 compliant (unif_input table)
✅ stage_enrich.yml RULE 2 compliant (staging tables)
❌ stage_enrich.yml has incorrect mapping on line 23
Expected: column: email_address_std
Found: column: email
FIX: Update line 23 to use col.name from src_prep_params.yml
[3/5] Database & Table Existence
✅ client_src exists
✅ client_stg exists
✅ client_gld exists
✅ client_config exists
❌ client_config.exclusion_list does NOT exist
FIX: Run: td query -d client_config -t presto -w "CREATE TABLE IF NOT EXISTS exclusion_list (key_value VARCHAR, key_name VARCHAR, tbls ARRAY(VARCHAR), note VARCHAR)"
[4/5] Configuration Validation
✅ All variables defined in environment.yml
✅ Source table client_stg.snowflake_orders exists
✅ All columns exist in source table
✅ unify.yml keys match src_prep_params.yml
[5/5] YAML Syntax Check
✅ All YAML files have valid syntax
✅ Proper indentation
✅ No tabs found
╔══════════════════════════════════════════════════════════════╗
║ VALIDATION SUMMARY ║
╚══════════════════════════════════════════════════════════════╝
Total Checks: 45
Passed: 43 ✅
Failed: 2 ❌
❌ VALIDATION FAILED - DO NOT DEPLOY
Required Actions:
1. Fix stage_enrich.yml line 23 mapping
2. Create client_config.exclusion_list table
Re-run validation after fixes: /cdp-unification:unify-validate
Standalone:
/cdp-unification:unify-validate
Auto-triggered in unify-setup (MANDATORY step before deployment)
Manual validation before deployment:
cd unification
/cdp-unification:unify-validate
If validation PASSES → Proceed with td wf push unification
If validation FAILS → Fix errors and re-validate
The /unify-setup command will automatically:
✅ ALL checks must pass before deployment is allowed ✅ No exceptions - even 1 failure blocks deployment ✅ Detailed error messages with exact fix instructions ✅ Auto-remediation suggestions where possible
Let's validate your unification files!