diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 9e4695e82..2469181a6 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 3fb852698..a6939c17f 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -8,6 +8,7 @@ var statePath = args.Length > 1 : AetheriaStatePaths.ResolveDefaultStatePath(root); RequireGameplaySourcePurity(root); +RequirePackageSerializerBoundary(root); await using var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-state-verify"); @@ -445,6 +446,7 @@ Console.WriteLine($"Described/geoname-linked corporations: {describedCorporation Console.WriteLine($"Corporation allegiance edges: {corporationAllegianceEdges}"); Console.WriteLine($"Name files: {nameFiles.Length}"); Console.WriteLine("Live gameplay source purity: no serializer or legacy database symbols in Assets/Scripts"); +Console.WriteLine("Package serializer boundary: MessagePack symbols remain in named CultCache transport files only"); static void RequireCount(AetheriaMigrationLedger ledger, string documentType, int actual) { @@ -502,6 +504,51 @@ static void RequireGameplaySourcePurity(string root) } } +static void RequirePackageSerializerBoundary(string root) +{ + var packageRuntimeRoot = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime"); + if (!Directory.Exists(packageRuntimeRoot)) + { + throw new InvalidOperationException($"Cannot verify package serializer boundary; missing path: {packageRuntimeRoot}"); + } + + var allowedFiles = new HashSet(StringComparer.Ordinal) + { + "AetheriaRuntimeCatalogStore.cs", + "AetheriaRuntimePendingCultCacheStore.cs", + "AetheriaRuntimeStateCommitDocument.cs", + "AetheriaRuntimeEveCommandDocument.cs" + }; + + var serializerSymbols = new[] + { + "MessagePack", + "MessagePackObject", + "MessagePackSerializer", + "MessagePackReader", + "MessagePackWriter", + "IMessagePackFormatter", + "[Union(", + "[Key(" + }; + + var hits = Directory.EnumerateFiles(packageRuntimeRoot, "*.cs", SearchOption.AllDirectories) + .Where(path => !allowedFiles.Contains(Path.GetFileName(path))) + .SelectMany(path => File.ReadLines(path) + .Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line })) + .Where(line => serializerSymbols.Any(symbol => line.Line.Contains(symbol, StringComparison.Ordinal))) + .Select(line => $"{Path.GetRelativePath(root, line.Path)}:{line.LineNumber}: {line.Line.Trim()}") + .Take(10) + .ToArray(); + + if (hits.Length > 0) + { + throw new InvalidOperationException( + "Package serializer symbols escaped the named CultCache transport boundary: " + + string.Join("; ", hits)); + } +} + static bool ContainsBehaviorValueKind(AetheriaBehaviorValue value, string kind) { return string.Equals(value.Kind, kind, StringComparison.OrdinalIgnoreCase) || diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 32969fdba..a060541bb 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -285,6 +285,10 @@ fails if live `Assets/Scripts` source grows back serializer or legacy database symbols such as MessagePack, Newtonsoft, JsonKnownTypes, RethinkDB, or old `DatabaseEntry`/`DatabaseLink` references; the remaining MessagePack usage is a named package/import CultCache transport boundary, not gameplay state authority. +The package boundary is also fenced: MessagePack symbols may only appear in the +runtime catalog reader, pending CultCache envelope store, and typed runtime/Eve +command document files until generated CultCache serializers replace that +temporary Unity-side codec. Use it after import when `GameData/aetheria-world.cc` changes. `Aetheria.State.Unity.Smoke` opens the materialized state through the runtime diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 3d436b202..096051dba 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1601,6 +1601,11 @@ First Aetheria surfaces to publish: JsonKnownTypes, RethinkDB, old database-link symbols, or serializer metadata. Package/import MessagePack usage remains explicitly bounded to CultCache transport and migration. +- `Aetheria.State.Verify` also fences the Unity package serializer boundary: + MessagePack symbols may appear only in `AetheriaRuntimeCatalogStore`, + `AetheriaRuntimePendingCultCacheStore`, `AetheriaRuntimeStateCommitDocument`, + and `AetheriaRuntimeEveCommandDocument` until CultLib generated serializers + become the Unity runtime owner. - Unity batchmode compile returned cleanly after the runtime blueprint rename; live Unity source has no `EntityPack`, `ShipPack`, `OrbitalEntityPack`, `ZonePack`, `PackedContents`, `PackZone`, `EntitySerializer.Pack`, or