Move authority smoke onto managed pointers

This commit is contained in:
Meta Vens 2026-06-28 06:40:28 +01:00
commit 52216e2864
2 changed files with 76 additions and 14 deletions

View file

@ -93,17 +93,18 @@ RequireInventoryProjectionSlotIdentity(root);
RequireInventoryLoadoutSaveRequestAuthority(root);
RequireInventoryLoadoutRestoreRequestAuthority(root);
RequireDockedCurrentShipRequestAuthority(root);
RequireAuthoritySmokeUsesManagedPointers(root);
await using var node = await AetheriaStateNode.OpenAsync(
statePath,
"aetheria-state-verify",
enableDurableShardLogs: false);
var ledger = await node.GetMigrationLedgerAsync()
var ledger = await node.MigrationLedger().ReadAsync()
?? throw new InvalidOperationException("Missing typed migration ledger.");
var quarantine = await node.GetLegacyCatalogQuarantineAsync()
var quarantine = await node.LegacyCatalogQuarantine().ReadAsync()
?? throw new InvalidOperationException("Missing legacy catalog quarantine document.");
var publishedSurface = await node.GetCatalogSurfaceAsync()
var publishedSurface = await node.CatalogSurface().ReadAsync()
?? throw new InvalidOperationException("Missing Aetheria catalog Eve surface document.");
var items = node.Cache.GetAll<AetheriaItemDefinition>().ToArray();
@ -510,15 +511,15 @@ if (publishedSurface.Schema != surface.Schema ||
await RequireLegacyLookupAsync(
items[0].LegacyId,
() => node.GetItemDefinitionByLegacyIdAsync(items[0].LegacyId),
() => node.ItemDefinitionByLegacyId(items[0].LegacyId).ReadAsync(),
"item definition");
await RequireLegacyLookupAsync(
corporations[0].LegacyId,
() => node.GetCorporationByLegacyIdAsync(corporations[0].LegacyId),
() => node.CorporationByLegacyId(corporations[0].LegacyId).ReadAsync(),
"corporation");
await RequireLegacyLookupAsync(
nameFiles[0].LegacyId,
() => node.GetNameFileByLegacyIdAsync(nameFiles[0].LegacyId),
() => node.NameFileByLegacyId(nameFiles[0].LegacyId).ReadAsync(),
"name file");
if (string.IsNullOrWhiteSpace(quarantine.CatalogFingerprint))
@ -8531,6 +8532,57 @@ static void RequireUnityPublicRequestVocabulary(string root)
}
}
static void RequireAuthoritySmokeUsesManagedPointers(string root)
{
var authoritySmokePath = Path.Combine(root, "Aetheria.State.AuthoritySmoke", "Program.cs");
if (!File.Exists(authoritySmokePath))
{
throw new InvalidOperationException("Authority smoke source is missing.");
}
var authoritySmoke = File.ReadAllText(authoritySmokePath);
var requiredSymbols = new[]
{
"writer.StarbridgeScenario()",
"writer.StarbridgeSession()",
"ravenNode.VerseAuthorityPolicy()",
"starfireNode.VerseAuthorityPolicy()",
"node.VerseAuthorityPolicy()",
"node.LatestFrame().ReadAsync()",
".ReplaceAsync(policy)",
".ReplaceAsync(scenario)",
".ReplaceAsync(session)",
".ReadAsync().ConfigureAwait(false)"
};
var missingSymbols = requiredSymbols
.Where(symbol => !authoritySmoke.Contains(symbol, StringComparison.Ordinal))
.ToArray();
if (missingSymbols.Length > 0)
{
throw new InvalidOperationException(
"Authority smoke no longer exercises managed Verse state pointers: " +
string.Join(", ", missingSymbols));
}
var forbiddenSymbols = new[]
{
"PutStarbridgeScenarioAsync(",
"PutStarbridgeSessionAsync(",
"PutVerseAuthorityPolicyAsync(",
"GetVerseAuthorityPolicyAsync(",
"GetDaemonFrameAsync("
};
var survivingSymbols = forbiddenSymbols
.Where(symbol => authoritySmoke.Contains(symbol, StringComparison.Ordinal))
.ToArray();
if (survivingSymbols.Length > 0)
{
throw new InvalidOperationException(
"Authority smoke still teaches compatibility helper access instead of managed Verse pointers: " +
string.Join(", ", survivingSymbols));
}
}
static void RequireDaemonVersePublication(string root)
{
var daemonDocumentsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeDaemonDocuments.cs");