Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a15374-f59f-7a31-86d2-d23b5d2ed181
57 lines
2.4 KiB
Makefile
57 lines
2.4 KiB
Makefile
# ops-warden development and install targets
|
|
ROOT := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
UNIT_PYTHON ?= $(ROOT)/.venv/bin/python
|
|
PHASE_MEMORY_REPO ?= $(abspath $(ROOT)/../phase-memory)
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
.PHONY: help sync install install-warden install-memory install-all check-memory verify-memory test lint
|
|
|
|
help:
|
|
@echo "ops-warden make targets"
|
|
@echo ""
|
|
@echo " make sync # uv sync (dev dependencies)"
|
|
@echo " make install # install warden CLI (SSH only, no phase-memory)"
|
|
@echo " make install-memory # reinstall warden with editable phase-memory"
|
|
@echo " make install-all # sync + warden + phase-memory (recommended)"
|
|
@echo " make check-memory # fail unless phase-memory is importable by warden"
|
|
@echo " make verify-memory # check-memory + warden memory status"
|
|
@echo " make test # unit tests"
|
|
@echo " make lint # ruff check"
|
|
@echo ""
|
|
@echo "Override phase-memory path: make install-all PHASE_MEMORY_REPO=/path/to/phase-memory"
|
|
|
|
sync:
|
|
uv sync
|
|
|
|
install-warden:
|
|
uv tool install . --force --reinstall-package ops-warden
|
|
|
|
install-memory:
|
|
@test -d "$(PHASE_MEMORY_REPO)" || (echo "ERROR: phase-memory not found at $(PHASE_MEMORY_REPO). Clone it or set PHASE_MEMORY_REPO."; exit 1)
|
|
@test -f "$(PHASE_MEMORY_REPO)/pyproject.toml" || (echo "ERROR: $(PHASE_MEMORY_REPO) is not a phase-memory checkout."; exit 1)
|
|
uv tool install . --with-editable "$(PHASE_MEMORY_REPO)" --force --reinstall-package ops-warden
|
|
|
|
install: install-warden
|
|
|
|
install-all: sync install-memory
|
|
|
|
check-memory:
|
|
@warden memory status --json >/dev/null 2>&1 || (echo "ERROR: phase-memory is not available to warden. Run: make install-memory"; exit 1)
|
|
@echo "phase-memory: ok (warden memory status succeeded)"
|
|
|
|
verify-memory: check-memory
|
|
@warden memory status
|
|
|
|
test:
|
|
"$(UNIT_PYTHON)" -I scripts/run_unit_tests.py --phase-memory-root "$(PHASE_MEMORY_REPO)" $(TEST_ARGS)
|
|
|
|
lint:
|
|
uv run ruff check .
|
|
|
|
# CUST-WP-0079: explicit staged work-record generation, using the owner renderer.
|
|
.PHONY: generated-work-records generated-work-records-check
|
|
generated-work-records: ## Generate and stage WORK-RECORDS from staged sources
|
|
$(MAKE) --no-print-directory -f .generated-work-records.mk generated-work-records
|
|
generated-work-records-check: ## Verify staged index without writes or publication
|
|
$(MAKE) --no-print-directory -f .generated-work-records.mk generated-work-records-check
|