$ErrorActionPreference = "Stop"

$projectRoot = Split-Path -Parent $PSScriptRoot
$env:UV_CACHE_DIR = Join-Path $projectRoot ".uv-cache"

Push-Location $projectRoot
try {
    uv sync --extra test --frozen
    uv run ruff check src tests_py
    uv run pytest
    uv run scopewrit benchmark --output evidence/local/isolated
    uv build
}
finally {
    Pop-Location
}
