# One command per step. `make help` lists them.
T ?= Customer SSN 123-45-6789 paid with 4111 1111 1111 1111, call 555-123-4567.

.PHONY: help setup test demo scan serve mock bench eval verify audit reset

help: ## Show this help
	@grep -E '^[a-z-]+:.*## ' $(MAKEFILE_LIST) | awk -F':.*## ' '{printf "  \033[36m%-8s\033[0m %s\n", $$1, $$2}'

setup: ## Install Python 3.12 + dependencies (needs uv)
	uv sync

test: ## Run the test suite (~3 s, no model needed)
	uv run pytest

demo: ## Mask, three roles, invented PII, audit log — all in-process
	uv run pii-proxy demo

scan: ## What gets detected and masked: make scan T="..."
	uv run pii-proxy scan "$(T)"

serve: ## Run the proxy on :8086 (upstream: UPSTREAM_OPENAI_URL, default local Ollama)
	uv run pii-proxy serve

mock: ## Run the mock LLM on :8087 (point the proxy at it with UPSTREAM_OPENAI_URL=http://127.0.0.1:8087/v1)
	uv run pii-proxy mock

bench: ## Detection quality, speed, streaming, token cost, audit
	uv run python scripts/bench.py

eval: ## Reasoning with a real model: raw vs redacted vs tokens (needs `ollama serve` + qwen3:4b, ~30 min)
	uv run python scripts/eval_reasoning.py

verify: ## Verify the audit chain and anchors
	uv run pii-proxy verify-audit

audit: ## Show the latest audit entries
	uv run pii-proxy audit

reset: ## Delete the vault, audit log and anchors (keeps nothing!)
	rm -rf data
