From 59aca27b673086e65b9c68a52193a357694626e0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 13 Sep 2026 17:45:53 +0200 Subject: [PATCH] Add CI drift guard for the CultNet contracts consolidation REC-032 commit 2: fail cultnet-interop.yml before it installs Node dependencies if either negative check from commit 1 finds anything: a *.schema.json file living outside contracts/cultnet/, or a lingering reference to the retired https://github.com/GameCult/cultnet-ts/contracts (or .../integration/contracts) namespace anywhere but .voidbot/birth snapshots. The old-namespace grep uses git grep -I so the deferred Unity plugin DLL (D4, not rebuilt in this pass) doesn't trip a permanent false failure. Verified locally: staging a stray contracts/stray.schema.json and a stray-id.ts referencing the old namespace makes the guard's logic report failure for both; removing them makes it pass again against the real tree. REC-032. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/cultnet-interop.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/cultnet-interop.yml b/.github/workflows/cultnet-interop.yml index 6876a76a..4000cc1c 100644 --- a/.github/workflows/cultnet-interop.yml +++ b/.github/workflows/cultnet-interop.yml @@ -65,6 +65,29 @@ jobs: "KOTLIN_JAVA_HOME=$env:JAVA_HOME" | Out-File -FilePath $env:GITHUB_ENV -Append "$kotlinHome\bin" | Out-File -FilePath $env:GITHUB_PATH -Append + - name: Verify CultNet schema contracts stayed consolidated + shell: pwsh + run: | + $ErrorActionPreference = "Stop" + $stray = git ls-files '*.schema.json' | Where-Object { $_ -notmatch '^contracts/cultnet/' } + # -I skips binary files: unity/org.gamecult.cultlib/Runtime/Plugins/GameCult.Networking.dll + # still embeds the retired namespace until it is rebuilt (REC-032 D4, deferred). + $oldNamespace = git grep -I -lE 'GameCult/cultnet-ts/(integration/)?contracts' -- ':!.voidbot' + if ($LASTEXITCODE -eq 2) { + throw "git grep failed" + } + if ($stray) { + Write-Host "Schema files found outside contracts/cultnet/:" + $stray | ForEach-Object { Write-Host " $_" } + } + if ($oldNamespace) { + Write-Host "Files still referencing the retired GameCult/cultnet-ts contracts namespace:" + $oldNamespace | ForEach-Object { Write-Host " $_" } + } + if ($stray -or $oldNamespace) { + throw "CultNet schema contracts drifted out of contracts/cultnet/ (REC-032). See CultLib/contracts/cultnet/ and rewrite any `$id back to https://github.com/GameCult/CultLib/contracts/cultnet/." + } + - name: Install Node dependencies run: npm install --no-package-lock