Review this dbt incremental model for correctness under real production mutations, not only the happy path.
Warehouse and dbt version: [details]
Model grain and unique key: [definition]
Source mutation behavior: [append, updates, deletes, late arrivals]
Maximum lateness and lookback: [duration]
Model SQL and config:
[Paste model]
schema.yml and relevant macros:
[Paste files]
Current symptoms: [duplicates, drift, slow runs, full-refresh mismatch]
Deliver:
1. Explicit statement of the model's intended grain and invariants
2. Analysis of is_incremental(), unique_key, incremental_strategy, and predicates
3. Counterexamples for missed updates, duplicate keys, deletes, and late-arriving facts
4. Null, timestamp, time-zone, and nondeterministic-ordering risks
5. Revised dialect-correct dbt SQL and configuration
6. Unit tests with fixtures for each mutation class
7. Data tests for uniqueness, relationships, accepted values, and freshness
8. Equivalence test comparing incremental output with a clean full refresh
9. Safe backfill and deployment plan
10. Performance implications of the chosen lookback and merge strategy
Do not use MAX(updated_at) as a watermark without analyzing ties, clock skew, failed batches, and source corrections.