Remove runtime-specific authority policy paths

This commit is contained in:
Meta Vens 2026-07-06 01:37:30 +01:00
commit 0e2665d19b
2 changed files with 36 additions and 44 deletions

View file

@ -16147,6 +16147,12 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root)
"org.gamecult.aetheria.state",
"Runtime",
"AetheriaRuntimeGameViewportDocuments.cs");
var verseAuthorityPolicyPath = Path.Combine(
root,
"Packages",
"org.gamecult.aetheria.state",
"Runtime",
"AetheriaRuntimeVerseAuthorityPolicy.cs");
var stateBoundaryPath = Path.Combine(
root,
"Packages",
@ -16182,6 +16188,9 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root)
var gameViewportDocuments = File.Exists(gameViewportDocumentsPath)
? File.ReadAllText(gameViewportDocumentsPath)
: throw new InvalidOperationException("Cannot verify daemon projectile authority; zone render documents are missing.");
var verseAuthorityPolicy = File.Exists(verseAuthorityPolicyPath)
? File.ReadAllText(verseAuthorityPolicyPath)
: throw new InvalidOperationException("Cannot verify runtime-neutral Verse authority policy; policy document is missing.");
var stateBoundary = File.Exists(stateBoundaryPath)
? File.ReadAllText(stateBoundaryPath)
: throw new InvalidOperationException("Cannot verify runtime-neutral client target authority; state boundary is missing.");
@ -16292,6 +16301,33 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root)
"Daemon combat regressed to runtime-named simulation, hardcoded game feel, direct target damage, or local projectile physics instead of daemon settings plus Ymir-shaped projectile contact damage.");
}
var forbiddenRuntimeSpecificAuthorityPolicySymbols = new[]
{
"ElectronLaunchedDaemon",
"electron-launched-daemon",
"UnityHost(",
"unity-host",
"BrowserWasmHost",
"browser-wasm-host",
"UnityPlayer",
"unity-player",
"BrowserObserver",
"browser-observer",
"BrowserSimulationHost",
"browser-simulation-host",
"aetheria-unity-host",
"aetheria.unity-host.v1"
};
var runtimeSpecificAuthorityPolicyHits = forbiddenRuntimeSpecificAuthorityPolicySymbols
.Where(symbol => verseAuthorityPolicy.Contains(symbol, StringComparison.Ordinal))
.ToArray();
if (runtimeSpecificAuthorityPolicyHits.Length > 0)
{
throw new InvalidOperationException(
"Shared Verse authority policy must describe daemon/trusted authority, not runtime-specific host side paths: " +
string.Join(", ", runtimeSpecificAuthorityPolicyHits));
}
if (!daemonTickRunner.Contains("AetheriaRuntimeDaemonSimulation.Step(", StringComparison.Ordinal) ||
!daemonTickRunner.Contains("public AetheriaRuntimeDaemonSimulationSettings SimulationSettings { get; set; }", StringComparison.Ordinal) ||
!daemonTickRunner.Contains("AetheriaRuntimeDaemonSimulationSettings.AetheriaDefault", StringComparison.Ordinal) ||

View file

@ -29,9 +29,6 @@ namespace GameCult.Aetheria.State.Verse
public static class AetheriaRuntimeVerseDeploymentModes
{
public const string DedicatedDaemon = "dedicated-daemon";
public const string ElectronLaunchedDaemon = "electron-launched-daemon";
public const string UnityHost = "unity-host";
public const string BrowserWasmHost = "browser-wasm-host";
public const string NativeKernelHost = "native-kernel-host";
public const string DistributedTrusted = "distributed-trusted";
public const string ObserverOnly = "observer-only";
@ -40,10 +37,7 @@ namespace GameCult.Aetheria.State.Verse
public static class AetheriaRuntimeVerseRuntimeRoles
{
public const string SimulationHost = "simulation-host";
public const string UnityPlayer = "unity-player";
public const string StarbridgeCommander = "starbridge-commander";
public const string BrowserObserver = "browser-observer";
public const string BrowserSimulationHost = "browser-simulation-host";
public const string NativeSimulationKernel = "native-simulation-kernel";
public const string DedicatedDaemon = "dedicated-daemon";
}
@ -114,44 +108,6 @@ namespace GameCult.Aetheria.State.Verse
}
};
}
public static AetheriaRuntimeVerseAuthorityPolicyDocument UnityHost(
string verseId,
string unityRuntimeId)
{
var runtimeId = string.IsNullOrWhiteSpace(unityRuntimeId) ? "aetheria-unity-host" : unityRuntimeId;
return new AetheriaRuntimeVerseAuthorityPolicyDocument
{
VerseId = string.IsNullOrWhiteSpace(verseId) ? "aetheria.local" : verseId,
PolicyId = "aetheria.unity-host.v1",
HostRuntimeId = runtimeId,
DefaultMode = AetheriaRuntimeAuthorityModes.HostAuthoritative,
DeploymentMode = AetheriaRuntimeVerseDeploymentModes.UnityHost,
UpdatedAtUtc = DateTime.UtcNow.ToString("O"),
RuntimeRoles = new[]
{
new AetheriaRuntimeAuthorityRuntimeRole
{
RuntimeId = runtimeId,
Roles = new[]
{
AetheriaRuntimeVerseRuntimeRoles.UnityPlayer,
AetheriaRuntimeVerseRuntimeRoles.SimulationHost
}
}
},
Rules = new[]
{
new AetheriaRuntimeAuthorityRule
{
RuleId = "unity-host.default",
SubjectPrefix = "*",
ClaimKinds = new[] { AetheriaRuntimeClaimKinds.Any },
Mode = AetheriaRuntimeAuthorityModes.HostAuthoritative
}
}
};
}
}
[MessagePackObject]