Route hull conductivity through checkpoint commits

This commit is contained in:
Meta Vens 2026-06-16 00:19:58 +01:00
commit b152f7fceb
5 changed files with 76 additions and 9 deletions

Binary file not shown.

View file

@ -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 + "()";

View file

@ -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();

View file

@ -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)});
}
});
}

View file

@ -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.