# Autonomous BACKLOG.md implementer.
do: lifecycle
lifecycle: sync-silent
  @uv run lifecycle

human: lifecycle-human
lifecycle-human: sync-silent
  uv run lifecycle --interactive

start: sync-silent
  @nohup uv run scheduler >> scheduler.log 2>&1 &

stop:
  @if [ -f scheduler.pid ]; then \
    kill "$(cat scheduler.pid)" 2>/dev/null || true; \
    rm -f scheduler.pid; \
  else \
    echo "scheduler.pid not found — nothing to stop"; \
  fi

compile:
  uv lock

lock:
  uv lock --upgrade  # --exclude-newer `date -d '14 days ago' --iso-8601=seconds`

sync:
  uv sync --group dev

sync-silent:
  @uv sync --group dev  >/dev/null 2>&1 < /dev/null

test: test-harness
test-harness: sync
  uv run pytest

format: sync
  uv run ruff format app/

lint: sync
  uv run ruff check app/

typecheck: sync
  uv run mypy app/

check: check-format check-lint check-complexity check-typecheck test

check-format: sync
  uv run ruff format --check app/

check-lint: sync
  uv run ruff check app/

check-typecheck: sync
  uv run mypy app/

check-complexity: sync
  uv run ruff check --select C901 app/ tests/
  uv run python tools/check_module_size.py app tests

fix: sync
  uv run ruff format app/
  uv run ruff check --fix --unsafe-fixes app/ tests/

sync-claude-md:
  cp CLAUDE.md app/vupi/claude/CLAUDE.md

publish:
  uv build
  uv publish
