Remove observed daemon state path witnesses
This commit is contained in:
parent
58170328a9
commit
42a95780a8
7 changed files with 31 additions and 36 deletions
|
|
@ -3238,7 +3238,7 @@ static void RequireEveRuntimeBootstrap(string root)
|
|||
"request.ProviderId, \"aetheria.daemon\"",
|
||||
"AetheriaClient",
|
||||
"AetheriaRuntimeObservedDaemonState",
|
||||
".ReadAsync(client.State, client.StatePath)",
|
||||
".ReadAsync(client.State)",
|
||||
"new AetheriaRuntimeDaemonOperationClient(",
|
||||
"AetheriaRuntimeDaemonSurfaceCommandCatalog.TrySubmitArgumentless(",
|
||||
"AetheriaRuntimeDaemonSurfaceCommandCatalog.CommandPrefix"
|
||||
|
|
@ -13760,9 +13760,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
"AetheriaClientState state",
|
||||
"state.Daemon.LatestFrame.LatestAsync()",
|
||||
"state.Daemon.LatestSoaView.LatestAsync()",
|
||||
"AetheriaRuntimeDaemonSoaViewIndex.Build(soaView)",
|
||||
"AetheriaRuntimeDaemonFrameStore.GetFramePath(statePath)",
|
||||
"AetheriaRuntimeDaemonSoaViewStore.GetViewPath(statePath)"
|
||||
"AetheriaRuntimeDaemonSoaViewIndex.Build(soaView)"
|
||||
};
|
||||
var missingObservedDaemonStateSymbols = requiredObservedDaemonStateSymbols
|
||||
.Where(symbol => !observedDaemonState.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -13774,6 +13772,24 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
string.Join(", ", missingObservedDaemonStateSymbols));
|
||||
}
|
||||
|
||||
var forbiddenObservedDaemonStateSymbols = new[]
|
||||
{
|
||||
"string statePath",
|
||||
"FramePath",
|
||||
"SoaViewPath",
|
||||
"AetheriaRuntimeDaemonFrameStore.GetFramePath",
|
||||
"AetheriaRuntimeDaemonSoaViewStore.GetViewPath"
|
||||
};
|
||||
var observedDaemonStateBypassHits = forbiddenObservedDaemonStateSymbols
|
||||
.Where(symbol => observedDaemonState.Contains(symbol, StringComparison.Ordinal))
|
||||
.ToArray();
|
||||
if (observedDaemonStateBypassHits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Observed daemon state still projects managed daemon documents back into witness file paths: " +
|
||||
string.Join(", ", observedDaemonStateBypassHits));
|
||||
}
|
||||
|
||||
var forbiddenDaemonClientBypassSymbols = new[]
|
||||
{
|
||||
"return _verse.GetObservedDaemonStateAsync();",
|
||||
|
|
@ -13872,7 +13888,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
!daemonObserver.Contains("AetheriaUnityRuntimeClientProvider.ResolveClient(", StringComparison.Ordinal) ||
|
||||
!daemonObserver.Contains("AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory)", StringComparison.Ordinal) ||
|
||||
!daemonObserver.Contains("AetheriaRuntimeObservedDaemonState", StringComparison.Ordinal) ||
|
||||
!daemonObserver.Contains(".ReadAsync(client.State, client.StatePath)", StringComparison.Ordinal))
|
||||
!daemonObserver.Contains(".ReadAsync(client.State)", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"AetheriaDaemonObserver no longer composes observed daemon state from managed Aetheria client documents.");
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public sealed class AetheriaDaemonObserver : MonoBehaviour
|
|||
{
|
||||
var client = ResolveClient();
|
||||
return AetheriaRuntimeObservedDaemonState
|
||||
.ReadAsync(client.State, client.StatePath)
|
||||
.ReadAsync(client.State)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ public class DaemonRuntimeDocumentTests
|
|||
using var zoneRenderReactive = client.State
|
||||
.Reactive<AetheriaRuntimeZoneRenderDocument>();
|
||||
var observed = AetheriaRuntimeObservedDaemonState
|
||||
.ReadAsync(client.State, client.StatePath)
|
||||
.ReadAsync(client.State)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var observedAuthoritativeFrame = client.State.Daemon.LatestFrame.LatestAsync().GetAwaiter().GetResult();
|
||||
|
|
@ -2158,7 +2158,7 @@ public class DaemonRuntimeDocumentTests
|
|||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var observed = AetheriaRuntimeObservedDaemonState
|
||||
.ReadAsync(client.State, client.StatePath)
|
||||
.ReadAsync(client.State)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
|
|
@ -2169,8 +2169,6 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreEqual("entity:observer-target", observed.Run.CurrentEntityKey);
|
||||
Assert.AreEqual(300, observed.Frame.FrameId);
|
||||
Assert.AreEqual(301, observed.SoaView.Generation);
|
||||
Assert.AreEqual(AetheriaRuntimeStateBoundary.GetDaemonFramePath(statePath), observed.FramePath);
|
||||
Assert.AreEqual(AetheriaRuntimeStateBoundary.GetDaemonSoaViewPath(statePath), observed.SoaViewPath);
|
||||
Assert.IsFalse(observed.SoaView.Buffers[0].ObserverWritable);
|
||||
}
|
||||
|
||||
|
|
@ -2202,7 +2200,7 @@ public class DaemonRuntimeDocumentTests
|
|||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var observed = AetheriaRuntimeObservedDaemonState
|
||||
.ReadAsync(client.State, client.StatePath)
|
||||
.ReadAsync(client.State)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
|
||||
|
|
@ -2213,8 +2211,6 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreEqual("daemon-frame-only-run", observed.Run.RunId);
|
||||
Assert.AreEqual("entity:frame-only-target", observed.Run.CurrentEntityKey);
|
||||
Assert.AreEqual(301, observed.Frame.FrameId);
|
||||
Assert.AreEqual(AetheriaRuntimeStateBoundary.GetDaemonFramePath(statePath), observed.FramePath);
|
||||
Assert.AreEqual(AetheriaRuntimeStateBoundary.GetDaemonSoaViewPath(statePath), observed.SoaViewPath);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
|
@ -4172,9 +4168,7 @@ public class DaemonRuntimeDocumentTests
|
|||
|
||||
return new AetheriaRuntimeObservedDaemonState(
|
||||
frame,
|
||||
soaView,
|
||||
"state.cc.daemon.frame.cc",
|
||||
"state.cc.daemon.soa.cc");
|
||||
soaView);
|
||||
}
|
||||
|
||||
private static void PublishLatestFrameThroughVerseClient(
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
if (submit == null) throw new ArgumentNullException(nameof(submit));
|
||||
|
||||
var observed = AetheriaRuntimeObservedDaemonState
|
||||
.ReadAsync(State, StatePath)
|
||||
.ReadAsync(State)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var operationClient = new AetheriaRuntimeDaemonOperationClient(
|
||||
|
|
|
|||
|
|
@ -37,8 +37,6 @@ namespace GameCult.Aetheria.State.Verse
|
|||
public long LastSoaGeneration { get; private set; } = -1;
|
||||
public string LastDaemonId { get; private set; } = "";
|
||||
public string LastSessionId { get; private set; } = "";
|
||||
public string LastFramePath { get; private set; } = "";
|
||||
public string LastSoaViewPath { get; private set; } = "";
|
||||
|
||||
public AetheriaRuntimeDaemonObservationResult Observe(AetheriaRuntimeObservedDaemonState? observed)
|
||||
{
|
||||
|
|
@ -64,8 +62,6 @@ namespace GameCult.Aetheria.State.Verse
|
|||
LastSoaGeneration = soaGeneration;
|
||||
LastDaemonId = frame.DaemonId ?? "";
|
||||
LastSessionId = frame.SessionId ?? "";
|
||||
LastFramePath = observed.FramePath ?? "";
|
||||
LastSoaViewPath = observed.SoaViewPath ?? "";
|
||||
|
||||
return new AetheriaRuntimeDaemonObservationResult(
|
||||
true,
|
||||
|
|
@ -82,8 +78,6 @@ namespace GameCult.Aetheria.State.Verse
|
|||
LastSoaGeneration = -1;
|
||||
LastDaemonId = "";
|
||||
LastSessionId = "";
|
||||
LastFramePath = "";
|
||||
LastSoaViewPath = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
}
|
||||
|
||||
var observed = AetheriaRuntimeObservedDaemonState
|
||||
.ReadAsync(client.State, client.StatePath)
|
||||
.ReadAsync(client.State)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
var operationClient = new AetheriaRuntimeDaemonOperationClient(
|
||||
|
|
|
|||
|
|
@ -10,29 +10,22 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
public AetheriaRuntimeObservedDaemonState(
|
||||
AetheriaRuntimeDaemonFrameDocument frame,
|
||||
AetheriaRuntimeDaemonSoaViewDocument? soaView,
|
||||
string framePath,
|
||||
string soaViewPath)
|
||||
AetheriaRuntimeDaemonSoaViewDocument? soaView)
|
||||
{
|
||||
Frame = frame ?? throw new ArgumentNullException(nameof(frame));
|
||||
SoaView = soaView;
|
||||
SoaIndex = AetheriaRuntimeDaemonSoaViewIndex.Build(soaView);
|
||||
FramePath = framePath ?? "";
|
||||
SoaViewPath = soaViewPath ?? "";
|
||||
}
|
||||
|
||||
public AetheriaRuntimeDaemonFrameDocument Frame { get; }
|
||||
public AetheriaRuntimeDaemonSoaViewDocument? SoaView { get; }
|
||||
public AetheriaRuntimeDaemonSoaViewIndex SoaIndex { get; }
|
||||
public string FramePath { get; }
|
||||
public string SoaViewPath { get; }
|
||||
public bool HasSoaView => SoaView != null && SoaIndex.IsValid;
|
||||
public bool IsAuthoritative => Frame.IsAuthoritative;
|
||||
public AetheriaRuntimeRunCheckpointCommit Run => Frame.Run;
|
||||
|
||||
public static async Task<AetheriaRuntimeObservedDaemonState?> ReadAsync(
|
||||
AetheriaClientState state,
|
||||
string statePath)
|
||||
AetheriaClientState state)
|
||||
{
|
||||
if (state == null) throw new ArgumentNullException(nameof(state));
|
||||
|
||||
|
|
@ -49,9 +42,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
return new AetheriaRuntimeObservedDaemonState(
|
||||
frame,
|
||||
soaView,
|
||||
AetheriaRuntimeDaemonFrameStore.GetFramePath(statePath),
|
||||
AetheriaRuntimeDaemonSoaViewStore.GetViewPath(statePath));
|
||||
soaView);
|
||||
}
|
||||
|
||||
private static async Task<AetheriaRuntimeDaemonSoaViewDocument?> TryReadLatestSoaViewAsync(
|
||||
|
|
|
|||
Loading…
Reference in a new issue