From 6f0a84073d359d9b3e0ac89b8f9e9e3e47fc1e09 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 11:44:01 +0100 Subject: [PATCH] Move runtime state boot probe into package --- .voidbot/state/aetheria.cc | Bin 27437 -> 27656 bytes Assets/Scripts/Gameplay/ActionGameManager.cs | 8 +++-- .../Runtime/AetheriaRuntimeStateBoot.cs | 28 ++++++++++++++++++ docs/aetheria-perfect-machine-map.md | 27 +++++++++++------ 4 files changed, 51 insertions(+), 12 deletions(-) create mode 100644 Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateBoot.cs diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 5a97fcf5f589b7039a67b3c21f97c523c13d428d..e49875b0154d3870d8d856cfcaf75d40aa334fae 100644 GIT binary patch delta 1023 zcmZ`&OKTKC5O#M%OroNQkBBTOh(wIZn0+Md=)uGw8qg48JQxqAx2Jcf$xQdq-Q#Ax z1QEf5m(Vw_;u8YG{s4_v5%eNP`~}`}_F~WWj(MP`p=+wX`s(|t*1u(*e9ydlne8i8 zE|x2fTdXXuWsd8)d)@j|_HjGvI%5;#?I_PZ=tK&|LOasamCxS&+&bGeJ&-|qd2nF1 za+^`r1gVfB5Fxyb>I4{X0B(+20tbkOKQhGylS9HP@jT+` z{F#9xDGFJMxFizv*ZC8xTsbpLMg*%7X!sQSAV|c8vON$nodiXr4K4!D!PrnyJ|O0q zel_E?UUYpMre1qk2 zLx&l;LRuH-s!?}FkuW8!_zrDT+#15jBhV!365MFFoVFdW@R)f>H1*{>{pX~jK>&W! z6NzPsLjk={!1_o{kCdn0z{gf!&yp1dI94Ei9tR$TXxUcTg4C>zf){v{$nw|rJ=79I zYQ%`TbCw2G23q~Y7T)M)iGD~A4-Fo6-Xey5F6K#1{@hn?Jsrv)a^0!eREuN>Lli+A z8F3B1(SMJPc0;!pu=T6-;o$y9&jqP%Ue~85r?Xt?t-k)!`MF*8+cE#M#I}4yuZ>R) z4<`#11*mB^X2(ixABNqc)|<)SM|(!xb!ehE0&YORuygZrlHc<;ve9RY9ast delta 846 zcmY*Y-Afcv6mL}`%ZmJhilqal618Kjx}s3FM3`hkrW8Jeckewrduit0<<6aSeJCOV zp{KadJxEv(1i?P`5JCL`y+lIMpAhs`Po0@{R(hJ5ALsD`yYZ+-7s58&jz+j|<*wVHK^A?20h)`};Z3F}IWro$?dyGmg$gA}iDfD&ae>Bd5BK+fTEq^#eCHJUBO& z#hU~RQdv#JGWx%o3yB!jW-jwY_#B0_&p$IVGz;sJtnCF+Ap4}HWj#|Qsc^{xxye%N zZ~o{Rbo^B)$Lu diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index bb178e507..b9e72dfbe 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -36,7 +36,6 @@ public class ActionGameManager : MonoBehaviour get => _gameDataDirectory ??= new DirectoryInfo(Application.dataPath).Parent.CreateSubdirectory("GameData"); } - public static string AetheriaStateFilePath => AetheriaRuntimeStateBoundary.GetStateFilePath(GameDataDirectory); private static string LegacyAetherDatabasePath => LegacyCatalogBoundary.GetLegacyCatalogPath(GameDataDirectory); private static ILegacyCatalogReader LegacyCatalog => LegacyCatalogBoundary.GetCatalog(GameDataDirectory); @@ -232,8 +231,11 @@ public class ActionGameManager : MonoBehaviour Instance = this; EntityInstance.EffectManagerParent = EffectManagerParent; ConsoleController.MessageReceiver = this; - - Debug.Log($"Aetheria typed state file: {AetheriaStateFilePath}"); + + var stateBoot = AetheriaRuntimeStateBoot.Inspect(GameDataDirectory); + Debug.Log($"Aetheria typed state file: {stateBoot.StateFilePath}"); + if (!stateBoot.StateFileExists) + Debug.LogWarning("Aetheria typed state file is missing. Run the Aetheria.State importer before treating legacy catalog data as runtime state."); Debug.Log($"Aetheria legacy item catalog: {LegacyAetherDatabasePath}"); ItemManager = new ItemManager( LegacyCatalog, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateBoot.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateBoot.cs new file mode 100644 index 000000000..d82189d9a --- /dev/null +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeStateBoot.cs @@ -0,0 +1,28 @@ +using System.IO; + +namespace GameCult.Aetheria.State.Unity +{ + public readonly struct AetheriaRuntimeStateBootReport + { + public AetheriaRuntimeStateBootReport(string stateFilePath, bool stateFileExists) + { + StateFilePath = stateFilePath; + StateFileExists = stateFileExists; + } + + public string StateFilePath { get; } + + public bool StateFileExists { get; } + } + + public static class AetheriaRuntimeStateBoot + { + public static AetheriaRuntimeStateBootReport Inspect(DirectoryInfo gameDataDirectory) + { + var stateFilePath = AetheriaRuntimeStateBoundary.GetStateFilePath(gameDataDirectory); + return new AetheriaRuntimeStateBootReport( + stateFilePath, + File.Exists(stateFilePath)); + } + } +} diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 48e805ea6..5a6353424 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -23,10 +23,14 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. `ActionGameManager` no longer owns a global legacy cache. `GameCult.Aetheria.State.Unity`, the embedded Unity package under `Packages/org.gamecult.aetheria.state`, owns the Unity runtime path to - `GameData/aetheria-world.cc` through `AetheriaRuntimeStateBoundary`; - `LegacyCatalogBoundary` no longer names or owns typed state paths. Local run - saves, loadouts, player settings files, zone files, and generated keyboard - layout caches no longer write bespoke durable files. The legacy + `GameData/aetheria-world.cc` through `AetheriaRuntimeStateBoundary` and owns + the Unity boot-time state-file existence probe through + `AetheriaRuntimeStateBoot`. `ActionGameManager` consumes that package-owned + boot report and warns when `aetheria-world.cc` is missing before treating + legacy catalog data as runtime state. `LegacyCatalogBoundary` no longer names + or owns typed state paths. Local run saves, loadouts, player settings files, + zone files, and generated keyboard layout caches no longer write bespoke + durable files. The legacy `PlayerSettings` runtime object is no longer decorated as a MessagePack persistence shape. - Shared domain state is still partly built around `DatabaseEntry`, GUID @@ -132,7 +136,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. project-local typed state file for the checked-in catalog. The importer stores relative provenance in the state document, not machine-local absolute paths. Unity resolves this path through the embedded `GameCult.Aetheria.State.Unity` - runtime package, not through the legacy catalog boundary. + runtime package, not through the legacy catalog boundary. Unity also asks the + package to inspect whether the typed state file exists during boot; the + warning is notification-only and does not make legacy catalog data the typed + state owner. Import rebuilds clear the generated `.cc`, `.cc.records`, and `.cultmesh` outputs for the selected state path after capturing legacy inputs, so schema evolution can rematerialize typed state instead of being blocked by stale @@ -197,7 +204,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. - Owner: `Aetheria.State` owns the new typed state spine for durable state. The embedded `GameCult.Aetheria.State.Unity` package owns Unity's runtime - typed state file path and is the landing zone for future typed catalog boot. + typed state file path plus the boot-time state-file probe, and is the landing + zone for future typed catalog boot. `LegacyCatalogBoundary` is the only named owner for opening the old catalog and binding legacy `DatabaseLink` resolution until catalog migration lands. `ActionGameManager` has a private boot helper that calls it only to construct @@ -221,9 +229,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. put/get paths; Unity `SaveState`/`SaveZone` still need to commit through those ports. The catalog operator UI is emitted as a typed Eve surface document derived from the catalog snapshot. -- Derived state: UI panels, generated keyboard layouts, editor rows, and - serialized legacy payloads are projections, migration inputs, or disabled - session-local DTOs, not durable authority. +- Derived state: UI panels, generated keyboard layouts, editor rows, typed + state boot warnings, and serialized legacy payloads are projections, + migration inputs, diagnostics, or disabled session-local DTOs, not durable + authority. - Forbidden writers: old JSON backing stores, JsonKnownTypes converters, Rethink/LiteNet paths, IMGUI database editor exports, local save-file writes, generated keyboard layout caches, and server-side `DatabaseCache` paths.