Use runtime-neutral daemon client defaults

This commit is contained in:
Meta Vens 2026-06-21 12:51:48 +01:00
commit bd2b491b59
4 changed files with 79 additions and 3 deletions

View file

@ -5913,6 +5913,8 @@ static void RequireTypedDaemonCommandPayloads(string root)
var requiredClientSymbols = new[]
{
"public const string DefaultClientId = \"aetheria-daemon-client\"",
"ClientId = string.IsNullOrWhiteSpace(clientId) ? DefaultClientId : clientId",
"private AetheriaRuntimeDaemonCommandEnvelope Send(AetheriaRuntimeDaemonCommandDocument command)",
"ReadObservedDaemonCommands()",
"Func<AetheriaRuntimeDaemonOperationClient, AetheriaRuntimeObservedDaemonState, AetheriaRuntimeDaemonCommandEnvelope> submit",
@ -6040,6 +6042,29 @@ static void RequireTypedDaemonCommandPayloads(string root)
string.Join(", ", clientDocumentBuilderHits));
}
var forbiddenSharedDaemonClientDefaults = new[]
{
"string clientId = \"unity-observer\"",
"? \"unity-observer\" :",
"? \"unity-uitoolkit\" : request.ClientId"
};
var sharedDaemonDefaultSources = new Dictionary<string, string>
{
["daemon operation client"] = daemonClient,
["daemon surface commands"] = daemonSurfaceCommands
};
var sharedDaemonDefaultHits = sharedDaemonDefaultSources
.SelectMany(source => forbiddenSharedDaemonClientDefaults
.Where(symbol => source.Value.Contains(symbol, StringComparison.Ordinal))
.Select(symbol => $"{source.Key}: {symbol}"))
.ToArray();
if (sharedDaemonDefaultHits.Length > 0)
{
throw new InvalidOperationException(
"Shared daemon command clients still use Unity-specific fallback client ids: " +
string.Join(", ", sharedDaemonDefaultHits));
}
if (tests.Contains("AetheriaRuntimeDaemonCommandLog.", StringComparison.Ordinal))
{
throw new InvalidOperationException(