diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index dc409aaf8..d66b06bc6 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 7d2483af9..3ba473615 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -69,8 +69,10 @@ and inspection metadata for the typed runtime bridge. Item instances now carry `RuntimeItemReference`, a narrow item-definition id plus optional hydrated projection cache. The old generic `RuntimeCatalogLink` abstraction has been deleted; item data projection is routed through -`ItemManager` and the typed runtime catalog reader. `Projection` is not durable -state; it is a bridge for surviving simulation and UI code. +`ItemManager` and a runtime item projection reader over the typed catalog. +`Projection` is not durable state; it is a bridge for surviving simulation and +UI code. The remaining single-item bridge is named `GetRuntimeItemProjection`, +not catalog entry access. Surviving item catalog Unity DTOs inherit `RuntimeItemProjectionEntry`; the old `RuntimeCatalogEntry` base name no longer appears in live source. Temporary faction/corporation projections and zone body/orbit DTOs keep local GUID fields diff --git a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs index 7ab01f37e..aa14af90c 100644 --- a/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs +++ b/Assets/Scripts/ServerShared/AetheriaRuntimeItemCatalog.cs @@ -6,13 +6,13 @@ using System.Reflection; using GameCult.Aetheria.State.Unity; using Unity.Mathematics; -public interface IRuntimeItemCatalogReader +public interface IRuntimeItemProjectionReader { ItemData Get(Guid guid); T Get(Guid guid) where T : ItemData; } -public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemCatalogReader +public sealed class AetheriaRuntimeItemCatalog : IRuntimeItemProjectionReader { private readonly Dictionary _items; private static readonly IReadOnlyDictionary BehaviorTypesByUnionKey = new Dictionary diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index e1b211bfc..6d6740f05 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -29,7 +29,7 @@ public class ItemManager // private Guid _forceLoadZone; - private readonly IRuntimeItemCatalogReader _itemData; + private readonly IRuntimeItemProjectionReader _itemProjections; public GameplaySettings GameplaySettings { get; } // public double Time @@ -45,16 +45,16 @@ public class ItemManager // private readonly Dictionary Tier = new Dictionary(); - public ItemManager(IRuntimeItemCatalogReader itemData, GameplaySettings settings, Action logger) + public ItemManager(IRuntimeItemProjectionReader itemProjections, GameplaySettings settings, Action logger) { - _itemData = itemData; + _itemProjections = itemProjections; GameplaySettings = settings; _logger = logger; } - public T GetCatalogEntry(Guid id) where T : ItemData + public T GetRuntimeItemProjection(Guid id) where T : ItemData { - return _itemData.Get(id); + return _itemProjections.Get(id); } public RuntimeItemReference CreateReference(ItemData item) @@ -75,7 +75,7 @@ public class ItemManager return; } - var data = _itemData.Get(item.Data.ItemId); + var data = _itemProjections.Get(item.Data.ItemId); if (data == null) { _logger($"Attempted to hydrate missing item id {item.Data.ItemId}"); diff --git a/Assets/Scripts/ServerShared/LoadoutGenerator.cs b/Assets/Scripts/ServerShared/LoadoutGenerator.cs index 03df0a2f9..de559dee7 100644 --- a/Assets/Scripts/ServerShared/LoadoutGenerator.cs +++ b/Assets/Scripts/ServerShared/LoadoutGenerator.cs @@ -181,7 +181,7 @@ public class LoadoutGenerator private T ProjectRuntimeItem(AetheriaRuntimeCatalogItem item) where T : EquippableItemData { return Guid.TryParse(item.LegacyId, out var legacyId) - ? ItemManager.GetCatalogEntry(legacyId) + ? ItemManager.GetRuntimeItemProjection(legacyId) : null; } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index c66d59751..1fbd7ef0d 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -109,9 +109,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. item-specific runtime reference. - `ItemManager` no longer exposes the raw runtime item catalog reader as public gameplay/UI API. Temporary item instantiation bridges now go through the - narrow `ItemManager.GetCatalogEntry` method. `ItemManager` no longer - exposes a legacy catalog enumeration API. This prevents catalog authority from - leaking into every caller that only needs a domain lookup. The item properties UI no longer uses + narrow `ItemManager.GetRuntimeItemProjection` method. `ItemManager` no + longer exposes a legacy catalog enumeration API or a catalog-entry-shaped + single-item API. This prevents catalog authority from leaking into every + caller that only needs a projection lookup. The item properties UI no longer uses `ItemManager` for manufacturer display; it resolves the manufacturer through the package-owned `ActionGameManager.RuntimeCatalog` typed snapshot. Entity restore and loadout manufacturer-distance weighting no longer use `ItemManager` @@ -368,8 +369,8 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. zone for future typed catalog boot. `ActionGameManager` opens the package-owned typed runtime catalog snapshot and binds item reference resolution through `AetheriaRuntimeItemCatalog`. - Runtime code receives narrow `ItemManager` catalog methods where gameplay - only needs item lookups. `Galaxy`, entity restore, and faction-distance + Runtime code receives narrow `ItemManager` projection methods where gameplay + still needs old `ItemData` DTOs. `Galaxy`, entity restore, and faction-distance loadout weighting have been moved off legacy faction catalog reads. The embedded Unity state package owns the read-only runtime catalog model contract and the read-only known-schema `.cc` catalog opener. `ActionGameManager` @@ -382,15 +383,18 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. an item projection identity helper, not a persistence base or corporation owner. `RuntimeItemReference.Projection` is a hydrated DTO cache derived from `RuntimeItemReference.ItemId` through `ItemManager`; it is not allowed to own - item identity or persistence. Behavior type selection now uses an explicit - runtime catalog map instead of `UnionAttribute` reflection. + item identity or persistence. The reader interface for this bridge is named + `IRuntimeItemProjectionReader` so callers cannot mistake it for catalog + ownership. Behavior type selection now uses an explicit runtime catalog map + instead of `UnionAttribute` reflection. Item/behavior DTO field layout for the temporary projection bridge is now marked with project-owned `LegacyPayloadKeyAttribute`, not MessagePack metadata. Item properties manufacturer display is a typed snapshot consumer; loadout generation is the - remaining runtime single-ID item lookup bridge. The old trade debug UI and - console `give` command have been deleted. No live caller can enumerate legacy - catalog entries through `ItemManager`. + remaining runtime single-ID item projection bridge. The old trade debug UI + and console `give` command have been deleted. No live caller can enumerate + legacy catalog entries or request catalog-shaped single entries through + `ItemManager`. - Inputs: Unity gameplay code, legacy catalog files, typed state documents, and CultMesh server state. - Outputs: `Aetheria.State` emits `.cc` state and CultMesh documents. Runtime @@ -694,6 +698,10 @@ First Aetheria surfaces to publish: `RuntimeItemReference.Projection`, making the hydrated `ItemData` DTO a cache/display/behavior bridge derived from `ItemId` instead of the reference's apparent state value. + - Done: rename the remaining `ItemManager.GetCatalogEntry` bridge to + `GetRuntimeItemProjection` and rename the bridge reader interface to + `IRuntimeItemProjectionReader`, so the live API exposes projection + hydration rather than catalog-entry ownership. - Done: quarantine the vendored Unity `MessagePack` assembly by disabling asmdef auto-reference; only explicit state-spine assemblies should see it while the Unity CultCache bridge still needs a low-level `.cc` codec. @@ -747,8 +755,8 @@ First Aetheria surfaces to publish: - Unity batchmode compile with Editor `6000.4.2f1` returned cleanly after the runtime catalog resolver cut; `Logs/codex-unity-compile.log` has no compiler error hits. -- `rg ".Data.Value|SetValue|BindRuntimeItemCatalog|ResolveRuntimeItemCatalog|private static IRuntimeItemCatalogReader"` in - `Assets/Scripts` is zero for the old item value/resolver path. +- `rg ".Data.Value|SetValue|GetCatalogEntry|IRuntimeItemCatalogReader|BindRuntimeItemCatalog|ResolveRuntimeItemCatalog|private static IRuntimeItemCatalogReader"` in + `Assets/Scripts` is zero for the old item value/catalog-entry/resolver path. - Live Unity source has no `RuntimeCatalogLink` or `RuntimeCatalogLinkBase`; item instances use `RuntimeItemReference` and expose `Data.ItemId`. - Live Unity source has no `RuntimeCatalogEntry`; only surviving item DTOs @@ -789,10 +797,9 @@ First Aetheria surfaces to publish: ## Immediate Cut Line -Do not bump Newtonsoft as the fix. That keeps the wrong organ alive with newer -paint on it. - -The first implementation cut should create the modern typed state spine and a -legacy quarantine. After that, every RethinkDB/Newtonsoft/JsonKnownTypes removal -has somewhere clean to land, and every old path can be judged by whether it -still owns behavior. +Do not add behavior to `ItemData`, `RuntimeItemProjectionEntry`, or the +temporary `AetheriaRuntimeItemCatalog` DTO materializer. The typed state spine +and migration quarantine exist; the next cuts should replace surviving +projection consumers with typed item facets, typed behavior factories, and Eve +surfaces until `GetRuntimeItemProjection` has no caller and the old DTO +bridge can be deleted.