diff --git a/Aetheria.State.AuthoritySmoke/Program.cs b/Aetheria.State.AuthoritySmoke/Program.cs index d4a8e3db7..b2e4ae320 100644 --- a/Aetheria.State.AuthoritySmoke/Program.cs +++ b/Aetheria.State.AuthoritySmoke/Program.cs @@ -728,10 +728,10 @@ internal sealed class AuthoritySmokeChecks { var smokeId = Guid.NewGuid().ToString("N"); var statePath = Path.Combine(Path.GetTempPath(), $"aetheria-starbridge-daemon-{smokeId}.cc"); - var rtsPort = GetFreeUdpPort(); + var clientCultMeshPort = GetFreeUdpPort(); const string runtimeId = "starbridge-daemon-smoke"; - await RunDaemonOnceAsync(statePath, runtimeId, rtsPort).ConfigureAwait(false); + await RunDaemonOnceAsync(statePath, runtimeId, clientCultMeshPort).ConfigureAwait(false); using var client = await AetheriaClient .OpenAsync(statePath, "starbridge-smoke-client", sessionId: "authority-smoke", pullOnOpen: true) @@ -801,7 +801,7 @@ internal sealed class AuthoritySmokeChecks "raven-local", policy, [ravenByRaven, hostileByRaven]).ConfigureAwait(false); - await RunDaemonOnceAsync(ravenStatePath, "raven-local", rtsPort: 41076).ConfigureAwait(false); + await RunDaemonOnceAsync(ravenStatePath, "raven-local", clientCultMeshPort: 41076).ConfigureAwait(false); var ravenFrame = await ReadPublishedFrameAsync(ravenStatePath, "raven-local").ConfigureAwait(false); Require(ravenFrame.AppliedCommandIds.Contains(ravenByRaven.CommandId), "raven daemon should apply Raven-authored Raven movement"); @@ -817,7 +817,7 @@ internal sealed class AuthoritySmokeChecks "starfire-local", policy, [ravenByStarfire, hostileByStarfire]).ConfigureAwait(false); - await RunDaemonOnceAsync(starfireStatePath, "starfire-local", rtsPort: 41077).ConfigureAwait(false); + await RunDaemonOnceAsync(starfireStatePath, "starfire-local", clientCultMeshPort: 41077).ConfigureAwait(false); var starfireFrame = await ReadPublishedFrameAsync(starfireStatePath, "starfire-local").ConfigureAwait(false); Require(starfireFrame.RejectedCommandIds.Contains(ravenByStarfire.CommandId), "starfire daemon should reject Starfire-authored Raven movement"); @@ -1137,25 +1137,25 @@ internal sealed class AuthoritySmokeChecks private static async Task RunDaemonOnceAsync( string statePath, string runtimeId, - int rtsPort) + int clientCultMeshPort) { - using var process = StartDaemonProcess(statePath, runtimeId, rtsPort, once: true); + using var process = StartDaemonProcess(statePath, runtimeId, clientCultMeshPort, once: true); await WaitForProcessSuccessAsync(process, runtimeId, TimeSpan.FromSeconds(90)).ConfigureAwait(false); } private static Process StartDaemonProcess( string statePath, string runtimeId, - int rtsPort, + int clientCultMeshPort, bool once) { - return StartDaemonProcess(statePath, runtimeId, rtsPort, once, peerEndpoints: null); + return StartDaemonProcess(statePath, runtimeId, clientCultMeshPort, once, peerEndpoints: null); } private static Process StartDaemonProcess( string statePath, string runtimeId, - int rtsPort, + int clientCultMeshPort, bool once, IReadOnlyList? peerEndpoints) { @@ -1195,8 +1195,8 @@ internal sealed class AuthoritySmokeChecks "aetheria.coop-smoke", "--session-id", "authority-smoke", - "--rts-cultmesh-port", - rtsPort.ToString(), + "--client-cultmesh-port", + clientCultMeshPort.ToString(), "--api-publication-interval-ms", "50", string.Join(" ", (peerEndpoints ?? Array.Empty()) diff --git a/Aetheria.State.Daemon/Program.cs b/Aetheria.State.Daemon/Program.cs index 60a16f3f3..fafa05b43 100644 --- a/Aetheria.State.Daemon/Program.cs +++ b/Aetheria.State.Daemon/Program.cs @@ -2421,6 +2421,7 @@ internal sealed class AetheriaDaemonHostOptions var clientCultMeshAdvertiseHost = ReadOption(args, "--client-cultmesh-advertise-host"); var clientCultMeshPort = ReadNonNegativeInt(args, "--client-cultmesh-port") ?? 3076; var aetheriaResourcesRoot = ReadOption(args, "--aetheria-resources-root"); + RejectRemovedOption(args, "--rts-cultmesh-port", "--client-cultmesh-port"); RejectRemovedOption(args, "--peer-cultmesh-endpoint", "Odin-discovered CultMesh peer documents"); RejectRemovedOption(args, "--odin-cultmesh-rudp", "--odin-cultmesh-uri"); RejectRemovedOption(args, "--odin-cultnet-rudp", "--odin-cultmesh-uri"); diff --git a/Aetheria.State.Freeze/Program.cs b/Aetheria.State.Freeze/Program.cs index 55af43f4d..b1557c09d 100644 --- a/Aetheria.State.Freeze/Program.cs +++ b/Aetheria.State.Freeze/Program.cs @@ -87,27 +87,30 @@ static async Task ExportFixtureSetAsync( .OpenAsync(statePath, runtimeId: "aetheria-freeze", startServer: false) .ConfigureAwait(false); - var frame = await node.LatestFrame().ReadAsync().ConfigureAwait(false); + var frame = await node.MutableDocument( + AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest) + .ReadAsync() + .ConfigureAwait(false); if (frame == null) throw new InvalidOperationException("Freeze export cannot continue because the daemon latest frame is missing."); WriteArtifact(outputDirectory, manifest, "daemon-frame.latest", AetheriaRuntimeDaemonSchemas.Frame, frame); - if (await TryReadAsync(() => node.Health().ReadAsync()).ConfigureAwait(false) is { } health) + if (await TryReadDocumentAsync(node, AetheriaRuntimeVerseRecordKeys.DaemonHealth).ConfigureAwait(false) is { } health) WriteArtifact(outputDirectory, manifest, "daemon-health.latest", AetheriaRuntimeDaemonSchemas.Health, health); - if (await TryReadAsync(() => node.ProviderAdvertisement().ReadAsync()).ConfigureAwait(false) is { } provider) + if (await TryReadDocumentAsync(node, AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement).ConfigureAwait(false) is { } provider) WriteArtifact(outputDirectory, manifest, "daemon-provider.latest", AetheriaRuntimeDaemonSchemas.ProviderAdvertisement, provider); - if (await TryReadAsync(() => node.CommandBoundary().ReadAsync()).ConfigureAwait(false) is { } commandBoundary) + if (await TryReadDocumentAsync(node, AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary).ConfigureAwait(false) is { } commandBoundary) WriteArtifact(outputDirectory, manifest, "daemon-command-boundary.latest", AetheriaRuntimeDaemonSchemas.CommandBoundary, commandBoundary); - if (await TryReadAsync(() => node.VerseAuthorityPolicy().ReadAsync()).ConfigureAwait(false) is { } authorityPolicy) + if (await TryReadDocumentAsync(node, AetheriaRuntimeVerseRecordKeys.VerseAuthorityPolicy).ConfigureAwait(false) is { } authorityPolicy) WriteArtifact(outputDirectory, manifest, "verse-authority-policy.latest", AetheriaRuntimeVerseAuthoritySchemas.Policy, authorityPolicy); - if (await TryReadAsync(() => node.StarbridgeSessionSummary().ReadAsync()).ConfigureAwait(false) is { } starbridgeSummary) + if (await TryReadDocumentAsync(node, AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary).ConfigureAwait(false) is { } starbridgeSummary) WriteArtifact(outputDirectory, manifest, "starbridge-session-summary.latest", AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary, starbridgeSummary); - if (await TryReadAsync(() => node.LatestSoaView().ReadAsync()).ConfigureAwait(false) is { } soaView) + if (await TryReadDocumentAsync(node, AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest).ConfigureAwait(false) is { } soaView) WriteArtifact(outputDirectory, manifest, "daemon-soa-view.latest", AetheriaRuntimeDaemonSchemas.SoaView, soaView); var viewport = new AetheriaRuntimeViewportBounds @@ -117,7 +120,7 @@ static async Task ExportFixtureSetAsync( MaxX = options.ViewportMaxX, MaxY = options.ViewportMaxY }; - WriteArtifact(outputDirectory, manifest, "document.rts-viewport", AetheriaRuntimeDaemonSchemas.GameViewport, AetheriaRuntimeGameDocuments.Viewport(frame, viewport)); + WriteArtifact(outputDirectory, manifest, "document.game-viewport", AetheriaRuntimeDaemonSchemas.GameViewport, AetheriaRuntimeGameDocuments.Viewport(frame, viewport)); WriteArtifact(outputDirectory, manifest, "document.objects-viewport", AetheriaRuntimeDaemonSchemas.ObjectsViewport, AetheriaRuntimeGameDocuments.ObjectsViewport(frame, viewport)); WriteArtifact(outputDirectory, manifest, "document.gravity-viewport", AetheriaRuntimeDaemonSchemas.GravityViewport, AetheriaRuntimeGameDocuments.GravityViewport(frame, viewport)); WriteArtifact(outputDirectory, manifest, "document.current-zone", AetheriaRuntimeDaemonSchemas.CurrentZone, AetheriaRuntimeGameDocuments.CurrentZone(frame)); @@ -148,6 +151,12 @@ static void ExportAuthorityDecisionFixtures(string outputDirectory) WriteJson(Path.Combine(outputDirectory, "manifest.json"), manifest); } +static Task TryReadDocumentAsync(AetheriaStateNode node, GameCult.Caching.CultRecordKey recordKey) + where T : class +{ + return TryReadAsync(() => node.MutableDocument(recordKey).ReadAsync()); +} + static async Task TryReadAsync(Func> read) where T : class { @@ -210,7 +219,7 @@ static async Task RunDaemonOnceAsync(FreezeOptions options, string statePath, st $"aetheria-freeze-{scenario}", "--session-id", scenario, - "--rts-cultmesh-port", + "--client-cultmesh-port", "0" }); diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 0a4bbce28..b7e8f7db5 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -16091,6 +16091,8 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) "Runtime", "AetheriaRuntimeGameViewportDocuments.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"); var snapshotDocuments = File.Exists(snapshotDocumentsPath) ? File.ReadAllText(snapshotDocumentsPath) : throw new InvalidOperationException("Cannot verify daemon projectile authority; runtime snapshot documents are missing."); @@ -16112,6 +16114,12 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) var rtsLocalDocuments = File.Exists(rtsLocalDocumentsPath) ? File.ReadAllText(rtsLocalDocumentsPath) : throw new InvalidOperationException("Cannot verify daemon projectile authority; Electron local projection is missing."); + var authoritySmoke = File.Exists(authoritySmokePath) + ? File.ReadAllText(authoritySmokePath) + : throw new InvalidOperationException("Cannot verify daemon transport vocabulary; authority smoke harness is missing."); + var freeze = File.Exists(freezePath) + ? File.ReadAllText(freezePath) + : throw new InvalidOperationException("Cannot verify daemon transport vocabulary; freeze harness is missing."); var requiredProjectileAuthoritySymbols = new Dictionary { @@ -16211,7 +16219,9 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) } if (daemonProgram.Contains("RtsCultMesh", StringComparison.Ordinal) || - daemonProgram.Contains("--rts-cultmesh", StringComparison.Ordinal) || + daemonProgram.Contains("ReadOption(args, \"--rts-cultmesh", StringComparison.Ordinal) || + daemonProgram.Contains("ReadNonNegativeInt(args, \"--rts-cultmesh", StringComparison.Ordinal) || + daemonProgram.Contains("ReadPositiveInt(args, \"--rts-cultmesh", StringComparison.Ordinal) || daemonProgram.Contains("RTS CultMesh endpoint", StringComparison.Ordinal) || daemonProgram.Contains("aetheria-rts-rudp", StringComparison.Ordinal) || daemonProgram.Contains("daemon:aetheria.rts.viewport", StringComparison.Ordinal) || @@ -16221,6 +16231,18 @@ static void RequireUnityDoesNotCallSharedSimulationTicks(string root) throw new InvalidOperationException( "Aetheria daemon transport must be client-neutral; runtime-branded CultMesh flags and transport ids belong outside daemon authority."); } + if (!daemonProgram.Contains("RejectRemovedOption(args, \"--rts-cultmesh-port\", \"--client-cultmesh-port\")", StringComparison.Ordinal)) + { + throw new InvalidOperationException( + "Aetheria daemon must explicitly reject the removed RTS-branded CultMesh port flag and point callers at the client-neutral flag."); + } + if (authoritySmoke.Contains("--rts-cultmesh-port", StringComparison.Ordinal) || + authoritySmoke.Contains("rtsPort", StringComparison.Ordinal) || + freeze.Contains("--rts-cultmesh-port", StringComparison.Ordinal)) + { + throw new InvalidOperationException( + "Aetheria daemon smoke/freeze callers must use the client-neutral CultMesh endpoint flag instead of preserving RTS-branded transport vocabulary."); + } var sharedRuntimeText = string.Join( "\n",