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

@ -648,8 +648,12 @@ internal sealed class AuthoritySmokeChecks
await writer.VerseAuthorityPolicy()
.ReplaceAsync(policy)
.ConfigureAwait(false);
await writer.PutStarbridgeScenarioAsync(scenario, flush: false).ConfigureAwait(false);
await writer.PutStarbridgeSessionAsync(session, flush: false).ConfigureAwait(false);
await writer.StarbridgeScenario()
.ReplaceAsync(scenario)
.ConfigureAwait(false);
await writer.StarbridgeSession()
.ReplaceAsync(session)
.ConfigureAwait(false);
await writer.FlushAsync().ConfigureAwait(false);
}
@ -769,11 +773,15 @@ internal sealed class AuthoritySmokeChecks
startServer: false,
enableDurableShardLogs: false).ConfigureAwait(false);
await ravenNode.PutVerseAuthorityPolicyAsync(policy).ConfigureAwait(false);
await starfireNode.PutVerseAuthorityPolicyAsync(policy).ConfigureAwait(false);
await ravenNode.VerseAuthorityPolicy()
.ReplaceAsync(policy)
.ConfigureAwait(false);
await starfireNode.VerseAuthorityPolicy()
.ReplaceAsync(policy)
.ConfigureAwait(false);
var ravenPolicy = await ravenNode.GetVerseAuthorityPolicyAsync().ConfigureAwait(false);
var starfirePolicy = await starfireNode.GetVerseAuthorityPolicyAsync().ConfigureAwait(false);
var ravenPolicy = await ravenNode.VerseAuthorityPolicy().ReadAsync().ConfigureAwait(false);
var starfirePolicy = await starfireNode.VerseAuthorityPolicy().ReadAsync().ConfigureAwait(false);
Require(ravenPolicy != null, "raven node should load authority policy");
Require(starfirePolicy != null, "starfire node should load authority policy");
@ -1109,7 +1117,9 @@ internal sealed class AuthoritySmokeChecks
startServer: false,
enableDurableShardLogs: false).ConfigureAwait(false);
await node.PutVerseAuthorityPolicyAsync(policy).ConfigureAwait(false);
await node.VerseAuthorityPolicy()
.ReplaceAsync(policy)
.ConfigureAwait(false);
foreach (var command in commands)
await node.SubmitDaemonCommandAsync(command).ConfigureAwait(false);
await node.FlushAsync().ConfigureAwait(false);
@ -1321,7 +1331,7 @@ internal sealed class AuthoritySmokeChecks
runtimeId,
startServer: false,
enableDurableShardLogs: false).ConfigureAwait(false);
var frame = await node.GetDaemonFrameAsync().ConfigureAwait(false);
var frame = await node.LatestFrame().ReadAsync().ConfigureAwait(false);
if (frame != null)
{
lastFrame = frame;

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");