Cortex Analyst formatting prevention — three-layer defense
Decision
For all future Snowflake Cortex Analyst semantic-view work: enforce Cortex Analyst’s ^[A-Z][A-Z0-9_]*$ column-name rule via THREE independent layers — (1) snowflake-report-mart skill Hard Rules 6/7/8, (2) snowflake-mcp v22.0.9 validate_semantic_view_for_cortex regex tool run before every CREATE OR REPLACE, (3) wrapper-view convention with _C suffix in target schema. RUNWAL_SALES_DASHBOARDS is the canonical working example.
Rationale
2026-05-08 session burned 5+ deployment cycles debugging Cortex’s undocumented validator strictness on quoted/spaced/mixed-case column names. Single-layer defense (skill rules) would be skipped if a future session ignored skill auto-load. Single-layer defense (validator only) requires deliberate invocation. Three-layer defense ensures: skill loads automatically with the workflow; validator catches any DDL slipping past skill rules; wrapper-view pattern in production gives the obvious replication example. Same root cause becomes unreachable from three angles.
Alternatives Rejected
Option A: skill rules only — rejected, no enforcement automation. Option B: validator only — rejected, requires deliberate call (skill rules tell agents WHEN to call). Option C: redesign upstream RNWL_REPORTING views to have clean column names — rejected, owned by data-engineering, out of scope for our agent-stack work, would be cleaner long-term but needs separate cross-team initiative.
Outcome
Pending