Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 69 additions & 45 deletions .github/workflows/smart-discovery-mainline-readiness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
mainline-readiness:
name: Require physical promotion before mainline review
name: Require R10 physical authority before mainline review
runs-on: windows-latest
steps:
- name: Checkout ARSAS full history
Expand All @@ -16,74 +16,98 @@ jobs:
git clone --quiet --branch $ref "https://github.com/$env:GITHUB_REPOSITORY.git" ArIED61850Tester
$arsasHead = (git -C .\ArIED61850Tester rev-parse HEAD).Trim().ToLowerInvariant()
"ARSAS_HEAD=$arsasHead" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "P0-5g mainline ARSAS head: $arsasHead"
Write-Host "R10 mainline ARSAS head: $arsasHead"

- name: Checkout ARIEC61850 PR 134 head
- name: Verify R10 physical convergence authority
shell: powershell
run: |
git clone --quiet --branch perf/smart-ied-discovery https://github.com/masarray/ARIEC61850.git ARIEC61850
$engineHead = (git -C .\ARIEC61850 rev-parse HEAD).Trim().ToLowerInvariant()
"ENGINE_HEAD=$engineHead" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "P0-5g mainline engine head: $engineHead"
$root = '.\ArIED61850Tester'
$target = Get-Content "$root\evidence\iedscout-convergence-target.json" -Raw | ConvertFrom-Json
$lock = Get-Content "$root\engines\ARIEC61850.lock.json" -Raw | ConvertFrom-Json

if ($target.status -ne 'physical-retest-passed-merge-ready' -or
-not [bool]$target.promotion.physicalRetestPassed -or
[bool]$target.promotion.physicalRetestRequired -or
-not [bool]$target.promotion.mergeAllowedAfterPhysicalRetest) {
throw 'R10 physical convergence authority is not in the accepted mainline state.'
}

$r10 = $target.physicalEvidence.arsasR10
foreach ($edition in @($r10.reuseEdition2, $r10.reuseEdition1)) {
if ([int]$edition.failedReads -ne 0 -or
[int]$edition.projectionErrors -ne 0 -or
[int]$edition.cacheLoss -ne 0 -or
[int]$edition.reportBackedRuntimePoints -ne 58 -or
[int]$edition.unresolvedRuntimePoints -ne 0 -or
-not [bool]$edition.actualInformationReportObserved) {
throw 'R10 trusted-SCL reuse proof regressed.'
}
}

if ($lock.commit -ne $target.activeStack.engineModelAndScl.mainMerge -or
$lock.commit -ne $r10.testedArtifact.engineMergedMain) {
throw 'ARSAS engine lock no longer matches the R10 merged engine authority.'
}

"ENGINE_REPOSITORY=$($lock.repository)" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append
"ENGINE_COMMIT=$($lock.commit)" | Out-File $env:GITHUB_ENV -Encoding utf8 -Append

- name: Checkout exact merged ARIEC61850 authority
shell: powershell
run: |
git clone --quiet --filter=blob:none --no-checkout "https://github.com/$env:ENGINE_REPOSITORY.git" ARIEC61850
git -C .\ARIEC61850 fetch --quiet --depth 1 origin $env:ENGINE_COMMIT
git -C .\ARIEC61850 checkout --quiet --detach $env:ENGINE_COMMIT
$actual = (git -C .\ARIEC61850 rev-parse HEAD).Trim().ToLowerInvariant()
if ($actual -ne $env:ENGINE_COMMIT) {
throw "R10 engine authority mismatch. Expected $env:ENGINE_COMMIT, got $actual."
}

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Validate exact engine head
- name: Validate exact merged engine authority
shell: powershell
run: |
.\ARIEC61850\scripts\verify-source-clean.ps1
dotnet restore .\ARIEC61850\ARIEC61850.sln
dotnet build .\ARIEC61850\ARIEC61850.sln -c Release --no-restore
dotnet test .\ARIEC61850\tests\AR.Iec61850.Tests\AR.Iec61850.Tests.csproj -c Release --no-build --no-restore

