.PHONY: install test lint format typecheck coverage build clean docs docs-build \
       docker-up docker-down docker-build benchmark publish

install:
	pip install -e ".[dev,all]"

test:
	python -m pytest tests/ -v

lint:
	ruff check src/ tests/

format:
	ruff format src/ tests/

typecheck:
	mypy src/aegis/

coverage:
	python -m pytest tests/ --cov=aegis --cov-report=term-missing --cov-fail-under=80

build:
	python -m build

docs:
	mkdocs serve

docs-build:
	mkdocs build --strict

docker-build:
	docker compose build

docker-up:
	docker compose up -d

docker-down:
	docker compose down

benchmark:
	python -m aegis eval benchmark --suite legal --output benchmarks/results/legal-latest.json
	python -m aegis eval benchmark --suite finance --output benchmarks/results/finance-latest.json
	python -m aegis eval benchmark --suite memory --output benchmarks/results/memory-latest.json

publish: build
	twine upload dist/*

clean:
	rm -rf dist/ build/ *.egg-info src/*.egg-info .coverage htmlcov/ .mypy_cache/ .pytest_cache/ .ruff_cache/ site/
	find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
