From 759caaaf17a0cc67728f32bb30a98d814a50506d Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 29 Jun 2026 05:11:56 +0100 Subject: [PATCH] Describe inventory access as typed documents --- Aetheria.State.Verify/Program.cs | 13 +++++++++++++ Assets/Scripts/UI/Menu/InventoryMenu.cs | 4 ++-- Assets/Scripts/UI/Menu/InventoryPanel.cs | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index cbda177de..697e1684c 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -6122,6 +6122,7 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root) { var tradeMenuPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "TradeMenu.cs"); var inventoryPanelPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "InventoryPanel.cs"); + var inventoryMenuPath = Path.Combine(root, "Assets", "Scripts", "UI", "Menu", "InventoryMenu.cs"); var catalogSnapshotPath = Path.Combine( root, "Packages", @@ -6142,6 +6143,10 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root) { throw new InvalidOperationException("Cannot verify typed catalog item enum accessors; InventoryPanel.cs is missing."); } + if (!File.Exists(inventoryMenuPath)) + { + throw new InvalidOperationException("Cannot verify typed inventory document vocabulary; InventoryMenu.cs is missing."); + } if (!File.Exists(catalogSnapshotPath)) { throw new InvalidOperationException("Cannot verify typed catalog item enum accessors; AetheriaRuntimeCatalogSnapshot.cs is missing."); @@ -6153,6 +6158,7 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root) var tradeMenu = File.ReadAllText(tradeMenuPath); var inventoryPanel = File.ReadAllText(inventoryPanelPath); + var inventoryMenu = File.ReadAllText(inventoryMenuPath); var catalogSnapshot = File.ReadAllText(catalogSnapshotPath); var tradeQueries = File.ReadAllText(tradeQueriesPath); var requiredTradeMenuSymbols = new[] @@ -6229,6 +6235,13 @@ static void RequireTradeItemValuesUseRuntimeQueries(string root) "InventoryPanel must ask AetheriaRuntimeCatalogItem for typed hardpoint classification instead of parsing catalog strings locally."); } + if (inventoryPanel.Contains("inventory projection", StringComparison.OrdinalIgnoreCase) || + inventoryMenu.Contains("inventory projection", StringComparison.OrdinalIgnoreCase)) + { + throw new InvalidOperationException( + "Inventory UI must describe direct reactive inventory document access as typed documents, not inventory projection chaff."); + } + var requiredQuerySymbols = new[] { "public static class AetheriaRuntimeDaemonTradeItemQueries", diff --git a/Assets/Scripts/UI/Menu/InventoryMenu.cs b/Assets/Scripts/UI/Menu/InventoryMenu.cs index e0db01773..c1a3215f3 100644 --- a/Assets/Scripts/UI/Menu/InventoryMenu.cs +++ b/Assets/Scripts/UI/Menu/InventoryMenu.cs @@ -863,7 +863,7 @@ public class InventoryMenu : MonoBehaviour } catch (Exception ex) { - Debug.LogWarning($"Failed to validate Aetheria inventory projection for {entityKey}: {ex.Message}"); + Debug.LogWarning($"Failed to validate Aetheria typed inventory document for {entityKey}: {ex.Message}"); return false; } } @@ -1008,7 +1008,7 @@ public class InventoryMenu : MonoBehaviour } catch (Exception ex) { - Debug.LogWarning($"Failed to bind Aetheria inventory projection for entity {entityIndex}: {ex.Message}"); + Debug.LogWarning($"Failed to bind Aetheria typed inventory document for entity {entityIndex}: {ex.Message}"); } return _inventory?.Current; diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index f9e1b28e4..10b572a11 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -1276,7 +1276,7 @@ private void Update() } catch (Exception ex) { - Debug.LogWarning($"Failed to validate Aetheria inventory projection for {entityKey}: {ex.Message}"); + Debug.LogWarning($"Failed to validate Aetheria typed inventory document for {entityKey}: {ex.Message}"); return false; } } @@ -1572,7 +1572,7 @@ private void Update() } catch (Exception ex) { - Debug.LogWarning($"Failed to bind Aetheria inventory projection for entity {entityIndex}: {ex.Message}"); + Debug.LogWarning($"Failed to bind Aetheria typed inventory document for entity {entityIndex}: {ex.Message}"); } return _inventory?.Current;