.PHONY: help ops:prepare ops:validate ops:build ops:data-collect ops:render ops:release ops:package full-gate

help:
	@echo "QuantEngine v0.1 — Operations CLI"
	@echo ""
	@echo "Core operations:"
	@echo "  make ops:render           — Render operational report from packet"
	@echo "  make ops:validate         — Validate release pipeline"
	@echo "  make ops:release          — Full release DAG"
	@echo "  make ops:package          — Package for deployment"
	@echo "  make full-gate            — Strict validation (all gates must PASS)"
	@echo ""
	@echo "Data operations:"
	@echo "  make ops:prepare          — Convert XLSX → JSON"
	@echo "  make ops:data-collect     — KIS data collection"
	@echo ""
	@echo "Development:"
	@echo "  make dotnet:build         — Build .NET projects"
	@echo "  make dotnet:run           — Run Web API (port 8788)"
	@echo "  make dotnet:watch         — Hot-reload API server"

ops:prepare:
	python tools/convert_xlsx_to_json.py

ops:validate:
	python tools/run_release_dag_v3.py --mode release

ops:build:
	python tools/build_bundle.py

ops:data-collect:
	python tools/run_kis_data_collection_v1.py --input-json GatherTradingData.json --sqlite-db src/quant_engine/kis_data_collection.db --output-json Temp/kis_data_collection_v1.json --kis-account real

ops:render:
	dotnet run --project src/dotnet/QuantEngine.Tools/QuantEngine.Tools.csproj -- report --packet=Temp/final_decision_packet_active.json --out=Temp/operational_report.json

ops:release:
	python tools/run_release_dag_v3.py --mode full

ops:package:
	python tools/refresh_trading_calendar.py && python tools/prepare_upload_zip.py --validation-mode release

full-gate:
	python tools/run_release_dag_v3.py --mode release --strict

dotnet:build:
	cd src/dotnet && dotnet build

dotnet:run:
	cd src/dotnet && dotnet run --project src/DataFeed.Api/QuantEngine.Web/QuantEngine.Web.csproj

dotnet:watch:
	cd src/dotnet && dotnet watch run --project src/QuantEngine.Web/QuantEngine.Web.csproj

dotnet:test:
	cd src/dotnet && dotnet test
