From d19d35e39c8d0c64c4b8e2320267ad48cf46982b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 18 Jul 2026 16:43:20 +0100 Subject: [PATCH] Separate Aetheria provider identity --- Aetheria.State.Daemon/Program.cs | 6 +-- Aetheria.Unity/Assets/AetheriaUnityClient.cs | 2 +- .../Tests/DaemonRuntimeDocumentTests.cs | 43 ++++++++++++------- .../Runtime/AetheriaRuntimeDaemonDocuments.cs | 13 ++++-- ...theriaRuntimeDaemonEditorSurfaceBuilder.cs | 2 +- ...AetheriaRuntimeDaemonGameSurfaceBuilder.cs | 4 +- .../AetheriaRuntimeDaemonOperationsClient.cs | 2 +- .../AetheriaRuntimeEveEntitySoaProjection.cs | 2 +- ...AetheriaRuntimeInputCapabilityDocuments.cs | 2 +- 9 files changed, 47 insertions(+), 29 deletions(-) diff --git a/Aetheria.State.Daemon/Program.cs b/Aetheria.State.Daemon/Program.cs index b211db0ab..1bc47111a 100644 --- a/Aetheria.State.Daemon/Program.cs +++ b/Aetheria.State.Daemon/Program.cs @@ -1663,7 +1663,7 @@ static EveProviderAdvertisementDocument BuildCoreProviderAdvertisement( new[] { "unity-scene", "web-reference", "electron-shell" }, "provider-owns-topology-discovery-landmarks-influence-and-assets"); return new EveProviderAdvertisementDocument( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, options.DaemonId, options.VerseId, "Aetheria Daemon", @@ -1892,7 +1892,7 @@ static AetheriaRuntimeSurfaceDocument BuildTradeMenuSurface( .ToArray(); return new AetheriaRuntimeSurfaceDocument( - providerId: "aetheria.daemon", + providerId: AetheriaRuntimeProviderIdentity.ProviderId, providerKind: "trade.menu", title: "Trade Menu", version: version, @@ -2217,7 +2217,7 @@ static EveAssetCatalogDocument BuildCoreAssetCatalog( .OrderBy(entry => entry.AssetRef, StringComparer.Ordinal) .ToArray(); return new EveAssetCatalogDocument( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, AetheriaRuntimeVerseRecordKeys.EveAssetCatalog.ToString(), AssetCatalogVersion(source.PublishedAtUtc), source.PublishedAtUtc, diff --git a/Aetheria.Unity/Assets/AetheriaUnityClient.cs b/Aetheria.Unity/Assets/AetheriaUnityClient.cs index cbe892a52..4a54d6e5e 100644 --- a/Aetheria.Unity/Assets/AetheriaUnityClient.cs +++ b/Aetheria.Unity/Assets/AetheriaUnityClient.cs @@ -25,7 +25,7 @@ public sealed class AetheriaUnityClient : MonoBehaviour _provider.Configure( endpoint, replicaPath, - providerId: "aetheria.daemon", + providerId: "aetheria", surfaceId: surfaceId, requiredSurfaceKind: "interactive-world", clientRuntimeId: "aetheria-unity"); diff --git a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs index 784abec2a..663abf16f 100644 --- a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs +++ b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs @@ -452,7 +452,7 @@ public class DaemonRuntimeDocumentTests { var tracker = new AetheriaEveUnityRemoteReceiptTracker(); var request = new EveSurfaceCommandRequest( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, CultMesh.OperationInvocation("aetheria.daemon.commands.SetMoveVector"), CultMesh.OperationPayload(("directionX", "1.0"), ("directionY", "0.0")), @@ -499,7 +499,18 @@ public class DaemonRuntimeDocumentTests "test-daemon", "session", 42, 42, new[] { new AetheriaRuntimeDaemonSoaBufferDocument { BufferId = "hot", Location = "mmf:test" } }, new[] { new AetheriaRuntimeDaemonSoaColumnDocument { ColumnId = "position", Kind = AetheriaRuntimeDaemonSoaColumnKinds.Position, BufferId = "hot", ScalarType = "float32", ElementStride = 12, ElementCount = 2 } }); - var portable = AetheriaRuntimeEveEntitySoaProjection.Project(source); + var portable = AetheriaRuntimeEveEntitySoaProjection.Project( + source, + new CultMeshBodyGeneration + { + BodyId = AetheriaRuntimeDaemonSoaFramePublisher.BodyId, + ProducerId = AetheriaRuntimeDaemonSoaFramePublisher.ProducerId, + SchemaId = AetheriaRuntimeDaemonSoaFramePublisher.BodySchemaId, + LayoutVersion = AetheriaRuntimeDaemonSoaFramePublisher.LayoutVersion, + Capacity = AetheriaRuntimeDaemonSoaFramePublisher.Capacity, + ProducerEpoch = 7, + Sequence = 42 + }); Assert.IsTrue(ContainsSurfaceProp(surface.Surface.Root, "entityViewPointerId", AetheriaRuntimeVerseRecordKeys.EveEntitySoaViewLatest.ToString())); @@ -514,6 +525,7 @@ public class DaemonRuntimeDocumentTests Assert.IsFalse(ContainsSurfaceValueFragment(surface.Surface.Root, "_Nebula"), "The semantic Eve surface must not own Unity shader property names."); Assert.AreEqual(EveEntitySoaViewDocument.SchemaId, portable.Schema); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, portable.ProviderId); Assert.AreEqual(42, portable.Generation); Assert.AreEqual(AetheriaRuntimeDaemonSoaColumnKinds.Position, portable.Columns.Single().Semantic); } @@ -614,7 +626,7 @@ public class DaemonRuntimeDocumentTests DaemonId = "test-daemon", SessionId = "session-tick", VerseId = "aetheria.test", - CultMeshAddress = "cultmesh://aetheria.test/eve/providers/aetheria.daemon", + CultMeshAddress = "cultmesh://aetheria.test/eve/providers/aetheria", FrameId = 42, SimulationTimeSeconds = 12.5, FixedDeltaSeconds = 0.02, @@ -649,9 +661,9 @@ public class DaemonRuntimeDocumentTests Assert.IsNotNull(providerAdvertisement); Assert.AreEqual(AetheriaRuntimeDaemonSchemas.ProviderAdvertisement, providerAdvertisement.Schema); Assert.AreEqual("aetheria.test", providerAdvertisement.VerseId); - Assert.AreEqual("aetheria.daemon", providerAdvertisement.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, providerAdvertisement.ProviderId); Assert.AreEqual("test-daemon", providerAdvertisement.DaemonId); - Assert.AreEqual("cultmesh://aetheria.test/eve/providers/aetheria.daemon", providerAdvertisement.CultMeshAddress); + Assert.AreEqual("cultmesh://aetheria.test/eve/providers/aetheria", providerAdvertisement.CultMeshAddress); Assert.AreEqual(AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest.ToString(), providerAdvertisement.FrameRecordRef); Assert.AreEqual(AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest.ToString(), providerAdvertisement.SoaViewRecordRef); Assert.AreEqual(AetheriaRuntimeVerseRecordKeys.DaemonHealth.ToString(), providerAdvertisement.HealthRecordRef); @@ -718,7 +730,7 @@ public class DaemonRuntimeDocumentTests entry.Kind == AetheriaRuntimeDaemonCommandKinds.TransferCargoItem && entry.CommandBody == nameof(AetheriaRuntimeCargoTransferCommand))); var gameSurface = result.GameSurface; - Assert.AreEqual("aetheria.daemon", gameSurface.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, gameSurface.ProviderId); Assert.AreEqual("game.daemon", gameSurface.ProviderKind); Assert.AreEqual(AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, gameSurface.Surface.Id); Assert.AreEqual(42, gameSurface.Version); @@ -751,12 +763,12 @@ public class DaemonRuntimeDocumentTests out var resolvedTargetName)); Assert.AreEqual("Target", resolvedTargetName); var gameTuiSurface = result.GameTuiSurface; - Assert.AreEqual("aetheria.daemon", gameTuiSurface.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, gameTuiSurface.ProviderId); Assert.AreEqual("game.daemon", gameTuiSurface.ProviderKind); Assert.AreEqual(AetheriaRuntimeDaemonGameSurfaceBuilder.TuiSurfaceId, gameTuiSurface.Surface.Id); Assert.AreEqual(42, gameTuiSurface.Version); var editorSurface = result.EditorSurface; - Assert.AreEqual("aetheria.daemon", editorSurface.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, editorSurface.ProviderId); Assert.AreEqual("editor.daemon", editorSurface.ProviderKind); Assert.AreEqual(AetheriaRuntimeDaemonEditorSurfaceBuilder.SurfaceId, editorSurface.Surface.Id); Assert.AreEqual(42, editorSurface.Version); @@ -797,7 +809,7 @@ public class DaemonRuntimeDocumentTests asset.Ref.Kind == AetheriaRuntimeAssetKinds.VolumeProfile && asset.Ref.Metadata["presentationRole"] == "environment.post-process.flight")); var editorTuiSurface = result.EditorTuiSurface; - Assert.AreEqual("aetheria.daemon", editorTuiSurface.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, editorTuiSurface.ProviderId); Assert.AreEqual("editor.daemon", editorTuiSurface.ProviderKind); Assert.AreEqual(AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, editorTuiSurface.Surface.Id); Assert.AreEqual(42, editorTuiSurface.Version); @@ -830,7 +842,7 @@ public class DaemonRuntimeDocumentTests surfaceResolver); Assert.AreEqual(AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, unityGameSurface.Surface.Id); - Assert.AreEqual("aetheria.daemon", unityGameSurface.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, unityGameSurface.ProviderId); Assert.IsTrue(unityGameSurface.Commands.Any(command => command.Command == "aetheria.daemon.commands.SetMoveVector" && command.Transport == "cultmesh")); @@ -3239,7 +3251,7 @@ public class DaemonRuntimeDocumentTests 0.02); PublishLatestFrameThroughVerseClient(statePath, frame); var request = new EveSurfaceCommandRequest( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, CultMesh.OperationInvocation("aetheria.daemon.commands.FireWeaponGroup"), CultMesh.OperationPayload(), @@ -3281,7 +3293,7 @@ public class DaemonRuntimeDocumentTests 0.02); PublishLatestFrameThroughVerseClient(statePath, frame); var request = new EveSurfaceCommandRequest( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, CultMesh.OperationInvocation("aetheria.daemon.commands.SensorPing"), CultMesh.OperationPayload(), @@ -3339,7 +3351,7 @@ public class DaemonRuntimeDocumentTests EveUnitySceneCommandReceipt observedReceipt = null; bridge.ReceiptAvailable += receipt => observedReceipt = receipt; var request = new EveSurfaceCommandRequest( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, CultMesh.OperationInvocation("aetheria.daemon.commands.SensorPing"), CultMesh.OperationPayload(), @@ -3354,7 +3366,7 @@ public class DaemonRuntimeDocumentTests Assert.AreEqual("accepted", observedReceipt.State); Assert.AreEqual("Aetheria", observedReceipt.OwnerRepo); Assert.AreEqual("aetheria-daemon-command-boundary", observedReceipt.Authority); - Assert.AreEqual("aetheria.daemon", observedReceipt.ProviderId); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, observedReceipt.ProviderId); Assert.AreEqual(AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, observedReceipt.SurfaceId); Assert.AreEqual( AetheriaRuntimeDaemonOperationIds.ForKind(AetheriaRuntimeDaemonCommandKinds.SensorPing), @@ -3671,7 +3683,7 @@ public class DaemonRuntimeDocumentTests 1.5, 0.02); var request = new EveSurfaceCommandRequest( - "aetheria.daemon", + AetheriaRuntimeProviderIdentity.ProviderId, AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, CultMesh.OperationInvocation("aetheria.daemon.commands.TransferCargoItem"), CultMesh.OperationPayload( @@ -5382,6 +5394,7 @@ public class DaemonRuntimeDocumentTests var capability = AetheriaRuntimeInputCapabilityDocument.FromFrame(frame, catalog: catalog); + Assert.AreEqual(AetheriaRuntimeProviderIdentity.ProviderId, capability.ProviderId); var repair = capability.Actions.Single(action => action.Operation.EndsWith("ActivateConsumable", StringComparison.Ordinal)); Assert.AreEqual("repair-gel", repair.Payload["itemKey"]); Assert.AreEqual("3", repair.Payload["quantityRemaining"]); diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonDocuments.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonDocuments.cs index e7fb30da9..24b0581c3 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonDocuments.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonDocuments.cs @@ -93,6 +93,11 @@ namespace GameCult.Aetheria.State.Verse public const string EditorSurface = "gamecult.aetheria.daemon_editor_surface.v1"; } + public static class AetheriaRuntimeProviderIdentity + { + public const string ProviderId = "aetheria"; + } + public static class AetheriaRuntimeDaemonOperationIds { public static string SetMoveVector => ForKind(AetheriaRuntimeDaemonCommandKinds.SetMoveVector); @@ -211,7 +216,7 @@ namespace GameCult.Aetheria.State.Verse public string VerseId { get; set; } = "aetheria.local"; [Key(2)] - public string ProviderId { get; set; } = "aetheria.daemon"; + public string ProviderId { get; set; } = AetheriaRuntimeProviderIdentity.ProviderId; [Key(3)] public string DaemonId { get; set; } = "aetheria-daemon"; @@ -265,7 +270,7 @@ namespace GameCult.Aetheria.State.Verse public IReadOnlyList CommandBoundaryIds { get; set; } = Array.Empty(); [Key(20)] - public string CultMeshAddress { get; set; } = "cultmesh://aetheria.local/eve/providers/aetheria.daemon"; + public string CultMeshAddress { get; set; } = "cultmesh://aetheria.local/eve/providers/aetheria"; [Key(21)] public string AssetManifestRecordRef { get; set; } = ""; @@ -300,7 +305,7 @@ namespace GameCult.Aetheria.State.Verse EditorGuiSurfaceId = AetheriaRuntimeDaemonEditorSurfaceBuilder.SurfaceId, EditorTuiSurfaceId = AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, CultMeshAddress = string.IsNullOrWhiteSpace(cultMeshAddress) - ? "cultmesh://aetheria.local/eve/providers/aetheria.daemon" + ? "cultmesh://aetheria.local/eve/providers/aetheria" : cultMeshAddress, EveSurfaces = AetheriaRuntimeEveSurfaceCatalog.All, PublishedSchemas = new[] @@ -961,7 +966,7 @@ namespace GameCult.Aetheria.State.Verse applied ? "reconciled" : "denied", "Aetheria", fact.SourceDaemonId, - "aetheria", + AetheriaRuntimeProviderIdentity.ProviderId, surfaceId ?? "", message, fact.CommittedAtUtc, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonEditorSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonEditorSurfaceBuilder.cs index 63ba1bc1d..ac28cb334 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonEditorSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonEditorSurfaceBuilder.cs @@ -24,7 +24,7 @@ namespace GameCult.Aetheria.State.Verse designerSurfaces ??= Array.Empty(); return new AetheriaRuntimeSurfaceDocument( - providerId: "aetheria.daemon", + providerId: AetheriaRuntimeProviderIdentity.ProviderId, providerKind: "editor.daemon", title: "Aetheria Daemon Editor", version: health.FrameId, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs index 413381a88..b7d02ccb8 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs @@ -109,7 +109,7 @@ namespace GameCult.Aetheria.State.Verse surfaceChildren.Add(refitPanel); return new AetheriaRuntimeSurfaceDocument( - providerId: "aetheria", + providerId: AetheriaRuntimeProviderIdentity.ProviderId, providerKind: "game.daemon", title: "Aetheria Daemon", version: frame.FrameId, @@ -164,7 +164,7 @@ namespace GameCult.Aetheria.State.Verse BuildStarbridgeRuntimeRolesCard(starbridge)); return new AetheriaRuntimeSurfaceDocument( - "aetheria", + AetheriaRuntimeProviderIdentity.ProviderId, "game.daemon", "Starbridge Commander", frame.FrameId, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs index 3534558e8..8ed74f37d 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs @@ -394,7 +394,7 @@ public sealed class AetheriaRuntimeDaemonOperationsClient { envelope = null; if (request == null || - !string.Equals(request.ProviderId, "aetheria", StringComparison.Ordinal) || + !string.Equals(request.ProviderId, AetheriaRuntimeProviderIdentity.ProviderId, StringComparison.Ordinal) || !TryResolveSurfaceCommandKind(request, out var kind)) { return false; diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveEntitySoaProjection.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveEntitySoaProjection.cs index 69b926b03..9b1f59417 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveEntitySoaProjection.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveEntitySoaProjection.cs @@ -17,7 +17,7 @@ namespace GameCult.Aetheria.State.Verse if (generation == null) throw new ArgumentNullException(nameof(generation)); return new EveEntitySoaViewDocument { - ProviderId = "aetheria", + ProviderId = AetheriaRuntimeProviderIdentity.ProviderId, ViewId = "pilot", FrameId = source.FrameId, PublishedAtUtc = source.PublishedAtUtc, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInputCapabilityDocuments.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInputCapabilityDocuments.cs index 7c5c4db4a..843ea604e 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInputCapabilityDocuments.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeInputCapabilityDocuments.cs @@ -67,7 +67,7 @@ namespace GameCult.Aetheria.State.Verse { public const string SchemaId = "gamecult.eve.input_capability.v1"; [Key(0)] public string Schema { get; set; } = SchemaId; - [Key(1)] public string ProviderId { get; set; } = "aetheria"; + [Key(1)] public string ProviderId { get; set; } = AetheriaRuntimeProviderIdentity.ProviderId; [Key(2)] public string CapabilityId { get; set; } = "aetheria.pilot.input"; [Key(3)] public long Version { get; set; } [Key(4)] public AetheriaRuntimeInputActionDocument[] Actions { get; set; } = Array.Empty();