From 10df4d2152db161d7be5c96d9e104026efc42ca6 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 07:28:45 +0100 Subject: [PATCH] Delete daemon latest sidecar stores --- Aetheria.State.AuthoritySmoke/Program.cs | 41 ++-- Aetheria.State.Daemon/Program.cs | 4 - Aetheria.State.Verify/Program.cs | 66 +++--- GameCult.Aetheria.State.Unity.csproj | 2 - .../AetheriaRuntimeCultCacheDocumentStore.cs | 199 ------------------ .../AetheriaRuntimeDaemonFrameStore.cs | 52 ----- .../AetheriaRuntimeDaemonFrameStore.cs.meta | 2 - .../AetheriaRuntimeDaemonPublicationStore.cs | 195 ----------------- ...heriaRuntimeDaemonPublicationStore.cs.meta | 2 - 9 files changed, 52 insertions(+), 511 deletions(-) delete mode 100644 Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs delete mode 100644 Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs.meta delete mode 100644 Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs delete mode 100644 Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs.meta diff --git a/Aetheria.State.AuthoritySmoke/Program.cs b/Aetheria.State.AuthoritySmoke/Program.cs index e4b6466cc..13f62cfe5 100644 --- a/Aetheria.State.AuthoritySmoke/Program.cs +++ b/Aetheria.State.AuthoritySmoke/Program.cs @@ -240,7 +240,7 @@ internal sealed class AuthoritySmokeChecks FixedDeltaSeconds = 0.02, ObservedCommands = Array.Empty(), PreRejectedCommandIds = [command.CommandId], - PublishWitnesses = false + BuildPublications = false }); Require(result.Frame.RejectedCommandIds.Contains(command.CommandId), "pre-rejected command should enter frame rejection receipts"); @@ -807,7 +807,7 @@ internal sealed class AuthoritySmokeChecks policy, [ravenByRaven, hostileByRaven]).ConfigureAwait(false); await RunDaemonOnceAsync(ravenStatePath, "raven-local", rtsPort: 41076).ConfigureAwait(false); - var ravenFrame = ReadPublishedFrame(ravenStatePath); + var ravenFrame = await ReadPublishedFrameAsync(ravenStatePath, "raven-local").ConfigureAwait(false); Require(ravenFrame.AppliedCommandIds.Contains(ravenByRaven.CommandId), "raven daemon should apply Raven-authored Raven movement"); Require(ravenFrame.RejectedCommandIds.Contains(hostileByRaven.CommandId), "raven daemon should reject Raven-authored hostile movement"); @@ -823,7 +823,7 @@ internal sealed class AuthoritySmokeChecks policy, [ravenByStarfire, hostileByStarfire]).ConfigureAwait(false); await RunDaemonOnceAsync(starfireStatePath, "starfire-local", rtsPort: 41077).ConfigureAwait(false); - var starfireFrame = ReadPublishedFrame(starfireStatePath); + var starfireFrame = await ReadPublishedFrameAsync(starfireStatePath, "starfire-local").ConfigureAwait(false); Require(starfireFrame.RejectedCommandIds.Contains(ravenByStarfire.CommandId), "starfire daemon should reject Starfire-authored Raven movement"); Require(starfireFrame.AppliedCommandIds.Contains(hostileByStarfire.CommandId), "starfire daemon should apply Starfire-authored hostile movement"); @@ -1124,15 +1124,16 @@ internal sealed class AuthoritySmokeChecks await node.SubmitDaemonCommandAsync(command).ConfigureAwait(false); await node.FlushAsync().ConfigureAwait(false); - AetheriaRuntimeDaemonFrameStore.PublishFrame( - statePath, - AetheriaRuntimeDaemonFrameDocument.Create( + await node.LatestFrame() + .ReplaceAsync(AetheriaRuntimeDaemonFrameDocument.Create( InitialCoopRun(), runtimeId, "authority-smoke", frameId: -1, simulationTimeSeconds: 0, - fixedDeltaSeconds: 0.02)); + fixedDeltaSeconds: 0.02)) + .ConfigureAwait(false); + await node.FlushAsync().ConfigureAwait(false); } private static async Task RunDaemonOnceAsync( @@ -1415,7 +1416,8 @@ internal sealed class AuthoritySmokeChecks { try { - if (TryReadPublishedFrame(statePath, out var frame)) + var frame = await TryReadPublishedFrameAsync(statePath, runtimeId).ConfigureAwait(false); + if (frame != null) { lastFrame = frame; if (isReady(frame)) @@ -1437,16 +1439,27 @@ internal sealed class AuthoritySmokeChecks (lastError == null ? "" : $" Last error: {lastError.GetType().Name}: {lastError.Message}")); } - private static AetheriaRuntimeDaemonFrameDocument ReadPublishedFrame(string statePath) + private static async Task ReadPublishedFrameAsync( + string statePath, + string runtimeId) { - return AetheriaRuntimeDaemonFrameStore.ReadPublishedFrame(statePath); + var frame = await TryReadPublishedFrameAsync(statePath, runtimeId).ConfigureAwait(false); + if (frame == null) + throw new InvalidOperationException($"No managed latest daemon frame is published at {statePath}."); + + return frame; } - private static bool TryReadPublishedFrame( + private static async Task TryReadPublishedFrameAsync( string statePath, - out AetheriaRuntimeDaemonFrameDocument frame) + string runtimeId) { - return AetheriaRuntimeDaemonFrameStore.TryReadPublishedFrame(statePath, out frame); + await using var node = await AetheriaStateNode.OpenAsync( + statePath, + runtimeId, + startServer: false, + enableDurableShardLogs: false).ConfigureAwait(false); + return await node.LatestFrame().ReadAsync().ConfigureAwait(false); } private static string ProcessDiagnostics(IReadOnlyList childProcesses) @@ -1518,7 +1531,7 @@ internal sealed class AuthoritySmokeChecks FixedDeltaSeconds = 0.02, ObservedCommands = authorizedCommands, PreRejectedCommandIds = rejectedIds, - PublishWitnesses = false + BuildPublications = false }); return result.Frame; diff --git a/Aetheria.State.Daemon/Program.cs b/Aetheria.State.Daemon/Program.cs index c76aef96b..8054bbebb 100644 --- a/Aetheria.State.Daemon/Program.cs +++ b/Aetheria.State.Daemon/Program.cs @@ -1311,16 +1311,12 @@ static async Task EnsureVerseAuthorityPolicyAsync( { var existing = await node.VerseAuthorityPolicy().ReadAsync().ConfigureAwait(false); if (existing != null && string.Equals(existing.Schema, AetheriaRuntimeVerseAuthoritySchemas.Policy, StringComparison.Ordinal)) - { - AetheriaRuntimeDaemonPublicationStore.PublishVerseAuthorityPolicy(node.StatePath, existing); return; - } var policy = AetheriaRuntimeVerseAuthorityPolicyDocument.TrustedCoop(options.VerseId, options.DaemonId); await node.VerseAuthorityPolicy() .ReplaceAsync(policy) .ConfigureAwait(false); - AetheriaRuntimeDaemonPublicationStore.PublishVerseAuthorityPolicy(node.StatePath, policy); } static async Task ReadRuntimeRunCheckpointAsync(AetheriaStateNode node) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index be784d14a..bcb12dffc 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -8672,8 +8672,6 @@ static void RequireDaemonVersePublication(string root) { var daemonDocumentsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonDocuments.cs"); var daemonTickRunnerPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonTickRunner.cs"); - var daemonFrameStorePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonFrameStore.cs"); - var daemonPublicationStorePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonPublicationStore.cs"); var daemonSoaDocumentsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonSoaDocuments.cs"); var daemonSoaFramePublisherPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonSoaFramePublisher.cs"); var daemonStateRefsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonStateRefs.cs"); @@ -8697,8 +8695,6 @@ static void RequireDaemonVersePublication(string root) { daemonDocumentsPath, daemonTickRunnerPath, - daemonFrameStorePath, - daemonPublicationStorePath, daemonSoaDocumentsPath, daemonSoaFramePublisherPath, daemonStateRefsPath, @@ -8731,8 +8727,6 @@ static void RequireDaemonVersePublication(string root) var daemonDocuments = File.ReadAllText(daemonDocumentsPath); var daemonTickRunner = File.ReadAllText(daemonTickRunnerPath); - var daemonFrameStore = File.ReadAllText(daemonFrameStorePath); - var daemonPublicationStore = File.ReadAllText(daemonPublicationStorePath); var daemonSoaDocuments = File.ReadAllText(daemonSoaDocumentsPath); var daemonSoaFramePublisher = File.ReadAllText(daemonSoaFramePublisherPath); var daemonStateRefs = File.ReadAllText(daemonStateRefsPath); @@ -8869,12 +8863,18 @@ static void RequireDaemonVersePublication(string root) string.Join(", ", missingBoundarySymbols)); } - var requiredStoreSymbols = new[] + var forbiddenPublicationStoreSymbols = new[] { + "WriteDaemonFrame(", + "ReadDaemonFrame(", + "WriteDaemonSoaView(", + "ReadDaemonSoaView(", "WriteDaemonProviderAdvertisement(", "ReadDaemonProviderAdvertisement(", "WriteDaemonHealth(", "ReadDaemonHealth(", + "WriteVerseAuthorityPolicy(", + "ReadVerseAuthorityPolicy(", "WriteDaemonCommandBoundary(", "ReadDaemonCommandBoundary(", "WriteStarbridgeSessionSummary(", @@ -8883,28 +8883,6 @@ static void RequireDaemonVersePublication(string root) "ReadDaemonGameSurface(", "WriteDaemonEditorSurface(", "ReadDaemonEditorSurface(", - "PublishProviderAdvertisement(", - "PublishHealth(", - "PublishCommandBoundary(", - "PublishStarbridgeSessionSummary(", - "PublishGameSurface(", - "PublishGameTuiSurface(", - "PublishEditorSurface(", - "PublishEditorTuiSurface(" - }; - var storeSource = documentStore + "\n" + daemonPublicationStore; - var missingStoreSymbols = requiredStoreSymbols - .Where(symbol => !storeSource.Contains(symbol, StringComparison.Ordinal)) - .ToArray(); - if (missingStoreSymbols.Length > 0) - { - throw new InvalidOperationException( - "Daemon Verse publication store is incomplete: " + - string.Join(", ", missingStoreSymbols)); - } - - var forbiddenPublicationStoreSymbols = new[] - { "TryReadProviderAdvertisement(", "TryReadHealth(", "TryReadVerseAuthorityPolicy(", @@ -8917,15 +8895,29 @@ static void RequireDaemonVersePublication(string root) "TryReadEditorTuiSurface(" }; var publicationStoreReaderHits = forbiddenPublicationStoreSymbols - .Where(symbol => daemonPublicationStore.Contains(symbol, StringComparison.Ordinal)) + .Where(symbol => documentStore.Contains(symbol, StringComparison.Ordinal)) .ToArray(); if (publicationStoreReaderHits.Length > 0) { throw new InvalidOperationException( - "Daemon publication store still exposes file-backed readers instead of passing typed tick-result documents: " + + "Daemon latest publication still exposes file-backed sidecar helpers instead of managed typed documents: " + string.Join(", ", publicationStoreReaderHits)); } + var daemonFrameStorePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonFrameStore.cs"); + if (File.Exists(daemonFrameStorePath)) + { + throw new InvalidOperationException( + "Daemon latest frames must stay on managed CultMesh pointers; delete AetheriaRuntimeDaemonFrameStore.cs instead of reviving sidecar path writes."); + } + + var daemonPublicationStorePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonPublicationStore.cs"); + if (File.Exists(daemonPublicationStorePath)) + { + throw new InvalidOperationException( + "Daemon latest publications must stay on managed CultMesh pointers; delete AetheriaRuntimeDaemonPublicationStore.cs instead of reviving sidecar path writes."); + } + var daemonSoaViewStorePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonSoaViewStore.cs"); if (File.Exists(daemonSoaViewStorePath)) { @@ -8933,13 +8925,6 @@ static void RequireDaemonVersePublication(string root) "Daemon SoA latest-view publication must stay on managed CultMesh pointers; delete AetheriaRuntimeDaemonSoaViewStore.cs instead of reviving sidecar path writes."); } - if (daemonFrameStore.Contains("TryReadFrame(", StringComparison.Ordinal) || - daemonFrameStore.Contains("ReadFrame(", StringComparison.Ordinal)) - { - throw new InvalidOperationException( - "Daemon frame store still exposes file-backed readers; use tick-result documents or AetheriaClient managed observation."); - } - var requiredDaemonRegistrySymbols = new[] { "CultMesh.CreateCultCacheDocumentRegistry(DocumentTypes)", @@ -9011,8 +8996,7 @@ static void RequireDaemonVersePublication(string root) throw new InvalidOperationException("Daemon Eve surface projector no longer lowers daemon surfaces into registered Eve surface state."); } - if (!daemonPublicationStore.Contains("GetCommandBoundaryPath(", StringComparison.Ordinal) || - !daemonDocuments.Contains("AetheriaRuntimeDaemonCommandKinds", StringComparison.Ordinal)) + if (!daemonDocuments.Contains("AetheriaRuntimeDaemonCommandKinds", StringComparison.Ordinal)) { throw new InvalidOperationException( "Daemon command boundary no longer exposes typed daemon command metadata."); @@ -9027,7 +9011,7 @@ static void RequireDaemonVersePublication(string root) ".daemon.pending", "ReadPending(" }; - var daemonQueueSource = daemonDocuments + "\n" + daemonTickRunner + "\n" + daemonPublicationStore + "\n" + tests; + var daemonQueueSource = daemonDocuments + "\n" + daemonTickRunner + "\n" + tests; var survivingDaemonQueueSymbols = forbiddenDaemonQueueSymbols .Where(symbol => daemonQueueSource.Contains(symbol, StringComparison.Ordinal)) .ToArray(); diff --git a/GameCult.Aetheria.State.Unity.csproj b/GameCult.Aetheria.State.Unity.csproj index 202b795fb..c4bf9528e 100644 --- a/GameCult.Aetheria.State.Unity.csproj +++ b/GameCult.Aetheria.State.Unity.csproj @@ -76,7 +76,6 @@ - @@ -120,7 +119,6 @@ - diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCultCacheDocumentStore.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCultCacheDocumentStore.cs index 817566e80..e9fa48039 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCultCacheDocumentStore.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCultCacheDocumentStore.cs @@ -47,205 +47,6 @@ namespace GameCult.Aetheria.State.Verse CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.Command)); } - public static void WriteDaemonFrame(string path, AetheriaRuntimeDaemonFrameDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.daemon_frame.{document.SessionId}.v1", - AetheriaRuntimeDaemonSchemas.Frame, - "gamecult.aetheria.daemon_frame", - "gamecult.aetheria.daemon_frame.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeDaemonFrameDocument ReadDaemonFrame(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.Frame)); - } - - public static void WriteDaemonSoaView(string path, AetheriaRuntimeDaemonSoaViewDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.daemon_soa_view.{document.SessionId}.v1", - AetheriaRuntimeDaemonSchemas.SoaView, - "gamecult.aetheria.daemon_soa_view", - "gamecult.aetheria.daemon_soa_view.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeDaemonSoaViewDocument ReadDaemonSoaView(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.SoaView)); - } - - public static void WriteAssetManifest(string path, AetheriaRuntimeAssetManifestDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.asset_manifest.{document.RunId}.v1", - AetheriaRuntimeDaemonSchemas.AssetManifest, - "gamecult.aetheria.asset_manifest", - "gamecult.aetheria.asset_manifest.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeAssetManifestDocument ReadAssetManifest(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.AssetManifest)); - } - - public static void WriteDaemonProviderAdvertisement( - string path, - AetheriaRuntimeDaemonProviderAdvertisementDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.daemon_provider.{document.DaemonId}.v1", - AetheriaRuntimeDaemonSchemas.ProviderAdvertisement, - "gamecult.aetheria.daemon_provider_advertisement", - "gamecult.aetheria.daemon_provider_advertisement.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeDaemonProviderAdvertisementDocument ReadDaemonProviderAdvertisement(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.ProviderAdvertisement)); - } - - public static void WriteDaemonHealth(string path, AetheriaRuntimeDaemonHealthDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.daemon_health.{document.DaemonId}.v1", - AetheriaRuntimeDaemonSchemas.Health, - "gamecult.aetheria.daemon_health", - "gamecult.aetheria.daemon_health.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeDaemonHealthDocument ReadDaemonHealth(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.Health)); - } - - public static void WriteVerseAuthorityPolicy( - string path, - AetheriaRuntimeVerseAuthorityPolicyDocument document) - { - WriteDocument( - path, - AetheriaRuntimeVerseAuthorityPolicyDocument.DocumentKey, - AetheriaRuntimeVerseAuthoritySchemas.Policy, - "gamecult.aetheria.verse_authority_policy", - "gamecult.aetheria.verse_authority_policy.v1", - document.UpdatedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeVerseAuthorityPolicyDocument ReadVerseAuthorityPolicy(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeVerseAuthoritySchemas.Policy)); - } - - public static void WriteDaemonCommandBoundary( - string path, - AetheriaRuntimeDaemonCommandBoundaryDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.daemon_command_boundary.{document.BoundaryId}.v1", - AetheriaRuntimeDaemonSchemas.CommandBoundary, - "gamecult.aetheria.daemon_command_boundary", - "gamecult.aetheria.daemon_command_boundary.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeDaemonCommandBoundaryDocument ReadDaemonCommandBoundary(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.CommandBoundary)); - } - - public static void WriteStarbridgeSessionSummary( - string path, - AetheriaRuntimeStarbridgeSessionSummaryDocument document) - { - WriteDocument( - path, - $"latest:gamecult.aetheria.starbridge_session_summary.{document.SessionId}.v1", - AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary, - "gamecult.aetheria.starbridge_session_summary", - "gamecult.aetheria.starbridge_session_summary.v1", - document.PublishedAtUtc, - MessagePackSerializer.Serialize(document)); - } - - public static AetheriaRuntimeStarbridgeSessionSummaryDocument ReadStarbridgeSessionSummary(string path) - { - return MessagePackSerializer.Deserialize( - CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary)); - } - - public static void WriteDaemonGameSurface(string path, AetheriaRuntimeSurfaceDocument document) - { - WriteDaemonSurface( - path, - document, - AetheriaRuntimeDaemonSchemas.GameSurface, - "gamecult.aetheria.daemon_game_surface", - "gamecult.aetheria.daemon_game_surface.v1"); - } - - public static AetheriaRuntimeSurfaceDocument ReadDaemonGameSurface(string path) - { - return ReadRuntimeSurfaceDocument(CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.GameSurface)); - } - - public static void WriteDaemonEditorSurface(string path, AetheriaRuntimeSurfaceDocument document) - { - WriteDaemonSurface( - path, - document, - AetheriaRuntimeDaemonSchemas.EditorSurface, - "gamecult.aetheria.daemon_editor_surface", - "gamecult.aetheria.daemon_editor_surface.v1"); - } - - public static AetheriaRuntimeSurfaceDocument ReadDaemonEditorSurface(string path) - { - return ReadRuntimeSurfaceDocument(CultMesh.ReadSingleFileDocumentPayload(path, AetheriaRuntimeDaemonSchemas.EditorSurface)); - } - - private static void WriteDaemonSurface( - string path, - AetheriaRuntimeSurfaceDocument document, - string schema, - string schemaName, - string schemaVersion) - { - WriteDocument( - path, - $"latest:{schemaName}.{document.Surface.Id}.v1", - schema, - schemaName, - schemaVersion, - document.UpdatedAtUtc, - WriteRuntimeSurfaceDocument(document)); - } - private static void WriteDocument( string path, string key, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs deleted file mode 100644 index e49683abb..000000000 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.IO; - -#nullable enable - -namespace GameCult.Aetheria.State.Verse -{ - public static class AetheriaRuntimeDaemonFrameStore - { - public static string GetFramePath(string stateFilePath) - { - if (string.IsNullOrWhiteSpace(stateFilePath)) - throw new ArgumentException("State file path must be non-empty.", nameof(stateFilePath)); - - return AetheriaRuntimeStateBoundary.GetDaemonFramePath(stateFilePath); - } - - public static string PublishFrame(string stateFilePath, AetheriaRuntimeDaemonFrameDocument frame) - { - if (frame == null) throw new ArgumentNullException(nameof(frame)); - - frame.Schema = AetheriaRuntimeDaemonSchemas.Frame; - if (string.IsNullOrWhiteSpace(frame.PublishedAtUtc)) - frame.PublishedAtUtc = DateTime.UtcNow.ToString("O"); - - var framePath = GetFramePath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(framePath) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonFrame(framePath, frame); - return framePath; - } - - public static AetheriaRuntimeDaemonFrameDocument ReadPublishedFrame(string stateFilePath) - { - return AetheriaRuntimeCultCacheDocumentStore.ReadDaemonFrame(GetFramePath(stateFilePath)); - } - - public static bool TryReadPublishedFrame( - string stateFilePath, - out AetheriaRuntimeDaemonFrameDocument frame) - { - var framePath = GetFramePath(stateFilePath); - if (!File.Exists(framePath)) - { - frame = null!; - return false; - } - - frame = AetheriaRuntimeCultCacheDocumentStore.ReadDaemonFrame(framePath); - return true; - } - } -} diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs.meta b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs.meta deleted file mode 100644 index dafaa0eee..000000000 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonFrameStore.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 2da25246f5a801f4db2d26f4100b70ad \ No newline at end of file diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs deleted file mode 100644 index 2a3c491dc..000000000 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System; -using System.IO; - -#nullable enable - -namespace GameCult.Aetheria.State.Verse -{ - public static class AetheriaRuntimeDaemonPublicationStore - { - public static string GetProviderAdvertisementPath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonProviderPath(stateFilePath); - } - - public static string GetHealthPath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonHealthPath(stateFilePath); - } - - public static string GetVerseAuthorityPolicyPath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetVerseAuthorityPolicyPath(stateFilePath); - } - - public static string GetCommandBoundaryPath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonCommandBoundaryPath(stateFilePath); - } - - public static string GetAssetManifestPath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonAssetManifestPath(stateFilePath); - } - - public static string GetStarbridgeSessionSummaryPath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonStarbridgeSessionSummaryPath(stateFilePath); - } - - public static string GetGameSurfacePath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonGameSurfacePath(stateFilePath); - } - - public static string GetGameTuiSurfacePath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonGameTuiSurfacePath(stateFilePath); - } - - public static string GetEditorSurfacePath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonEditorSurfacePath(stateFilePath); - } - - public static string GetEditorTuiSurfacePath(string stateFilePath) - { - return AetheriaRuntimeStateBoundary.GetDaemonEditorTuiSurfacePath(stateFilePath); - } - - public static string PublishProviderAdvertisement( - string stateFilePath, - AetheriaRuntimeDaemonProviderAdvertisementDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - document.Schema = AetheriaRuntimeDaemonSchemas.ProviderAdvertisement; - if (string.IsNullOrWhiteSpace(document.PublishedAtUtc)) - document.PublishedAtUtc = DateTime.UtcNow.ToString("O"); - - var path = GetProviderAdvertisementPath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonProviderAdvertisement(path, document); - return path; - } - - public static string PublishHealth(string stateFilePath, AetheriaRuntimeDaemonHealthDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - document.Schema = AetheriaRuntimeDaemonSchemas.Health; - if (string.IsNullOrWhiteSpace(document.PublishedAtUtc)) - document.PublishedAtUtc = DateTime.UtcNow.ToString("O"); - - var path = GetHealthPath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonHealth(path, document); - return path; - } - - public static string PublishVerseAuthorityPolicy( - string stateFilePath, - AetheriaRuntimeVerseAuthorityPolicyDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - document.Schema = AetheriaRuntimeVerseAuthoritySchemas.Policy; - if (string.IsNullOrWhiteSpace(document.UpdatedAtUtc)) - document.UpdatedAtUtc = DateTime.UtcNow.ToString("O"); - - var path = GetVerseAuthorityPolicyPath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteVerseAuthorityPolicy(path, document); - return path; - } - - public static string PublishCommandBoundary( - string stateFilePath, - AetheriaRuntimeDaemonCommandBoundaryDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - document.Schema = AetheriaRuntimeDaemonSchemas.CommandBoundary; - if (string.IsNullOrWhiteSpace(document.PublishedAtUtc)) - document.PublishedAtUtc = DateTime.UtcNow.ToString("O"); - - var path = GetCommandBoundaryPath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonCommandBoundary(path, document); - return path; - } - - public static string PublishAssetManifest( - string stateFilePath, - AetheriaRuntimeAssetManifestDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - document.Schema = AetheriaRuntimeDaemonSchemas.AssetManifest; - if (string.IsNullOrWhiteSpace(document.PublishedAtUtc)) - document.PublishedAtUtc = DateTime.UtcNow.ToString("O"); - - var path = GetAssetManifestPath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteAssetManifest(path, document); - return path; - } - - public static string PublishStarbridgeSessionSummary( - string stateFilePath, - AetheriaRuntimeStarbridgeSessionSummaryDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - document.Schema = AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary; - if (string.IsNullOrWhiteSpace(document.PublishedAtUtc)) - document.PublishedAtUtc = DateTime.UtcNow.ToString("O"); - - var path = GetStarbridgeSessionSummaryPath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteStarbridgeSessionSummary(path, document); - return path; - } - - public static string PublishGameSurface(string stateFilePath, AetheriaRuntimeSurfaceDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - var path = GetGameSurfacePath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonGameSurface(path, document); - return path; - } - - public static string PublishGameTuiSurface(string stateFilePath, AetheriaRuntimeSurfaceDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - var path = GetGameTuiSurfacePath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonGameSurface(path, document); - return path; - } - - public static string PublishEditorSurface(string stateFilePath, AetheriaRuntimeSurfaceDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - var path = GetEditorSurfacePath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonEditorSurface(path, document); - return path; - } - - public static string PublishEditorTuiSurface(string stateFilePath, AetheriaRuntimeSurfaceDocument document) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - var path = GetEditorTuiSurfacePath(stateFilePath); - Directory.CreateDirectory(Path.GetDirectoryName(path) ?? "."); - AetheriaRuntimeCultCacheDocumentStore.WriteDaemonEditorSurface(path, document); - return path; - } - - } -} diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs.meta b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs.meta deleted file mode 100644 index f2e398941..000000000 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonPublicationStore.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 893394e396737fe48a79566dbbfd5272 \ No newline at end of file