From a947062f7b851cad0b253860fb6f8159de9c95db Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 9 Jul 2026 02:19:55 +0100 Subject: [PATCH] Define EveUnity test runner contract --- docs/eve-migration-roadmap.md | 9 +++ docs/parity-testing-harness.md | 8 ++- .../README.md | 8 +++ .../eve-runtime-capability.json | 13 ++++ ...cult.eve.runtime_capability.v1.schema.json | 63 +++++++++++++++++++ scripts/run-eveunity-lifecycle-smoke.ps1 | 40 ++++++++++++ ...ntime-owner-conformance-consumer-smoke.ps1 | 7 ++- tools/parity/parity-manifest.json | 13 ++++ tools/parity/run-parity.mjs | 31 +++++++++ 9 files changed, 189 insertions(+), 3 deletions(-) diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index 6a0569c..0cbf936 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -280,6 +280,15 @@ Exit criteria: Recently cut: +- EveUnity test lifecycle now carries a structured Unity EditMode runner + contract. `packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json` + names the runner script, consumer Unity project, default Unity editor path, + package name, test assembly, platform, result artifacts, and temporary + `testables` manifest mutation. The lifecycle smoke validates the runner + script and Aetheria project, parity compares the contract against the ledger, + and the runtime-owner consumer smoke asserts exported test fields. This is + Unity package consumption proof for CultLib-produced assemblies; CultLib + remains the owner of the .NET/NuGet dependency story. - EveUnity release lifecycle now carries a structured UPM release contract. `packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json` names the package root, version source, tag pattern, artifact kind, and diff --git a/docs/parity-testing-harness.md b/docs/parity-testing-harness.md index d54cbc4..8e6c8be 100644 --- a/docs/parity-testing-harness.md +++ b/docs/parity-testing-harness.md @@ -118,8 +118,9 @@ capture status, and missing evidence without reading Eve's local parity manifest. The runtime-owner consumer smoke asserts EveUnity lifecycle stage status and pending release/test/capture proofs from the exported runtime record, plus release contract fields such as package name, artifact kind, tag pattern, -and package root, so split blockers stay machine-readable instead of hiding in -handoff prose. +and package root, plus Unity EditMode test runner contract fields such as +runner script, package name, test assembly, and platform. Split blockers stay +machine-readable instead of hiding in handoff prose. After generating the parity report, `run-parity-harness.ps1` copies `artifacts/conformance/latest` into @@ -233,6 +234,9 @@ Unity-style precompiled references for the Brokkr/CultMesh DLLs that Unity needs to resolve `GameCult.Mesh`; this complements the normal CultLib .NET/NuGet dependency story rather than replacing it. The runner proves the incubating package test lifecycle, not final EveUnity-owned release or capture. +The exported runtime lifecycle records that runner contract so EveUnity can +inherit the Unity-specific test proof without making Eve responsible for +CultLib package distribution. Unity runtime lifecycle evidence: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/README.md b/packages/org.gamecult.eve.unity-uitoolkit/README.md index ec25fc9..1c5ea8c 100644 --- a/packages/org.gamecult.eve.unity-uitoolkit/README.md +++ b/packages/org.gamecult.eve.unity-uitoolkit/README.md @@ -47,6 +47,14 @@ The release stage also declares the UPM release contract: its version from `package.json`, and uses tag pattern `eveunity-uitoolkit-v{version}` once the tag is cut from EveUnity. +The test stage declares the Unity EditMode runner contract: the current runner +is `scripts/run-aetheria-unity-editmode-tests.ps1`, runs +`GameCult.Eve.UnityUIToolkit.Tests` on `EditMode`, writes XML and log artifacts +under `artifacts/aetheria-unity-editmode/{stamp}`, and temporarily adds +`org.gamecult.eve.unity-uitoolkit` to Aetheria's Unity `testables`. This is a +Unity package consumption proof. CultLib still owns the .NET/NuGet dependency +story for its assemblies. + Those lifecycle claims are validated by the parity harness. A missing evidence path is a runtime capability error, not a README footnote. diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json index 21715c4..a01759a 100644 --- a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json +++ b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json @@ -74,6 +74,19 @@ "ownerRepo": "EveUnity", "status": "batchmode-editmode-tests-and-consumer-build-smoke", "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1", + "testContract": { + "ownerRepo": "EveUnity", + "runnerKind": "unity-editmode-batchmode", + "runnerScript": "scripts/run-aetheria-unity-editmode-tests.ps1", + "consumerProject": "E:\\Projects\\Aetheria", + "unityExeDefault": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe", + "packageName": "org.gamecult.eve.unity-uitoolkit", + "testAssembly": "GameCult.Eve.UnityUIToolkit.Tests", + "testPlatform": "EditMode", + "resultsArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode-results.xml", + "logArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode.log", + "manifestMutation": "Temporarily adds org.gamecult.eve.unity-uitoolkit to Aetheria Packages/manifest.json testables and restores the manifest after the run." + }, "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", diff --git a/schemas/gamecult.eve.runtime_capability.v1.schema.json b/schemas/gamecult.eve.runtime_capability.v1.schema.json index b1b05c4..06b04d7 100644 --- a/schemas/gamecult.eve.runtime_capability.v1.schema.json +++ b/schemas/gamecult.eve.runtime_capability.v1.schema.json @@ -230,6 +230,69 @@ "command": { "type": "string" }, + "testContract": { + "type": "object", + "required": [ + "ownerRepo", + "runnerKind", + "runnerScript", + "consumerProject", + "unityExeDefault", + "packageName", + "testAssembly", + "testPlatform", + "resultsArtifact", + "logArtifact", + "manifestMutation" + ], + "properties": { + "ownerRepo": { + "type": "string", + "minLength": 1 + }, + "runnerKind": { + "type": "string", + "minLength": 1 + }, + "runnerScript": { + "type": "string", + "minLength": 1 + }, + "consumerProject": { + "type": "string", + "minLength": 1 + }, + "unityExeDefault": { + "type": "string", + "minLength": 1 + }, + "packageName": { + "type": "string", + "minLength": 1 + }, + "testAssembly": { + "type": "string", + "minLength": 1 + }, + "testPlatform": { + "type": "string", + "minLength": 1 + }, + "resultsArtifact": { + "type": "string", + "minLength": 1 + }, + "logArtifact": { + "type": "string", + "minLength": 1 + }, + "manifestMutation": { + "type": "string", + "minLength": 1 + } + }, + "additionalProperties": true + }, "evidencePaths": { "type": "array", "items": { diff --git a/scripts/run-eveunity-lifecycle-smoke.ps1 b/scripts/run-eveunity-lifecycle-smoke.ps1 index b151215..d9114bc 100644 --- a/scripts/run-eveunity-lifecycle-smoke.ps1 +++ b/scripts/run-eveunity-lifecycle-smoke.ps1 @@ -118,6 +118,46 @@ if ($packageManifest.name -ne $releaseContract.packageName) { throw "EveUnity release contract package name does not match package manifest: $($releaseContract.packageName) vs $($packageManifest.name)" } +$testContract = $manifest.lifecycle.test.testContract +if ($null -eq $testContract) { + throw "EveUnity test lifecycle missing testContract" +} +if ($testContract.ownerRepo -ne "EveUnity") { + throw "EveUnity test contract has unexpected owner: $($testContract.ownerRepo)" +} +if ($testContract.runnerKind -ne "unity-editmode-batchmode") { + throw "EveUnity test contract has unexpected runner kind: $($testContract.runnerKind)" +} +if ($testContract.packageName -ne "org.gamecult.eve.unity-uitoolkit") { + throw "EveUnity test contract has unexpected package name: $($testContract.packageName)" +} +if ($testContract.testAssembly -ne "GameCult.Eve.UnityUIToolkit.Tests") { + throw "EveUnity test contract has unexpected test assembly: $($testContract.testAssembly)" +} +if ($testContract.testPlatform -ne "EditMode") { + throw "EveUnity test contract has unexpected test platform: $($testContract.testPlatform)" +} +foreach ($pathProperty in @("runnerScript", "consumerProject")) { + $candidate = $testContract.$pathProperty + if (-not $candidate) { + throw "EveUnity test contract missing $pathProperty" + } + $absolutePath = if ([System.IO.Path]::IsPathRooted($candidate)) { + $candidate + } else { + Join-Path $projectRoot $candidate + } + if (-not (Test-Path -LiteralPath $absolutePath)) { + throw "EveUnity test contract $pathProperty does not exist: $candidate" + } +} +$runnerSource = Get-Content -LiteralPath (Join-Path $projectRoot $testContract.runnerScript) -Raw +foreach ($expectedText in @($testContract.packageName, $testContract.testAssembly, $testContract.testPlatform, "testables", "Restore-Manifest")) { + if (-not $runnerSource.Contains($expectedText)) { + throw "EveUnity test contract runner script missing expected text: $expectedText" + } +} + & (Join-Path $projectRoot "scripts\run-aetheria-unity-package-smoke.ps1") if ($LASTEXITCODE -ne 0) { throw "Aetheria Unity package smoke failed with exit code $LASTEXITCODE" diff --git a/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 b/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 index deaff6c..0ab61fc 100644 --- a/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 +++ b/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 @@ -67,7 +67,12 @@ node $consumerScript $consumerExport ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageName:org.gamecult.eve.unity-uitoolkit" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.artifactKind:upm-package" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.tagPattern:eveunity-uitoolkit-v{version}" ` - --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageRoot:packages/org.gamecult.eve.unity-uitoolkit" + --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageRoot:packages/org.gamecult.eve.unity-uitoolkit" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerKind:unity-editmode-batchmode" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerScript:scripts/run-aetheria-unity-editmode-tests.ps1" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.packageName:org.gamecult.eve.unity-uitoolkit" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.testAssembly:GameCult.Eve.UnityUIToolkit.Tests" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.testPlatform:EditMode" if ($LASTEXITCODE -ne 0) { throw "Runtime owner conformance consumer smoke failed with exit code $LASTEXITCODE" diff --git a/tools/parity/parity-manifest.json b/tools/parity/parity-manifest.json index 0b95075..1a3418c 100644 --- a/tools/parity/parity-manifest.json +++ b/tools/parity/parity-manifest.json @@ -996,6 +996,19 @@ "ownerRepo": "EveUnity", "status": "batchmode-editmode-tests-and-consumer-build-smoke", "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1", + "testContract": { + "ownerRepo": "EveUnity", + "runnerKind": "unity-editmode-batchmode", + "runnerScript": "scripts/run-aetheria-unity-editmode-tests.ps1", + "consumerProject": "E:\\Projects\\Aetheria", + "unityExeDefault": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe", + "packageName": "org.gamecult.eve.unity-uitoolkit", + "testAssembly": "GameCult.Eve.UnityUIToolkit.Tests", + "testPlatform": "EditMode", + "resultsArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode-results.xml", + "logArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode.log", + "manifestMutation": "Temporarily adds org.gamecult.eve.unity-uitoolkit to Aetheria Packages/manifest.json testables and restores the manifest after the run." + }, "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", diff --git a/tools/parity/run-parity.mjs b/tools/parity/run-parity.mjs index 6db5c16..9cb81b4 100644 --- a/tools/parity/run-parity.mjs +++ b/tools/parity/run-parity.mjs @@ -1139,6 +1139,7 @@ function compareRuntimeLifecycleClaims(expectedLifecycle, actualLifecycle, manif errors.push(...missingMembers(expected.evidencePaths || [], actual.evidencePaths || [], `${label}.evidencePaths`)); errors.push(...missingMembers(expected.pendingProofs || [], actual.pendingProofs || [], `${label}.pendingProofs`)); errors.push(...compareReleaseContract(expected.releaseContract, actual.releaseContract, `${label}.releaseContract`)); + errors.push(...compareTestContract(expected.testContract, actual.testContract, `${label}.testContract`)); for (const evidencePath of actual.evidencePaths || []) { if (!existsSync(path.join(repoRoot, evidencePath))) { @@ -1149,6 +1150,36 @@ function compareRuntimeLifecycleClaims(expectedLifecycle, actualLifecycle, manif return errors; } +function compareTestContract(expected, actual, label) { + const errors = []; + if (!expected) return errors; + if (!actual) return [`${label}:missing`]; + for (const key of [ + "ownerRepo", + "runnerKind", + "runnerScript", + "consumerProject", + "unityExeDefault", + "packageName", + "testAssembly", + "testPlatform", + "resultsArtifact", + "logArtifact", + "manifestMutation", + ]) { + if ((expected[key] || "") !== (actual[key] || "")) { + errors.push(`${label}.${key}:expected ${expected[key] || ""} got ${actual[key] || ""}`); + } + } + if (actual.runnerScript && !existsSync(path.join(repoRoot, actual.runnerScript))) { + errors.push(`${label}.runnerScript:${actual.runnerScript}:missing`); + } + if (actual.consumerProject && !existsSync(actual.consumerProject)) { + errors.push(`${label}.consumerProject:${actual.consumerProject}:missing`); + } + return errors; +} + function compareReleaseContract(expected, actual, label) { const errors = []; if (!expected) return errors;