.PHONY: help dev lint format typecheck test all publish clean

# Default goal
.DEFAULT_GOAL := help

help: ## Show this help message
	@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf "  \033[36m%-15s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

dev: ## Install runtime + optional dependencies
	uv sync --all-extras

lint: ## Run ruff check + format check
	uv run ruff check .
	uv run ruff format --check .

format: ## Auto-fix lint issues and format code
	uv run ruff check --fix .
	uv run ruff format .

typecheck: ## Run mypy strict type checking
	uv run mypy --strict src

test: ## Run test suite (quiet)
	uv run pytest -q

all: lint typecheck test ## Run lint + typecheck + tests

publish: ## Build and publish to PyPI
	uv build
	uv publish

clean: ## Remove build/test artifacts
	rm -rf dist/ build/ *.egg-info src/harness_memory/_version.py
