diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 84ab1a0b0..9e4695e82 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 c24baf908..3fb852698 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -7,6 +7,8 @@ var statePath = args.Length > 1 ? Path.GetFullPath(args[1]) : AetheriaStatePaths.ResolveDefaultStatePath(root); +RequireGameplaySourcePurity(root); + await using var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-state-verify"); var ledger = await node.GetMigrationLedgerAsync() @@ -442,6 +444,7 @@ Console.WriteLine($"Corporations: {corporations.Length}"); Console.WriteLine($"Described/geoname-linked corporations: {describedCorporations}/{corporationNameLinks}"); 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"); static void RequireCount(AetheriaMigrationLedger ledger, string documentType, int actual) { @@ -458,6 +461,47 @@ static void RequireCount(AetheriaMigrationLedger ledger, string documentType, in } } +static void RequireGameplaySourcePurity(string root) +{ + var gameplayRoot = Path.Combine(root, "Assets", "Scripts"); + if (!Directory.Exists(gameplayRoot)) + { + throw new InvalidOperationException($"Cannot verify live gameplay source purity; missing path: {gameplayRoot}"); + } + + var forbiddenSymbols = new[] + { + "MessagePack", + "MessagePackObject", + "MessagePackSerializer", + "MessagePackReader", + "IMessagePackFormatter", + "JsonConvert", + "Newtonsoft", + "JsonKnownTypes", + "RethinkDB", + "DatabaseEntry", + "DatabaseLink", + "[Union(", + "[Key(" + }; + + var hits = Directory.EnumerateFiles(gameplayRoot, "*.cs", SearchOption.AllDirectories) + .SelectMany(path => File.ReadLines(path) + .Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line })) + .Where(line => forbiddenSymbols.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( + "Live gameplay source still contains serializer or legacy database symbols: " + + 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 8535d2283..32969fdba 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -280,7 +280,11 @@ payload tree, and the published Eve catalog surface. The current catalog materializes 65 behavior payloads, 661 behavior fields, and 18 behavior-side legacy-ID references. Legacy content currently includes at least one overhanging hardpoint; the verifier preserves the payload and checks hardpoint local masks -rather than silently converting content repair into migration. +rather than silently converting content repair into migration. The verifier also +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. 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 e1ed6dcfe..3d436b202 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1596,6 +1596,11 @@ First Aetheria surfaces to publish: auto-reference; `Assets/Scripts` and `Assets/Editor` have no `using MessagePack`, `MessagePackSerializer`, `[MessagePackObject]`, or `IMessagePackFormatter` hits. +- `Aetheria.State.Verify` now enforces the gameplay-source purity invariant: + live `Assets/Scripts` cannot contain MessagePack, Newtonsoft, + JsonKnownTypes, RethinkDB, old database-link symbols, or serializer metadata. + Package/import MessagePack usage remains explicitly bounded to CultCache + transport and migration. - Unity batchmode compile returned cleanly after the runtime blueprint rename; live Unity source has no `EntityPack`, `ShipPack`, `OrbitalEntityPack`, `ZonePack`, `PackedContents`, `PackZone`, `EntitySerializer.Pack`, or