cultlib byte gate: the refusal names toolchain drift beside a source change, and says what to check

Unchanged CultMath source built on another SDK or host gives other bytes (Linux sdk:10.0:
db2a11cc against tracked 6781bf20), so the refusal no longer sends the operator to release a
CultMath with no change (Soul finding cut-3-gate.s1.toolchain-drift-named-as-source-change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-03 13:00:54 +02:00
commit 1eece6beef
2 changed files with 8 additions and 4 deletions

View file

@ -285,7 +285,10 @@ It is wired into:
CultMath package's version and every `CultMath.dll` it built equals the one
that package tracks, byte for byte. Any CultMath source change therefore means:
release `org.gamecult.cultmath`, declare its new version in
`org.gamecult.cultlib`, then release `org.gamecult.cultlib`.
`org.gamecult.cultlib`, then release `org.gamecult.cultlib`. The bytes also
depend on the .NET SDK and host, which no `global.json` pins, so the same
refusal at unchanged CultMath source means this toolchain differs from the one
that built the tracked DLL.
### Coverage gaps

View file

@ -42,8 +42,9 @@ $unityPackageVersion = (Get-Content -LiteralPath (Join-Path $templateRoot "packa
# (1) The declared dependency version must equal the CultMath package's own version. Checked here,
# before anything is built.
# (2) Every CultMath.dll the publishes below produce must equal, byte for byte, the one that package
# tracks. Checked once they exist. The builds are deterministic, so a mismatch means the CultMath
# source changed since that package was released.
# tracks. Checked once they exist. The builds are deterministic for one toolchain, so a mismatch
# means the CultMath source changed since that package was released, or this SDK, compiler or host
# builds different bytes from the one that built the tracked DLL (no global.json pins the SDK).
$cultMathPackageRoot = Join-Path $repoRoot "packages\cultmath\unity\org.gamecult.cultmath"
$cultMathDeclared = (Get-Content -LiteralPath (Join-Path $templateRoot "package.json") -Raw | ConvertFrom-Json).dependencies.'org.gamecult.cultmath'
$cultMathAvailable = (Get-Content -LiteralPath (Join-Path $cultMathPackageRoot "package.json") -Raw | ConvertFrom-Json).version
@ -91,7 +92,7 @@ foreach ($publish in $managedPublishes) {
$builtCultMath = Join-Path $publish.Root "CultMath.dll"
if (-not (Test-Path -LiteralPath $builtCultMath)) { continue }
if ((Get-FileHash -LiteralPath $builtCultMath -Algorithm SHA256).Hash -ne $cultMathTrackedHash) {
throw "Release order: the CultMath.dll built into $($publish.Root) differs from the one org.gamecult.cultmath $cultMathAvailable tracks; CultMath source changed since that release. Release CultMath first, then declare its version."
throw "Release order: the CultMath.dll built into $($publish.Root) differs from the one org.gamecult.cultmath $cultMathAvailable tracks. Either CultMath source changed since that release, or this toolchain builds different bytes from the one that built the tracked DLL. Check first: git log cultmath-unity-v$cultMathAvailable.. -- packages/cultmath/src for a source change, then dotnet --version and the host against the build that produced the tracked DLL. A source change means release CultMath first, then declare its version; a toolchain difference means build with the toolchain that produced the tracked DLL."
}
$cultMathComparedRoots += $publish.Root
}