#!/usr/bin/env bash
set -euo pipefail

repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "$repo_root"

required_model_inputs=(
  "data/text_data.csv"
  "data/expert.csv"
  "data/lr_data.csv"
  "data/union_mapping.csv"
  "data/party_families.csv"
)

missing=0
for input in "${required_model_inputs[@]}"; do
  if [ ! -s "$input" ]; then
    echo "Missing model-ready input: $input" >&2
    missing=1
  fi
done

if [ "$missing" -ne 0 ]; then
  echo "Regenerate model inputs with data-setup/run_data_setup.sh, or restore the included data/ files." >&2
  exit 1
fi

echo "Model-ready data inputs are present."
