Use client-neutral shared surface vocabulary
This commit is contained in:
parent
768712469b
commit
4846b8fad4
11 changed files with 48 additions and 14 deletions
|
|
@ -11,6 +11,7 @@ RequireGameplaySourcePurity(root);
|
|||
RequirePackageSerializerBoundary(root);
|
||||
RequireSharedEvePackagesImportedFromEveRepo(root);
|
||||
RequireSharedRuntimeSurfaceCommandsUseCultMeshTransport(root);
|
||||
RequireSharedRuntimeSurfacesUseClientNeutralVocabulary(root);
|
||||
RequireTypedPendingCommitKeys(root);
|
||||
RequireTypedRuntimeFactionKeys(root);
|
||||
RequireTypedGalaxyFactionRelationships(root);
|
||||
|
|
@ -748,6 +749,39 @@ static void RequireSharedRuntimeSurfaceCommandsUseCultMeshTransport(string root)
|
|||
Console.WriteLine("Shared runtime surface commands: command templates advertise CultMesh transport instead of Unity UI Toolkit");
|
||||
}
|
||||
|
||||
static void RequireSharedRuntimeSurfacesUseClientNeutralVocabulary(string root)
|
||||
{
|
||||
var runtimePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime");
|
||||
if (!Directory.Exists(runtimePath))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Shared runtime surface vocabulary cannot be verified because the state runtime package is missing.");
|
||||
}
|
||||
|
||||
var forbiddenSurfaceVocabulary = new[]
|
||||
{
|
||||
"Unity supplies",
|
||||
"Unity projects",
|
||||
"Unity reads",
|
||||
"Unity must observe",
|
||||
"Unity runtime shells"
|
||||
};
|
||||
var hits = Directory.EnumerateFiles(runtimePath, "*.cs", SearchOption.TopDirectoryOnly)
|
||||
.SelectMany(path => File.ReadLines(path)
|
||||
.Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line }))
|
||||
.Where(line => forbiddenSurfaceVocabulary.Any(symbol => line.Line.Contains(symbol, StringComparison.Ordinal)))
|
||||
.Select(line => $"{Path.GetRelativePath(root, line.Path)}:{line.LineNumber}: {line.Line.Trim()}")
|
||||
.ToArray();
|
||||
if (hits.Length > 0)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Shared runtime surfaces still describe their contract as Unity-owned instead of client-neutral CultMesh API: " +
|
||||
string.Join("; ", hits));
|
||||
}
|
||||
|
||||
Console.WriteLine("Shared runtime surfaces: surface copy uses client-neutral observer vocabulary");
|
||||
}
|
||||
|
||||
static void RequirePackageSerializerBoundary(string root)
|
||||
{
|
||||
var packageRuntimeRoot = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime");
|
||||
|
|
@ -3993,7 +4027,7 @@ static void RequireTradeCargoSelectorUseEveSurface(string root)
|
|||
"public static string ShipBayCommand(",
|
||||
"public static AetheriaRuntimeSurfaceDocument Build(",
|
||||
"providerKind: \"trade.menu\"",
|
||||
"Unity projects available cargo targets; the shared runtime surface owns the cargo selector contract."
|
||||
"The observing client projects available cargo targets; the shared runtime surface owns the cargo selector contract."
|
||||
};
|
||||
var missingBuilderSymbols = requiredBuilderSymbols
|
||||
.Where(symbol => !tradeCargoSelectorSurfaceBuilder.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -4211,7 +4245,7 @@ static void RequireTradeItemDetailsUseEveSurface(string root)
|
|||
"AetheriaRuntimeTradeItemMetric",
|
||||
"public static AetheriaRuntimeSurfaceDocument Build(",
|
||||
"providerKind: \"trade.menu\"",
|
||||
"Unity supplies the selected market row; the shared runtime surface owns trade item inspection layout."
|
||||
"The observing client supplies the selected market row; the shared runtime surface owns trade item inspection layout."
|
||||
};
|
||||
var missingBuilderSymbols = requiredBuilderSymbols
|
||||
.Where(symbol => !tradeItemDetailsSurfaceBuilder.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -4322,7 +4356,7 @@ static void RequireInventoryDropdownUseEveSurface(string root)
|
|||
"public static string LoadoutCommand(",
|
||||
"public static AetheriaRuntimeSurfaceDocument Build(",
|
||||
"providerKind: \"inventory.panel\"",
|
||||
"Unity projects available inventory navigation; the shared runtime surface owns the dropdown contract."
|
||||
"The observing client projects available inventory navigation; the shared runtime surface owns the dropdown contract."
|
||||
};
|
||||
var missingBuilderSymbols = requiredBuilderSymbols
|
||||
.Where(symbol => !inventoryDropdownSurfaceBuilder.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
: state.Description),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"Unity supplies the selected item; the shared runtime surface owns cargo-item inspection layout."),
|
||||
"The observing client supplies the selected item; the shared runtime surface owns cargo-item inspection layout."),
|
||||
Metric($"{SurfaceId}.manufacturer", "Manufacturer", state.Manufacturer),
|
||||
Metric($"{SurfaceId}.mass", "Mass", state.Mass))
|
||||
};
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
? state.BootFailureMessage
|
||||
: string.Equals(state.TargetSource, "state-path-override", StringComparison.Ordinal)
|
||||
? "AETHERIA_STATE_PATH is overriding the persisted client target. Update the environment if you want boot to follow the saved target again."
|
||||
: "Client target edits persist in aetheria-client.cc. Verse discovery and selection mutate the same typed owner. Verse visibility changes append provider-owned Eve requests for the daemon bridge. Remote Verse targets hydrate a cache-only local replica before Unity reads them.";
|
||||
: "Client target edits persist in aetheria-client.cc. Verse discovery and selection mutate the same typed owner. Verse visibility changes append provider-owned Eve requests for the daemon bridge. Remote Verse targets hydrate a cache-only local replica before observers read them.";
|
||||
|
||||
var discoveryChildren = new List<AetheriaRuntimeSurfaceComponent>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
if (requireObserverReadOnly && buffer.ObserverWritable)
|
||||
{
|
||||
errors.Add($"SoA buffer '{buffer.BufferId}' is observer-writable; Unity must observe daemon state read-only.");
|
||||
errors.Add($"SoA buffer '{buffer.BufferId}' is observer-writable; clients must observe daemon state read-only.");
|
||||
}
|
||||
|
||||
buffersById.Add(buffer.BufferId, buffer);
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
: state.Description),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"Unity projects the selected equipment; the shared runtime surface owns equipped-item inspection layout and commands."),
|
||||
"The observing client projects the selected equipment; the shared runtime surface owns equipped-item inspection layout and commands."),
|
||||
Metric($"{SurfaceId}.manufacturer", "Manufacturer", state.Manufacturer),
|
||||
Metric($"{SurfaceId}.mass", "Mass", state.Mass)),
|
||||
Card(
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
string.IsNullOrWhiteSpace(state.CurrentView) ? "None" : state.CurrentView),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"Unity projects available inventory navigation; the shared runtime surface owns the dropdown contract."))
|
||||
"The observing client projects available inventory navigation; the shared runtime surface owns the dropdown contract."))
|
||||
};
|
||||
|
||||
foreach (var group in state.Groups)
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
state.ShutdownPerformance),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"Unity projects selected ship state; shutdown changes are sent as daemon operations."),
|
||||
"The observing client projects selected ship state; shutdown changes are sent as daemon operations."),
|
||||
ButtonRow(
|
||||
$"{SurfaceId}.shutdown.buttons",
|
||||
Button($"{SurfaceId}.shutdown.decrement", "Threshold -", DecrementShutdownThreshold),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using GameCult.Eve.Surface;
|
|||
|
||||
namespace GameCult.Aetheria.State.Verse
|
||||
{
|
||||
// Unity runtime shells acquire typed state through this port so the transport can move to the daemon without spelunking every consumer.
|
||||
// Runtime shells acquire typed state through this port so the transport can move to the daemon without spelunking every consumer.
|
||||
public static class AetheriaRuntimeStateReader
|
||||
{
|
||||
public static AetheriaRuntimeCatalogSnapshot OpenRuntimeCatalog(string stateFilePath)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Metric($"{SurfaceId}.current", "Current", state.CurrentTarget),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"Unity projects available cargo targets; the shared runtime surface owns the cargo selector contract."),
|
||||
"The observing client projects available cargo targets; the shared runtime surface owns the cargo selector contract."),
|
||||
ButtonColumn(
|
||||
$"{SurfaceId}.options",
|
||||
targets
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
"Trade Filters",
|
||||
Text(
|
||||
$"{FilterSurfaceId}.note",
|
||||
"Unity projects available trade filters; the shared runtime surface owns the filter selector contract."),
|
||||
"The observing client projects available trade filters; the shared runtime surface owns the filter selector contract."),
|
||||
Text($"{FilterSurfaceId}.active", state.FilterSummary))
|
||||
};
|
||||
|
||||
|
|
@ -200,7 +200,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
Text($"{RowActionSurfaceId}.title", state.Title),
|
||||
Text(
|
||||
$"{RowActionSurfaceId}.note",
|
||||
"Unity projects available row actions; the shared runtime surface owns the row action contract."),
|
||||
"The observing client projects available row actions; the shared runtime surface owns the row action contract."),
|
||||
ButtonColumn(
|
||||
$"{RowActionSurfaceId}.options",
|
||||
state.Actions
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
: state.Description),
|
||||
Text(
|
||||
$"{SurfaceId}.note",
|
||||
"Unity supplies the selected market row; the shared runtime surface owns trade item inspection layout."),
|
||||
"The observing client supplies the selected market row; the shared runtime surface owns trade item inspection layout."),
|
||||
Metric($"{SurfaceId}.manufacturer", "Manufacturer", state.Manufacturer),
|
||||
Metric($"{SurfaceId}.mass", "Mass", state.Mass),
|
||||
Metric($"{SurfaceId}.price", "Price", state.Price.ToString("N0")))
|
||||
|
|
|
|||
Loading…
Reference in a new issue