{
 "batches": {
  "clean_batches": 216,
  "lands_hours_after_window_end": 1,
  "windows": [
   [
    0,
    6
   ],
   [
    6,
    12
   ],
   [
    12,
    18
   ],
   [
    18,
    24
   ]
  ]
 },
 "caught_rule": "a check at a layer flags a planted date on any morning from 2023-02-02 06:00 to the clock, and the clean workload's same check at the same layer did not flag that date on any of those mornings",
 "checks": {
  "across_layers": [
   "landing_reconciliation",
   "daily_reconciliation"
  ],
  "anomaly_floor": 0.02,
  "anomaly_mad_scale": 8.8956,
  "baseline_days": 14,
  "cannot_run_on_modeled": [
   "source_unique",
   "content_duplicates",
   "unit_invariant"
  ],
  "day_volume_ratio": 0.6,
  "fare_null_limit": 0.05,
  "freshness_error_hours": 12,
  "per_layer": [
   "freshness",
   "fare_completeness",
   "day_volume",
   "source_unique",
   "content_duplicates",
   "unit_invariant",
   "fare_null_anomaly_v2"
  ],
  "scope": "what the layer received since the previous morning",
  "time": "06:00 every morning",
  "unit_tolerance": 1e-06
 },
 "clock": "2023-02-24T06:00:00",
 "data": {
  "days": 54,
  "first_day": "2023-01-01",
  "last_day": "2023-02-23",
  "normalize": "quality/warehouse_data.py normalize_sql",
  "rows": 1402214,
  "source_notes": "warehouse_cost/data-files.json"
 },
 "design": "DESIGN-layers.md",
 "dev_runs": "synthetic tables in tests and the clean feed of 2023-01-01 to 2023-01-05 only; no February, no fault",
 "fault_workloads": {
  "backfill_unit_change": {
   "days": [
    "2023-02-02",
    "2023-02-08"
   ],
   "deliver_at": "2023-02-24T04:00:00",
   "miles_factor": 1.609344
  },
  "late_batch": {
   "after": "day-2023-02-18-w3",
   "day": "2023-02-17",
   "deliver_at": "2023-02-19T01:00:00",
   "window": 3
  },
  "late_batch_null_spike": {
   "after": "day-2023-02-18-w3",
   "day": "2023-02-17",
   "deliver_at": "2023-02-19T01:00:00",
   "fare_blank_share": 0.3,
   "window": 3
  },
  "missing_day": {
   "skip_day": "2023-02-23"
  },
  "null_spike": {
   "day": "2023-02-22",
   "fare_blank_share": 0.3
  },
  "replayed_batch": {
   "again_after_minutes": 20,
   "day": "2023-02-22",
   "window": 1
  },
  "unit_change": {
   "day": "2023-02-22",
   "miles_factor": 1.609344
  }
 },
 "freshness": {
  "measures": [
   "batches_behind",
   "windows_behind_complete_through",
   "hole"
  ],
  "when": "after every batch and every build",
  "window_hours": 6
 },
 "headline": "per layer, faults caught of 7 (raw, cleaned, modeled) and faults no layer caught, exact counts",
 "layers": {
  "cleaned": {
   "partition": "trip_date",
   "write": "merge on trip_id per batch, limited to touched trip_date partitions; latest load wins (loaded_at, batch_seq)"
  },
  "modeled": {
   "build_time": "05:00",
   "columns": [
    "trip_date",
    "trips",
    "fares_present",
    "fare_sum",
    "missing_fare_share",
    "miles_sum",
    "seconds_sum",
    "built_at",
    "built_through_seq"
   ],
   "write": "daily build at 05:00: replace the rows of trip dates with cleaned rows written since the last build"
  },
  "raw": {
   "extra": [
    "loaded_at",
    "batch_id",
    "batch_seq"
   ],
   "partition": "load_date",
   "write": "append one commit per batch"
  }
 },
 "money": "none",
 "no_paid_calls": true,
 "planted_dates": {
  "backfill_unit_change": [
   "2023-02-02",
   "2023-02-03",
   "2023-02-04",
   "2023-02-05",
   "2023-02-06",
   "2023-02-07",
   "2023-02-08"
  ],
  "late_batch": [
   "2023-02-17"
  ],
  "late_batch_null_spike": [
   "2023-02-17"
  ],
  "missing_day": [
   "2023-02-23"
  ],
  "null_spike": [
   "2023-02-22"
  ],
  "replayed_batch": [
   "2023-02-22"
  ],
  "unit_change": [
   "2023-02-22"
  ]
 },
 "predictions": {
  "1": {
   "cleaned": [
    5,
    5
   ],
   "modeled": [
    2,
    3
   ],
   "raw": [
    6,
    6
   ]
  },
  "2": "late_batch caught at no layer",
  "3": "replayed_batch caught only at raw, by source_unique; modeled table equals clean",
  "4": "unit_change and backfill_unit_change caught at raw and cleaned by unit_invariant, missed at modeled; both change modeled miles",
  "5": {
   "across_layer_faults_caught": [
    0,
    0
   ]
  },
  "6": {
   "clean_modeled_batches_behind": [
    0,
    4
   ],
   "clean_raw_cleaned_batches_behind": [
    0,
    0
   ],
   "late_batch_modeled": "publishes 2023-02-17 short at the 2023-02-18 build, restates it at the 2023-02-19 build",
   "late_batch_raw_cleaned_batches_behind": [
    0,
    0
   ],
   "late_batch_raw_cleaned_worst_windows_behind": [
    4,
    5
   ]
  },
  "7": {
   "clean_content_duplicates_feb_dates_raw": [
    5,
    15
   ],
   "modeled_clean_flags": [
    0,
    0
   ],
   "raw_equals_cleaned": true
  }
 },
 "repeat": "clean February replayed once from the same state; rows, flags, freshness and modeled table must match",
 "snapshot_after": "2023-02-01T06:00:00",
 "table_format": "Delta (deltalake package), read by DuckDB through its delta extension (delta_scan)",
 "tolerance": {
  "counts": 0,
  "sums": 0.01
 }
}
