npm run check:fast

# CI compares the committed advertised-schema summary on every code change, and
# a stale summary was the most common PR CI failure. Check it here only when
# the branch changes production source, so other pushes skip the build.
base=$(git merge-base HEAD origin/main 2>/dev/null || true)
if [ -n "$base" ] &&
  git diff --quiet "$base" HEAD -- src ':(exclude)**/*.test.ts'; then
  exit 0
fi
npm run verify:advertised-schemas
# The check reads the working tree; CI reads the pushed commit.
summaries=scripts/verify/advertised-schemas/tools
if [ -n "$(git status --porcelain -- "$summaries")" ]; then
  echo "Commit the updated files in $summaries before pushing." >&2
  exit 1
fi
