From 266c33324e7360681e58e2a6e6ab36c3ddba9979 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 13:11:45 +0100 Subject: [PATCH] Keep runtime command port typed at the public edge --- Aetheria.State.Verify/Program.cs | 19 ++++++++++++++++++- Aetheria.State/docs/verse-daemon-shape.md | 2 +- .../Runtime/AetheriaRuntimeCommandPort.cs | 4 ++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index d4219044d..f2615a0f5 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -6774,7 +6774,7 @@ static void RequireDaemonVersePublication(string root) "Queues are an implementation detail.", "Eve commands and daemon commands are typed `gamecult.eve.command.v1` and `gamecult.aetheria.daemon_command.v1` records in the Aetheria state graph", "`AetheriaCommandPort` is the neutral command submission implementation for typed command records.", - "Unity-side command lowerers may use `AetheriaRuntimeCommandPort` as a facade over that same port.", + "Client-side command lowerers may use typed runtime clients over that same port.", "`CommandLog`, `Inbox`, `mailbox`, `.eve.commands`, `.daemon.commands`, `.cc.pending`, or `" + "Pending" + "CultCacheStore` in Unity-facing daemon/Eve command code", "Do not add a private HTTP dashboard, Unity-only inspector, JSON status blob, or agent-specific daemon wrapper as canonical truth." }; @@ -6872,6 +6872,8 @@ static void RequireTypedEveCommandBodies(string root) "global::Aetheria.State.AetheriaCommandPort", "public const string DefaultRuntimeId = \"aetheria-command-client\"", "string.IsNullOrWhiteSpace(runtimeId) ? DefaultRuntimeId : runtimeId", + "internal Task SubmitDaemonCommandAsync(", + "internal Task SubmitEveCommandAsync(", "internal static class AetheriaRuntimeCommandSubmitter", "TrySubmitEveCommand(", "TrySubmitDaemonCommand(", @@ -6982,6 +6984,21 @@ static void RequireTypedEveCommandBodies(string root) "Shared command runtime still exposes the generic transport submitter publicly instead of routing callers through typed clients."); } + var forbiddenRuntimePortSubmitMethods = new[] + { + "public Task SubmitDaemonCommandAsync(", + "public Task SubmitEveCommandAsync(" + }; + var publicRuntimePortSubmitHits = forbiddenRuntimePortSubmitMethods + .Where(symbol => runtimeCommandPort.Contains(symbol, StringComparison.Ordinal)) + .ToArray(); + if (publicRuntimePortSubmitHits.Length > 0) + { + throw new InvalidOperationException( + "Runtime command port still exposes raw document submission publicly instead of routing callers through typed clients: " + + string.Join(", ", publicRuntimePortSubmitHits)); + } + var forbiddenUnitySubmitterSymbols = new[] { "AetheriaRuntimeCommandSubmitter.TrySubmitEveCommand(", diff --git a/Aetheria.State/docs/verse-daemon-shape.md b/Aetheria.State/docs/verse-daemon-shape.md index dea8af1ef..b29f42315 100644 --- a/Aetheria.State/docs/verse-daemon-shape.md +++ b/Aetheria.State/docs/verse-daemon-shape.md @@ -39,7 +39,7 @@ The bridge layer must point at daemon-owned witnesses instead of becoming a seco Queues are an implementation detail. Eve commands and daemon commands are typed `gamecult.eve.command.v1` and `gamecult.aetheria.daemon_command.v1` records in the Aetheria state graph; the old `.pending` runtime commit outbox is gone. None of those folders are the public API, daemon identity, or a substitute for CultNet/CultMesh command ports. Anything still named `Queue*`, `CommandLog`, `Inbox`, `mailbox`, `.eve.commands`, `.daemon.commands`, `.cc.pending`, or `PendingCultCacheStore` in Unity-facing daemon/Eve command code should lower to typed command documents and be demoted behind typed operation methods as the CultNet command boundaries come online. -`AetheriaCommandPort` is the neutral command submission implementation for typed command records. Unity-side command lowerers may use `AetheriaRuntimeCommandPort` as a facade over that same port. They must not drain those records or mutate state in response; ownership stays with the daemon Verse member. +`AetheriaCommandPort` is the neutral command submission implementation for typed command records. Client-side command lowerers may use typed runtime clients over that same port. They must not drain those records or mutate state in response; ownership stays with the daemon Verse member. Migration rule: do not expose string command names and payload maps as public Aetheria APIs. Compatibility adapters may decode external Eve requests at the edge, but persisted Aetheria command documents and Unity gameplay calls should use typed command bodies and typed operation methods. diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCommandPort.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCommandPort.cs index 2969928ca..296a62c46 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCommandPort.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeCommandPort.cs @@ -167,13 +167,13 @@ namespace GameCult.Aetheria.State.Verse return new AetheriaRuntimeCommandPort(port); } - public Task SubmitDaemonCommandAsync( + internal Task SubmitDaemonCommandAsync( AetheriaRuntimeDaemonCommandDocument command) { return _port.SubmitDaemonCommandAsync(command); } - public Task SubmitEveCommandAsync( + internal Task SubmitEveCommandAsync( AetheriaRuntimeEveCommandDocument command) { return _port.SubmitEveCommandAsync(command);