From e1506d4db029036b7977e10098088d81207f97e4 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 5 Jul 2026 21:16:38 +0100 Subject: [PATCH] Neutralize Unity runtime client fallback --- Aetheria.State.Verify/Program.cs | 10 ++++++++-- Aetheria.State/scripts/verify-stage7d-unity-parity.ps1 | 2 ++ .../Gameplay/AetheriaUnityRuntimeClientProvider.cs | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 2c89f9248..f9be30ffb 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -16102,6 +16102,7 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeClientTargetStore.cs"); + var runtimeClientProviderPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "AetheriaUnityRuntimeClientProvider.cs"); var rtsLocalDocumentsPath = Path.Combine(root, "Aetheria.Rts.Web", "Electron", "aetheria-rts-local-documents.ts"); var authoritySmokePath = Path.Combine(root, "Aetheria.State.AuthoritySmoke", "Program.cs"); var freezePath = Path.Combine(root, "Aetheria.State.Freeze", "Program.cs"); @@ -16129,6 +16130,9 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) var clientTargetStore = File.Exists(clientTargetStorePath) ? File.ReadAllText(clientTargetStorePath) : throw new InvalidOperationException("Cannot verify runtime-neutral client target authority; client target store is missing."); + var runtimeClientProvider = File.Exists(runtimeClientProviderPath) + ? File.ReadAllText(runtimeClientProviderPath) + : throw new InvalidOperationException("Cannot verify runtime-neutral client target authority; Unity runtime client provider is missing."); var rtsLocalDocuments = File.Exists(rtsLocalDocumentsPath) ? File.ReadAllText(rtsLocalDocumentsPath) : throw new InvalidOperationException("Cannot verify daemon projectile authority; Electron local projection is missing."); @@ -16269,10 +16273,12 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) } if (stateBoundary.Contains("UnityRuntimeIdOverrideEnvironmentVariable", StringComparison.Ordinal) || stateBoundary.Contains("AETHERIA_UNITY_RUNTIME_ID", StringComparison.Ordinal) || - clientTargetStore.Contains("raven-unity", StringComparison.Ordinal)) + clientTargetStore.Contains("raven-unity", StringComparison.Ordinal) || + runtimeClientProvider.Contains("raven-unity", StringComparison.Ordinal) || + !runtimeClientProvider.Contains("AetheriaRuntimeStateBoundary.DefaultClientRuntimeId", StringComparison.Ordinal)) { throw new InvalidOperationException( - "Aetheria shared client-target authority must use generic runtime identity only; Unity-specific defaults and environment fallbacks belong at the Unity edge."); + "Aetheria shared client-target authority must use generic runtime identity only; Unity-specific defaults and environment fallbacks must not survive as ambient provider defaults."); } var sharedRuntimeText = string.Join( diff --git a/Aetheria.State/scripts/verify-stage7d-unity-parity.ps1 b/Aetheria.State/scripts/verify-stage7d-unity-parity.ps1 index 38f318358..ab70dbc1d 100644 --- a/Aetheria.State/scripts/verify-stage7d-unity-parity.ps1 +++ b/Aetheria.State/scripts/verify-stage7d-unity-parity.ps1 @@ -356,6 +356,8 @@ $renderSettingsBridge = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityRenderSe $cockpitHudShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityCockpitHudShell.cs" $gameplayBootShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityGameplayBootShell.cs" $sceneWiring = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityGameplaySceneWiring.cs" +Assert-Contains $runtimeClientProvider "AetheriaRuntimeStateBoundary.DefaultClientRuntimeId" "Unity runtime provider must default unnamed readers to the shared client runtime identity." +Assert-NotContains $runtimeClientProvider "raven-unity" "Unity runtime provider must not preserve a Unity-branded ambient runtime id." Assert-Contains $actionGameManager "private readonly AetheriaUnityPresentationEntityIndex _presentationEntityIndex" "ActionGameManager must keep observed entity adaptation behind an explicit helper." Assert-Contains $actionGameManager "private AetheriaClientState _gameplayState;" "ActionGameManager must cache the managed CultMesh state handle for gameplay reads." Assert-Contains $actionGameManager "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-action-game-manager"")" "ActionGameManager must grab gameplay state through the Unity runtime provider." diff --git a/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs b/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs index 27eeb8287..dc92505b3 100644 --- a/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs +++ b/Assets/Scripts/Gameplay/AetheriaUnityRuntimeClientProvider.cs @@ -28,7 +28,9 @@ public static class AetheriaUnityRuntimeClientProvider private static AetheriaClient ResolveClient(string stateFilePath, string runtimeId = "") { - var effectiveRuntimeId = string.IsNullOrWhiteSpace(runtimeId) ? "raven-unity" : runtimeId; + var effectiveRuntimeId = string.IsNullOrWhiteSpace(runtimeId) + ? AetheriaRuntimeStateBoundary.DefaultClientRuntimeId + : runtimeId; var cacheKey = CacheKey(stateFilePath, effectiveRuntimeId); if (RuntimeClients.TryGetValue(cacheKey, out var runtimeClient)) return runtimeClient;