From 615bc1e3070394731469ed4665ec6532dbf3297c Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 9 Jul 2026 00:23:51 +0100 Subject: [PATCH] Validate exported conformance consumer layout --- docs/eve-migration-roadmap.md | 8 ++- docs/parity-testing-harness.md | 11 ++++ scripts/run-conformance-consumer-smoke.ps1 | 36 ++++++++++ scripts/run-parity-harness.ps1 | 1 + tools/conformance/consume-export.mjs | 77 ++++++++++++++++++++++ 5 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 scripts/run-conformance-consumer-smoke.ps1 create mode 100644 tools/conformance/consume-export.mjs diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index 513028e..0826116 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -276,11 +276,15 @@ Exit criteria: 1. Add a real Unity plugin-host proof for either Sai or Norn, or keep `EveUnity` blocked on explicit unsupported-plugin declarations. -2. Move one conformance-pack consumer outside Eve's source layout and run it - against `artifacts/conformance/latest`. +2. Use the exported conformance packs from one non-Eve repo or runtime smoke so + the consumer path proves a real split candidate, not only a copied-layout + local check. Recently cut: +- The parity harness now runs a conformance consumer smoke against a copied + `artifacts/conformance/latest` layout, proving the export can be consumed + through `index.json` and `packs/*.json` without reading Eve's parity manifest. - The parity harness now emits an `EveConformance`-shaped export under `artifacts/conformance/latest`, with a top-level index and per-pack JSON files for core, plugin, provider, and runtime consumers. diff --git a/docs/parity-testing-harness.md b/docs/parity-testing-harness.md index 4dcb76a..ff8c6c7 100644 --- a/docs/parity-testing-harness.md +++ b/docs/parity-testing-harness.md @@ -59,6 +59,17 @@ The semantic runner writes: - `artifacts/parity/latest.json` - `artifacts/parity//parity-report.md` - `artifacts/parity//parity-report.json` +- `artifacts/conformance/latest/index.md` +- `artifacts/conformance/latest/index.json` +- `artifacts/conformance/latest/packs/*.json` +- `artifacts/conformance//...` + +After generating the parity report, `run-parity-harness.ps1` copies +`artifacts/conformance/latest` into +`artifacts/conformance-consumer-smoke/export` and runs +`tools/conformance/consume-export.mjs` against that copied layout. That smoke +proves the conformance export can be consumed through its own index and pack +files without reading `tools/parity/parity-manifest.json`. The smoke runner writes: diff --git a/scripts/run-conformance-consumer-smoke.ps1 b/scripts/run-conformance-consumer-smoke.ps1 new file mode 100644 index 0000000..f7f6166 --- /dev/null +++ b/scripts/run-conformance-consumer-smoke.ps1 @@ -0,0 +1,36 @@ +param( + [string] $ExportDirectory = "artifacts\conformance\latest", + [string] $ConsumerDirectory = "artifacts\conformance-consumer-smoke" +) + +$ErrorActionPreference = "Stop" + +$projectRoot = Split-Path -Parent $PSScriptRoot +$sourceExport = if ([System.IO.Path]::IsPathRooted($ExportDirectory)) { + $ExportDirectory +} else { + Join-Path $projectRoot $ExportDirectory +} +$consumerRoot = if ([System.IO.Path]::IsPathRooted($ConsumerDirectory)) { + $ConsumerDirectory +} else { + Join-Path $projectRoot $ConsumerDirectory +} +$consumerExport = Join-Path $consumerRoot "export" + +if (-not (Test-Path $sourceExport)) { + throw "Conformance export not found: $sourceExport" +} + +if (Test-Path $consumerExport) { + Remove-Item -LiteralPath $consumerExport -Recurse -Force +} +New-Item -ItemType Directory -Force -Path $consumerRoot | Out-Null +Copy-Item -LiteralPath $sourceExport -Destination $consumerExport -Recurse + +Push-Location $projectRoot +try { + node .\tools\conformance\consume-export.mjs $consumerExport +} finally { + Pop-Location +} diff --git a/scripts/run-parity-harness.ps1 b/scripts/run-parity-harness.ps1 index ad462ff..e8f17dd 100644 --- a/scripts/run-parity-harness.ps1 +++ b/scripts/run-parity-harness.ps1 @@ -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-conformance-consumer-smoke.ps1") } finally { Pop-Location } diff --git a/tools/conformance/consume-export.mjs b/tools/conformance/consume-export.mjs new file mode 100644 index 0000000..478f6a2 --- /dev/null +++ b/tools/conformance/consume-export.mjs @@ -0,0 +1,77 @@ +import { readFile } from "node:fs/promises"; +import { existsSync } from "node:fs"; +import { readFileSync } from "node:fs"; +import path from "node:path"; + +const exportDirectory = process.argv[2] ? path.resolve(process.argv[2]) : ""; +if (!exportDirectory) { + console.error("Usage: node tools/conformance/consume-export.mjs "); + process.exit(2); +} + +const indexPath = path.join(exportDirectory, "index.json"); +const errors = []; + +if (!existsSync(indexPath)) { + errors.push(`index.json:missing:${indexPath}`); +} else { + const index = JSON.parse(await readFile(indexPath, "utf8")); + validateIndex(index, exportDirectory, errors); +} + +for (const error of errors) console.error(`Conformance consumer error: ${error}`); +if (errors.length) process.exit(1); + +console.log(`Conformance consumer smoke passed: ${exportDirectory}`); + +function validateIndex(index, directory, errors) { + if (index.schema !== "gamecult.eve.conformance_export.v1") { + errors.push(`schema:expected gamecult.eve.conformance_export.v1 got ${index.schema || ""}`); + } + + const packs = Array.isArray(index.packs) ? index.packs : []; + const packIds = new Set(packs.map(pack => pack.id)); + for (const requiredPack of ["core", "plugin", "provider", "runtime"]) { + if (!packIds.has(requiredPack)) errors.push(`pack:${requiredPack}:missing`); + } + + for (const pack of packs) { + const packPath = path.join(directory, "packs", `${pack.id}.json`); + if (!existsSync(packPath)) { + errors.push(`pack-file:${pack.id}:missing`); + continue; + } + + const packDocument = JSON.parse(readFileSyncUtf8(packPath)); + if (packDocument.id !== pack.id) { + errors.push(`pack-file:${pack.id}:id:expected ${pack.id} got ${packDocument.id || ""}`); + } + if ((packDocument.fixtures || []).length !== (pack.fixtures || []).length) { + errors.push(`pack-file:${pack.id}:fixture-count:expected ${(pack.fixtures || []).length} got ${(packDocument.fixtures || []).length}`); + } + + for (const fixture of packDocument.fixtures || []) { + if (!fixture.fixtureId) errors.push(`pack-file:${pack.id}:fixture:fixtureId:missing`); + if (!fixture.status) errors.push(`pack-file:${pack.id}:fixture:${fixture.fixtureId || "unknown"}:status:missing`); + if (!fixture.surface?.path) errors.push(`pack-file:${pack.id}:fixture:${fixture.fixtureId || "unknown"}:surface.path:missing`); + if (!fixture.metadataPath) errors.push(`pack-file:${pack.id}:fixture:${fixture.fixtureId || "unknown"}:metadataPath:missing`); + } + } + + if (!Array.isArray(index.plugins) || !index.plugins.some(plugin => plugin.pluginId === "sai.vn" && plugin.abiFixturePath)) { + errors.push("plugins:sai.vn:abiFixturePath:missing"); + } + if (!Array.isArray(index.providers) || !index.providers.some(provider => provider.providerId === "aetheria" && provider.scenarioPath)) { + errors.push("providers:aetheria:scenarioPath:missing"); + } + if (!Array.isArray(index.runtimes) || !index.runtimes.some(runtime => runtime.runtimeId === "unity-uitoolkit" && runtime.commandTransportSchema === "gamecult.eve.command.v1")) { + errors.push("runtimes:unity-uitoolkit:commandTransportSchema:missing"); + } + if (!Array.isArray(index.splitTargets) || !index.splitTargets.some(target => target.id === "EveUnity")) { + errors.push("splitTargets:EveUnity:missing"); + } +} + +function readFileSyncUtf8(filePath) { + return readFileSync(filePath, "utf8"); +}