- name: Require READY_FOR_REVIEW promotion state
shell: powershell
run: |
$root = '.\ArIED61850Tester'
$physical = "$root\evidence\smart-discovery-repeat-run.authority.json"
$promotion = "$root\evidence\smart-discovery-production-promotion-authority.json"
$physicalArg = if (Test-Path $physical -PathType Leaf) { $physical } else { '' }
$promotionArg = if (Test-Path $promotion -PathType Leaf) { $promotion } else { '' }
$output = "$root\TestResults\P0-5G-mainline-readiness.json"
New-Item -ItemType Directory -Force "$root\TestResults" | Out-Null

& "$root\scripts\verify-smart-discovery-production-readiness.ps1" `
-TargetPath "$root\evidence\smart-discovery-production-promotion-target.json" `
-EngineLockPath "$root\engines\ARIEC61850.lock.json" `
-PromotionPropsPath "$root\evidence\SmartDiscoveryPromotion.props" `
-ArsasRepositoryPath $root `
-EngineRepositoryPath '.\ARIEC61850' `
-ArsasHeadCommit $env:ARSAS_HEAD `
-EngineHeadCommit $env:ENGINE_HEAD `
-EngineHeadCiConclusion success `
-PhysicalAuthorityPath $physicalArg `
-PromotionAuthorityPath $promotionArg `
-OutputJson $output `
-NoFailExit

$result = Get-Content $output -Raw | ConvertFrom-Json
if ($result.Verdict -ne 'READY_FOR_REVIEW') {
throw "MAINLINE BLOCKED: readiness verdict is '$($result.Verdict)': $(@($result.Blockers) -join '; ')"
}
if (-not [bool]$result.ProductionSwitchEnabled) {
throw 'MAINLINE BLOCKED: production smart-discovery switch is not enabled.'
}

- name: Build and test promoted ARSAS path
- name: Build and test R10 ARSAS path
shell: powershell
run: |
dotnet restore .\ArIED61850Tester\ArIED61850Tester.sln
dotnet build .\ArIED61850Tester\ArIED61850Tester.sln -c Release --no-restore
dotnet test .\ArIED61850Tester\tests\ARSAS.Tests\ARSAS.Tests.csproj -c Release --no-build --no-restore

- name: Upload P0-5g mainline evidence
- name: Write R10 mainline evidence
if: always()
shell: powershell
run: |
$root = '.\ArIED61850Tester'
New-Item -ItemType Directory -Force "$root\TestResults" | Out-Null
$target = Get-Content "$root\evidence\iedscout-convergence-target.json" -Raw | ConvertFrom-Json
[ordered]@{
schemaVersion = 1
sourceCommit = $env:ARSAS_HEAD
engineCommit = $env:ENGINE_COMMIT
convergenceStatus = $target.status
physicalRetestPassed = [bool]$target.promotion.physicalRetestPassed
ed2ProjectionErrors = [int]$target.physicalEvidence.arsasR10.reuseEdition2.projectionErrors
ed2CacheLoss = [int]$target.physicalEvidence.arsasR10.reuseEdition2.cacheLoss
ed1ProjectionErrors = [int]$target.physicalEvidence.arsasR10.reuseEdition1.projectionErrors
ed1CacheLoss = [int]$target.physicalEvidence.arsasR10.reuseEdition1.cacheLoss
reportBackedRuntimePoints = 58
} | ConvertTo-Json -Depth 5 | Set-Content "$root\TestResults\R10-mainline-readiness.json"

