diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index d25b807ed..351ca5114 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -94,6 +94,7 @@ RequireInventoryLoadoutSaveRequestAuthority(root); RequireInventoryLoadoutRestoreRequestAuthority(root); RequireDockedCurrentShipRequestAuthority(root); RequireAuthoritySmokeUsesManagedPointers(root); +RequireAetheriaStateNodeUsesManagedPointers(root); await using var node = await AetheriaStateNode.OpenAsync( statePath, @@ -8583,6 +8584,90 @@ static void RequireAuthoritySmokeUsesManagedPointers(string root) } } +static void RequireAetheriaStateNodeUsesManagedPointers(string root) +{ + var stateNodePath = Path.Combine(root, "Aetheria.State", "AetheriaStateNode.cs"); + if (!File.Exists(stateNodePath)) + { + throw new InvalidOperationException("AetheriaStateNode source is missing."); + } + + var stateNode = File.ReadAllText(stateNodePath); + var requiredSymbols = new[] + { + "public CultMeshMutableStatePointer World()", + "public CultMeshMutableStatePointer MigrationLedger()", + "public CultMeshMutableStatePointer ItemDefinition(", + "public CultMeshMutableStatePointer LatestFrame()", + "public CultMeshMutableStatePointer LatestSoaView()", + "public CultMeshMutableStatePointer StarbridgeScenario()", + "public CultMeshMutableStatePointer DaemonGameSurface()", + "private CultMeshMutableStatePointer MutableDocumentPointer(CultRecordKey key)", + "CultMesh.MutableStatePointer(" + }; + var missingSymbols = requiredSymbols + .Where(symbol => !stateNode.Contains(symbol, StringComparison.Ordinal)) + .ToArray(); + if (missingSymbols.Length > 0) + { + throw new InvalidOperationException( + "AetheriaStateNode no longer exposes managed typed state pointers: " + + string.Join(", ", missingSymbols)); + } + + var forbiddenSymbols = new[] + { + "public Task> PutWorldAsync(", + "public Task GetWorldAsync(", + "public Task> PutMigrationLedgerAsync(", + "public Task GetMigrationLedgerAsync(", + "public Task> PutItemDefinitionAsync(", + "public Task GetItemDefinitionAsync(", + "public Task GetItemDefinitionByLegacyIdAsync(", + "public Task> PutCorporationAsync(", + "public Task GetCorporationAsync(", + "public Task> PutNameFileAsync(", + "public Task GetNameFileAsync(", + "public Task> PutTradeValuePolicyAsync(", + "public Task GetTradeValuePolicyAsync(", + "public Task> PutCatalogSurfaceAsync(", + "public Task GetCatalogSurfaceAsync(", + "public Task> PutProviderAdvertisementAsync(", + "public Task GetProviderAdvertisementAsync(", + "public Task> PutDaemonProviderAdvertisementAsync(", + "public Task GetDaemonProviderAdvertisementAsync(", + "public Task> PutVerseAuthorityPolicyAsync(", + "public Task GetVerseAuthorityPolicyAsync(", + "public Task> PutDaemonFrameAsync(", + "public Task GetDaemonFrameAsync(", + "public Task> PutDaemonSoaViewAsync(", + "public Task GetDaemonSoaViewAsync(", + "public Task> PutStarbridgeScenarioAsync(", + "public Task GetStarbridgeScenarioAsync(", + "public Task> PutDaemonGameSurfaceAsync(", + "public Task GetDaemonGameSurfaceAsync(", + "public Task> PutRuntimeSessionAsync(", + "public Task GetRuntimeSessionAsync(", + "public Task> PutPlayerSettingsAsync(", + "public Task GetPlayerSettingsAsync(", + "public Task> PutRunStateAsync(", + "public Task GetRunStateAsync(", + "public Task> PutEntitySnapshotAsync(", + "public Task GetEntitySnapshotAsync(", + "public Task> PutVerseHostSettingsAsync(", + "public Task GetVerseHostSettingsAsync(" + }; + var survivingSymbols = forbiddenSymbols + .Where(symbol => stateNode.Contains(symbol, StringComparison.Ordinal)) + .ToArray(); + if (survivingSymbols.Length > 0) + { + throw new InvalidOperationException( + "AetheriaStateNode still exposes compatibility document Get/Put helpers instead of managed typed pointers: " + + string.Join(", ", survivingSymbols)); + } +} + static void RequireDaemonVersePublication(string root) { var daemonDocumentsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonDocuments.cs"); diff --git a/Aetheria.State/AetheriaStateNode.cs b/Aetheria.State/AetheriaStateNode.cs index d0d9962ec..395f88f12 100644 --- a/Aetheria.State/AetheriaStateNode.cs +++ b/Aetheria.State/AetheriaStateNode.cs @@ -298,190 +298,6 @@ public sealed class AetheriaStateNode : IAsyncDisposable, IDisposable return MutableDocumentPointer(key); } - public Task> PutWorldAsync(AetheriaWorldState world) - { - return Database.PutAsync(new CultRecordKey("global:aetheria.world_state.v1"), world); - } - - public Task GetWorldAsync() - { - return Database.GetAsync(new CultRecordKey("global:aetheria.world_state.v1")); - } - - public Task> PutMigrationLedgerAsync(AetheriaMigrationLedger ledger) - { - return Database.PutAsync(new CultRecordKey("global:aetheria.migration_ledger.v1"), ledger); - } - - public Task GetMigrationLedgerAsync() - { - return Database.GetAsync(new CultRecordKey("global:aetheria.migration_ledger.v1")); - } - - public Task> PutLegacyCatalogQuarantineAsync( - AetheriaLegacyCatalogQuarantine quarantine) - { - return Database.PutAsync(new CultRecordKey("global:aetheria.legacy_catalog_quarantine.v1"), quarantine); - } - - public Task GetLegacyCatalogQuarantineAsync() - { - return Database.GetAsync( - new CultRecordKey("global:aetheria.legacy_catalog_quarantine.v1")); - } - - public Task> PutItemDefinitionAsync( - CultRecordKey key, - AetheriaItemDefinition item) - { - return Database.PutAsync(key, item); - } - - public Task> PutLegacyItemDefinitionAsync(AetheriaItemDefinition item) - { - return PutItemDefinitionAsync(AetheriaCatalogKeys.ItemDefinitionFromLegacyId(item.LegacyId), item); - } - - public Task GetItemDefinitionAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task GetItemDefinitionByLegacyIdAsync(string legacyId) - { - return GetItemDefinitionAsync(AetheriaCatalogKeys.ItemDefinitionFromLegacyId(legacyId)); - } - - public Task> PutCorporationAsync(CultRecordKey key, AetheriaCorporation corporation) - { - return Database.PutAsync(key, corporation); - } - - public Task> PutLegacyCorporationAsync(AetheriaCorporation corporation) - { - return PutCorporationAsync(AetheriaCatalogKeys.CorporationFromLegacyId(corporation.LegacyId), corporation); - } - - public Task GetCorporationAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task GetCorporationByLegacyIdAsync(string legacyId) - { - return GetCorporationAsync(AetheriaCatalogKeys.CorporationFromLegacyId(legacyId)); - } - - public Task> PutNameFileAsync(CultRecordKey key, AetheriaNameFile nameFile) - { - return Database.PutAsync(key, nameFile); - } - - public Task> PutLegacyNameFileAsync(AetheriaNameFile nameFile) - { - return PutNameFileAsync(AetheriaCatalogKeys.NameFileFromLegacyId(nameFile.LegacyId), nameFile); - } - - public Task GetNameFileAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task GetNameFileByLegacyIdAsync(string legacyId) - { - return GetNameFileAsync(AetheriaCatalogKeys.NameFileFromLegacyId(legacyId)); - } - - public Task> PutTradeValuePolicyAsync( - AetheriaTradeValuePolicy policy) - { - return Database.PutAsync(new CultRecordKey(AetheriaTradeValuePolicy.RecordKey), policy); - } - - public Task GetTradeValuePolicyAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaTradeValuePolicy.RecordKey)); - } - - public Task> PutCatalogSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaCatalogSurfaceProjector.SurfaceKey), surface); - } - - public Task GetCatalogSurfaceAsync() - { - return Database.GetAsync(new CultRecordKey(AetheriaCatalogSurfaceProjector.SurfaceKey)); - } - - public Task> PutOperationsSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaOperationsSurfaceProjector.SurfaceKey), surface); - } - - public Task GetOperationsSurfaceAsync() - { - return Database.GetAsync(new CultRecordKey(AetheriaOperationsSurfaceProjector.SurfaceKey)); - } - - public Task> PutPlayerSettingsSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaPlayerSettingsSurfaceProjector.SurfaceKey), surface); - } - - public Task GetPlayerSettingsSurfaceAsync() - { - return Database.GetAsync(new CultRecordKey(AetheriaPlayerSettingsSurfaceProjector.SurfaceKey)); - } - - public Task> PutProviderAdvertisementAsync( - EveProviderAdvertisementState advertisement) - { - return Database.PutAsync(new CultRecordKey(AetheriaProviderAdvertisementProjector.AdvertisementKey), advertisement); - } - - public Task GetProviderAdvertisementAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaProviderAdvertisementProjector.AdvertisementKey)); - } - - public Task> PutDaemonProviderAdvertisementAsync( - AetheriaRuntimeDaemonProviderAdvertisementDocument advertisement) - { - return Database.PutAsync(new CultRecordKey("daemon:aetheria.provider_advertisement.v1"), advertisement); - } - - public Task GetDaemonProviderAdvertisementAsync() - { - return Database.GetAsync( - new CultRecordKey("daemon:aetheria.provider_advertisement.v1")); - } - - public Task> PutDaemonHealthAsync( - AetheriaRuntimeDaemonHealthDocument health) - { - return Database.PutAsync(new CultRecordKey("daemon:aetheria.health.v1"), health); - } - - public Task GetDaemonHealthAsync() - { - return Database.GetAsync( - new CultRecordKey("daemon:aetheria.health.v1")); - } - - public Task> PutDaemonCommandBoundaryAsync( - AetheriaRuntimeDaemonCommandBoundaryDocument boundary) - { - return Database.PutAsync(new CultRecordKey("daemon:aetheria.command_boundary.v1"), boundary); - } - - public Task GetDaemonCommandBoundaryAsync() - { - return Database.GetAsync( - new CultRecordKey("daemon:aetheria.command_boundary.v1")); - } - public Task> SubmitDaemonCommandAsync( AetheriaRuntimeDaemonCommandDocument command) { @@ -528,20 +344,6 @@ public sealed class AetheriaStateNode : IAsyncDisposable, IDisposable .ToArray(); } - public Task> PutVerseAuthorityPolicyAsync( - AetheriaRuntimeVerseAuthorityPolicyDocument policy) - { - return Database.PutAsync( - new CultRecordKey(AetheriaRuntimeVerseAuthorityPolicyDocument.DocumentKey), - policy); - } - - public Task GetVerseAuthorityPolicyAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaRuntimeVerseAuthorityPolicyDocument.DocumentKey)); - } - public IReadOnlyList ReadAuthorityLeases() { return Cache.GetAll().ToArray(); @@ -581,196 +383,6 @@ public sealed class AetheriaStateNode : IAsyncDisposable, IDisposable return new CultRecordKey($"eve:commands:{StableToken(commandId)}:gamecult.eve.command.v1"); } - public Task> PutDaemonFrameAsync( - AetheriaRuntimeDaemonFrameDocument frame) - { - return Database.PutAsync(new CultRecordKey("daemon:aetheria.frame.latest.v1"), frame); - } - - public Task GetDaemonFrameAsync() - { - return Database.GetAsync( - new CultRecordKey("daemon:aetheria.frame.latest.v1")); - } - - public Task> PutDaemonSoaViewAsync( - AetheriaRuntimeDaemonSoaViewDocument view) - { - return Database.PutAsync(new CultRecordKey("daemon:aetheria.soa_view.latest.v1"), view); - } - - public Task GetDaemonSoaViewAsync() - { - return Database.GetAsync( - new CultRecordKey("daemon:aetheria.soa_view.latest.v1")); - } - - public Task> PutStarbridgeScenarioAsync( - AetheriaRuntimeStarbridgeScenarioDocument scenario) - { - return Database.PutAsync(AetheriaRuntimeVerseRecordKeys.StarbridgeScenarioLatest, scenario); - } - - public Task GetStarbridgeScenarioAsync() - { - return Database.GetAsync( - AetheriaRuntimeVerseRecordKeys.StarbridgeScenarioLatest); - } - - public Task> PutStarbridgeSessionAsync( - AetheriaRuntimeStarbridgeSessionDocument session) - { - return Database.PutAsync(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionLatest, session); - } - - public Task GetStarbridgeSessionAsync() - { - return Database.GetAsync( - AetheriaRuntimeVerseRecordKeys.StarbridgeSessionLatest); - } - - public Task> PutStarbridgeSessionSummaryAsync( - AetheriaRuntimeStarbridgeSessionSummaryDocument summary) - { - return Database.PutAsync(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary, summary); - } - - public Task GetStarbridgeSessionSummaryAsync() - { - return Database.GetAsync( - AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary); - } - - public Task> PutDaemonGameSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonGameSurfaceKey), surface); - } - - public Task GetDaemonGameSurfaceAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonGameSurfaceKey)); - } - - public Task> PutDaemonGameTuiSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonGameTuiSurfaceKey), surface); - } - - public Task GetDaemonGameTuiSurfaceAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonGameTuiSurfaceKey)); - } - - public Task> PutDaemonEditorSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonEditorSurfaceKey), surface); - } - - public Task GetDaemonEditorSurfaceAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonEditorSurfaceKey)); - } - - public Task> PutDaemonEditorTuiSurfaceAsync(EveSurfaceState surface) - { - return Database.PutAsync(new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonEditorTuiSurfaceKey), surface); - } - - public Task GetDaemonEditorTuiSurfaceAsync() - { - return Database.GetAsync( - new CultRecordKey(AetheriaProviderAdvertisementProjector.DaemonEditorTuiSurfaceKey)); - } - - public Task> PutRuntimeSessionAsync(AetheriaRuntimeSession session) - { - return Database.PutAsync(RuntimeSessionKey(session.RuntimeId), session); - } - - public Task GetRuntimeSessionAsync(string runtimeId) - { - return Database.GetAsync(RuntimeSessionKey(runtimeId)); - } - - public Task> PutPlayerSettingsAsync(AetheriaPlayerSettings settings) - { - return Database.PutAsync(PlayerSettingsKey, settings); - } - - public Task GetPlayerSettingsAsync() - { - return Database.GetAsync(PlayerSettingsKey); - } - - public Task> PutLoadoutTemplateAsync( - CultRecordKey key, - AetheriaLoadoutTemplate loadout) - { - return Database.PutAsync(key, loadout); - } - - public Task GetLoadoutTemplateAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task> PutRunStateAsync(CultRecordKey key, AetheriaRunState run) - { - return Database.PutAsync(key, run); - } - - public Task GetRunStateAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task> PutZoneStateAsync(CultRecordKey key, AetheriaZoneState zone) - { - return Database.PutAsync(key, zone); - } - - public Task GetZoneStateAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task> PutEntitySnapshotAsync( - CultRecordKey key, - AetheriaEntitySnapshot entity) - { - return Database.PutAsync(key, entity); - } - - public Task GetEntitySnapshotAsync(CultRecordKey key) - { - return Database.GetAsync(key); - } - - public Task> PutVerseHostSettingsAsync( - AetheriaVerseHostSettings settings) - { - return Database.PutAsync(VerseHostSettingsKey, settings); - } - - public Task GetVerseHostSettingsAsync() - { - return Database.GetAsync(VerseHostSettingsKey); - } - - public Task> PutEveCommandAcceptanceStatusAsync( - AetheriaEveCommandAcceptanceStatus status) - { - return Database.PutAsync(EveCommandAcceptanceStatusKey, status); - } - - public Task GetEveCommandAcceptanceStatusAsync() - { - return Database.GetAsync(EveCommandAcceptanceStatusKey); - } - public Task FlushAsync(bool soft = false) { return _node.FlushAsync(soft);