From 512e19838996f8b5a33459aa8bfa3e1ea09fd8d7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 08:25:05 +0100 Subject: [PATCH] Keep Eve command emission in runtime package --- .voidbot/state/aetheria.cc | Bin 76385 -> 77912 bytes .../Aetheria.State.Smoke.csproj | 1 + Aetheria.State.Smoke/Program.cs | 30 +++++---- Aetheria.State/AetheriaEveCommandBridge.cs | 63 ------------------ docs/aetheria-perfect-machine-map.md | 4 ++ 5 files changed, 23 insertions(+), 75 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 436232b86e4c2f2441195e48d79449a0b4ad499c..e5d0be56a298c87d4bb50b309feefa7aa8a8ec3b 100644 GIT binary patch delta 1274 zcmZ{kziSjh6vx@*kfch4L=z>+!$MSYYs`6yrjQr~8$qL@1PkYOUv39?XErmlcN{4q zM67IN!L<*fh-e^)V55j)8`Q#B#s9)W!MA(67mZro-J2ix{eIu)&9~2`FPo*+M_s)q zPFAXRW#ahUJ!>$2-*q=H9GT1tvU{;89LowlrLiv9yLPbj>bsT1i>LM4)t?_ASs%6r z$3i6=+(lK!29_Ne1WdSPS1~TiQuwW8=b&}nox4!%(zF-OHW2cyfC1Np z=uUx(gy8`~$ef$3jv$*t!$O1+x}B5r+(&IcbbQ8xuU3Ej%%C0z7KT1gzbFi)GHFG);G&PT49syP-9ZLziqZ~A1{d{0 zuC^Z;6lqW!?=E{3Ouqa_l!YU%K^yM-z?R@VYE21VpdcYl4CbW@m>H*}47AVyqq5Sb zOgU-|Gm&p*m_z?i*mk881t`o^x-&A7qNT`y_GIL{sTH3&NO546ZlTMOE;^uwS(*;5 zG68Nx_8n$YSKP!4F9w$0o{^ajghn zf|RRlz0-F3$E%V&nN~=d|KB$`Wr}vxS{*9WwiPn%Crmh=RI@m*C;gBq}qSwa=|{-6nBZ`Y&fXjbV&z}fAv#CjdI=sI`db8_{N=q_|z^qckWUkZ(@72bkXxIy0f-!o5dOuLR)=m`$_JPSO=_X z@_NMDM<1(w*3iKf;`mvPQMqmYu|s?XsJ*8?)|u0y7lSxSMn|pvJ^7|Ef;Dyam>m-uy_lI`<24kj#ew delta 184 zcmccdfaT#8mJQ39IE}0f%=JvoEutneicUVt)B_c;FaZnXGgrd|ASyUm(Pm~~1TtrOwF=__cCfse!Q_w3;*;~4 k*`~* + diff --git a/Aetheria.State.Smoke/Program.cs b/Aetheria.State.Smoke/Program.cs index ca402191b..ade754924 100644 --- a/Aetheria.State.Smoke/Program.cs +++ b/Aetheria.State.Smoke/Program.cs @@ -2,6 +2,8 @@ using Aetheria.State; using Aetheria.State.Documents; using Aetheria.State.Migration; using GameCult.Caching; +using GameCult.Aetheria.State.Unity; +using GameCult.Eve.Surface; var root = args.Length > 0 ? args[0] : Directory.GetCurrentDirectory(); var statePath = AetheriaStatePaths.ResolveDefaultStatePath(root); @@ -105,20 +107,24 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s await node.PutOperationsSurfaceAsync(AetheriaOperationsSurfaceProjector.Build(drainStatus)); await node.PutProviderAdvertisementAsync(AetheriaProviderAdvertisementProjector.Build(statePath, now)); - AetheriaEveCommandBridge.QueueCommand( + AetheriaRuntimeEveCommandLog.QueueCommand( statePath, - AetheriaProviderAdvertisementProjector.ProviderId, - AetheriaCatalogSurfaceProjector.SurfaceId, - "aetheria.catalog.refresh", - new Dictionary { ["source"] = "state-smoke" }, - "aetheria-state-smoke"); - AetheriaEveCommandBridge.QueueCommand( + new EveSurfaceCommandRequest( + AetheriaProviderAdvertisementProjector.ProviderId, + AetheriaCatalogSurfaceProjector.SurfaceId, + "aetheria.catalog.refresh", + new Dictionary { ["source"] = "state-smoke" }, + DateTimeOffset.UtcNow, + "aetheria-state-smoke")); + AetheriaRuntimeEveCommandLog.QueueCommand( statePath, - AetheriaProviderAdvertisementProjector.ProviderId, - AetheriaCatalogSurfaceProjector.SurfaceId, - "aetheria.catalog.unknown", - new Dictionary { ["source"] = "state-smoke" }, - "aetheria-state-smoke"); + new EveSurfaceCommandRequest( + AetheriaProviderAdvertisementProjector.ProviderId, + AetheriaCatalogSurfaceProjector.SurfaceId, + "aetheria.catalog.unknown", + new Dictionary { ["source"] = "state-smoke" }, + DateTimeOffset.UtcNow, + "aetheria-state-smoke")); var eveCommandReport = await AetheriaEveCommandBridge.ApplyPendingAsync(node); var eveCommandStatus = new AetheriaEveCommandDrainStatus { diff --git a/Aetheria.State/AetheriaEveCommandBridge.cs b/Aetheria.State/AetheriaEveCommandBridge.cs index 8af91ac55..bf3d81610 100644 --- a/Aetheria.State/AetheriaEveCommandBridge.cs +++ b/Aetheria.State/AetheriaEveCommandBridge.cs @@ -1,4 +1,3 @@ -using System.Buffers; using Aetheria.State.Documents; using MessagePack; @@ -80,43 +79,6 @@ public static class AetheriaEveCommandBridge return report; } - public static void QueueCommand( - string stateFilePath, - string providerId, - string surfaceId, - string command, - IReadOnlyDictionary? payload = null, - string clientId = "aetheria-state") - { - var issuedAtUtc = DateTimeOffset.UtcNow.UtcDateTime.ToString("O"); - var commandId = Guid.NewGuid().ToString("N"); - var pendingDirectory = GetPendingDirectory(stateFilePath); - Directory.CreateDirectory(pendingDirectory); - - var finalPath = Path.Combine( - pendingDirectory, - $"{issuedAtUtc.Replace(':', '-')}.{StableToken(surfaceId)}.{StableToken(command)}.{commandId}.cc"); - var tempPath = finalPath + ".tmp"; - - var buffer = new ArrayBufferWriter(); - var writer = new MessagePackWriter(buffer); - writer.WriteArrayHeader(8); - writer.Write(CommandSchema); - writer.Write(commandId); - writer.Write(providerId ?? ""); - writer.Write(surfaceId ?? ""); - writer.Write(command ?? ""); - writer.Write(issuedAtUtc); - writer.Write(clientId ?? ""); - WritePayload(ref writer, payload); - writer.Flush(); - - File.WriteAllBytes(tempPath, buffer.WrittenSpan.ToArray()); - if (File.Exists(finalPath)) - File.Delete(finalPath); - File.Move(tempPath, finalPath); - } - private static AetheriaPendingEveCommand ReadCommand(string path) { var reader = new MessagePackReader(File.ReadAllBytes(path)); @@ -199,17 +161,6 @@ public static class AetheriaEveCommandBridge }; } - private static void WritePayload(ref MessagePackWriter writer, IReadOnlyDictionary? payload) - { - payload ??= new Dictionary(0, StringComparer.Ordinal); - writer.WriteMapHeader(payload.Count); - foreach (var entry in payload.OrderBy(entry => entry.Key, StringComparer.Ordinal)) - { - writer.Write(entry.Key ?? ""); - writer.Write(entry.Value ?? ""); - } - } - private static IReadOnlyDictionary ReadPayload(ref MessagePackReader reader) { var count = reader.ReadMapHeader(); @@ -225,20 +176,6 @@ public static class AetheriaEveCommandBridge return payload; } - private static string StableToken(string value) - { - if (string.IsNullOrWhiteSpace(value)) - return "empty"; - - var chars = value - .Select(character => char.IsLetterOrDigit(character) ? character : '-') - .ToArray(); - var token = new string(chars).Trim('-').ToLowerInvariant(); - while (token.Contains("--", StringComparison.Ordinal)) - token = token.Replace("--", "-", StringComparison.Ordinal); - return string.IsNullOrWhiteSpace(token) ? "empty" : token; - } - private static string ReadString(ref MessagePackReader reader) { return reader.ReadString() ?? ""; diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 76ce87dac..f10855484 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -900,6 +900,10 @@ First Aetheria surfaces to publish: validates provider/surface/command templates, invokes the current refresh handlers, republishes accepted surfaces, rejects unknown commands, and records typed command-drain status. + - Done: delete provider-side Eve command emission from + `AetheriaEveCommandBridge`; renderer/runtime command files are queued + through `AetheriaRuntimeEveCommandLog`, while the provider bridge only + validates, applies, reports, and deletes accounted commands. - Extend the command bridge beyond refresh commands as gameplay/editor Eve surfaces acquire provider-owned handlers. - Wire the presenter into a Unity scene/prefab for the first runtime surface