- name: Upload R10 mainline evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: ARSAS-p0-5g-mainline-readiness
path: ArIED61850Tester\TestResults\P0-5G-mainline-readiness.json
name: ARSAS-r10-mainline-readiness
path: ArIED61850Tester\TestResults\R10-mainline-readiness.json
if-no-files-found: error
retention-days: 14
14 changes: 7 additions & 7 deletions .github/workflows/smart-discovery-post-merge-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ jobs:
- name: Checkout exact merged ARIEC61850 authority
shell: powershell
run: |
git clone --quiet --filter=blob:none --no-checkout "https://github.com/$env:ENGINE_REPOSITORY.git" ARIEC61850
git -C .\ARIEC61850 fetch --quiet --depth 1 origin $env:ENGINE_COMMIT
git -C .\ARIEC61850 checkout --quiet --detach $env:ENGINE_COMMIT
$actual = (git -C .\ARIEC61850 rev-parse HEAD).Trim().ToLowerInvariant()
git clone --quiet --filter=blob:none --no-checkout "https://github.com/$env:ENGINE_REPOSITORY.git" ..\ARIEC61850
git -C ..\ARIEC61850 fetch --quiet --depth 1 origin $env:ENGINE_COMMIT
git -C ..\ARIEC61850 checkout --quiet --detach $env:ENGINE_COMMIT
$actual = (git -C ..\ARIEC61850 rev-parse HEAD).Trim().ToLowerInvariant()
if ($actual -ne $env:ENGINE_COMMIT) {
throw "R10 engine authority mismatch. Expected $env:ENGINE_COMMIT, got $actual."
}
Expand All @@ -70,9 +70,9 @@ jobs:
run: |
# Keep the exact R10 physical-tested engine commit. Post-merge acceptance
# validates the immutable commit identity plus full restore/build/test.
dotnet restore .\ARIEC61850\ARIEC61850.sln
dotnet build .\ARIEC61850\ARIEC61850.sln -c Release --no-restore
dotnet test .\ARIEC61850\tests\AR.Iec61850.Tests\AR.Iec61850.Tests.csproj -c Release --no-build --no-restore
dotnet restore ..\ARIEC61850\ARIEC61850.sln
dotnet build ..\ARIEC61850\ARIEC61850.sln -c Release --no-restore
dotnet test ..\ARIEC61850\tests\AR.Iec61850.Tests\AR.Iec61850.Tests.csproj -c Release --no-build --no-restore

- name: Build and test ARSAS main
shell: powershell
Expand Down
2 changes: 2 additions & 0 deletions scripts/verify-source-clean.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ $ApprovedConvergenceIdentifierPaths = [System.Collections.Generic.HashSet[string
@(
".github/workflows/iedscout-convergence-guard.yml",
".github/workflows/scl-interoperability-r7.yml",
".github/workflows/smart-discovery-post-merge-production.yml",
".github/workflows/smart-discovery-mainline-readiness.yml",
"docs/IEDSCOUT_CONVERGENCE.md",
"evidence/iedscout-convergence-target.json",
"tests/ARSAS.Tests/CanonicalLiveSclExportRegressionTests.cs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,22 @@ public void P05g_ReadinessAllowsMissingPromotionBindingsWhileFailClosed()
}

[Fact]
public void P05g_DedicatedMainlineGateRequiresReadyForReviewAndRealAuthorities()
public void R10_DedicatedMainlineGateRequiresPhysicalAuthorityAndExactMergedEngine()
{
var workflow = File.ReadAllText(FindRepoFile(".github/workflows/smart-discovery-mainline-readiness.yml"));

Assert.Contains("Smart Discovery Mainline Readiness", workflow, StringComparison.Ordinal);
Assert.Contains("smart-discovery-repeat-run.authority.json", workflow, StringComparison.Ordinal);
Assert.Contains("smart-discovery-production-promotion-authority.json", workflow, StringComparison.Ordinal);
Assert.Contains("READY_FOR_REVIEW", workflow, StringComparison.Ordinal);
Assert.Contains("ProductionSwitchEnabled", workflow, StringComparison.Ordinal);
Assert.Contains("-NoFailExit", workflow, StringComparison.Ordinal);
Assert.Contains("Verify R10 physical convergence authority", workflow, StringComparison.Ordinal);
Assert.Contains("physical-retest-passed-merge-ready", workflow, StringComparison.Ordinal);
Assert.Contains("projectionErrors", workflow, StringComparison.Ordinal);
Assert.Contains("cacheLoss", workflow, StringComparison.Ordinal);
Assert.Contains("reportBackedRuntimePoints", workflow, StringComparison.Ordinal);
Assert.Contains("actualInformationReportObserved", workflow, StringComparison.Ordinal);
Assert.Contains("engineMergedMain", workflow, StringComparison.Ordinal);
Assert.Contains("Validate exact merged engine authority", workflow, StringComparison.Ordinal);
Assert.Contains("Build and test R10 ARSAS path", workflow, StringComparison.Ordinal);
Assert.DoesNotContain("smart-discovery-repeat-run.authority.json", workflow, StringComparison.Ordinal);
Assert.DoesNotContain("READY_FOR_REVIEW", workflow, StringComparison.Ordinal);
Assert.Contains("if-no-files-found: error", workflow, StringComparison.Ordinal);
}

Expand Down
Loading