diff --git a/scripts/verify-n13-uia-selectors.ps1 b/scripts/verify-n13-uia-selectors.ps1 new file mode 100644 index 0000000..0510fd8 --- /dev/null +++ b/scripts/verify-n13-uia-selectors.ps1 @@ -0,0 +1,37 @@ +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +$repo = (Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..")).Path +Set-Location -LiteralPath $repo + +if (-not (Get-Command go -ErrorAction SilentlyContinue)) { + throw "go was not found. Run this verifier in a Go 1.23.x environment." +} + +Write-Host "## go test ./internal/uiaselector" +go test ./internal/uiaselector -count=1 +if ($LASTEXITCODE -ne 0) { + throw "go test ./internal/uiaselector failed with exit code $LASTEXITCODE" +} + +Write-Host "## boundary grep" +$forbidden = @( + "send_after_approval", + "send_file_after_approval", + "receive_file_after_approval", + "open_conversation", + "ValuePattern.SetValue", + "InvokePattern" +) +$files = @( + "internal\uiaselector\catalog.go", + "internal\uiaselector\matcher.go" +) +foreach ($term in $forbidden) { + $hit = Select-String -LiteralPath $files -Pattern $term -SimpleMatch -ErrorAction SilentlyContinue + if ($hit) { + throw "forbidden action term found in selector implementation: $term" + } +} + +Write-Host "N13 UIA selector verification passed." \ No newline at end of file