.PHONY: check lint test migrate-check leaks sync

sync:            ## install locked deps (creates .venv)
	uv sync --frozen

lint:            ## ruff
	uv run ruff check .

test:            ## pytest
	uv run pytest

migrate-check:   ## smoke the alembic chain on a scratch sqlite db
	rm -f /tmp/cayce-ops-migrate.db
	CAYCE_OPS_DATABASE_URL=sqlite:////tmp/cayce-ops-migrate.db uv run alembic upgrade head
	@rm -f /tmp/cayce-ops-migrate.db

leaks:           ## gitleaks over the full history
	gitleaks detect --source . --log-opts="--all" -v

check: lint test migrate-check leaks   ## the pre-push gate — must be green before every push
	@echo "check: OK"
