Runtime Case Collector v0 Windows #71
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Runtime Case Collector v0 Windows | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| collector_output_route: | |
| description: Private Windows collector output route on the trusted runner host | |
| required: true | |
| type: string | |
| schedule: | |
| - cron: "0 * * * *" | |
| permissions: | |
| contents: read | |
| jobs: | |
| collect-windows-candidates: | |
| name: Collect Windows runtime candidates | |
| runs-on: [self-hosted, Windows, X64] | |
| defaults: | |
| run: | |
| working-directory: ${{ github.workspace }} | |
| steps: | |
| - name: Check out platform repo | |
| uses: actions/checkout@v4 | |
| - name: Verify Windows factory script path | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| if (-not (Test-Path -LiteralPath $factoryScript)) { | |
| Write-Error "Expected checked-out factory script was not found at $factoryScript." | |
| exit 1 | |
| } | |
| - name: Preflight Windows collector lane | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| env: | |
| COLLECTOR_OUTPUT_ROUTE: ${{ github.event_name == 'schedule' && vars.RCC_WINDOWS_OUTPUT_ROUTE || inputs.collector_output_route }} | |
| run: | | |
| $route = $env:COLLECTOR_OUTPUT_ROUTE | |
| if ([string]::IsNullOrWhiteSpace($route)) { | |
| Write-Error "RCC_WINDOWS_OUTPUT_ROUTE is required for scheduled collection, and collector_output_route is required for workflow_dispatch." | |
| exit 1 | |
| } | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| $preflight = python -B "$factoryScript" collector-windows-preflight --output-route "$route" --format json | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| $preflightJson = $preflight | ConvertFrom-Json | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "## Runtime Case Collector v0 Windows" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- collector lane: windows" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- workflow run ID: $env:GITHUB_RUN_ID" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- route approved: $($preflightJson.route_status.approved_windows_private_route -ne $null)" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- route exists: $($preflightJson.route_status.route_exists)" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- route writable: $($preflightJson.route_status.route_writable)" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- append_to_lifetime_ledger: false" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- governed_cases_appended: false" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- public_safe_status: NOT_PUBLIC_SAFE" | |
| - name: Self-test Windows collector lane | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| python -B "$factoryScript" collector-windows-self-test --format json | |
| - name: Dry-run Windows collector lane | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| python -B "$factoryScript" collector-windows-run-once --dry-run --format json | |
| - name: Collect Windows private candidates | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| env: | |
| COLLECTOR_OUTPUT_ROUTE: ${{ github.event_name == 'schedule' && vars.RCC_WINDOWS_OUTPUT_ROUTE || inputs.collector_output_route }} | |
| run: | | |
| $route = $env:COLLECTOR_OUTPUT_ROUTE | |
| if ([string]::IsNullOrWhiteSpace($route)) { | |
| Write-Error "RCC_WINDOWS_OUTPUT_ROUTE is required for scheduled collection, and collector_output_route is required for workflow_dispatch." | |
| exit 1 | |
| } | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| $collect = python -B "$factoryScript" collector-windows-run-once --output-route "$route" --format json | |
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } | |
| $collectJson = $collect | ConvertFrom-Json | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- candidate_count: $($collectJson.candidate_count)" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- duplicate_count: $($collectJson.duplicate_count)" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- generated_output_files: $($collectJson.generated_output_files)" | |
| Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "- final boundary: RUNTIME_CASE_COLLECTOR_V0_WINDOWS_PRIVATE_CANDIDATE_COLLECTION_ONLY" | |
| - name: Verify Windows collector sample | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| python -B "$factoryScript" collector-windows-verify --format json | |
| - name: Check Windows collector dedupe | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| $factoryScript = Join-Path $env:GITHUB_WORKSPACE "scripts\ho_factory.py" | |
| python -B "$factoryScript" collector-windows-dedupe-check --format json |