# ROOST Phase 0 — reproducible pipeline entrypoints.
# Every target is deterministic from the committed config + seed. The LLM is OFF.

UV ?= uv
RUN = $(UV) run roost

.PHONY: help setup init info ingest label features train eval comment test lint clean reset ablation-paths

help:
	@echo "ROOST Phase 0 targets:"
	@echo "  make setup     - create venv (py3.12) + install deps via uv"
	@echo "  make init      - create + migrate the Pellet ledger          (M1)"
	@echo "  make info      - show ledger status"
	@echo "  make ingest    - mine OSS repos into 'change'                (M2)"
	@echo "  make label     - SZZ fix-inducing labels into 'outcome'      (M3)"
	@echo "  make features  - build Kamei + blast-radius feature matrix   (M4)"
	@echo "  make train     - train calibrated LightGBM model             (M5)"
	@echo "  make eval      - honest eval + PASS/FAIL vs pre-registered bar (M6)"
	@echo "  make test      - run the test suite (LLM off)"
	@echo "  make clean     - remove generated data artifacts"

setup:
	$(UV) sync --extra dev

init:
	$(RUN) init

info:
	$(RUN) info

ingest:
	$(RUN) ingest

label:
	$(RUN) label

features:
	$(RUN) features

train:
	$(RUN) train

eval:
	$(RUN) eval

# Stufe 1 ablation: slim (v0.1 baseline) vs slim_paths (+ Tier-0 path signals).
# Runs the multi-seed slim-vs-slim_paths eval on the native feature matrix vs the
# pre-registered DECISIONS criterion. Needs `make features` first (the matrix carries
# the path columns). `roost eval --feature-set slim_paths` is the single-seed equivalent.
# (scripts/build_slimpaths_from_frozen.py is the legacy frozen-parquet path, kept for the
# window when the ledger was degraded; no longer needed now that the ledger is repaired.)
ablation-paths:
	$(UV) run python scripts/ablation_slimpaths.py

comment:
	$(RUN) comment

test:
	$(UV) run pytest

lint:
	$(UV) run ruff check src tests

clean:
	rm -rf data/repos data/parquet data/reports data/models data/ledger.duckdb

reset: clean
	$(RUN) init --reset
