From b130df95572c8ce636cebd215a18027fe059006f Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 15 Jun 2026 20:48:49 +0100 Subject: [PATCH] Fence package serializer boundary --- .voidbot/state/aetheria.cc | Bin 135385 -> 135594 bytes Aetheria.State.Verify/Program.cs | 47 +++++++++++++++++++++++++++ Aetheria.State/README.md | 4 +++ docs/aetheria-perfect-machine-map.md | 5 +++ 4 files changed, 56 insertions(+) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 9e4695e8256993139d748b12c351ee74ef32c177..2469181a6db8d767dfd222258b4c5d67df16b0ed 100644 GIT binary patch delta 1002 zcmZWoziSjh6lNxuOVVheK~T_#+C-8=O=3)fVl*L$MlTm)ks>g=J9{^{JG0Kr<~S`B z1uF~X5~hwK0V@k3rAE-+GHJBXKfpo+k?8D?yBwt4Z}z?Sz3=RkrQOO8!QHL5) zuwuV_M&*#GbLxQ-v2-aA?mc>xfRoV9UgSyhe5`qd zaet4`0;(pU`LleasD-41&~$&D#)DwK^q`a7g9*{*rJbXPriB}alw_lnc z|IqEjS!*o`SCNn!JnHDRTeyP0uC3$Ihm*EL130aBu9-0e5o^V~PKJ(%xkqFJR87Qz z2abJ|)T-fum6Cv@RcSZ1<00mjxk|TdS21PB2h5?;mIMt5#lVU!)dH@?fxgL{p(^F+ zV@r%Z?adX0=PRm0@5M~gSu0o+kj6r4S2?pKF)e>jgtmGww5_|^X6_Q+aycTpX0{MM zR#cH)!!y4To}4XLW~Qd+X28oO&6cR<6FW1I#v~JXe^|^a#`DX|Q_`(5Os$X30_{2t?gJcBUvzh8gO@PksMRo?)9Er4lca^h(APUmT%p zHn5po?Zx*5+fUq<QI=>rHe=y(xD)bZWYua>JKo8jzOoobSRSMy|-)G?fX9See?NzzMt=Gu6Jy&bv)g` zokL@#q2kbRY3@GiUU`G>wt!P9pmH~wz{qe4bmR}=eGixW^IQFSH2QPu%mlM_ra1wr z7NJfI5LocvRnGK)T9hn+8VOk>NCS+DHDwURn%jnlEh|2vg7EMoD!Es0QMY@)gAT5I zdslE@caT{c2hBplC6_grX2y^jyF}B)Isfmxa8$$m??bRw6sE(6>aH!PEeE4lr6brxSNc%R-* z;J*Jr2UcI;%WZ2jv4l+h5rlh}jsuZihGxY2DzTZlAK2@@O1OwMgLGh;)wK8LSwNFy zoM7uj0ttddj!={cpel@r+WFO)00RPtVU=90%A#p7zU;hR+KRA3C80W=4Z+i=cdaLC>n=M zTH_V5-C&zZ4*Zj3>iTb7doyrfexN=#lEYJI%H7Q2zGK-iS{HD+K>P|x3rUE&$wR$e zCEceSzFjU~ZSIth$=eB1x=3?reJ%I`+nw`&TSk?vavf$@-MfYkyRJ6e<$mSy^X6iY vri<-9wBeT-a`Hs>7*wv^J!{8N3mr)wfIC~jx0*;P?c4fXz^^-7(D2+J$09HK 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