From 52216e2864ce2658d67fde71b6f72ac743bb8fc1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 06:40:28 +0100 Subject: [PATCH] Move authority smoke onto managed pointers --- Aetheria.State.AuthoritySmoke/Program.cs | 26 +++++++--- Aetheria.State.Verify/Program.cs | 64 +++++++++++++++++++++--- 2 files changed, 76 insertions(+), 14 deletions(-) diff --git a/Aetheria.State.AuthoritySmoke/Program.cs b/Aetheria.State.AuthoritySmoke/Program.cs index a6218e66b..e4b6466cc 100644 --- a/Aetheria.State.AuthoritySmoke/Program.cs +++ b/Aetheria.State.AuthoritySmoke/Program.cs @@ -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; diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index e35dedc6e..faf41701d 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -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().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");