From 7af447fa57990b183a96b3fdfb0407b6de58b476 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 9 Jul 2026 11:24:24 +0100 Subject: [PATCH] Add Unity scene release request contract --- docs/eve-migration-roadmap.md | 15 ++- .../eve-runtime-capability.json | 10 +- .../run-eveunity-scene-lifecycle-smoke.ps1 | 13 ++- ...-eveunity-scene-release-contract-smoke.ps1 | 98 +++++++++++++++++++ ...ntime-owner-conformance-consumer-smoke.ps1 | 4 + .../eveunity-release-contract.test.mjs | 23 +++++ tools/parity/parity-manifest.json | 7 ++ 7 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 scripts/run-eveunity-scene-release-contract-smoke.ps1 diff --git a/docs/eve-migration-roadmap.md b/docs/eve-migration-roadmap.md index f217b41..4f9652f 100644 --- a/docs/eve-migration-roadmap.md +++ b/docs/eve-migration-roadmap.md @@ -403,8 +403,11 @@ Recently cut: lifecycle smoke at `scripts/run-eveunity-scene-lifecycle-smoke.ps1`. The manifest claims a provider-agnostic scene graph command surface for `unity-scene`, types the package release, provider-advertisement scene smoke, - command boundary, and scene capture contracts. It now reuses the shared - EveUnity capture request builder through + command boundary, and scene capture contracts. The release contract now uses + the Unity scene package manifest as version source and reuses the shared + EveUnity release request builder through + `scripts/run-eveunity-scene-release-contract-smoke.ps1`. It also reuses the + shared EveUnity capture request builder through `scripts/run-eveunity-scene-capture-contract-smoke.ps1`, while the actual Unity scene PNG/frame artifact remains pending. Plugin projection adapters stay unsupported until Sai, Norn, or TeX sidecar projection support exists in @@ -520,6 +523,14 @@ Recently cut: `scripts/run-eveunity-scene-capture-contract-smoke.ps1` proves the request without pretending a Unity scene frame has been captured. The actual frame or screenshot artifact remains a split blocker for EveUnity. +- Unity scene release now uses the same UPM release request contract shape as + Unity UI Toolkit. The `unity-scene` runtime capability manifest names + `gamecult.eve.runtime_release_request.v1`, the shared + `tools/eveunity/eveunity-release-contract.mjs` request builder, + `runtimes/incubating/eve-unity-scene/package.json` as the version source, and + the `eveunity-scene-v{version}` tag/artifact pattern. + `scripts/run-eveunity-scene-release-contract-smoke.ps1` proves the request + without pretending the tagged UPM package has been published. - EveTui capture lifecycle now carries a structured pending capture request contract for terminal artifacts. `captureContract` names the TUI runtime, transcript/cell-grid capture kind, ANSI transcript or JSON grid artifact kind, diff --git a/runtimes/incubating/eve-unity-scene/eve-runtime-capability.json b/runtimes/incubating/eve-unity-scene/eve-runtime-capability.json index 1f007ab..02a81f4 100644 --- a/runtimes/incubating/eve-unity-scene/eve-runtime-capability.json +++ b/runtimes/incubating/eve-unity-scene/eve-runtime-capability.json @@ -62,9 +62,12 @@ "ownerRepo": "EveUnity", "packageName": "org.gamecult.eve.unity-scene", "packageRoot": "runtimes/incubating/eve-unity-scene", - "versionSource": "runtimes/incubating/eve-unity-scene/eve-runtime-capability.json", + "versionSource": "runtimes/incubating/eve-unity-scene/package.json", "tagPattern": "eveunity-scene-v{version}", "artifactKind": "upm-package", + "requestSchema": "gamecult.eve.runtime_release_request.v1", + "requestBuilder": "tools/eveunity/eveunity-release-contract.mjs", + "artifactPattern": "artifacts/eveunity-scene-release/{version}/org.gamecult.eve.unity-scene-{version}.tgz", "publishProof": "Tagged Unity scene package release is created from the EveUnity repo and references the provider-agnostic scene package root." }, "evidencePaths": [ @@ -72,7 +75,10 @@ "runtimes/incubating/eve-unity-scene/Runtime/GameCult.Eve.UnityScene.asmdef", "runtimes/incubating/eve-unity-scene/Runtime/EveUnitySceneSurfaceLowerer.cs", "runtimes/incubating/eve-unity-scene/eveunity-scene-split-handoff.json", - "scripts/run-eveunity-scene-split-handoff-smoke.ps1" + "scripts/run-eveunity-scene-split-handoff-smoke.ps1", + "scripts/run-eveunity-scene-release-contract-smoke.ps1", + "tools/eveunity/eveunity-release-contract.mjs", + "tools/eveunity/eveunity-release-contract.test.mjs" ], "pendingProofs": [ "Unity scene package release is cut from EveUnity rather than Eve incubation." diff --git a/scripts/run-eveunity-scene-lifecycle-smoke.ps1 b/scripts/run-eveunity-scene-lifecycle-smoke.ps1 index 65f9d05..549bcd2 100644 --- a/scripts/run-eveunity-scene-lifecycle-smoke.ps1 +++ b/scripts/run-eveunity-scene-lifecycle-smoke.ps1 @@ -105,11 +105,14 @@ foreach ($stage in @("release", "test", "capture")) { } $releaseContract = $manifest.lifecycle.release.releaseContract -foreach ($field in @("ownerRepo", "packageName", "packageRoot", "versionSource", "tagPattern", "artifactKind", "publishProof")) { +foreach ($field in @("ownerRepo", "packageName", "packageRoot", "versionSource", "tagPattern", "artifactKind", "requestSchema", "requestBuilder", "artifactPattern", "publishProof")) { if (-not $releaseContract.$field) { throw "EveUnity scene release contract missing $field" } } +if ($releaseContract.requestSchema -ne "gamecult.eve.runtime_release_request.v1") { + throw "EveUnity scene release contract has unexpected request schema: $($releaseContract.requestSchema)" +} foreach ($pathProperty in @("packageRoot", "versionSource")) { $relativePath = $releaseContract.$pathProperty $absolutePath = Join-Path $projectRoot $relativePath @@ -117,6 +120,13 @@ foreach ($pathProperty in @("packageRoot", "versionSource")) { throw "EveUnity scene release contract $pathProperty does not exist: $relativePath" } } +foreach ($pathProperty in @("requestBuilder")) { + $relativePath = $releaseContract.$pathProperty + $absolutePath = Join-Path $projectRoot $relativePath + if (-not (Test-Path -LiteralPath $absolutePath)) { + throw "EveUnity scene release contract $pathProperty does not exist: $relativePath" + } +} $testContract = $manifest.lifecycle.test.testContract foreach ($field in @("ownerRepo", "runnerKind", "runnerScript", "consumerProject", "packageName", "testAssembly", "testPlatform", "resultsArtifact", "logArtifact", "manifestMutation")) { @@ -164,6 +174,7 @@ foreach ($pathProperty in @("requestBuilder", "advertisementPath")) { & (Join-Path $projectRoot "scripts\run-eveunity-scene-split-handoff-smoke.ps1") & (Join-Path $projectRoot "scripts\run-eveunity-scene-provider-shell-smoke.ps1") +& (Join-Path $projectRoot "scripts\run-eveunity-scene-release-contract-smoke.ps1") & (Join-Path $projectRoot "scripts\run-eveunity-scene-capture-contract-smoke.ps1") Write-Host "EveUnity scene lifecycle smoke passed: $absoluteManifestPath" diff --git a/scripts/run-eveunity-scene-release-contract-smoke.ps1 b/scripts/run-eveunity-scene-release-contract-smoke.ps1 new file mode 100644 index 0000000..50f6f89 --- /dev/null +++ b/scripts/run-eveunity-scene-release-contract-smoke.ps1 @@ -0,0 +1,98 @@ +param( + [string] $CapabilityManifestPath = "runtimes\incubating\eve-unity-scene\eve-runtime-capability.json", + [string] $OutputPath = "artifacts\eveunity-scene-release-contract\latest\release-request.json" +) + +$ErrorActionPreference = "Stop" + +$projectRoot = Split-Path -Parent $PSScriptRoot +$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) { + $CapabilityManifestPath +} else { + Join-Path $projectRoot $CapabilityManifestPath +} +$absoluteOutputPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) { + $OutputPath +} else { + Join-Path $projectRoot $OutputPath +} + +if (-not (Test-Path -LiteralPath $absoluteCapabilityPath)) { + throw "EveUnity scene release contract input not found: $absoluteCapabilityPath" +} + +$manifest = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json +$releaseContract = $manifest.lifecycle.release.releaseContract +if ($null -eq $releaseContract) { + throw "EveUnity scene release contract missing lifecycle.release.releaseContract" +} +foreach ($field in @("ownerRepo", "packageName", "packageRoot", "versionSource", "tagPattern", "artifactKind", "requestSchema", "requestBuilder", "artifactPattern", "publishProof")) { + if (-not $releaseContract.$field) { + throw "EveUnity scene release contract missing $field" + } +} +if ($releaseContract.ownerRepo -ne "EveUnity") { + throw "Unexpected EveUnity scene release owner: $($releaseContract.ownerRepo)" +} +if ($releaseContract.packageName -ne "org.gamecult.eve.unity-scene") { + throw "Unexpected EveUnity scene package name: $($releaseContract.packageName)" +} +if ($releaseContract.requestSchema -ne "gamecult.eve.runtime_release_request.v1") { + throw "Unexpected EveUnity scene release request schema: $($releaseContract.requestSchema)" +} +if ($releaseContract.artifactKind -ne "upm-package") { + throw "Unexpected EveUnity scene release artifact kind: $($releaseContract.artifactKind)" +} + +$builderPath = Join-Path $projectRoot $releaseContract.requestBuilder +$packagePath = Join-Path $projectRoot $releaseContract.versionSource +$packageRoot = Join-Path $projectRoot $releaseContract.packageRoot +foreach ($path in @($builderPath, $packagePath, $packageRoot)) { + if (-not (Test-Path -LiteralPath $path)) { + throw "EveUnity scene release contract path not found: $path" + } +} + +node --test (Join-Path $projectRoot "tools\eveunity\eveunity-release-contract.test.mjs") +if ($LASTEXITCODE -ne 0) { + throw "EveUnity release contract tests failed with exit code $LASTEXITCODE" +} + +node $builderPath --capability $absoluteCapabilityPath --package $packagePath --output $absoluteOutputPath +if ($LASTEXITCODE -ne 0) { + throw "EveUnity scene release request builder failed with exit code $LASTEXITCODE" +} +if (-not (Test-Path -LiteralPath $absoluteOutputPath)) { + throw "EveUnity scene release request was not written: $absoluteOutputPath" +} + +$request = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json +$packageManifest = Get-Content -LiteralPath $packagePath -Raw | ConvertFrom-Json +foreach ($expectation in @( + @{ field = "schema"; value = "gamecult.eve.runtime_release_request.v1" }, + @{ field = "ownerRepo"; value = "EveUnity" }, + @{ field = "repository"; value = "GameCult/EveUnity" }, + @{ field = "packageName"; value = "org.gamecult.eve.unity-scene" }, + @{ field = "version"; value = $packageManifest.version }, + @{ field = "packageRoot"; value = "runtimes/incubating/eve-unity-scene" }, + @{ field = "versionSource"; value = "runtimes/incubating/eve-unity-scene/package.json" }, + @{ field = "artifactKind"; value = "upm-package" } +)) { + if ($request.($expectation.field) -ne $expectation.value) { + throw "EveUnity scene release request $($expectation.field) expected $($expectation.value) got $($request.($expectation.field))" + } +} + +$expectedTagName = $releaseContract.tagPattern.Replace("{version}", $packageManifest.version) +if ($request.tagName -ne $expectedTagName) { + throw "Unexpected EveUnity scene release tag: $($request.tagName)" +} +$expectedArtifactPath = $releaseContract.artifactPattern.Replace("{version}", $packageManifest.version) +if ($request.artifactPath -ne $expectedArtifactPath) { + throw "Unexpected EveUnity scene release artifact path: $($request.artifactPath)" +} +if ($request.dependencies."org.gamecult.eve.surface" -ne $packageManifest.dependencies."org.gamecult.eve.surface") { + throw "EveUnity scene release request lost org.gamecult.eve.surface dependency" +} + +Write-Host "EveUnity scene release contract smoke passed: $absoluteOutputPath" diff --git a/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 b/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 index 0214b03..7f3c01a 100644 --- a/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 +++ b/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 @@ -153,6 +153,10 @@ node $consumerScript $consumerExport ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.packageName:org.gamecult.eve.unity-scene" ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.artifactKind:upm-package" ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.tagPattern:eveunity-scene-v{version}" ` + --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.versionSource:runtimes/incubating/eve-unity-scene/package.json" ` + --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requestSchema:gamecult.eve.runtime_release_request.v1" ` + --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requestBuilder:tools/eveunity/eveunity-release-contract.mjs" ` + --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.artifactPattern:artifacts/eveunity-scene-release/{version}/org.gamecult.eve.unity-scene-{version}.tgz" ` --expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerKind:unity-scene-provider-shell-smoke" ` --expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerScript:scripts/run-eveunity-scene-provider-shell-smoke.ps1" ` --expect-runtime-lifecycle-field "unity-scene:capture:captureContract.captureKind:unity-scene-frame-png" ` diff --git a/tools/eveunity/eveunity-release-contract.test.mjs b/tools/eveunity/eveunity-release-contract.test.mjs index 50a0b9c..5e91492 100644 --- a/tools/eveunity/eveunity-release-contract.test.mjs +++ b/tools/eveunity/eveunity-release-contract.test.mjs @@ -5,6 +5,8 @@ import { buildUnityReleaseRequest } from "./eveunity-release-contract.mjs"; const capabilityManifest = JSON.parse(readFileSync(new URL("../../packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json", import.meta.url), "utf8")); const packageManifest = JSON.parse(readFileSync(new URL("../../packages/org.gamecult.eve.unity-uitoolkit/package.json", import.meta.url), "utf8")); +const sceneCapabilityManifest = JSON.parse(readFileSync(new URL("../../runtimes/incubating/eve-unity-scene/eve-runtime-capability.json", import.meta.url), "utf8")); +const scenePackageManifest = JSON.parse(readFileSync(new URL("../../runtimes/incubating/eve-unity-scene/package.json", import.meta.url), "utf8")); test("builds EveUnity UPM release request from package manifest", () => { const request = buildUnityReleaseRequest({ @@ -35,3 +37,24 @@ test("rejects package manifests that do not match the release contract package", /package name mismatch/, ); }); + +test("builds EveUnity scene UPM release request from package manifest", () => { + const request = buildUnityReleaseRequest({ + capabilityManifest: sceneCapabilityManifest, + packageManifest: scenePackageManifest, + capabilityManifestPath: "runtimes/incubating/eve-unity-scene/eve-runtime-capability.json", + packageManifestPath: "runtimes/incubating/eve-unity-scene/package.json", + }); + + assert.equal(request.schema, "gamecult.eve.runtime_release_request.v1"); + assert.equal(request.ownerRepo, "EveUnity"); + assert.equal(request.repository, "GameCult/EveUnity"); + assert.equal(request.packageName, "org.gamecult.eve.unity-scene"); + assert.equal(request.version, "0.1.0"); + assert.equal(request.packageRoot, "runtimes/incubating/eve-unity-scene"); + assert.equal(request.versionSource, "runtimes/incubating/eve-unity-scene/package.json"); + assert.equal(request.tagName, "eveunity-scene-v0.1.0"); + assert.equal(request.artifactKind, "upm-package"); + assert.equal(request.artifactPath, "artifacts/eveunity-scene-release/0.1.0/org.gamecult.eve.unity-scene-0.1.0.tgz"); + assert.equal(request.dependencies["org.gamecult.eve.surface"], "0.1.0"); +}); diff --git a/tools/parity/parity-manifest.json b/tools/parity/parity-manifest.json index 56665f1..21be69c 100644 --- a/tools/parity/parity-manifest.json +++ b/tools/parity/parity-manifest.json @@ -922,8 +922,11 @@ "runtimes/incubating/eve-unity-scene/eve-runtime-capability.json", "runtimes/incubating/eve-unity-scene/eveunity-scene-split-handoff.json", "scripts/run-eveunity-scene-lifecycle-smoke.ps1", + "scripts/run-eveunity-scene-release-contract-smoke.ps1", "scripts/run-eveunity-scene-provider-shell-smoke.ps1", "scripts/run-eveunity-scene-capture-contract-smoke.ps1", + "tools/eveunity/eveunity-release-contract.mjs", + "tools/eveunity/eveunity-release-contract.test.mjs", "tools/eveunity/eveunity-capture-contract.mjs", "tools/eveunity/eveunity-capture-contract.test.mjs" ], @@ -939,6 +942,10 @@ { "path": "tools/eveunity/eveunity-capture-contract.test.mjs", "contains": ["builds Unity scene capture request from provider advertisement", "unity-scene", "artifacts/eveunity-scene-capture/smoke/unity-scene.png"] + }, + { + "path": "tools/eveunity/eveunity-release-contract.test.mjs", + "contains": ["builds EveUnity scene UPM release request from package manifest", "eveunity-scene-v0.1.0", "artifacts/eveunity-scene-release/0.1.0/org.gamecult.eve.unity-scene-0.1.0.tgz"] } ], "capture": {