# Shared command vocabulary for humans and agents.
# See planning_and_roadmaps/code_quality_rollout_plan.md for the rollout context.

# Auto-format src and tests
format:
    uv run ruff format src tests analyses

# Lint without fixing
lint:
    uv run ruff check src tests analyses

# Lint and auto-fix what ruff can
lint-fix:
    uv run ruff check --fix src tests analyses

# Type-check with pyright
typecheck:
    uv run pyright

# Run the test suite in parallel
test:
    uv run pytest -n auto

# Run tests that avoid complete executions and reviewed golden comparisons
test-fast:
    uv run pytest -n auto -m "not e2e and not golden"

# Run isolated deterministic tests
test-unit:
    uv run pytest -m unit

# Run public interface and deterministic artifact contracts
test-contract:
    uv run pytest -m contract

# Run complete public compile-and-execute workflows
test-e2e:
    uv run pytest -m e2e

# Run all public workflow characterization tests
test-integration:
    uv run pytest -m "contract or e2e" tests/integration

# Check deterministic artifacts against committed goldens
test-golden:
    uv run pytest -m golden tests/integration

# Measure branch coverage and enforce the configured non-regression floor
coverage:
    uv run pytest -n auto --cov=spine --cov-report=term-missing:skip-covered

# Explicitly regenerate deterministic test goldens for review
regenerate-goldens:
    uv run python tests/golden/regenerate.py

# Regenerate docs/error_codes.md from the diagnostics registry (F31)
regenerate-error-docs:
    uv run python -m spine.backends.error_codes_doc

# Full gate: lint + types + pre-commit hooks (run before committing)
check:
    just lint
    just typecheck
    uv run pre-commit run --all-files
