Skip to content

M2.1: typed Quality evidence and fail-closed MMS bitstring decoding #2621

M2.1: typed Quality evidence and fail-closed MMS bitstring decoding

M2.1: typed Quality evidence and fail-closed MMS bitstring decoding #2621

name: Validate SV evidence bundles
on:
pull_request:
paths:
- "SmvViewerWindow.xaml"
- "Services/SmvViewerWindow.P1Evidence.cs"
- "Services/SmvSnapshotEvidenceExporter.cs"
- "Services/SmvSnapshotCaptureService.cs"
- "tests/ARSAS.Tests/**"
- "engines/ARIEC61850.lock.json"
- ".github/workflows/validate-sv-evidence.yml"
- "scripts/verify-ci-canonical-reuse.py"
- "scripts/test-ci-canonical-reuse.py"
workflow_dispatch:
permissions:
contents: read
actions: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
validate-evidence:
name: Build and test deterministic SV evidence
runs-on: ${{ github.event_name == 'pull_request' && 'ubuntu-latest' || 'windows-latest' }}
steps:
- name: Checkout exact ARSAS application revision
uses: actions/checkout@v7
with:
path: ARSAS
ref: ${{ github.sha }}
persist-credentials: false
fetch-depth: 1
- id: engine
name: Resolve exact immutable ARIEC61850 engine identity
uses: ./ARSAS/.github/actions/resolve-ariec-engine
with:
lock-path: ARSAS/engines/ARIEC61850.lock.json
- name: Run offline canonical evidence safety fixtures
if: github.event_name == 'pull_request'
run: python3 ARSAS/scripts/test-ci-canonical-reuse.py
- name: Prove exact canonical SV evidence tests passed
if: github.event_name == 'pull_request'
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
PR_HEAD_BRANCH: ${{ github.event.pull_request.head.ref }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
PR_MERGE_SHA: ${{ github.sha }}
ENGINE_SHA: ${{ steps.engine.outputs.commit }}
run: |
set -euo pipefail
mkdir -p ARSAS/TestResults
python3 ARSAS/scripts/verify-ci-canonical-reuse.py \
--repository "$GITHUB_REPOSITORY" \
--head-branch "$PR_HEAD_BRANCH" \
--head-sha "$PR_HEAD_SHA" \
--merge-sha "$PR_MERGE_SHA" \
--engine-sha "$ENGINE_SHA" \
--wait-seconds 960 \
--allow-in-progress-artifact \
--require-test-substring SmvSnapshotEvidenceExporterTests \
--output ARSAS/TestResults/sv-canonical-domain-proof.json
- name: Checkout immutable ARIEC61850 engine revision for manual diagnostics
if: github.event_name == 'workflow_dispatch'
shell: powershell
env:
ENGINE_REPOSITORY: ${{ steps.engine.outputs.repository }}
ENGINE_COMMIT: ${{ steps.engine.outputs.commit }}
run: |
git clone --quiet --filter=blob:none --no-checkout "https://github.com/$env:ENGINE_REPOSITORY.git" ARIEC61850
if ($LASTEXITCODE -ne 0) { throw 'Engine clone failed.' }
git -C .\ARIEC61850 fetch --quiet --depth 1 origin $env:ENGINE_COMMIT
if ($LASTEXITCODE -ne 0) { throw 'Pinned engine fetch failed.' }
git -C .\ARIEC61850 checkout --quiet --detach $env:ENGINE_COMMIT
if ($LASTEXITCODE -ne 0) { throw 'Pinned engine checkout failed.' }
$actual = (git -C .\ARIEC61850 rev-parse HEAD).Trim().ToLowerInvariant()
if ($actual -cne $env:ENGINE_COMMIT) {
throw "ARIEC61850 pin mismatch. Expected $env:ENGINE_COMMIT, got $actual."
}
- name: Setup .NET 8 for manual diagnostics
if: github.event_name == 'workflow_dispatch'
uses: actions/setup-dotnet@v6
with:
dotnet-version: 8.0.x
- name: Restore focused test project
if: github.event_name == 'workflow_dispatch'
run: dotnet restore .\ARSAS\tests\ARSAS.Tests\ARSAS.Tests.csproj
- name: Build focused test project
if: github.event_name == 'workflow_dispatch'
shell: powershell
run: |
$log = ".\ARSAS\sv-evidence-build.log"
dotnet build .\ARSAS\tests\ARSAS.Tests\ARSAS.Tests.csproj -c Release --no-restore *> $log
$buildExitCode = $LASTEXITCODE
if ($buildExitCode -ne 0) {
Write-Host "=== Focused compiler errors ===" -ForegroundColor Red
$errors = @(Select-String -Path $log -Pattern ': error ')
if ($errors.Count -eq 0) {
Get-Content $log -Tail 80 | ForEach-Object { Write-Host $_ -ForegroundColor Red }
}
else {
$errors | ForEach-Object { Write-Host $_.Line -ForegroundColor Red }
}
exit $buildExitCode
}
Get-Content $log -Tail 12
- name: Run SV evidence regression tests
if: github.event_name == 'workflow_dispatch'
run: dotnet test .\ARSAS\tests\ARSAS.Tests\ARSAS.Tests.csproj -c Release --no-build --no-restore --filter "FullyQualifiedName~SmvSnapshotEvidenceExporterTests" --logger "trx;LogFileName=sv-evidence-tests.trx" --results-directory .\ARSAS\TestResults
- name: Upload SV validation evidence
if: always()
uses: actions/upload-artifact@v7
with:
name: ARSAS-sv-evidence-test-results
path: |
ARSAS/TestResults/sv-canonical-domain-proof.json
ARSAS/TestResults/*.trx
ARSAS/sv-evidence-build.log
if-no-files-found: warn