Add dedicated Geometry Unity package

This commit is contained in:
Meta Vens 2026-07-22 03:01:08 +01:00
commit 0f16f14415
5 changed files with 130 additions and 5 deletions

View file

@ -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.

View file

@ -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)"

View file

@ -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.

View file

@ -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
}

View file

@ -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"
}
}