<# .SYNOPSIS The single verification gate for POSA Copyrighter. Run this before commit, before a delivery build, and from CI — same command, same result everywhere. .DESCRIPTION Runs, in order: 1. ruff — lint (config: ruff.toml) 2. pytest — full suite incl. operator-GUI E2E (config: pytest.ini) Browser (Playwright) specs skip cleanly when Chromium is absent, so this works on a host that has not run `playwright install chromium`. .PARAMETER SkipLint Run tests only. For a fast inner loop; the commit gate runs both. .PARAMETER Coverage Add a coverage report over src/. .EXAMPLE .\verify.ps1 .EXAMPLE .\verify.ps1 -Coverage #> [CmdletBinding()] param( [switch]$SkipLint, [switch]$Coverage ) $ErrorActionPreference = 'Stop' Set-Location -LiteralPath $PSScriptRoot $failures = @() if (-not $SkipLint) { Write-Host "`n=== ruff check ===" -ForegroundColor Cyan & python -m ruff check src tests if ($LASTEXITCODE -ne 0) { $failures += 'ruff' } } Write-Host "`n=== pytest ===" -ForegroundColor Cyan $pytestArgs = @() if ($Coverage) { $pytestArgs += @('--cov=src/rights_filter', '--cov-report=term-missing') } & python -m pytest @pytestArgs if ($LASTEXITCODE -ne 0) { $failures += 'pytest' } Write-Host '' if ($failures.Count -gt 0) { Write-Host "VERIFY FAILED: $($failures -join ', ')" -ForegroundColor Red exit 1 } Write-Host 'VERIFY OK' -ForegroundColor Green exit 0