flowchart TB
    subgraph Input["Data Ingestion"]
        SNB["SnowBridge<br/>(Historian SQL + Redpanda)"]
    end

    subgraph Snowflake["Snowflake + dbt"]
        direction TB
        LAND["Landing Tables<br/>(raw, as-received)"]
        STG["Staging Models<br/>(cleaned, typed)"]
        subgraph Curated["Curated Layer (canonical model)"]
            DIM["dim_equipment<br/>(UUID + 5 identifiers<br/>+ UNS path + class)"]
            STATE["fact_state_transitions<br/>(Running/Idle/Faulted/<br/>Starved/Blocked)"]
            TAGS["fact_tag_values<br/>(time-series, filtered)"]
            OEE["mart_oee<br/>(cross-site OEE<br/>from canonical state)"]
            EVENTS["fact_events<br/>(canonical event stream)"]
        end
        TESTS["dbt tests<br/>(enum divergence checks,<br/>source freshness ≤15min)"]
    end

    subgraph Consumers["Analytics Consumers"]
        PBI["Power BI<br/>(reporting)"]
        AIML["AI/ML Models<br/>(predictive)"]
        ADHOC["Ad-hoc SQL<br/>(analysts)"]
    end

    SNB --> LAND
    LAND --> STG
    STG --> DIM
    STG --> STATE
    STG --> TAGS
    STATE --> OEE
    TAGS --> OEE
    DIM --> PBI
    OEE --> PBI
    EVENTS --> AIML
    STATE --> AIML
    DIM --> ADHOC
    TAGS --> ADHOC
    TESTS -.->|"validates"| Curated
