# Pushing is gated harder than committing: full coverage, and mutation when the domain core changed.
pnpm --filter @mintel/web test:coverage || exit 1

base="$(git merge-base HEAD origin/main 2>/dev/null || git rev-list --max-parents=0 HEAD | tail -n 1)"
if git diff --name-only "$base"...HEAD | grep -q '^apps/web/src/domain/'; then
  echo "src/domain changed: running mutation gate (about 2 minutes)"
  pnpm --filter @mintel/web test:mutation || exit 1
fi
