From b152f7fceb6305a20b1172ed2ebe8719c5c66d32 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 16 Jun 2026 00:19:58 +0100 Subject: [PATCH] Route hull conductivity through checkpoint commits --- .voidbot/state/aetheria.cc | Bin 142007 -> 142118 bytes Aetheria.State.Verify/Program.cs | 36 +++++++++++++++++++ Assets/Scripts/Gameplay/ActionGameManager.cs | 24 +++++++++++++ Assets/Scripts/UI/Menu/InventoryPanel.cs | 16 ++++----- docs/aetheria-perfect-machine-map.md | 9 ++++- 5 files changed, 76 insertions(+), 9 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 67aa294f6939f9e3d0d4394452f525baa023da95..fc078b7cc12edd871eebbd30b2c89940ab34d7fb 100644 GIT binary patch delta 1454 zcmaJ>O=w(I6y{DsNmUU1N&JEIV6jr1yf%%dlPrV~N*Ylp^(Q52;>~?$=3VpNz2m+2 z&2&&0B`cTpfp;N@!J;6dbs^(MyAoGIHwqEKwdkg+x^Urn?@eCDXx$9MdG~zhobUV2 z8T>f$@lO-iuGa3FTbykyo}LRDXV0!*VfSa>)!sRXHRg(#9=m);^{(M}kJYBKiE&`R z?VKDRoE&Gnm+EUv=pr^7xw~Kbzt!I6s@zv zD%M};?4f?Jtdm5#!>P{~oz$TlNfAMkI-b{|5ujyc2wa6gXoOe9T(3IiBi&VKY$V%MrX#WI z*)QzA{}N`1n28s(QhqS^L3Z0O=T*0{x5<^LnXWP^?xxnC4u0*8G zMQqw^@cFBZGf%&hkK_%{jLJN7P>bj?u+8I7FOyKQRG6DV zo3QldKladnAlUR#zMq%v{<_+yt-Ae^RNHa8EgV^vf74UWI-*Lj^O3>k-opOD2%dBP zi;%sY?VOp;ewaV8u~Dr@c?|@QV+;S=AuWzWPVQ?C-J84YFkv8&fc#r8u?PGLvg7wu zC+*4E^{bAztoLssdt>q|KD=d%l~HF>Ik<)F!>{igNy=`FO;xvYVRk;hmHy}H+BXNm rGmYT^J>tJTR!gcYx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Aetheria.State.Verify/Program.cs index b48dc8668..f7971ff3c 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -15,6 +15,7 @@ RequireNoRendererLocalDebugPanels(root); RequireMainMenuSettingsCommit(root); RequirePropertiesPanelReadOnlyInspector(root); RequireRuntimeSimulationTuningCommits(root); +RequireHullConductivityCommitAuthority(root); await using var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-state-verify"); @@ -459,6 +460,7 @@ Console.WriteLine("Renderer-local debug panels: obsolete uGUI field tester autho Console.WriteLine("Main-menu settings authority: gameplay and graphics settings return through typed player-settings commits"); Console.WriteLine("PropertiesPanel inspector authority: reflection inspection is read-only display"); Console.WriteLine("Runtime simulation tuning authority: UI writes flow through gameplay checkpoint commits"); +Console.WriteLine("Hull conductivity authority: inventory UI toggles flow through gameplay checkpoint commits"); static void RequireCount(AetheriaMigrationLedger ledger, string documentType, int actual) { @@ -802,6 +804,40 @@ static void RequireRuntimeSimulationTuningCommits(string root) } } +static void RequireHullConductivityCommitAuthority(string root) +{ + var actionGameManagerPath = Path.Combine(root, "Assets", "Scripts", "Gameplay", "ActionGameManager.cs"); + var actionGameManager = File.Exists(actionGameManagerPath) + ? File.ReadAllText(actionGameManagerPath) + : throw new InvalidOperationException("Cannot verify hull conductivity authority; ActionGameManager.cs is missing."); + + if (!actionGameManager.Contains("CommitHullConductivityToggle", StringComparison.Ordinal) || + !actionGameManager.Contains("QueueRunCheckpoint(\"hull-conductivity-toggle\")", StringComparison.Ordinal)) + { + throw new InvalidOperationException( + "Hull conductivity no longer has a gameplay-owned checkpoint commit primitive."); + } + + var uiRoot = Path.Combine(root, "Assets", "Scripts", "UI"); + var hits = Directory.EnumerateFiles(uiRoot, "*.cs", SearchOption.AllDirectories) + .SelectMany(path => File.ReadLines(path) + .Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line })) + .Where(line => + line.Line.Contains("HullConductivity[", StringComparison.Ordinal) && + line.Line.Contains("=", StringComparison.Ordinal) && + !line.Line.Contains("=>", StringComparison.Ordinal)) + .Select(line => $"{Path.GetRelativePath(root, line.Path)}:{line.LineNumber}: {line.Line.Trim()}") + .Take(10) + .ToArray(); + + if (hits.Length > 0) + { + throw new InvalidOperationException( + "Hull conductivity still has renderer-local UI write authority: " + + string.Join("; ", hits)); + } +} + static string ExtractMethodBody(string source, string methodName) { var signature = "private void " + methodName + "()"; diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 5e61c3048..8ff34889c 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -1442,6 +1442,30 @@ public class ActionGameManager : MonoBehaviour QueueRunCheckpoint("entity-shutdown-performance"); } + public bool CommitHullConductivityToggle(Entity entity, int2 position, int axis) + { + if (entity?.HullConductivity == null || + position.x < 0 || + position.y < 0 || + position.x >= entity.HullConductivity.GetLength(0) || + position.y >= entity.HullConductivity.GetLength(1) || + axis < 0 || + axis > 1) + { + return false; + } + + var conductivity = entity.HullConductivity[position.x, position.y]; + if (axis == 0) + conductivity.x = !conductivity.x; + else + conductivity.y = !conductivity.y; + + entity.HullConductivity[position.x, position.y] = conductivity; + QueueRunCheckpoint("hull-conductivity-toggle"); + return true; + } + private void OnDisable() { Input.Dispose(); diff --git a/Assets/Scripts/UI/Menu/InventoryPanel.cs b/Assets/Scripts/UI/Menu/InventoryPanel.cs index 58aa630d9..e60558d34 100644 --- a/Assets/Scripts/UI/Menu/InventoryPanel.cs +++ b/Assets/Scripts/UI/Menu/InventoryPanel.cs @@ -483,23 +483,23 @@ public class InventoryPanel : MonoBehaviour, IPointerClickHandler // Debug.Log($"Clicked at pos {data.position}, normalized {point}"); if (_displayedHullShape[int2(v.x - 1, v.y)] && point.x < ThermalToggleRegionSize) { - entity.HullConductivity[v.x - 1, v.y].x = !entity.HullConductivity[v.x - 1, v.y].x; - RefreshCells(new []{v,int2(v.x - 1, v.y)}); + if (GameManager.CommitHullConductivityToggle(entity, int2(v.x - 1, v.y), 0)) + RefreshCells(new []{v,int2(v.x - 1, v.y)}); } if (_displayedHullShape[int2(v.x + 1, v.y)] && point.x > 1 - ThermalToggleRegionSize) { - entity.HullConductivity[v.x, v.y].x = !entity.HullConductivity[v.x, v.y].x; - RefreshCells(new []{v,int2(v.x + 1, v.y)}); + if (GameManager.CommitHullConductivityToggle(entity, int2(v.x, v.y), 0)) + RefreshCells(new []{v,int2(v.x + 1, v.y)}); } if (_displayedHullShape[int2(v.x, v.y - 1)] && point.y < ThermalToggleRegionSize) { - entity.HullConductivity[v.x, v.y - 1].y = !entity.HullConductivity[v.x, v.y - 1].y; - RefreshCells(new []{v,int2(v.x, v.y - 1)}); + if (GameManager.CommitHullConductivityToggle(entity, int2(v.x, v.y - 1), 1)) + RefreshCells(new []{v,int2(v.x, v.y - 1)}); } if (_displayedHullShape[int2(v.x, v.y + 1)] && point.y > 1 - ThermalToggleRegionSize) { - entity.HullConductivity[v.x, v.y].y = !entity.HullConductivity[v.x, v.y].y; - RefreshCells(new []{v,int2(v.x, v.y + 1)}); + if (GameManager.CommitHullConductivityToggle(entity, int2(v.x, v.y), 1)) + RefreshCells(new []{v,int2(v.x, v.y + 1)}); } }); } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 905714360..26535674b 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1375,6 +1375,11 @@ First Aetheria surfaces to publish: simulation objects directly. The item override-shutdown bit is part of the typed loadout/entity item-slot state so the checkpoint spine can see what the simulation sees. + - Done: route hull conductivity toggles through the same gameplay-owned + checkpoint spine. `InventoryPanel` requests conductivity edge toggles from + `ActionGameManager.CommitHullConductivityToggle`; the gameplay owner mutates + `Entity.HullConductivity` and queues the typed run checkpoint that already + projects `hull_conductivity_x` and `hull_conductivity_y` grids. - Replace the next concrete uGUI screen with an Eve-owned surface. - Move the staged packages into the Eve repo once its worktree is clean, then import them back into Aetheria from Eve instead of carrying a local copy. @@ -1691,7 +1696,9 @@ boundaries, and replace runtime/operator UI truth with Eve surfaces. The old inspection as a shortcut around typed command/state ownership. Runtime simulation tuning controls may remain temporarily on uGUI only when they delegate to gameplay-owned commit methods that queue typed checkpoint state; direct UI -mutation of entity/item/behavior settings is obsolete authority. Any +mutation of entity/item/behavior settings is obsolete authority. Hull +conductivity changes follow the same rule: UI requests the toggle, gameplay owns +the grid mutation and checkpoint. Any predicate that still needs legacy DTO objects must earn that dependency by using behavior objects or simulation-only methods that typed facets do not yet expose.