# Makefile for Chapter 19 labs
# Usage: make <target>

.PHONY: build up down ingest garak art rag agent clean help

help:
	@echo "Chapter 19 lab targets:"
	@echo "  make build   - build all three Docker images"
	@echo "  make up      - start all services"
	@echo "  make down    - stop and remove containers and volumes"
	@echo "  make ingest  - ingest synthetic corpus into ChromaDB (Labs 4+5)"
	@echo "  make garak   - open a shell in the garak container (Lab 1)"
	@echo "  make art     - open Jupyter URL for ART lab (Lab 3)"
	@echo "  make rag     - open a shell in the rag-harness container (Labs 4+5)"
	@echo "  make clean   - remove all built images for this chapter"

build:
	docker compose build

up:
	docker compose up -d

down:
	docker compose down -v

ingest: up
	docker exec ch19-rag-harness python3 /lab/scripts/ingest_corpus.py

garak: up
	docker exec -it ch19-garak /bin/bash

art: up
	@echo "Open: http://localhost:8888  (token: lab19art)"

rag: up
	docker exec -it ch19-rag-harness /bin/bash

agent: rag

clean:
	docker rmi ch19-garak:local ch19-art-jupyter:local ch19-rag-harness:local 2>/dev/null || true
