dbt_model_inventory — v1

Back to project
ID5390ade7-79be-4ed6-811e-b5b52f51d251
Lensdbt_model_inventory
Functioninventory
Phasediscovery
Topicsdbt, data-pipeline
Versionv1
Created2026-04-19T10:22:16+00:00

Content

{
  "models": [
    {
      "name": "active_queries",
      "path": "models/admin/active_queries.sql",
      "layer": "other",
      "description": "Admin utility showing currently running Snowflake queries."
    },
    {
      "name": "columns",
      "path": "models/admin/columns.sql",
      "layer": "other",
      "description": "Admin view combining column metadata from multiple Snowflake databases."
    },
    {
      "name": "source_columns",
      "path": "models/admin/source_columns.sql",
      "layer": "other",
      "description": "Union of information_schema.columns from backend and DW databases."
    },
    {
      "name": "customer_first_purchases",
      "path": "models/intermediate/customers/customer_first_purchases.sql",
      "layer": "other",
      "description": "First paid credit transaction per user. Used for new vs repeat revenue segmentation in paid budget models."
    },
    {
      "name": "customer_first_trials",
      "path": "models/intermediate/customers/customer_first_trials.sql",
      "layer": "other",
      "description": "First free credit transaction per user."
    },
    {
      "name": "daily_marketing_acquisition",
      "path": "models/intermediate/daily_marketing_acquisition.sql",
      "layer": "signal",
      "description": "Daily acquisition counts by ad platform click ID (gclid, fbclid, etc.) from PostHog user_created events joined to person properties. Provides a daily snapshot of how many signups came from each paid channel.",
      "attribution_concepts": [
        "click ID detection",
        "daily acquisition counting"
      ],
      "upstream_dependencies": [
        "posthog_events",
        "posthog_persons"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "COUNT with click ID coalesce for channel detection",
        "GROUP BY date"
      ]
    },
    {
      "name": "int_finance__credit_transactions_with_policy",
      "path": "models/intermediate/finance/int_finance__credit_transactions_with_policy.sql",
      "layer": "other",
      "description": "Credit transactions with expiration policy applied. Calculates synthetic expiry dates based on business rules."
    },
    {
      "name": "int_finance__kiloclaw_arr_monthly",
      "path": "models/intermediate/finance/int_finance__kiloclaw_arr_monthly.sql",
      "layer": "other",
      "description": "Monthly KiloClaw subscription ARR using point-in-time Stripe subscription periods."
    },
    {
      "name": "int_finance__org_credit_transactions_prepared",
      "path": "models/intermediate/finance/int_finance__org_credit_transactions_prepared.sql",
      "layer": "other",
      "description": "Pre-filtered organization credit transactions for Python balance reconstruction algorithm."
    },
    {
      "name": "int_finance__org_usage_totals",
      "path": "models/intermediate/finance/int_finance__org_usage_totals.sql",
      "layer": "other",
      "description": "Pre-aggregated microdollar usage totals per organization for balance reconstruction."
    },
    {
      "name": "int_finance__token_revenue_monthly",
      "path": "models/intermediate/finance/int_finance__token_revenue_monthly.sql",
      "layer": "other",
      "description": "Monthly token revenue per user from paid credit transactions. Single source of truth for token revenue filtering logic."
    },
    {
      "name": "int_finance__user_credit_transactions_prepared",
      "path": "models/intermediate/finance/int_finance__user_credit_transactions_prepared.sql",
      "layer": "other",
      "description": "Pre-filtered personal credit transactions for Python balance reconstruction."
    },
    {
      "name": "int_finance__user_usage_totals",
      "path": "models/intermediate/finance/int_finance__user_usage_totals.sql",
      "layer": "other",
      "description": "Pre-aggregated microdollar usage totals per user for balance reconstruction."
    },
    {
      "name": "int_org_memberships_at_month_end",
      "path": "models/intermediate/finance/int_org_memberships_at_month_end.sql",
      "layer": "other",
      "description": "Point-in-time org membership reconstructed from audit logs for historical ARR attribution."
    },
    {
      "name": "int_org_memberships_monthly_historical",
      "path": "models/intermediate/finance/int_org_memberships_monthly_historical.sql",
      "layer": "other",
      "description": "Historical org membership counts at each month-end from audit log events."
    },
    {
      "name": "int_conversion_events__posthog",
      "path": "models/intermediate/marketing/int_conversion_events__posthog.sql",
      "layer": "signal",
      "description": "PostHog-sourced conversion events classified by type (user_created, first_usage, payment_succeeded, pageview, etc.) and enriched with user attribution data including click IDs. Core touchpoint/signal extraction for ad platform sync.",
      "attribution_concepts": [
        "touchpoint extraction",
        "conversion event classification",
        "click ID enrichment"
      ],
      "upstream_dependencies": [
        "stg_posthog__events_filtered",
        "stg_posthog__person_identity",
        "int_person_id__to_distinct_id",
        "int_user_id__to_distinct_id",
        "canonical_users"
      ],
      "downstream_consumers": [
        "conversion_events"
      ],
      "key_patterns": [
        "CASE WHEN for event classification",
        "LEFT JOIN for identity enrichment",
        "Coalesce for click ID resolution"
      ]
    },
    {
      "name": "int_conversion_events__synthetic_daily",
      "path": "models/intermediate/marketing/int_conversion_events__synthetic_daily.sql",
      "layer": "signal",
      "description": "Synthetic daily conversion events (last_day_usage, last_day_usage_kilo_claw, last_day_token_usage_kilo_claw) generated from activity data with power-curve conversion values for ad platform optimization.",
      "attribution_concepts": [
        "synthetic conversion signals",
        "conversion value modeling",
        "retention signal generation"
      ],
      "upstream_dependencies": [
        "user_activity_hourly",
        "int_feature_activity_hourly__kiloclaw",
        "canonical_users",
        "users"
      ],
      "downstream_consumers": [
        "conversion_events"
      ],
      "key_patterns": [
        "MD5 for deterministic event_id",
        "Power curve formula for conversion_value",
        "UNION ALL for multiple event types"
      ]
    },
    {
      "name": "int_paid_budget__ad_spend_by_platform",
      "path": "models/intermediate/paid_budget/int_paid_budget__ad_spend_by_platform.sql",
      "layer": "channel",
      "description": "Unified daily ad spend across all 6 paid platforms with product classification (Users/Teams/Enterprise/KiloClaw) and campaign type (Acquisition/Retention) derived from campaign names, ad set names, and final URLs. Replicates Funnel.io classification rules.",
      "attribution_concepts": [
        "channel classification",
        "product classification",
        "campaign type derivation"
      ],
      "upstream_dependencies": [
        "stg_google_ads__campaign_performance",
        "stg_google_ads__ad_group_ads",
        "stg_bing_ads__campaign_performance_daily",
        "stg_facebook_ads__insights",
        "stg_linkedin_ads__campaign_analytics",
        "stg_linkedin_ads__campaigns",
        "stg_twitter_ads__campaign_report",
        "stg_twitter_ads__campaigns",
        "stg_reddit_ads__ad_report"
      ],
      "downstream_consumers": [
        "paid_budget__ad_spend"
      ],
      "key_patterns": [
        "CASE WHEN for product classification from URLs and campaign names",
        "CASE WHEN for campaign_type from name patterns",
        "UNION ALL for multi-platform unification"
      ]
    },
    {
      "name": "int_paid_budget__ad_spend_geo",
      "path": "models/intermediate/paid_budget/int_paid_budget__ad_spend_geo.sql",
      "layer": "channel",
      "description": "Daily campaign-level spend broken down by country for platforms with geo reporting (Meta Ads ISO codes, Reddit region strings).",
      "attribution_concepts": [
        "geographic spend attribution"
      ],
      "upstream_dependencies": [
        "stg_facebook_ads__insights_country",
        "stg_reddit_ads__campaign_report",
        "stg_reddit_ads__campaigns"
      ],
      "downstream_consumers": [
        "paid_budget__ad_spend_geo"
      ],
      "key_patterns": [
        "CASE WHEN for product classification",
        "UNION ALL for multi-platform geo data"
      ]
    },
    {
      "name": "int_feature_activity_hourly__agent_manager",
      "path": "models/intermediate/product/int_feature_activity_hourly__agent_manager.sql",
      "layer": "other",
      "description": "Agent Manager hourly activity from backend sessions and gateway usage."
    },
    {
      "name": "int_feature_activity_hourly__app_builder",
      "path": "models/intermediate/product/int_feature_activity_hourly__app_builder.sql",
      "layer": "other",
      "description": "App Builder hourly activity from backend project data."
    },
    {
      "name": "int_feature_activity_hourly__autocomplete",
      "path": "models/intermediate/product/int_feature_activity_hourly__autocomplete.sql",
      "layer": "other",
      "description": "Autocomplete hourly activity from PostHog telemetry events."
    },
    {
      "name": "int_feature_activity_hourly__autotriage",
      "path": "models/intermediate/product/int_feature_activity_hourly__autotriage.sql",
      "layer": "other",
      "description": "Autotriage/Autofix hourly activity using GitHub login as external identifier."
    },
    {
      "name": "int_feature_activity_hourly__cli",
      "path": "models/intermediate/product/int_feature_activity_hourly__cli.sql",
      "layer": "other",
      "description": "CLI hourly activity from backend session tables."
    },
    {
      "name": "int_feature_activity_hourly__cloud_agent",
      "path": "models/intermediate/product/int_feature_activity_hourly__cloud_agent.sql",
      "layer": "other",
      "description": "Cloud Agent hourly activity from backend sessions and PostHog telemetry."
    },
    {
      "name": "int_feature_activity_hourly__code_reviews",
      "path": "models/intermediate/product/int_feature_activity_hourly__code_reviews.sql",
      "layer": "other",
      "description": "Unified Code Reviews activity combining backend (cloud) and telemetry (local) sources."
    },
    {
      "name": "int_feature_activity_hourly__code_reviews_backend",
      "path": "models/intermediate/product/int_feature_activity_hourly__code_reviews_backend.sql",
      "layer": "other",
      "description": "Code Reviews cloud activity from backend with GitHub username to user_id mapping."
    },
    {
      "name": "int_feature_activity_hourly__code_reviews_telemetry",
      "path": "models/intermediate/product/int_feature_activity_hourly__code_reviews_telemetry.sql",
      "layer": "other",
      "description": "Code Reviews local activity from PostHog LLM Completion events with mode=review."
    },
    {
      "name": "int_feature_activity_hourly__direct_gateway",
      "path": "models/intermediate/product/int_feature_activity_hourly__direct_gateway.sql",
      "layer": "other",
      "description": "Direct gateway activity (feature=direct-gateway) from microdollar_usage_hourly."
    },
    {
      "name": "int_feature_activity_hourly__jetbrains",
      "path": "models/intermediate/product/int_feature_activity_hourly__jetbrains.sql",
      "layer": "other",
      "description": "JetBrains hourly activity from PostHog LLM Completion events."
    },
    {
      "name": "int_feature_activity_hourly__kiloclaw",
      "path": "models/intermediate/product/int_feature_activity_hourly__kiloclaw.sql",
      "layer": "other",
      "description": "KiloClaw hourly activity combining gateway token consumption and telemetry instance events."
    },
    {
      "name": "int_feature_activity_hourly__managed_indexes",
      "path": "models/intermediate/product/int_feature_activity_hourly__managed_indexes.sql",
      "layer": "other",
      "description": "Managed Indexes hourly activity from backend indexing tables."
    },
    {
      "name": "int_feature_activity_hourly__paid_seats",
      "path": "models/intermediate/product/int_feature_activity_hourly__paid_seats.sql",
      "layer": "other",
      "description": "Hourly activity filtered to users on paid seat org subscriptions."
    },
    {
      "name": "int_feature_activity_hourly__parallel_agents",
      "path": "models/intermediate/product/int_feature_activity_hourly__parallel_agents.sql",
      "layer": "other",
      "description": "Parallel Agents hourly activity from PostHog Agent Manager events."
    },
    {
      "name": "int_feature_activity_hourly__security_agent",
      "path": "models/intermediate/product/int_feature_activity_hourly__security_agent.sql",
      "layer": "other",
      "description": "Security Agent hourly activity from backend findings and gateway usage."
    },
    {
      "name": "int_feature_activity_hourly__slack_bot",
      "path": "models/intermediate/product/int_feature_activity_hourly__slack_bot.sql",
      "layer": "other",
      "description": "Kilo for Slack hourly activity using Slack user ID as identifier."
    },
    {
      "name": "int_feature_activity_hourly__unioned",
      "path": "models/intermediate/product/int_feature_activity_hourly__unioned.sql",
      "layer": "other",
      "description": "Union of all feature activity models into a single long-format table at (user_id, hour, feature) grain."
    },
    {
      "name": "int_feature_activity_hourly__vscode",
      "path": "models/intermediate/product/int_feature_activity_hourly__vscode.sql",
      "layer": "other",
      "description": "VS Code hourly activity from PostHog LLM Completion events."
    },
    {
      "name": "int_gateway_activity_hourly",
      "path": "models/intermediate/product/int_gateway_activity_hourly.sql",
      "layer": "other",
      "description": "Hourly Kilo Gateway activity from microdollar_usage."
    },
    {
      "name": "int_user__feature_milestones",
      "path": "models/intermediate/product/int_user__feature_milestones.sql",
      "layer": "other",
      "description": "Non-Pattern-A feature lifecycle milestones per user including multiproduct weeks, model categories, and org membership windows."
    },
    {
      "name": "int_shared__reporting_months",
      "path": "models/intermediate/shared/int_shared__reporting_months.sql",
      "layer": "other",
      "description": "Month spine for finance and ops reporting from 2025-08-01 to the last complete month."
    },
    {
      "name": "int_stripe__subscription_events",
      "path": "models/intermediate/stripe/int_stripe__subscription_events.sql",
      "layer": "other",
      "description": "Parsed Stripe subscription lifecycle events with lateral-flattened line items for multi-product subscriptions."
    },
    {
      "name": "int_stripe__subscription_periods",
      "path": "models/intermediate/stripe/int_stripe__subscription_periods.sql",
      "layer": "other",
      "description": "SCD-2 reconstruction of Stripe subscription state from the event log with valid_from/valid_to periods."
    },
    {
      "name": "teams_subscriptions",
      "path": "models/intermediate/subscriptions/teams_subscriptions.sql",
      "layer": "other",
      "description": "Stripe-sourced Teams and Enterprise org subscriptions filtered to seats product IDs."
    },
    {
      "name": "int_microdollar_usage__enriched",
      "path": "models/intermediate/usage/int_microdollar_usage__enriched.sql",
      "layer": "other",
      "description": "Microdollar usage joined to metadata, feature attribution, and anonymous identity resolution. Single source of truth for gateway-based usage signals."
    },
    {
      "name": "int_microdollar_usage__identified",
      "path": "models/intermediate/usage/int_microdollar_usage__identified.sql",
      "layer": "other",
      "description": "Microdollar usage filtered to identified users only, excluding anonymous IDs to prevent double-counting with PostHog."
    },
    {
      "name": "int_microdollar_usage__kiloclaw",
      "path": "models/intermediate/usage/int_microdollar_usage__kiloclaw.sql",
      "layer": "other",
      "description": "Microdollar usage filtered to KiloClaw gateway rows with heartbeat flagging."
    },
    {
      "name": "int_usage_by_ip_hourly",
      "path": "models/intermediate/usage/int_usage_by_ip_hourly.sql",
      "layer": "other",
      "description": "Hourly IP-level usage aggregation for real-time account farm detection."
    },
    {
      "name": "int_identity__resolution",
      "path": "models/intermediate/users/int_identity__resolution.sql",
      "layer": "identity",
      "description": "The single source of truth for identity resolution. Maps PostHog persons to canonical user_id using a 7-tier matching system: strong_id > email_validated_user_id > email_validated_kilo_user_id > single_id_exists > email_only > unresolved_posthog > unresolved_kilocode. Handles cross-system identity stitching between PostHog analytics and Kilocode backend.",
      "attribution_concepts": [
        "identity resolution",
        "user stitching",
        "cross-system identity matching",
        "tiered matching"
      ],
      "upstream_dependencies": [
        "stg_kilocode__user_identity",
        "stg_posthog__person_identity"
      ],
      "downstream_consumers": [
        "canonical_users",
        "int_posthog__person_collapsed",
        "int_user_id__attribution_history",
        "int_user_id__to_person_id"
      ],
      "key_patterns": [
        "NOT IN subquery for tier exclusion",
        "EXISTS for ID validation",
        "HAVING count(distinct) = 1 for unique email match",
        "UNION ALL for tiered match assembly"
      ]
    },
    {
      "name": "int_person_id__to_distinct_id",
      "path": "models/intermediate/users/int_person_id__to_distinct_id.sql",
      "layer": "identity",
      "description": "Maps PostHog person IDs to their distinct IDs. Step B in the identity mapping chain (person_id \u2192 distinct_id). Reads directly from raw PostHog persons source.",
      "attribution_concepts": [
        "device graph mapping",
        "cross-session linking"
      ],
      "upstream_dependencies": [
        "staging_posthog.persons"
      ],
      "downstream_consumers": [
        "int_conversion_events__posthog",
        "int_user_id__to_distinct_id"
      ],
      "key_patterns": [
        "SELECT DISTINCT for deduplication"
      ]
    },
    {
      "name": "int_posthog__person_collapsed",
      "path": "models/intermediate/users/int_posthog__person_collapsed.sql",
      "layer": "identity",
      "description": "Collapses multiple PostHog persons to a single canonical user_id with scalar attribution fields. Uses min_by(field, posthog_created_at) for first-touch attribution to match PostHog's $initial_* behavior.",
      "attribution_concepts": [
        "identity resolution",
        "first-touch attribution preservation",
        "user deduplication"
      ],
      "upstream_dependencies": [
        "int_identity__resolution",
        "stg_posthog__person_identity"
      ],
      "downstream_consumers": [
        "canonical_users"
      ],
      "key_patterns": [
        "MIN_BY for first-touch field selection",
        "MIN for earliest timestamp",
        "MAX for latest values",
        "GROUP BY user_id for collapsing"
      ]
    },
    {
      "name": "int_posthog__user_event_firsts",
      "path": "models/intermediate/users/int_posthog__user_event_firsts.sql",
      "layer": "signal",
      "description": "First occurrence of each funnel-relevant PostHog event per resolved user. Extracts milestone timestamps (first landing visit, user_created, first_usage, etc.) from events and sessions. Feeds the event spine for funnel analysis.",
      "attribution_concepts": [
        "first-touch event extraction",
        "funnel stage detection",
        "milestone timestamp tracking"
      ],
      "upstream_dependencies": [
        "int_user_id__to_distinct_id",
        "stg_posthog__events_filtered",
        "staging_posthog.sessions"
      ],
      "downstream_consumers": [
        "int_user__event_firsts"
      ],
      "key_patterns": [
        "MIN(CASE WHEN event_name = X THEN timestamp) for first occurrence",
        "FULL OUTER JOIN for combining session and event sources",
        "LEAST for earliest across sources"
      ]
    },
    {
      "name": "int_user__attribution_resolved",
      "path": "models/intermediate/users/int_user__attribution_resolved.sql",
      "layer": "attribution",
      "description": "Per-user resolved click IDs with platform-specific 90-day staleness windows. Consolidates multi-touch attribution history into one canonical row per user, selecting initial click ID when within staleness window and falling back to most recent. Constructs Meta fbc tokens per spec.",
      "attribution_concepts": [
        "click ID staleness windows",
        "first-touch vs last-touch fallback",
        "platform-specific attribution rules",
        "fbc token construction"
      ],
      "upstream_dependencies": [
        "int_user_id__attribution_history"
      ],
      "downstream_consumers": [
        "conversion_events__google_ads",
        "conversion_events__google_ads_kilo_claw",
        "conversion_events__meta",
        "conversion_events__meta_kilo_claw",
        "kilo_pass_events__google_ads",
        "kilo_pass_events__meta",
        "kilo_pass_events__reddit"
      ],
      "key_patterns": [
        "CASE WHEN for 90-day staleness window",
        "MIN_BY/MAX_BY for initial/latest click values",
        "LEFT JOIN for optional platform enrichment"
      ]
    },
    {
      "name": "int_user__event_firsts",
      "path": "models/intermediate/users/int_user__event_firsts.sql",
      "layer": "signal",
      "description": "First occurrence of each named lifecycle event per user across all authoritative sources (PostHog, Stripe, backend). Assembles milestone timestamps into an event spine with (user_id, event_type) grain. Feeds the custom_events mart and Omni funnel explorer.",
      "attribution_concepts": [
        "event spine construction",
        "lifecycle milestone tracking",
        "conversion event identification",
        "multi-source timestamp assembly"
      ],
      "upstream_dependencies": [
        "int_posthog__user_event_firsts",
        "int_user__feature_milestones",
        "int_stripe__subscription_periods",
        "stg_backend__kiloclaw_instances",
        "stg_backend__credit_transactions",
        "stg_backend__referral_codes",
        "stg_backend__referral_code_usages",
        "canonical_users",
        "user_activity_daily"
      ],
      "downstream_consumers": [
        "custom_events"
      ],
      "key_patterns": [
        "Jinja loop for UNION ALL event roster",
        "MIN(CASE WHEN) for first occurrence",
        "COALESCE for multi-source timestamp resolution"
      ]
    },
    {
      "name": "int_user__paid_seat_status",
      "path": "models/intermediate/users/int_user__paid_seat_status.sql",
      "layer": "other",
      "description": "Current paid seat status per user from user_activity_daily."
    },
    {
      "name": "int_user__vercel_country",
      "path": "models/intermediate/users/int_user__vercel_country.sql",
      "layer": "other",
      "description": "Vercel country per user based on first microdollar usage."
    },
    {
      "name": "int_user__website_visits",
      "path": "models/intermediate/users/int_user__website_visits.sql",
      "layer": "signal",
      "description": "Identifies users who have visited kilo.ai from PostHog pageview events, providing first_visit_date and is_website_visitor flag for marketing audience segmentation.",
      "attribution_concepts": [
        "website visit detection",
        "first visit tracking"
      ],
      "upstream_dependencies": [
        "int_user_id__to_distinct_id",
        "stg_posthog__events_filtered"
      ],
      "downstream_consumers": [
        "audiences"
      ],
      "key_patterns": [
        "MIN for first visit date",
        "INNER JOIN for identity resolution"
      ]
    },
    {
      "name": "int_user_activity_summary",
      "path": "models/intermediate/users/int_user_activity_summary.sql",
      "layer": "other",
      "description": "User-level activity summary with first/last usage dates, feature flags, and product counts."
    },
    {
      "name": "int_user_id__attribution_history",
      "path": "models/intermediate/users/int_user_id__attribution_history.sql",
      "layer": "signal",
      "description": "Normalized attribution history storing all touchpoints per user in long format. One row per (user_id, posthog_person_id, person_version) where at least one attribution field (UTM, click ID, referrer) is non-null. Foundation for multi-touch attribution analysis.",
      "attribution_concepts": [
        "multi-touch attribution history",
        "touchpoint normalization",
        "attribution field extraction"
      ],
      "upstream_dependencies": [
        "int_identity__resolution",
        "stg_posthog__person_identity"
      ],
      "downstream_consumers": [
        "int_user__attribution_resolved"
      ],
      "key_patterns": [
        "OR chain for non-null attribution filter",
        "INNER JOIN for identity-resolved touchpoints"
      ]
    },
    {
      "name": "int_user_id__to_distinct_id",
      "path": "models/intermediate/users/int_user_id__to_distinct_id.sql",
      "layer": "identity",
      "description": "Maps canonical user_id to PostHog distinct_id (one-to-many). Step C in the identity mapping chain: joins user\u2192person (A) with person\u2192distinct_id (B). Primary table for joining PostHog event data to resolved users.",
      "attribution_concepts": [
        "identity resolution",
        "cross-session linking",
        "event-to-user mapping"
      ],
      "upstream_dependencies": [
        "int_user_id__to_person_id",
        "int_person_id__to_distinct_id"
      ],
      "downstream_consumers": [
        "anon_conversion",
        "int_conversion_events__posthog",
        "int_feature_activity_hourly__autocomplete",
        "int_feature_activity_hourly__cloud_agent",
        "int_feature_activity_hourly__code_reviews_telemetry",
        "int_feature_activity_hourly__jetbrains",
        "int_feature_activity_hourly__kiloclaw",
        "int_feature_activity_hourly__parallel_agents",
        "int_feature_activity_hourly__vscode",
        "int_microdollar_usage__enriched",
        "int_posthog__user_event_firsts",
        "int_user__website_visits",
        "paid_budget__event_conversions"
      ],
      "key_patterns": [
        "SELECT DISTINCT for deduplication",
        "INNER JOIN for mapping chain"
      ]
    },
    {
      "name": "int_user_id__to_person_id",
      "path": "models/intermediate/users/int_user_id__to_person_id.sql",
      "layer": "identity",
      "description": "Maps canonical user_id to PostHog person_id (one-to-many). Step A in the identity mapping chain, derived directly from int_identity__resolution.",
      "attribution_concepts": [
        "identity resolution",
        "user-to-person mapping"
      ],
      "upstream_dependencies": [
        "int_identity__resolution"
      ],
      "downstream_consumers": [
        "int_user_id__to_distinct_id"
      ],
      "key_patterns": [
        "SELECT DISTINCT for deduplication"
      ]
    },
    {
      "name": "int_user_payments",
      "path": "models/intermediate/users/int_user_payments.sql",
      "layer": "other",
      "description": "Payment data per user including first purchase, first trial, and aggregate amounts."
    },
    {
      "name": "int_users__feedback_reasons",
      "path": "models/intermediate/users/int_users__feedback_reasons.sql",
      "layer": "other",
      "description": "Flattened user feedback reasons (one row per feedback_id \u00d7 reason) for cancellation analysis."
    },
    {
      "name": "canonical_users",
      "path": "models/marts/core/canonical_users.sql",
      "layer": "identity",
      "description": "Single source of truth for user identity resolution. Combines PostHog persons and kilocode_users via 7-tier identity matching. Preserves both initial (first-touch) and current attribution data including all click IDs, UTM parameters, and GeoIP. Derives paid acquisition channel from first-touch signals with click ID priority over UTM fallback.",
      "attribution_concepts": [
        "identity resolution",
        "first-touch attribution",
        "channel classification",
        "click ID hierarchy"
      ],
      "upstream_dependencies": [
        "int_identity__resolution",
        "int_posthog__person_collapsed",
        "stg_kilocode__user_identity"
      ],
      "downstream_consumers": [
        "int_conversion_events__posthog",
        "int_conversion_events__synthetic_daily",
        "int_user__event_firsts",
        "int_user__feature_milestones",
        "kilo_pass_events",
        "paid_budget__enterprise_conversions",
        "paid_budget__event_conversions",
        "paid_budget__kiloclaw_conversions",
        "paid_budget__teams_conversions",
        "paid_budget__user_conversions",
        "user_activity_daily",
        "user_activity_hourly",
        "user_lifecycle_states",
        "users",
        "vscode_weekly_cohorts"
      ],
      "key_patterns": [
        "ROW_NUMBER for best match tier selection",
        "CASE WHEN for channel classification from click IDs",
        "COALESCE for email/name resolution",
        "LEFT JOIN for optional enrichment"
      ]
    },
    {
      "name": "fact_organizations",
      "path": "models/marts/core/fact_organizations.sql",
      "layer": "other",
      "description": "Organization dimension table with credit, membership, and attribution data for enterprise organizations."
    },
    {
      "name": "finance__arr_daily",
      "path": "models/marts/finance/arr/finance__arr_daily.sql",
      "layer": "reporting",
      "description": "Daily ARR and subscription activity across all product streams (kiloclaw, seats). Unified view for Omni daily revenue dashboards.",
      "attribution_concepts": [],
      "upstream_dependencies": [
        "finance__kiloclaw_daily",
        "finance__seats_daily"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "UNION ALL for multi-stream unification"
      ]
    },
    {
      "name": "finance__arr_monthly",
      "path": "models/marts/finance/arr/finance__arr_monthly.sql",
      "layer": "reporting",
      "description": "Monthly ARR by revenue stream at subscription grain. Point-in-time state for MoM ARR trends, stream composition, and churn/expansion analysis.",
      "attribution_concepts": [],
      "upstream_dependencies": [
        "finance__org_kilo_pass_arr_monthly",
        "finance__org_seats_arr_monthly",
        "finance__user_kilo_pass_arr_monthly",
        "int_finance__kiloclaw_arr_monthly",
        "int_finance__token_revenue_monthly",
        "int_shared__reporting_months"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "UNION ALL for multi-stream union",
        "Incremental merge on last complete month"
      ]
    },
    {
      "name": "finance__investor_metrics_monthly",
      "path": "models/marts/finance/arr/finance__investor_metrics_monthly.sql",
      "layer": "reporting",
      "description": "Monthly investor metrics for board reporting including WAU, MAU, avg_dau, token revenue, ARR by stream, free trial seats, and token consumption.",
      "attribution_concepts": [],
      "upstream_dependencies": [
        "finance__org_kilo_pass_arr_monthly",
        "finance__org_seats_arr_monthly",
        "finance__user_kilo_pass_arr_monthly",
        "int_finance__kiloclaw_arr_monthly",
        "int_finance__token_revenue_monthly",
        "int_org_memberships_monthly_historical",
        "microdollar_usage_daily",
        "stg_backend__organization_memberships",
        "stg_backend__organizations",
        "user_activity_daily"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "COUNT DISTINCT for MAU/WAU",
        "AVG of daily counts for avg_dau",
        "HAVING for week overlap filter"
      ]
    },
    {
      "name": "finance__kiloclaw_arr",
      "path": "models/marts/finance/arr/finance__kiloclaw_arr.sql",
      "layer": "reporting",
      "description": "KiloClaw subscription ARR detail \u2014 one row per subscription with current state, ARR, and suspended trial detection."
    },
    {
      "name": "finance__kiloclaw_daily",
      "path": "models/marts/finance/arr/finance__kiloclaw_daily.sql",
      "layer": "reporting",
      "description": "Daily snapshot of Kilo Claw compute instances, trial/subscription activity, and ARR."
    },
    {
      "name": "finance__org_kilo_pass_arr",
      "path": "models/marts/finance/arr/finance__org_kilo_pass_arr.sql",
      "layer": "reporting",
      "description": "Org Kilo Pass subscription ARR detail with invoice-based net pricing."
    },
    {
      "name": "finance__org_kilo_pass_arr_monthly",
      "path": "models/marts/finance/arr/finance__org_kilo_pass_arr_monthly.sql",
      "layer": "reporting",
      "description": "Org Kilo Pass subscription ARR at each month-end for historical analysis."
    },
    {
      "name": "finance__org_seats_arr",
      "path": "models/marts/finance/arr/finance__org_seats_arr.sql",
      "layer": "reporting",
      "description": "Seats subscription ARR detail with invoice-based net pricing."
    },
    {
      "name": "finance__org_seats_arr_monthly",
      "path": "models/marts/finance/arr/finance__org_seats_arr_monthly.sql",
      "layer": "reporting",
      "description": "Org seat subscription ARR at each month-end for historical analysis."
    },
    {
      "name": "finance__paying_customers",
      "path": "models/marts/finance/arr/finance__paying_customers.sql",
      "layer": "reporting",
      "description": "Monthly paying customer counts deduplicated across all revenue streams."
    },
    {
      "name": "finance__seats_daily",
      "path": "models/marts/finance/arr/finance__seats_daily.sql",
      "layer": "reporting",
      "description": "Daily snapshot of Kilo Seats subscription activity including trials, conversions, and ARR."
    },
    {
      "name": "finance__user_kilo_pass_arr",
      "path": "models/marts/finance/arr/finance__user_kilo_pass_arr.sql",
      "layer": "reporting",
      "description": "Individual Kilo Pass subscription ARR with tier-to-price mapping."
    },
    {
      "name": "finance__user_kilo_pass_arr_monthly",
      "path": "models/marts/finance/arr/finance__user_kilo_pass_arr_monthly.sql",
      "layer": "reporting",
      "description": "Individual Kilo Pass subscription ARR at each month-end."
    },
    {
      "name": "finance__org_balance_monthly",
      "path": "models/marts/finance/balance/finance__org_balance_monthly.sql",
      "layer": "reporting",
      "description": "Monthly aggregate summary of organization credit balances."
    },
    {
      "name": "finance__user_balance_monthly",
      "path": "models/marts/finance/balance/finance__user_balance_monthly.sql",
      "layer": "reporting",
      "description": "Monthly aggregate summary of user credit balances."
    },
    {
      "name": "finance__credit_purchase_funnel",
      "path": "models/marts/finance/revenue/finance__credit_purchase_funnel.sql",
      "layer": "reporting",
      "description": "Monthly credit purchase funnel: active users \u2192 buyers \u2192 revenue with conversion rates."
    },
    {
      "name": "finance__revenue_charges",
      "path": "models/marts/finance/revenue/finance__revenue_charges.sql",
      "layer": "reporting",
      "description": "Revenue events at charge grain with stream classification (token_credits, seats, kilo_pass, kiloclaw) including credit-funded KiloClaw deductions."
    },
    {
      "name": "finance__revenue_daily",
      "path": "models/marts/finance/revenue/finance__revenue_daily.sql",
      "layer": "reporting",
      "description": "Daily cash-basis revenue broken down by revenue stream."
    },
    {
      "name": "audience__about_to_churn_last_7_days",
      "path": "models/marts/marketing/audiences/audience__about_to_churn_last_7_days.sql",
      "layer": "reporting",
      "description": "Users at risk of churning (7-30 days since last usage) for retention campaigns."
    },
    {
      "name": "audience__active_last_7_days",
      "path": "models/marts/marketing/audiences/audience__active_last_7_days.sql",
      "layer": "reporting",
      "description": "Recently active users for campaign exclusion."
    },
    {
      "name": "audience__churned_vscode_2_weeks_ago",
      "path": "models/marts/marketing/audiences/audience__churned_vscode_2_weeks_ago.sql",
      "layer": "reporting",
      "description": "VS Code users active 2-4 weeks ago but silent last week for re-engagement targeting."
    },
    {
      "name": "audience__free_user_with_usage_last_7_days",
      "path": "models/marts/marketing/audiences/audience__free_user_with_usage_last_7_days.sql",
      "layer": "reporting",
      "description": "Free users with feature usage for conversion campaigns."
    },
    {
      "name": "audience__has_ever_used_any_feature_last_7_days",
      "path": "models/marts/marketing/audiences/audience__has_ever_used_any_feature_last_7_days.sql",
      "layer": "reporting",
      "description": "Users who have used at least one product feature."
    },
    {
      "name": "audience__long_gone_last_7_days",
      "path": "models/marts/marketing/audiences/audience__long_gone_last_7_days.sql",
      "layer": "reporting",
      "description": "Churned users (30+ days since last usage) for win-back campaigns."
    },
    {
      "name": "audience__non_vscode_users_last_14_days",
      "path": "models/marts/marketing/audiences/audience__non_vscode_users_last_14_days.sql",
      "layer": "reporting",
      "description": "Active users who haven't used VS Code in last 14 days for re-activation."
    },
    {
      "name": "audience__org_admins",
      "path": "models/marts/marketing/audiences/audience__org_admins.sql",
      "layer": "reporting",
      "description": "Org owners and admins with org details for Customer.io targeting."
    },
    {
      "name": "audience__org_owner",
      "path": "models/marts/marketing/audiences/audience__org_owner.sql",
      "layer": "reporting",
      "description": "Org owners with org details for Customer.io targeting."
    },
    {
      "name": "audience__signup_no_usage_last_7_days",
      "path": "models/marts/marketing/audiences/audience__signup_no_usage_last_7_days.sql",
      "layer": "reporting",
      "description": "Signed up users who never used any feature for activation campaigns."
    },
    {
      "name": "audience__used_multiple_products_last_7_days",
      "path": "models/marts/marketing/audiences/audience__used_multiple_products_last_7_days.sql",
      "layer": "reporting",
      "description": "Power users who have used 2+ products."
    },
    {
      "name": "audience__used_one_product_last_7_days",
      "path": "models/marts/marketing/audiences/audience__used_one_product_last_7_days.sql",
      "layer": "reporting",
      "description": "Single-product users for cross-sell targeting."
    },
    {
      "name": "audience__website_visitor_last_7_days",
      "path": "models/marts/marketing/audiences/audience__website_visitor_last_7_days.sql",
      "layer": "reporting",
      "description": "Website visitors who haven't signed up for retargeting."
    },
    {
      "name": "audiences",
      "path": "models/marts/marketing/audiences/audiences.sql",
      "layer": "reporting",
      "description": "User-level audience flags for Hightouch sync. Combines identity, activity, payment, and KiloClaw trial data into boolean segment flags. Excludes internal users and users not in any segment to reduce sync volume.",
      "attribution_concepts": [
        "audience segmentation",
        "lifecycle stage classification"
      ],
      "upstream_dependencies": [
        "users",
        "finance__user_balance",
        "int_feature_activity_hourly__kiloclaw",
        "int_user__paid_seat_status",
        "int_user__website_visits",
        "int_user_activity_summary",
        "stg_backend__kiloclaw_subscriptions",
        "stg_backend__organization_memberships"
      ],
      "downstream_consumers": [
        "audience__churned_vscode_2_weeks_ago",
        "audience__non_vscode_users_last_14_days",
        "audience__org_admins",
        "audience__org_owner"
      ],
      "key_patterns": [
        "CASE WHEN for boolean flag derivation",
        "COALESCE for safe defaults",
        "LEFT JOIN for optional enrichment"
      ]
    },
    {
      "name": "conversion_events",
      "path": "models/marts/marketing/conversion_events/conversion_events.sql",
      "layer": "reporting",
      "description": "Unified conversion events view for ad platform sync via Hightouch. Unions PostHog real-time events and synthetic daily retention signals with all click IDs, user identity, and conversion values.",
      "attribution_concepts": [
        "conversion event unification",
        "ad platform sync preparation"
      ],
      "upstream_dependencies": [
        "int_conversion_events__posthog",
        "int_conversion_events__synthetic_daily"
      ],
      "downstream_consumers": [
        "conversion_events__bing",
        "conversion_events__bing_kilo_claw",
        "conversion_events__customerio",
        "conversion_events__google_ads",
        "conversion_events__google_ads_kilo_claw",
        "conversion_events__meta",
        "conversion_events__meta_kilo_claw",
        "conversion_events__reddit",
        "conversion_events_last_7_days",
        "conversion_events_last_day_usage_last_7_days"
      ],
      "key_patterns": [
        "UNION ALL for source combination"
      ]
    },
    {
      "name": "conversion_events_last_7_days",
      "path": "models/marts/marketing/conversion_events/conversion_events_last_7_days.sql",
      "layer": "reporting",
      "description": "7-day window of all conversion events for ad platform sync."
    },
    {
      "name": "conversion_events_last_day_usage_last_7_days",
      "path": "models/marts/marketing/conversion_events/conversion_events_last_day_usage_last_7_days.sql",
      "layer": "reporting",
      "description": "last_day_usage events from last 7 days with integer conversion values for ad platforms."
    },
    {
      "name": "conversion_events__bing",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__bing.sql",
      "layer": "reporting",
      "description": "Conversion events shaped for Microsoft Bing Ads upload with msclkid and gclid cross-network attribution.",
      "attribution_concepts": [
        "platform-specific conversion formatting",
        "click ID matching"
      ],
      "upstream_dependencies": [
        "conversion_events"
      ],
      "downstream_consumers": [
        "conversion_events__bing_last_day_usage"
      ],
      "key_patterns": [
        "24-hour time window filter",
        "INT cast for conversion_value"
      ]
    },
    {
      "name": "conversion_events__bing_kilo_claw",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__bing_kilo_claw.sql",
      "layer": "reporting",
      "description": "KiloClaw-specific conversion events for Bing Ads."
    },
    {
      "name": "conversion_events__bing_last_day_usage",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__bing_last_day_usage.sql",
      "layer": "reporting",
      "description": "last_day_usage events for Bing Ads."
    },
    {
      "name": "conversion_events__customerio",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__customerio.sql",
      "layer": "reporting",
      "description": "Conversion events shaped for Customer.io event syncs."
    },
    {
      "name": "conversion_events__google_ads",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__google_ads.sql",
      "layer": "reporting",
      "description": "Conversion events shaped for Google Ads enhanced conversion upload with 90-day gclid staleness window, CONVERSION_PRECEDES_EVENT guard, and SHA-256 hashed PII.",
      "attribution_concepts": [
        "platform-specific conversion formatting",
        "click ID staleness enforcement",
        "conversion-precedes-event filtering",
        "enhanced conversion matching"
      ],
      "upstream_dependencies": [
        "conversion_events",
        "int_user__attribution_resolved"
      ],
      "downstream_consumers": [
        "conversion_events__google_ads_last_day_usage"
      ],
      "key_patterns": [
        "CASE WHEN for gclid nullification on expiry/precedence",
        "SHA2 for PII hashing",
        "TO_VARCHAR for timestamp formatting"
      ]
    },
    {
      "name": "conversion_events__google_ads_kilo_claw",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__google_ads_kilo_claw.sql",
      "layer": "reporting",
      "description": "KiloClaw-specific conversions for Google Ads with same staleness and precedence guards."
    },
    {
      "name": "conversion_events__google_ads_last_day_usage",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__google_ads_last_day_usage.sql",
      "layer": "reporting",
      "description": "last_day_usage events for Google Ads."
    },
    {
      "name": "conversion_events__meta",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__meta.sql",
      "layer": "reporting",
      "description": "Conversion events shaped for Meta Conversions API with resolved fbclid, fbc token construction, and fbp cookie. Uses 90-day staleness window from int_user__attribution_resolved.",
      "attribution_concepts": [
        "platform-specific conversion formatting",
        "fbc token construction",
        "fbp cookie forwarding"
      ],
      "upstream_dependencies": [
        "conversion_events",
        "int_user__attribution_resolved"
      ],
      "downstream_consumers": [
        "conversion_events__meta_last_day_usage"
      ],
      "key_patterns": [
        "COALESCE for event-level vs user-level fbclid",
        "String concatenation for fbc token",
        "epoch_second for Unix timestamp"
      ]
    },
    {
      "name": "conversion_events__meta_kilo_claw",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__meta_kilo_claw.sql",
      "layer": "reporting",
      "description": "KiloClaw-specific conversions for Meta CAPI."
    },
    {
      "name": "conversion_events__meta_last_day_usage",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__meta_last_day_usage.sql",
      "layer": "reporting",
      "description": "last_day_usage events for Meta CAPI."
    },
    {
      "name": "conversion_events__reddit",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__reddit.sql",
      "layer": "reporting",
      "description": "Conversion events shaped for Reddit Ads with rdt_cid and 24-hour hard API limit.",
      "attribution_concepts": [
        "platform-specific conversion formatting"
      ],
      "upstream_dependencies": [
        "conversion_events"
      ],
      "downstream_consumers": [
        "conversion_events__reddit_last_day_usage"
      ],
      "key_patterns": [
        "24-hour time window filter",
        "INT cast for conversion_value"
      ]
    },
    {
      "name": "conversion_events__reddit_last_day_usage",
      "path": "models/marts/marketing/conversion_events/platform/conversion_events__reddit_last_day_usage.sql",
      "layer": "reporting",
      "description": "last_day_usage events for Reddit Ads."
    },
    {
      "name": "kilo_pass_events",
      "path": "models/marts/marketing/kilo_pass/kilo_pass_events.sql",
      "layer": "reporting",
      "description": "Kilo Pass subscription lifecycle events (activated/renewed) enriched with user attribution for Customer.io and ad platform sync.",
      "attribution_concepts": [
        "subscription lifecycle events",
        "first-touch attribution enrichment"
      ],
      "upstream_dependencies": [
        "stg_backend__kilo_pass_subscriptions",
        "canonical_users"
      ],
      "downstream_consumers": [
        "kilo_pass_events__google_ads",
        "kilo_pass_events__meta",
        "kilo_pass_events__reddit"
      ],
      "key_patterns": [
        "Date spine for renewal event generation",
        "MD5 for deterministic event_id",
        "COALESCE for click ID resolution"
      ]
    },
    {
      "name": "kilo_pass_events__google_ads",
      "path": "models/marts/marketing/kilo_pass/kilo_pass_events__google_ads.sql",
      "layer": "reporting",
      "description": "Kilo Pass events shaped for Google Ads with 90-day gclid staleness window."
    },
    {
      "name": "kilo_pass_events__meta",
      "path": "models/marts/marketing/kilo_pass/kilo_pass_events__meta.sql",
      "layer": "reporting",
      "description": "Kilo Pass events shaped for Meta CAPI with resolved fbclid and fbc token."
    },
    {
      "name": "kilo_pass_events__reddit",
      "path": "models/marts/marketing/kilo_pass/kilo_pass_events__reddit.sql",
      "layer": "reporting",
      "description": "Kilo Pass events shaped for Reddit Ads with 90-day rdt_cid staleness window."
    },
    {
      "name": "kilo_pass_subscriptions",
      "path": "models/marts/marketing/kilo_pass/kilo_pass_subscriptions.sql",
      "layer": "reporting",
      "description": "Granular Kilo Pass subscription fact table for BI analysis with churn timestamps from Stripe events and cancellation feedback."
    },
    {
      "name": "paid_budget__ad_spend",
      "path": "models/marts/marketing/paid_budget/paid_budget__ad_spend.sql",
      "layer": "reporting",
      "description": "Daily paid ad spend by channel, product, kilo_product, and campaign type. Replaces Funnel.io import.",
      "attribution_concepts": [
        "spend aggregation by channel and product"
      ],
      "upstream_dependencies": [
        "int_paid_budget__ad_spend_by_platform"
      ],
      "downstream_consumers": [
        "paid_budget__ad_spend_sheet_export",
        "paid_budget__budget_pacing",
        "paid_budget__monthly_performance",
        "paid_budget__weekly_performance"
      ],
      "key_patterns": [
        "SUM with GROUP BY for aggregation"
      ]
    },
    {
      "name": "paid_budget__ad_spend_geo",
      "path": "models/marts/marketing/paid_budget/paid_budget__ad_spend_geo.sql",
      "layer": "reporting",
      "description": "Daily paid ad spend broken down by country for platforms supporting geo reporting."
    },
    {
      "name": "paid_budget__ad_spend_sheet_export",
      "path": "models/marts/marketing/paid_budget/paid_budget__ad_spend_sheet_export.sql",
      "layer": "reporting",
      "description": "Ad spend in the exact format of the Paid Budget Google Sheet."
    },
    {
      "name": "paid_budget__budget_pacing",
      "path": "models/marts/marketing/paid_budget/paid_budget__budget_pacing.sql",
      "layer": "reporting",
      "description": "Monthly budget pacing with spend-to-date, pacing %, daily run rate, and projected spend."
    },
    {
      "name": "paid_budget__conversions",
      "path": "models/marts/marketing/paid_budget/paid_budget__conversions.sql",
      "layer": "aggregation",
      "description": "Unified daily conversion metrics by channel and product. Combines user signups, credit purchases, Teams/Enterprise subscriptions, and KiloClaw trials with both total_* (all channels) and paid_* (per-channel) counts. Foundation for CAC calculations.",
      "attribution_concepts": [
        "conversion aggregation",
        "channel-attributed vs total conversion counting",
        "CAC denominator preparation"
      ],
      "upstream_dependencies": [
        "paid_budget__user_conversions",
        "paid_budget__teams_conversions",
        "paid_budget__enterprise_conversions",
        "paid_budget__event_conversions",
        "paid_budget__kiloclaw_conversions"
      ],
      "downstream_consumers": [
        "paid_budget__monthly_performance",
        "paid_budget__weekly_performance"
      ],
      "key_patterns": [
        "UNION ALL for multi-product union",
        "DISTINCT for total deduplication",
        "SUM for aggregation"
      ]
    },
    {
      "name": "paid_budget__enterprise_conversions",
      "path": "models/marts/marketing/paid_budget/paid_budget__enterprise_conversions.sql",
      "layer": "attribution",
      "description": "Daily Enterprise subscription conversions attributed to paid channels using first-touch click IDs from canonical_users. Click ID presence takes priority over UTM-based channel classification.",
      "attribution_concepts": [
        "first-touch attribution",
        "channel classification from click IDs",
        "UTM fallback classification"
      ],
      "upstream_dependencies": [
        "teams_subscriptions",
        "canonical_users"
      ],
      "downstream_consumers": [
        "paid_budget__conversions",
        "paid_budget__enterprise_sheet_export"
      ],
      "key_patterns": [
        "CASE WHEN hierarchy for channel from click IDs",
        "LEFT JOIN for attribution enrichment"
      ]
    },
    {
      "name": "paid_budget__enterprise_sheet_export",
      "path": "models/marts/marketing/paid_budget/paid_budget__enterprise_sheet_export.sql",
      "layer": "reporting",
      "description": "Enterprise metrics in wide format for Google Sheet export with channel pivot columns."
    },
    {
      "name": "paid_budget__event_conversions",
      "path": "models/marts/marketing/paid_budget/paid_budget__event_conversions.sql",
      "layer": "attribution",
      "description": "PostHog event-based conversion metrics (free trials, org invites, demo clicks/bookings, KiloClaw trial starts) attributed to paid channels using first-touch click IDs. Joins events to canonical_users via distinct_id for channel attribution.",
      "attribution_concepts": [
        "event-based conversion attribution",
        "first-touch channel classification",
        "click ID hierarchy"
      ],
      "upstream_dependencies": [
        "stg_posthog__events_filtered",
        "int_user_id__to_distinct_id",
        "canonical_users"
      ],
      "downstream_consumers": [
        "paid_budget__conversions",
        "paid_budget__enterprise_sheet_export",
        "paid_budget__kiloclaw_sheet_export"
      ],
      "key_patterns": [
        "CASE WHEN for metric_name classification",
        "CASE WHEN hierarchy for channel from click IDs",
        "COUNT for event aggregation"
      ]
    },
    {
      "name": "paid_budget__kiloclaw_conversions",
      "path": "models/marts/marketing/paid_budget/paid_budget__kiloclaw_conversions.sql",
      "layer": "attribution",
      "description": "Daily KiloClaw subscription events (trial_started, paid_started, new_mrr) attributed to paid channels. MRR from credits-paid subs uses credit_transactions; Stripe-paid subs uses Stripe invoices.",
      "attribution_concepts": [
        "subscription event attribution",
        "first-touch channel classification"
      ],
      "upstream_dependencies": [
        "stg_backend__kiloclaw_subscriptions",
        "stg_backend__credit_transactions",
        "airbyte_stg_stripe__invoices",
        "canonical_users"
      ],
      "downstream_consumers": [
        "paid_budget__conversions",
        "paid_budget__kiloclaw_sheet_export"
      ],
      "key_patterns": [
        "CASE WHEN for channel classification",
        "ROW_NUMBER for first billing period",
        "UNION ALL for multi-source events"
      ]
    },
    {
      "name": "paid_budget__kiloclaw_sheet_export",
      "path": "models/marts/marketing/paid_budget/paid_budget__kiloclaw_sheet_export.sql",
      "layer": "reporting",
      "description": "KiloClaw metrics in wide format for Google Sheet export."
    },
    {
      "name": "paid_budget__monthly_performance",
      "path": "models/marts/marketing/paid_budget/paid_budget__monthly_performance.sql",
      "layer": "reporting",
      "description": "Monthly paid budget performance with CAC, ROI, and budget pacing by channel, product, and campaign type.",
      "attribution_concepts": [
        "CAC calculation",
        "ROI measurement",
        "budget pacing"
      ],
      "upstream_dependencies": [
        "paid_budget__ad_spend",
        "paid_budget__conversions",
        "paid_budget_monthly_budgets"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "cost_usd / NULLIF(total_*, 0) for CAC",
        "FULL OUTER JOIN for budget vs spend"
      ]
    },
    {
      "name": "paid_budget__new_repeat_credit_revenue",
      "path": "models/marts/marketing/paid_budget/paid_budget__new_repeat_credit_revenue.sql",
      "layer": "reporting",
      "description": "Daily credit revenue split by new vs repeat customers (30-day window from first purchase)."
    },
    {
      "name": "paid_budget__teams_conversions",
      "path": "models/marts/marketing/paid_budget/paid_budget__teams_conversions.sql",
      "layer": "attribution",
      "description": "Daily Teams subscription conversions attributed to paid channels using first-touch click IDs from canonical_users.",
      "attribution_concepts": [
        "first-touch attribution",
        "channel classification from click IDs"
      ],
      "upstream_dependencies": [
        "teams_subscriptions",
        "canonical_users"
      ],
      "downstream_consumers": [
        "paid_budget__conversions"
      ],
      "key_patterns": [
        "CASE WHEN hierarchy for channel from click IDs",
        "LEFT JOIN for attribution"
      ]
    },
    {
      "name": "paid_budget__user_conversions",
      "path": "models/marts/marketing/paid_budget/paid_budget__user_conversions.sql",
      "layer": "attribution",
      "description": "Daily individual user signups and credit payments attributed to paid channels using first-touch click IDs. Distinguishes new_payment (first purchase matched to customer_first_purchases) from repeat_payment. Includes Organic/Direct rows for total aggregation.",
      "attribution_concepts": [
        "first-touch attribution",
        "channel classification from click IDs",
        "new vs repeat payment classification"
      ],
      "upstream_dependencies": [
        "stg_backend__kilocode_users",
        "canonical_users",
        "stg_backend__credit_transactions",
        "customer_first_purchases"
      ],
      "downstream_consumers": [
        "paid_budget__conversions",
        "paid_budget__users_sheet_export"
      ],
      "key_patterns": [
        "CASE WHEN hierarchy for channel from click IDs",
        "LEFT JOIN for first purchase matching",
        "UNION ALL for signup + payment events"
      ]
    },
    {
      "name": "paid_budget__users_sheet_export",
      "path": "models/marts/marketing/paid_budget/paid_budget__users_sheet_export.sql",
      "layer": "reporting",
      "description": "Users metrics in wide format for Google Sheet export with channel pivot columns."
    },
    {
      "name": "paid_budget__weekly_performance",
      "path": "models/marts/marketing/paid_budget/paid_budget__weekly_performance.sql",
      "layer": "reporting",
      "description": "Weekly paid budget performance \u2014 primary output for growth team with inline CAC calculations using total_* denominators.",
      "attribution_concepts": [
        "CAC calculation",
        "ROI measurement",
        "weekly performance tracking"
      ],
      "upstream_dependencies": [
        "paid_budget__ad_spend",
        "paid_budget__conversions"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "cost_usd / NULLIF(total_*, 0) for CAC",
        "DISTINCT for total deduplication"
      ]
    },
    {
      "name": "paid_traffic__keyword_cohorts",
      "path": "models/marts/marketing/paid_budget/paid_traffic__keyword_cohorts.sql",
      "layer": "reporting",
      "description": "Weekly retention cohort analysis for paid traffic users by utm_source, utm_medium, utm_campaign, and utm_term (keyword). Top-200 keywords shown individually, rest bucketed.",
      "attribution_concepts": [
        "keyword-level retention analysis",
        "paid traffic cohort tracking"
      ],
      "upstream_dependencies": [
        "users",
        "user_activity_daily"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "ROW_NUMBER for top-N keyword selection",
        "COUNT DISTINCT for cohort sizing and retention",
        "DATEDIFF for weeks_since_signup"
      ]
    },
    {
      "name": "paid_traffic__retention_cohorts",
      "path": "models/marts/marketing/paid_budget/paid_traffic__retention_cohorts.sql",
      "layer": "reporting",
      "description": "Weekly retention cohort analysis for paid traffic users by top-30 countries and utm_campaign.",
      "attribution_concepts": [
        "geographic retention analysis",
        "campaign-level retention tracking"
      ],
      "upstream_dependencies": [
        "users",
        "user_activity_daily"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "ROW_NUMBER for top-N country selection",
        "COUNT DISTINCT for retention calculation"
      ]
    },
    {
      "name": "anon_conversion",
      "path": "models/marts/product/anon_conversion.sql",
      "layer": "reporting",
      "description": "Anon-to-signup conversion at device grain. Tracks anonymous free-tier users who later create accounts, with time-to-signup metrics.",
      "attribution_concepts": [
        "anonymous-to-known conversion tracking"
      ],
      "upstream_dependencies": [
        "microdollar_usage_hourly",
        "int_user_id__to_distinct_id",
        "stg_backend__kilocode_users"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "ROW_NUMBER for earliest signup per device",
        "LEFT JOIN for conversion detection",
        "DATEDIFF for time-to-signup"
      ]
    },
    {
      "name": "cloudflare_model_metrics_daily",
      "path": "models/marts/product/cloudflare_model_metrics_daily.sql",
      "layer": "other",
      "description": "Daily aggregated API gateway performance metrics by model and provider."
    },
    {
      "name": "custom_events",
      "path": "models/marts/product/custom_events.sql",
      "layer": "reporting",
      "description": "Public surface for the event spine. One row per (user_id, event_type) exposing first occurrence of each named lifecycle event. Stable mart reference for all downstream consumers (Omni topics, Hightouch syncs).",
      "attribution_concepts": [
        "lifecycle event spine",
        "conversion event identification",
        "funnel stage tracking"
      ],
      "upstream_dependencies": [
        "int_user__event_firsts"
      ],
      "downstream_consumers": [
        "user_lifecycle_states",
        "users"
      ],
      "key_patterns": [
        "View passthrough of intermediate"
      ]
    },
    {
      "name": "external_user_activity_daily",
      "path": "models/marts/product/external_user_activity_daily.sql",
      "layer": "other",
      "description": "Daily activity for features using external identifiers (Slack user ID, GitHub login)."
    },
    {
      "name": "external_user_activity_hourly",
      "path": "models/marts/product/external_user_activity_hourly.sql",
      "layer": "other",
      "description": "Hourly activity for features using external identifiers (Kilo for Slack, Autotriage/Autofix)."
    },
    {
      "name": "model_performance_since_launch",
      "path": "models/marts/product/model_performance_since_launch.sql",
      "layer": "other",
      "description": "Cumulative token usage by model since launch date for model comparison leaderboard."
    },
    {
      "name": "model_tokens_daily",
      "path": "models/marts/product/model_tokens_daily.sql",
      "layer": "other",
      "description": "Daily token usage aggregated by LLM model from PostHog events."
    },
    {
      "name": "user_activation_cohorts",
      "path": "models/marts/product/user_activation_cohorts.sql",
      "layer": "other",
      "description": "Classifies users by week 1 activation behavior: Never active, Bouncers, User, Skipper."
    },
    {
      "name": "user_activity_daily",
      "path": "models/marts/product/user_activity_daily.sql",
      "layer": "reporting",
      "description": "Canonical daily user activity with per-feature boolean flags and used_any_feature. Single source of truth for user activity definition used by WAUzers, last_day_usage, feature flags, and all marketing audiences.",
      "attribution_concepts": [
        "activity definition",
        "feature usage tracking"
      ],
      "upstream_dependencies": [
        "user_activity_hourly",
        "airbyte_stg_stripe__subscriptions",
        "canonical_users"
      ],
      "downstream_consumers": [
        "audience__churned_vscode_2_weeks_ago",
        "audience__non_vscode_users_last_14_days",
        "finance__credit_purchase_funnel",
        "finance__investor_metrics_monthly",
        "int_user__event_firsts",
        "int_user__feature_milestones",
        "int_user__paid_seat_status",
        "paid_traffic__keyword_cohorts",
        "paid_traffic__retention_cohorts",
        "user_activation_cohorts",
        "user_activity_weekly",
        "user_lifecycle_states",
        "vscode_weekly_cohorts"
      ],
      "key_patterns": [
        "MAX for boolean rollup from hourly",
        "LEFT JOIN for internal/paid_seat flags"
      ]
    },
    {
      "name": "user_activity_hourly",
      "path": "models/marts/product/user_activity_hourly.sql",
      "layer": "reporting",
      "description": "Hourly feature activity for all users in wide format with paid seat and internal indicators. Pivots the unioned long-format activity into per-feature boolean columns.",
      "attribution_concepts": [],
      "upstream_dependencies": [
        "int_feature_activity_hourly__unioned",
        "int_feature_activity_hourly__kiloclaw",
        "airbyte_stg_stripe__subscriptions",
        "canonical_users",
        "stg_backend__organization_memberships"
      ],
      "downstream_consumers": [
        "int_conversion_events__synthetic_daily",
        "int_user_activity_summary",
        "user_activity_daily",
        "wau_hourly_buildup"
      ],
      "key_patterns": [
        "MAX(COALESCE(feature = X, false)) for pivoting",
        "LEFT JOIN for enrichment"
      ]
    },
    {
      "name": "user_activity_weekly",
      "path": "models/marts/product/user_activity_weekly.sql",
      "layer": "reporting",
      "description": "Weekly activity spine for retention analysis. One row per (user, week) with boolean feature flags."
    },
    {
      "name": "user_lifecycle_states",
      "path": "models/marts/product/user_lifecycle_states.sql",
      "layer": "reporting",
      "description": "Growth accounting at user \u00d7 feature \u00d7 day grain. Classifies each day as new, retained, churned, resurrected, or dormant. Powers quick ratio, churn rate, and resurrection rate charts.",
      "attribution_concepts": [
        "growth accounting",
        "lifecycle state classification"
      ],
      "upstream_dependencies": [
        "canonical_users",
        "custom_events",
        "user_activity_daily"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "LAG() for previous-day activity detection",
        "CASE WHEN for lifecycle state classification",
        "UNION ALL for feature unpivoting"
      ]
    },
    {
      "name": "users",
      "path": "models/marts/product/users.sql",
      "layer": "reporting",
      "description": "One-stop shop for user data. Combines canonical_users identity and attribution with payments, activity summary, feature milestones, event spine dates, and geographic data. Primary user dimension table for BI tools.",
      "attribution_concepts": [
        "user dimension table",
        "first-touch attribution exposure",
        "channel classification"
      ],
      "upstream_dependencies": [
        "canonical_users",
        "int_user_payments",
        "int_user_activity_summary",
        "int_user__vercel_country",
        "int_user__feature_milestones",
        "custom_events",
        "event_registry"
      ],
      "downstream_consumers": [
        "audiences",
        "finance__user_kilo_pass_arr",
        "int_conversion_events__synthetic_daily",
        "paid_traffic__keyword_cohorts",
        "paid_traffic__retention_cohorts",
        "user_activation_cohorts"
      ],
      "key_patterns": [
        "LEFT JOIN for optional enrichment",
        "COALESCE for multi-source fields",
        "pivot_feature_firsts macro for dynamic column generation"
      ]
    },
    {
      "name": "vscode_weekly_cohorts",
      "path": "models/marts/product/vscode_weekly_cohorts.sql",
      "layer": "reporting",
      "description": "Weekly VS Code retention cohort analysis with cohort week based on signup date."
    },
    {
      "name": "wau_hourly_buildup",
      "path": "models/marts/product/wau_hourly_buildup.sql",
      "layer": "aggregation",
      "description": "Pre-computed cumulative WAU by feature for current week vs last complete week. Enables real-time WoW comparison without date shifting.",
      "attribution_concepts": [],
      "upstream_dependencies": [
        "int_feature_activity_hourly__unioned",
        "external_user_activity_hourly",
        "user_activity_hourly"
      ],
      "downstream_consumers": [],
      "key_patterns": [
        "COUNT DISTINCT for cumulative user counting",
        "CROSS JOIN with hour spine",
        "LEFT JOIN for zero-fill"
      ]
    },
    {
      "name": "wauzers_daily",
      "path": "models/marts/product/wauzers_daily.sql",
      "layer": "reporting",
      "description": "Daily-updated weekly feature WAU metrics using complete weeks only."
    },
    {
      "name": "wauzers_hourly",
      "path": "models/marts/product/wauzers_hourly.sql",
      "layer": "reporting",
      "description": "Hourly-updated weekly feature WAU metrics with real-time projections."
    },
    {
      "name": "microdollar_usage_daily",
      "path": "models/marts/usage/microdollar_usage_daily.sql",
      "layer": "reporting",
      "description": "Daily rollup of API usage by user, feature, model, and provider. Derived from hourly to avoid re-scanning 500M-row source tables."
    },
    {
      "name": "microdollar_usage_hourly",
      "path": "models/marts/usage/microdollar_usage_hourly.sql",
      "layer": "reporting",
      "description": "Hourly aggregation of API usage by user, feature, model, and provider. Base aggregation layer reading directly from enriched source tables."
    },
    {
      "name": "airbyte_stg_stripe__balance_transactions",
      "path": "models/staging/airbyte/airbyte_stg_stripe__balance_transactions.sql",
      "layer": "staging",
      "description": "Airbyte typed staging of Stripe balance_transactions with USD conversion."
    },
    {
      "name": "airbyte_stg_stripe__charges",
      "path": "models/staging/airbyte/airbyte_stg_stripe__charges.sql",
      "layer": "staging",
      "description": "Airbyte typed staging passthrough of Stripe charges."
    },
    {
      "name": "airbyte_stg_stripe__events",
      "path": "models/staging/airbyte/airbyte_stg_stripe__events.sql",
      "layer": "staging",
      "description": "Airbyte typed staging passthrough of Stripe events."
    },
    {
      "name": "airbyte_stg_stripe__invoice_line_items",
      "path": "models/staging/airbyte/airbyte_stg_stripe__invoice_line_items.sql",
      "layer": "staging",
      "description": "Airbyte typed staging passthrough of Stripe invoice line items."
    },
    {
      "name": "airbyte_stg_stripe__invoices",
      "path": "models/staging/airbyte/airbyte_stg_stripe__invoices.sql",
      "layer": "staging",
      "description": "Airbyte typed staging passthrough of Stripe invoices."
    },
    {
      "name": "airbyte_stg_stripe__products",
      "path": "models/staging/airbyte/airbyte_stg_stripe__products.sql",
      "layer": "staging",
      "description": "Airbyte typed staging passthrough of Stripe products."
    },
    {
      "name": "airbyte_stg_stripe__subscriptions",
      "path": "models/staging/airbyte/airbyte_stg_stripe__subscriptions.sql",
      "layer": "staging",
      "description": "Airbyte typed staging passthrough of Stripe subscriptions."
    },
    {
      "name": "stg_backend__app_builder_project_sessions",
      "path": "models/staging/backend/stg_backend__app_builder_project_sessions.sql",
      "layer": "staging",
      "description": "Passthrough of backend app_builder_project_sessions."
    },
    {
      "name": "stg_backend__app_builder_projects",
      "path": "models/staging/backend/stg_backend__app_builder_projects.sql",
      "layer": "staging",
      "description": "Passthrough of backend app_builder_projects."
    },
    {
      "name": "stg_backend__auto_fix_tickets",
      "path": "models/staging/backend/stg_backend__auto_fix_tickets.sql",
      "layer": "staging",
      "description": "Staging of backend auto_fix_tickets."
    },
    {
      "name": "stg_backend__auto_triage_tickets",
      "path": "models/staging/backend/stg_backend__auto_triage_tickets.sql",
      "layer": "staging",
      "description": "Staging of backend auto_triage_tickets."
    },
    {
      "name": "stg_backend__cli_sessions",
      "path": "models/staging/backend/stg_backend__cli_sessions.sql",
      "layer": "staging",
      "description": "Passthrough of backend cli_sessions (v1 legacy)."
    },
    {
      "name": "stg_backend__cli_sessions_v2",
      "path": "models/staging/backend/stg_backend__cli_sessions_v2.sql",
      "layer": "staging",
      "description": "Passthrough of backend cli_sessions_v2."
    },
    {
      "name": "stg_backend__cloud_agent_code_reviews",
      "path": "models/staging/backend/stg_backend__cloud_agent_code_reviews.sql",
      "layer": "staging",
      "description": "Passthrough of backend cloud_agent_code_reviews with null created_at filter."
    },
    {
      "name": "stg_backend__code_indexing_manifest",
      "path": "models/staging/backend/stg_backend__code_indexing_manifest.sql",
      "layer": "staging",
      "description": "Passthrough of backend code_indexing_manifest."
    },
    {
      "name": "stg_backend__code_indexing_search",
      "path": "models/staging/backend/stg_backend__code_indexing_search.sql",
      "layer": "staging",
      "description": "Passthrough of backend code_indexing_search."
    },
    {
      "name": "stg_backend__credit_transactions",
      "path": "models/staging/backend/stg_backend__credit_transactions.sql",
      "layer": "staging",
      "description": "Backend credit_transactions passthrough with amount_usd derived from amount_microdollars."
    },
    {
      "name": "stg_backend__deployment_builds",
      "path": "models/staging/backend/stg_backend__deployment_builds.sql",
      "layer": "staging",
      "description": "Passthrough of backend deployment_builds."
    },
    {
      "name": "stg_backend__deployments",
      "path": "models/staging/backend/stg_backend__deployments.sql",
      "layer": "staging",
      "description": "Passthrough of backend deployments."
    },
    {
      "name": "stg_backend__enrichment_data",
      "path": "models/staging/backend/stg_backend__enrichment_data.sql",
      "layer": "staging",
      "description": "Passthrough of backend enrichment_data."
    },
    {
      "name": "stg_backend__feature",
      "path": "models/staging/backend/stg_backend__feature.sql",
      "layer": "staging",
      "description": "Feature lookup table (feature_id \u2192 feature name) from backend."
    },
    {
      "name": "stg_backend__http_ip",
      "path": "models/staging/backend/stg_backend__http_ip.sql",
      "layer": "staging",
      "description": "Passthrough of backend http_ip."
    },
    {
      "name": "stg_backend__http_user_agent",
      "path": "models/staging/backend/stg_backend__http_user_agent.sql",
      "layer": "staging",
      "description": "Passthrough of backend http_user_agent."
    },
    {
      "name": "stg_backend__ja4_digest",
      "path": "models/staging/backend/stg_backend__ja4_digest.sql",
      "layer": "staging",
      "description": "Passthrough of backend ja4_digest."
    },
    {
      "name": "stg_backend__kilo_pass_subscriptions",
      "path": "models/staging/backend/stg_backend__kilo_pass_subscriptions.sql",
      "layer": "staging",
      "description": "Staging of Kilo Pass subscription records with column renaming."
    },
    {
      "name": "stg_backend__kiloclaw_instances",
      "path": "models/staging/backend/stg_backend__kiloclaw_instances.sql",
      "layer": "staging",
      "description": "Staging of KiloClaw sandbox instances."
    },
    {
      "name": "stg_backend__kiloclaw_subscription_change_log",
      "path": "models/staging/backend/stg_backend__kiloclaw_subscription_change_log.sql",
      "layer": "staging",
      "description": "Append-only audit log of KiloClaw subscription state transitions."
    },
    {
      "name": "stg_backend__kiloclaw_subscriptions",
      "path": "models/staging/backend/stg_backend__kiloclaw_subscriptions.sql",
      "layer": "staging",
      "description": "KiloClaw subscriptions with derived subscription_source (stripe/credits/trial)."
    },
    {
      "name": "stg_backend__kilocode_users",
      "path": "models/staging/backend/stg_backend__kilocode_users.sql",
      "layer": "staging",
      "description": "Normalized user records with cleaned customer_source attribution from free-text input using regex-based classification."
    },
    {
      "name": "stg_backend__microdollar_usage",
      "path": "models/staging/backend/stg_backend__microdollar_usage.sql",
      "layer": "staging",
      "description": "Per-request microdollar usage with cost_usd and resolved inference_provider."
    },
    {
      "name": "stg_backend__microdollar_usage_metadata",
      "path": "models/staging/backend/stg_backend__microdollar_usage_metadata.sql",
      "layer": "staging",
      "description": "Per-request metadata (machine_id, feature_id, session_id, BYOK flags, latency)."
    },
    {
      "name": "stg_backend__organization_audit_logs",
      "path": "models/staging/backend/stg_backend__organization_audit_logs.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_audit_logs."
    },
    {
      "name": "stg_backend__organization_invitations",
      "path": "models/staging/backend/stg_backend__organization_invitations.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_invitations."
    },
    {
      "name": "stg_backend__organization_memberships",
      "path": "models/staging/backend/stg_backend__organization_memberships.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_memberships."
    },
    {
      "name": "stg_backend__organization_modes",
      "path": "models/staging/backend/stg_backend__organization_modes.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_modes."
    },
    {
      "name": "stg_backend__organization_seats_purchases",
      "path": "models/staging/backend/stg_backend__organization_seats_purchases.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_seats_purchases."
    },
    {
      "name": "stg_backend__organization_user_limits",
      "path": "models/staging/backend/stg_backend__organization_user_limits.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_user_limits."
    },
    {
      "name": "stg_backend__organization_user_usage",
      "path": "models/staging/backend/stg_backend__organization_user_usage.sql",
      "layer": "staging",
      "description": "Passthrough of backend organization_user_usage."
    },
    {
      "name": "stg_backend__organizations",
      "path": "models/staging/backend/stg_backend__organizations.sql",
      "layer": "staging",
      "description": "Passthrough of backend organizations."
    },
    {
      "name": "stg_backend__payment_methods",
      "path": "models/staging/backend/stg_backend__payment_methods.sql",
      "layer": "staging",
      "description": "Passthrough of backend payment_methods."
    },
    {
      "name": "stg_backend__referral_code_usages",
      "path": "models/staging/backend/stg_backend__referral_code_usages.sql",
      "layer": "staging",
      "description": "Passthrough of backend referral_code_usages."
    },
    {
      "name": "stg_backend__referral_codes",
      "path": "models/staging/backend/stg_backend__referral_codes.sql",
      "layer": "staging",
      "description": "Passthrough of backend referral_codes."
    },
    {
      "name": "stg_backend__security_findings",
      "path": "models/staging/backend/stg_backend__security_findings.sql",
      "layer": "staging",
      "description": "Staging of backend security_findings."
    },
    {
      "name": "stg_backend__slack_bot_requests",
      "path": "models/staging/backend/stg_backend__slack_bot_requests.sql",
      "layer": "staging",
      "description": "Passthrough of backend slack_bot_requests."
    },
    {
      "name": "stg_backend__source_embeddings",
      "path": "models/staging/backend/stg_backend__source_embeddings.sql",
      "layer": "staging",
      "description": "Passthrough of backend source_embeddings."
    },
    {
      "name": "stg_backend__stytch_fingerprints",
      "path": "models/staging/backend/stg_backend__stytch_fingerprints.sql",
      "layer": "staging",
      "description": "Passthrough of backend stytch_fingerprints."
    },
    {
      "name": "stg_backend__system_prompt_prefix",
      "path": "models/staging/backend/stg_backend__system_prompt_prefix.sql",
      "layer": "staging",
      "description": "Passthrough of backend system_prompt_prefix."
    },
    {
      "name": "stg_backend__user_auth_provider",
      "path": "models/staging/backend/stg_backend__user_auth_provider.sql",
      "layer": "staging",
      "description": "Passthrough of backend user_auth_provider."
    },
    {
      "name": "stg_backend__user_feedback",
      "path": "models/staging/backend/stg_backend__user_feedback.sql",
      "layer": "staging",
      "description": "User feedback submissions with parsed JSON context for cancellation reasons."
    },
    {
      "name": "stg_backend__vercel_ip_city",
      "path": "models/staging/backend/stg_backend__vercel_ip_city.sql",
      "layer": "staging",
      "description": "Passthrough of backend vercel_ip_city."
    },
    {
      "name": "stg_backend__vercel_ip_country",
      "path": "models/staging/backend/stg_backend__vercel_ip_country.sql",
      "layer": "staging",
      "description": "Passthrough of backend vercel_ip_country."
    },
    {
      "name": "stg_bing_ads__campaign_performance_daily",
      "path": "models/staging/bing_ads/stg_bing_ads__campaign_performance_daily.sql",
      "layer": "staging",
      "description": "Daily campaign-level spend from Microsoft Ads (Bing) aggregated to campaign grain."
    },
    {
      "name": "stg_cloudflare__api_metrics",
      "path": "models/staging/cloudflare/stg_cloudflare__api_metrics.sql",
      "layer": "staging",
      "description": "Per-request metrics from Cloudflare AI Gateway with latency, TTFB, and error data."
    },
    {
      "name": "stg_facebook_ads__insights",
      "path": "models/staging/facebook_ads/stg_facebook_ads__insights.sql",
      "layer": "staging",
      "description": "Daily ad set-level performance from Facebook/Meta Ads."
    },
    {
      "name": "stg_facebook_ads__insights_country",
      "path": "models/staging/facebook_ads/stg_facebook_ads__insights_country.sql",
      "layer": "staging",
      "description": "Daily ad set-level performance from Facebook/Meta Ads broken down by country."
    },
    {
      "name": "stg_google_ads__ad_group_ads",
      "path": "models/staging/google_ads/stg_google_ads__ad_group_ads.sql",
      "layer": "staging",
      "description": "Ad-level final URLs aggregated to campaign level for product classification."
    },
    {
      "name": "stg_google_ads__campaign_performance",
      "path": "models/staging/google_ads/stg_google_ads__campaign_performance.sql",
      "layer": "staging",
      "description": "Daily campaign-level spend from Google Ads with cost_micros to USD conversion."
    },
    {
      "name": "stg_google_ads__geographic_view",
      "path": "models/staging/google_ads/stg_google_ads__geographic_view.sql",
      "layer": "staging",
      "description": "Google Ads geographic view dimension reference (no spend metrics in current connector config)."
    },
    {
      "name": "stg_kilocode__user_identity",
      "path": "models/staging/kilocode/stg_kilocode__user_identity.sql",
      "layer": "staging",
      "description": "Authoritative internal user identity view built on stg_backend__kilocode_users with normalized email."
    },
    {
      "name": "stg_linkedin_ads__campaign_analytics",
      "path": "models/staging/linkedin_ads/stg_linkedin_ads__campaign_analytics.sql",
      "layer": "staging",
      "description": "Daily campaign-level spend from LinkedIn Ads with cost already in USD."
    },
    {
      "name": "stg_linkedin_ads__campaigns",
      "path": "models/staging/linkedin_ads/stg_linkedin_ads__campaigns.sql",
      "layer": "staging",
      "description": "LinkedIn Ads campaign metadata (latest version per campaign_id)."
    },
    {
      "name": "posthog_events",
      "path": "models/staging/posthog/posthog_events.sql",
      "layer": "staging",
      "description": "Passthrough of raw PostHog events."
    },
    {
      "name": "posthog_persons",
      "path": "models/staging/posthog/posthog_persons.sql",
      "layer": "staging",
      "description": "Passthrough of raw PostHog persons."
    },
    {
      "name": "posthog_sessions",
      "path": "models/staging/posthog/posthog_sessions.sql",
      "layer": "staging",
      "description": "Passthrough of raw PostHog sessions."
    },
    {
      "name": "stg_posthog__events_filtered",
      "path": "models/staging/posthog/stg_posthog__events_filtered.sql",
      "layer": "staging",
      "description": "Filtered PostHog events containing only events used downstream. Reduces scan volume by ~48%. Deduplicates on UUID and adds bot traffic detection."
    },
    {
      "name": "stg_posthog__person_identity",
      "path": "models/staging/posthog/stg_posthog__person_identity.sql",
      "layer": "staging",
      "description": "PostHog persons deduplicated by person_version with all initial_* (first-touch) and current (last-touch) attribution properties extracted and cleaned."
    },
    {
      "name": "stg_reddit_ads__ad_report",
      "path": "models/staging/reddit_ads/stg_reddit_ads__ad_report.sql",
      "layer": "staging",
      "description": "Daily ad-level spend from Reddit Ads with microdollars to USD conversion."
    },
    {
      "name": "stg_reddit_ads__ads",
      "path": "models/staging/reddit_ads/stg_reddit_ads__ads.sql",
      "layer": "staging",
      "description": "Reddit Ads ad-level metadata with click_url for KiloClaw classification."
    },
    {
      "name": "stg_reddit_ads__campaign_report",
      "path": "models/staging/reddit_ads/stg_reddit_ads__campaign_report.sql",
      "layer": "staging",
      "description": "Daily campaign-level spend from Reddit Ads with region for geo breakdown."
    },
    {
      "name": "stg_reddit_ads__campaigns",
      "path": "models/staging/reddit_ads/stg_reddit_ads__campaigns.sql",
      "layer": "staging",
      "description": "Reddit Ads campaign metadata for name lookup."
    },
    {
      "name": "stg_twitter_ads__campaign_report",
      "path": "models/staging/twitter_ads/stg_twitter_ads__campaign_report.sql",
      "layer": "staging",
      "description": "Daily campaign-level spend from X (Twitter) Ads with micros to USD conversion."
    },
    {
      "name": "stg_twitter_ads__campaigns",
      "path": "models/staging/twitter_ads/stg_twitter_ads__campaigns.sql",
      "layer": "staging",
      "description": "X (Twitter) Ads campaign metadata (latest version per campaign_id from SCD table)."
    }
  ]
}