Add Sai and Norn plugin handoff proofs

This commit is contained in:
Meta Vens 2026-07-09 01:48:37 +01:00
commit 96968931a1
10 changed files with 265 additions and 2 deletions

View file

@ -14,6 +14,7 @@ $env:EVE_PARITY_OUTPUT = if ([System.IO.Path]::IsPathRooted($OutputDirectory)) {
Push-Location $projectRoot
try {
node .\tools\parity\run-parity.mjs
& (Join-Path $PSScriptRoot "run-plugin-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-aetheria-provider-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-eveunity-split-handoff-smoke.ps1")
& (Join-Path $PSScriptRoot "run-conformance-consumer-smoke.ps1")

View file

@ -0,0 +1,110 @@
param(
[string[]] $HandoffPaths = @(
"plugins\incubating\sai-vn.plugin-handoff.json",
"plugins\incubating\norn-graph.plugin-handoff.json"
)
)
$ErrorActionPreference = "Stop"
$projectRoot = Split-Path -Parent $PSScriptRoot
foreach ($handoffPath in $HandoffPaths) {
$absoluteHandoffPath = if ([System.IO.Path]::IsPathRooted($handoffPath)) {
$handoffPath
} else {
Join-Path $projectRoot $handoffPath
}
if (-not (Test-Path -LiteralPath $absoluteHandoffPath)) {
throw "Plugin handoff manifest not found: $absoluteHandoffPath"
}
$handoff = Get-Content -LiteralPath $absoluteHandoffPath -Raw | ConvertFrom-Json
if ($handoff.schema -ne "gamecult.eve.plugin_handoff.v1") {
throw "Unexpected plugin handoff schema in $($handoffPath): $($handoff.schema)"
}
if (-not $handoff.pluginId) {
throw "Plugin handoff missing pluginId: $handoffPath"
}
if (-not $handoff.ownerRepo) {
throw "Plugin handoff missing ownerRepo: $($handoff.pluginId)"
}
if ($handoff.currentHostRepo -ne "Eve") {
throw "Plugin handoff $($handoff.pluginId) has unexpected current host: $($handoff.currentHostRepo)"
}
foreach ($pathProperty in @("manifestPath", "advertisementPath", "abiFixturePath")) {
$relativePath = $handoff.$pathProperty
if (-not $relativePath) {
throw "Plugin handoff $($handoff.pluginId) missing $pathProperty"
}
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "Plugin handoff $($handoff.pluginId) references missing $($pathProperty): $relativePath"
}
}
$manifest = Get-Content -LiteralPath (Join-Path $projectRoot $handoff.manifestPath) -Raw | ConvertFrom-Json
$advertisement = Get-Content -LiteralPath (Join-Path $projectRoot $handoff.advertisementPath) -Raw | ConvertFrom-Json
$abiFixture = Get-Content -LiteralPath (Join-Path $projectRoot $handoff.abiFixturePath) -Raw | ConvertFrom-Json
if ($manifest.pluginId -ne $handoff.pluginId) {
throw "Plugin handoff pluginId does not match manifest: $($handoff.pluginId) vs $($manifest.pluginId)"
}
if ($advertisement.pluginId -ne $handoff.pluginId) {
throw "Plugin handoff pluginId does not match advertisement: $($handoff.pluginId) vs $($advertisement.pluginId)"
}
if ($abiFixture.pluginId -ne $handoff.pluginId) {
throw "Plugin handoff pluginId does not match ABI fixture: $($handoff.pluginId) vs $($abiFixture.pluginId)"
}
if ($manifest.incubation.ownerRepo -ne $handoff.ownerRepo) {
throw "Plugin handoff $($handoff.pluginId) owner does not match manifest owner: $($manifest.incubation.ownerRepo)"
}
if ($manifest.incubation.splitTarget -ne $handoff.splitTarget) {
throw "Plugin handoff $($handoff.pluginId) split target does not match manifest: $($manifest.incubation.splitTarget)"
}
$operations = @($abiFixture.operations | ForEach-Object { $_.operation })
foreach ($operation in @("describe", "validate", "project", "lower", "measure", "apply")) {
if (-not ($operations -contains $operation)) {
throw "Plugin handoff $($handoff.pluginId) ABI fixture missing operation: $operation"
}
}
foreach ($moveSet in @($handoff.moveSets)) {
if ($moveSet.destinationOwner -ne $handoff.ownerRepo) {
throw "Plugin handoff $($handoff.pluginId) move set $($moveSet.id) has unexpected destination owner: $($moveSet.destinationOwner)"
}
if (-not $moveSet.replacementProof) {
throw "Plugin handoff $($handoff.pluginId) move set $($moveSet.id) missing replacement proof"
}
foreach ($relativePath in @($moveSet.currentPaths)) {
$absolutePath = Join-Path $projectRoot $relativePath
if (-not (Test-Path -LiteralPath $absolutePath)) {
throw "Plugin handoff $($handoff.pluginId) move set $($moveSet.id) references missing path: $relativePath"
}
}
}
foreach ($contract in @(
"gamecult.eve.plugin.v1",
"gamecult.eve.plugin_advertisement.v1",
"gamecult.eve.plugin_abi.v1",
"gamecult.eve.plugin_abi_fixture.v1",
"gamecult.eve.conformance_export.v1"
)) {
if (-not (@($handoff.contractInputs) -contains $contract)) {
throw "Plugin handoff $($handoff.pluginId) missing contract input: $contract"
}
}
foreach ($proof in @($handoff.requiredExternalProofs)) {
if (-not $proof) {
throw "Plugin handoff $($handoff.pluginId) contains an empty required external proof"
}
}
}
Write-Host "Plugin handoff smoke passed: $($HandoffPaths -join ', ')"

View file

@ -35,6 +35,8 @@ node $consumerScript $consumerExport `
--expect-fixture sai-vn `
--expect-plugin sai.vn `
--expect-plugin norn.graph `
--expect-plugin-handoff sai.vn `
--expect-plugin-handoff norn.graph `
--expect-plugin-operation sai.vn:describe `
--expect-plugin-operation sai.vn:validate `
--expect-plugin-operation sai.vn:project `