From 0f16f1441517252ff0e1455d0567f1206eaa97a0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 22 Jul 2026 03:01:08 +0100 Subject: [PATCH] Add dedicated Geometry Unity package --- ...th-gamecult-geometry-migration-progress.md | 19 +++-- scripts/build-geometry-unity-package.ps1 | 70 +++++++++++++++++++ unity/org.gamecult.geometry/README.md | 12 ++++ .../Runtime/GameCult.Geometry.asmdef | 19 +++++ unity/org.gamecult.geometry/package.json | 15 ++++ 5 files changed, 130 insertions(+), 5 deletions(-) create mode 100644 scripts/build-geometry-unity-package.ps1 create mode 100644 unity/org.gamecult.geometry/README.md create mode 100644 unity/org.gamecult.geometry/Runtime/GameCult.Geometry.asmdef create mode 100644 unity/org.gamecult.geometry/package.json diff --git a/docs/cultmath-gamecult-geometry-migration-progress.md b/docs/cultmath-gamecult-geometry-migration-progress.md index d872a6c2..ab9b8455 100644 --- a/docs/cultmath-gamecult-geometry-migration-progress.md +++ b/docs/cultmath-gamecult-geometry-migration-progress.md @@ -4,7 +4,7 @@ Plan: `docs/cultmath-gamecult-geometry-migration-plan.md` (locked) Started: 2026-07-22 -Status: Stage 0 complete; Stage 1 in progress +Status: Stages 0-1 complete; Stage 2 in progress ## Objective @@ -55,8 +55,8 @@ Demotions: | Stage | State | Evidence / next gate | | --- | --- | --- | | 0. Freeze and baseline | Complete | Source bodies, contracts, consumers, licenses, fixtures, and focused baselines mapped | -| 1. Destination/dependency/formatters/SoA | In progress | Resolver ownership and exact unmanaged-column support are the first cuts | -| 2. Primitive deletion and v2 schemas | Pending | Requires intact CultMath vector serialization and SoA | +| 1. Destination/dependency/formatters/SoA | Complete | NuGet and dedicated UPM artifacts prove dependency direction and owned vector integration | +| 2. Primitive deletion and v2 schemas | In progress | Delete duplicate vectors first, then publish corrected v2 contracts | | 3. Planetary transfer | Pending | Requires destination packaging and preserved parity corpus | | 4. Mine `vg-csg` | Pending | Requires v1 fixture capture and target Rust package seam | | 5. CultCache/CultNet/CultMesh integration | Pending | Requires current schemas and runtime packages | @@ -135,6 +135,12 @@ a broader stage gate. selected-cut, and chunk record keys. Focused Rust tests passed 4/4; formatting and clippy passed. VibeGeometry commit `82b56db` advances its submodule to that witness commit. Both migration branches are pushed. +- `scripts/build-geometry-unity-package.ps1` staged + `org.gamecult.geometry@0.1.0` successfully. Its manifest depends explicitly + on `org.gamecult.cultmath@0.1.0` and `org.gamecult.cultlib@1.0.7`; the package + contains only its owned `GameCult.Geometry.dll`/symbols plus its asmdef and + documentation. It neither duplicates CultMath nor buries Geometry inside the + CultLib Unity package. ## Decisions and Deviations @@ -152,5 +158,8 @@ a broader stage gate. ## Next Actions -1. Establish and inspect the dedicated `org.gamecult.geometry` UPM artifact. -2. Begin Stage 2 only after the Unity dependency/layout gate is proven. +1. Rewrite Geometry primitives over CultMath and delete `CultVec2`/`CultVec3` + without aliases or forwarding types. +2. Publish v2 geometry documents with typed vectors/quaternion and deliberate + stable-key fixtures; keep v1 only as test evidence. +3. Run repository/package negative searches before beginning planetary transfer. diff --git a/scripts/build-geometry-unity-package.ps1 b/scripts/build-geometry-unity-package.ps1 new file mode 100644 index 00000000..c5665b1e --- /dev/null +++ b/scripts/build-geometry-unity-package.ps1 @@ -0,0 +1,70 @@ +param( + [string] $Configuration = "Release", + [string] $OutputDirectory = "artifacts\unity\org.gamecult.geometry", + [string] $CultMathCandidateFeed = "..\CultMath\.tools\local-feed" +) + +$ErrorActionPreference = "Stop" + +$repoRoot = Split-Path -Parent $PSScriptRoot +$projectPath = Join-Path $repoRoot "src\GameCult.Geometry\GameCult.Geometry.csproj" +$templateRoot = Join-Path $repoRoot "unity\org.gamecult.geometry" +$publishRoot = Join-Path $repoRoot "artifacts\geometry-unity-publish" +$outputRoot = if ([System.IO.Path]::IsPathRooted($OutputDirectory)) { + $OutputDirectory +} else { + Join-Path $repoRoot $OutputDirectory +} +$candidateFeed = if ([System.IO.Path]::IsPathRooted($CultMathCandidateFeed)) { + $CultMathCandidateFeed +} else { + Join-Path $repoRoot $CultMathCandidateFeed +} +$pluginRoot = Join-Path $outputRoot "Runtime\Plugins" + +if (-not (Test-Path -LiteralPath (Join-Path $candidateFeed "CultMath.0.1.0-geometry-migration.1.nupkg"))) { + throw "CultMath migration candidate is missing from $candidateFeed. Pack CultMath before staging Geometry." +} + +if (Test-Path -LiteralPath $publishRoot) { + Remove-Item -LiteralPath $publishRoot -Recurse -Force +} +if (Test-Path -LiteralPath $outputRoot) { + Remove-Item -LiteralPath $outputRoot -Recurse -Force +} + +dotnet restore $projectPath --disable-build-servers -p:CultMathCandidateFeed=$candidateFeed -p:UseSharedCompilation=false -m:1 +if ($LASTEXITCODE -ne 0) { + throw "GameCult.Geometry restore failed with exit code $LASTEXITCODE" +} + +dotnet publish $projectPath -c $Configuration -o $publishRoot --no-restore --disable-build-servers -p:UseSharedCompilation=false -m:1 +if ($LASTEXITCODE -ne 0) { + throw "GameCult.Geometry publish failed with exit code $LASTEXITCODE" +} + +New-Item -ItemType Directory -Force -Path $pluginRoot | Out-Null +Copy-Item -LiteralPath (Join-Path $templateRoot "package.json") -Destination $outputRoot +Copy-Item -LiteralPath (Join-Path $templateRoot "README.md") -Destination $outputRoot +Copy-Item -LiteralPath (Join-Path $templateRoot "Runtime\GameCult.Geometry.asmdef") -Destination (Join-Path $outputRoot "Runtime") + +$geometryAssembly = Join-Path $publishRoot "GameCult.Geometry.dll" +if (-not (Test-Path -LiteralPath $geometryAssembly)) { + throw "Geometry Unity package is missing GameCult.Geometry.dll" +} +Copy-Item -LiteralPath $geometryAssembly -Destination $pluginRoot +$geometrySymbols = [System.IO.Path]::ChangeExtension($geometryAssembly, ".pdb") +if (Test-Path -LiteralPath $geometrySymbols) { + Copy-Item -LiteralPath $geometrySymbols -Destination $pluginRoot +} + +$manifest = Get-Content -LiteralPath (Join-Path $outputRoot "package.json") -Raw | ConvertFrom-Json +$stagedAssemblies = @(Get-ChildItem -LiteralPath $pluginRoot -Filter "*.dll") +if ($stagedAssemblies.Count -ne 1 -or $stagedAssemblies[0].Name -ne "GameCult.Geometry.dll") { + throw "Geometry package must stage only its owned assembly; found: $($stagedAssemblies.Name -join ', ')" +} + +Write-Host "GameCult.Geometry Unity package: $outputRoot" +Write-Host "Package: $($manifest.name)@$($manifest.version)" +Write-Host "Dependencies: $($manifest.dependencies.PSObject.Properties.Name -join ', ')" +Write-Host "Managed assemblies: $($stagedAssemblies.Count)" diff --git a/unity/org.gamecult.geometry/README.md b/unity/org.gamecult.geometry/README.md new file mode 100644 index 00000000..7a6e0823 --- /dev/null +++ b/unity/org.gamecult.geometry/README.md @@ -0,0 +1,12 @@ +# GameCult.Geometry for Unity + +This package is the Unity projection of the GameCult.Geometry authority. It +depends on `org.gamecult.cultmath` for numeric primitives and +`org.gamecult.cultlib` for CultCache/CultNet/CultMesh integration. + +Build it with `scripts/build-geometry-unity-package.ps1`. Do not edit generated +plugin assemblies in the package output. + +CultLib-authored files are MIT licensed. Geometry sources transferred from +CultMath retain their MPL-2.0 notices and provenance; those files will be listed +here as they enter this package. No transferred CultMath source is relicensed. diff --git a/unity/org.gamecult.geometry/Runtime/GameCult.Geometry.asmdef b/unity/org.gamecult.geometry/Runtime/GameCult.Geometry.asmdef new file mode 100644 index 00000000..ea9a8c9f --- /dev/null +++ b/unity/org.gamecult.geometry/Runtime/GameCult.Geometry.asmdef @@ -0,0 +1,19 @@ +{ + "name": "GameCult.Geometry", + "rootNamespace": "GameCult.Geometry", + "references": [ + "CultMath", + "GameCult.CultLib" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [ + "GameCult.Geometry.dll" + ], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": true +} diff --git a/unity/org.gamecult.geometry/package.json b/unity/org.gamecult.geometry/package.json new file mode 100644 index 00000000..023fed98 --- /dev/null +++ b/unity/org.gamecult.geometry/package.json @@ -0,0 +1,15 @@ +{ + "name": "org.gamecult.geometry", + "displayName": "GameCult.Geometry", + "version": "0.1.0", + "unity": "2021.3", + "description": "GameCult geometry values, typed state contracts, and runtime algorithms built on CultMath primitives.", + "license": "SEE LICENSES IN README.md", + "author": { + "name": "GameCult" + }, + "dependencies": { + "org.gamecult.cultmath": "0.1.0", + "org.gamecult.cultlib": "1.0.7" + } +}