.PHONY: install lint test type fmt ci up down verify-demo docker-build docker-run docker-health docker-scan

install:
	pip install -e '.[dev]'

fmt:
	ruff format src tests cli

lint:
	ruff check src tests cli

type:
	mypy src

test:
	pytest -q

ci: lint type test

up:
	docker compose up -d

down:
	docker compose down

verify-demo:
	python -m gtv.cli.verify tests/fixtures/envelope_demo.json

docker-build:
	docker build -t gtv:local .

docker-run:
	docker run --rm -p 8080:8080 gtv:local

docker-health:
	@curl -sf localhost:8080/health && echo " OK" || echo " FAIL"

docker-scan:
	@command -v grype >/dev/null 2>&1 || (echo "grype not installed, skipping scan"; exit 0); \
	grype gtv:local --fail-on high
