Demote current entity slot from canonical run state

This commit is contained in:
Meta Vens 2026-06-16 17:27:28 +01:00
commit 9bc8ec125d
11 changed files with 60 additions and 26 deletions

View file

@ -1905,7 +1905,7 @@ static void RequireMainMenuContinueRunState(string root)
"ReadEntitySnapshots(RuntimeStateFilePath)",
"entity.RecordKey",
"run.CurrentEntityKey",
"ResolveCurrentEntityRecordKey(run, zoneEntityKeyPrefix)",
"ResolveCurrentEntityRecordKey(run)",
"ReplaceZoneEntitiesFromTypedSnapshots",
"Zone.Agents.Clear()",
"FlattenEntityGraph(Zone)",
@ -1956,6 +1956,23 @@ static void RequireMainMenuContinueRunState(string root)
string.Join(", ", forbiddenGameplayHits));
}
var canonicalRunStatePath = Path.Combine(root, "Aetheria.State", "Documents", "AetheriaRuntimeStateDocuments.cs");
var canonicalRunState = File.Exists(canonicalRunStatePath)
? File.ReadAllText(canonicalRunStatePath)
: throw new InvalidOperationException("Cannot verify canonical run-state authority; AetheriaRuntimeStateDocuments.cs is missing.");
if (canonicalRunState.Contains("CurrentZoneEntityIndex", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Canonical typed run state still exposes integer current-entity slot authority.");
}
if (packageSnapshot.Contains("CurrentZoneEntityIndex", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Unity package runtime run snapshot still exposes integer current-entity slot authority.");
}
var requiredPackageSymbols = new[]
{
"public string RecordKey",