diff --git a/Aetheria.State.Daemon.Smoke/Program.cs b/Aetheria.State.Daemon.Smoke/Program.cs index e64a8e040..4c42391ee 100644 --- a/Aetheria.State.Daemon.Smoke/Program.cs +++ b/Aetheria.State.Daemon.Smoke/Program.cs @@ -109,6 +109,7 @@ internal sealed class AetheriaDaemonYmirSmokeChecks RunCheck(PickupIsCapacityCheckedExactlyOnceAndExpires); RunCheck(StationBodiesCannotConsumePickups); RunCheck(PickupProximityCollectsOrBounces); + RunCheck(PausedFirstFrameCreatesPersistableYmirWorld); RunCheck(PickupRemovalSurvivesRestartWithoutReplay); } @@ -9442,6 +9443,53 @@ internal sealed class AetheriaDaemonYmirSmokeChecks } } + private static void PausedFirstFrameCreatesPersistableYmirWorld() + { + var root = Path.Combine(Path.GetTempPath(), "aetheria-ymir-paused-first-frame-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(root); + try + { + var statePath = Path.Combine(root, "world.cc"); + var run = new AetheriaRuntimeRunCheckpointCommit + { + RunId = "paused-first-frame-smoke", + CurrentZoneIndex = 0, + CurrentEntityKey = "zone.0.entity.0", + Zones = [new AetheriaRuntimeZoneSnapshotCommit + { + ZoneIndex = 0, + Entities = [Entity(0, 0, "player")] + }] + }; + var frame = new AetheriaRuntimeDaemonFrameDocument + { + FrameId = 0, + FixedDeltaSeconds = 0.1, + SimulationTimeSeconds = 0, + SimulationStepsExecuted = 0, + Run = run + }; + using var physics = new AetheriaYmirWorldPhysics(); + using var node = AetheriaStateNode.OpenAsync(statePath).GetAwaiter().GetResult(); + using var persistence = AetheriaYmirPersistenceCoordinator.OpenAsync(node, physics, null) + .GetAwaiter().GetResult(); + + var captures = persistence.Capture(frame); + + RequireEqual(1, captures.Count, + "a paused first frame must still create one persistable Ymir zone world"); + RequireEqual(0L, captures[0].FrameId, + "the paused Ymir persistence capture must belong to the authoritative first frame"); + RequireEqual(-1, captures[0].SimulationStepIndex, + "a paused first frame must retain the no-step persistence cursor"); + } + finally + { + if (Directory.Exists(root)) + Directory.Delete(root, recursive: true); + } + } + private static void PickupRemovalSurvivesRestartWithoutReplay() { var root = Path.Combine(Path.GetTempPath(), "aetheria-ymir-restart-" + Guid.NewGuid().ToString("N")); diff --git a/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs b/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs index b8bdfa0d2..0d96cbf70 100644 --- a/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs +++ b/Aetheria.State.Daemon/AetheriaDaemonZoneGenerator.cs @@ -277,9 +277,8 @@ internal static class AetheriaDaemonZoneGenerator AetheriaRuntimeCatalogSnapshot catalog, string scenario) { - // Start the proof pilot at rest on the station's authored center. Ymir's field moves it - // during provider-session negotiation, but the resulting trajectory remains inside the - // fossil 25-unit docking envelope. The fixture does not lock or repair the live position. + // Start the proof pilot at rest on the station's authored center. The proof session owns + // its paused initial clock, so client connection latency cannot alter this starting state. entities[1].Position.X = entities[0].Position.X; entities[1].Position.Z = entities[0].Position.Z; entities[1].Velocity = Vec2(0, 0); diff --git a/Aetheria.State.Daemon/AetheriaYmirPersistenceCoordinator.cs b/Aetheria.State.Daemon/AetheriaYmirPersistenceCoordinator.cs index cd4b1b5b7..d704ca45c 100644 --- a/Aetheria.State.Daemon/AetheriaYmirPersistenceCoordinator.cs +++ b/Aetheria.State.Daemon/AetheriaYmirPersistenceCoordinator.cs @@ -96,9 +96,17 @@ public sealed class AetheriaYmirPersistenceCoordinator : IDisposable var run = frame.Run ?? throw new InvalidOperationException("Ymir persistence requires an authoritative run."); if (string.IsNullOrWhiteSpace(run.RunId)) throw new InvalidOperationException("Ymir persistence requires a stable run id."); - return (run.Zones ?? Array.Empty()) + var zones = (run.Zones ?? Array.Empty()) .Where(zone => zone != null) .OrderBy(zone => zone.ZoneIndex) + .ToArray(); + foreach (var zone in zones) + _physics.SynchronizePersistenceFrame( + run.RunId, + frame.FrameId, + zone, + zone.Entities ?? Array.Empty()); + return zones .Select(zone => { var world = CursorFor(run.RunId, zone.ZoneIndex, WorldChannel); diff --git a/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs b/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs index 6d75889d9..42d8c73f3 100644 --- a/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs +++ b/Aetheria.State.Daemon/AetheriaYmirWorldPhysics.cs @@ -15,6 +15,49 @@ public sealed class AetheriaYmirWorldPhysics : IAetheriaRuntimeWorldPhysics, IDi public string ImplementationId => "ymir.box3d.retained-session.v1"; + public void SynchronizePersistenceFrame( + string runId, + long frameId, + AetheriaRuntimeZoneSnapshotCommit zone, + IReadOnlyList entities) + { + ArgumentNullException.ThrowIfNull(zone); + if (string.IsNullOrWhiteSpace(runId)) + throw new ArgumentException("A retained Ymir world requires a run id.", nameof(runId)); + + var key = new WorldKey(runId, zone.ZoneIndex); + if (_sessions.TryGetValue(key, out var existing) && existing.LastFrameId == frameId) + return; + if (existing != null && frameId < existing.LastFrameId) + throw new InvalidOperationException( + $"Ymir session '{existing.WorldSession.Info.SessionId}' cannot synchronize backward from " + + $"frame {existing.LastFrameId} to {frameId}."); + + var desiredBodies = BuildBodies(ActiveEntities(entities), ActivePickups(zone)); + var state = existing ?? CreateSession(key, zone, desiredBodies); + if (existing == null) + _sessions.Add(key, state); + else + { + var commandOrdinal = 0; + Reconcile( + state.WorldSession, + desiredBodies, + frameId, + state.LastSimulationStepIndex, + ref commandOrdinal); + } + + state.LastFrameId = frameId; + state.LastResult = null; + if (state.PayloadSession != null) + { + state.LastPayloadFrameId = frameId; + state.LastPayloadSimulationStepIndex = state.LastSimulationStepIndex; + state.LastPayloadResult = null; + } + } + public AetheriaYmirZonePersistenceCapture CapturePersistence( string runId, int zoneIndex, diff --git a/Aetheria.State.Daemon/Program.cs b/Aetheria.State.Daemon/Program.cs index 9ae54b766..a2887b434 100644 --- a/Aetheria.State.Daemon/Program.cs +++ b/Aetheria.State.Daemon/Program.cs @@ -116,24 +116,31 @@ var firstPublication = PreparePublication( firstTick, ingressState, physicsPersistence); -await PublishPreparedDocumentsAsync( +await PublishClientGameplayDocumentsAsync( node, options, - physicsPersistence, unityBundles, - firstPublication, + firstPublication.Publication, + firstPublication.Catalog, reactiveSurfaceState, publishTopology: true).ConfigureAwait(false); -TraceStartup("first-publication"); +TraceStartup("client-bootstrap"); await PublishHotEntityStateAsync( node, soaPublisher, hotState, firstTick.Frame, ingressState.Catalog, cultMeshClientHost).ConfigureAwait(false); TraceStartup("hot-entity-state"); +Task publicationTask = Task.Run(() => PersistPreparedDocumentsAsync( + node, + options, + physicsPersistence, + firstPublication, + initialTopology: true)); nextApiPublicationUtc = DateTimeOffset.UtcNow.Add(options.ApiPublicationInterval); Console.WriteLine($"Aetheria Verse daemon published frame {firstTick.Frame.FrameId}."); Console.WriteLine($"Aetheria daemon playable-world-ready in {startup.Elapsed.TotalMilliseconds:0.###}ms."); if (options.Once) { + await publicationTask.ConfigureAwait(false); await PublishRuntimeSessionAsync(node, options, startedAtUtc, "completed").ConfigureAwait(false); return; } @@ -148,7 +155,6 @@ await PublishRuntimeSessionAsync(node, options, startedAtUtc, "running").Configu Console.WriteLine("Aetheria Verse daemon is running. Press Ctrl+C to stop."); var nextTickUtc = DateTimeOffset.UtcNow.Add(options.TickInterval); -Task publicationTask = Task.CompletedTask; while (!stopped.Task.IsCompleted) { ThrowIfClientHostFaulted(cultMeshClientHost); @@ -179,14 +185,14 @@ while (!stopped.Task.IsCompleted) tick, ingressState, physicsPersistence); - publicationTask = PublishPreparedDocumentsAsync( + publicationTask = Task.Run(() => PersistPreparedDocumentsAsync( node, options, physicsPersistence, - unityBundles, publication, - reactiveSurfaceState, - publishTopology: false); + initialTopology: false, + unityBundles: unityBundles, + reactiveSurfaceState: reactiveSurfaceState)); await PublishDemandedManagedViewportsAsync(node, options, tick.Frame, managedViewportDemand).ConfigureAwait(false); nextApiPublicationUtc = DateTimeOffset.UtcNow.Add(options.ApiPublicationInterval); } @@ -393,7 +399,16 @@ static async Task TickAsync( if (buildPublications) { - await PublishDaemonApiDocumentsAsync(node, options, unityBundles, result, publishTopology: true).ConfigureAwait(false); + await PublishDurableDaemonDocumentsAsync(node, result).ConfigureAwait(false); + await PublishClientGameplayDocumentsAsync( + node, + options, + unityBundles, + result, + ingressState.Catalog ?? throw new InvalidOperationException("Aetheria runtime catalog was not initialized."), + reactiveSurfaceState: null, + publishTopology: true).ConfigureAwait(false); + await PublishSecondaryTopologyDocumentsAsync(node, options, result).ConfigureAwait(false); TracePhase("api-publication"); await PublishStateSurfacesAsync(node, options, result.Frame.PublishedAtUtc).ConfigureAwait(false); TracePhase("state-surfaces"); @@ -435,31 +450,42 @@ static AetheriaPreparedPublication PreparePublication( SimulationSettings = options.SimulationSettings }, frame.AccountedCommandIds?.Count ?? 0); - return new AetheriaPreparedPublication(publication, physics); + return new AetheriaPreparedPublication( + publication, + physics, + ingressState.Catalog ?? throw new InvalidOperationException("Aetheria runtime catalog was not initialized.")); } -static async Task PublishPreparedDocumentsAsync( +static async Task PersistPreparedDocumentsAsync( AetheriaStateNode node, AetheriaDaemonHostOptions options, AetheriaYmirPersistenceCoordinator physicsPersistence, - AetheriaUnityBundleArtifactSet unityBundles, AetheriaPreparedPublication prepared, - AetheriaReactiveSurfacePublicationState reactiveSurfaceState, - bool publishTopology) + bool initialTopology, + AetheriaUnityBundleArtifactSet? unityBundles = null, + AetheriaReactiveSurfacePublicationState? reactiveSurfaceState = null) { await physicsPersistence.PersistPrivateAsync(prepared.Physics).ConfigureAwait(false); - await PublishDaemonApiDocumentsAsync( - node, - options, - unityBundles, - prepared.Publication, - publishTopology, - reactiveSurfaceState).ConfigureAwait(false); - if (publishTopology) + await PublishDurableDaemonDocumentsAsync(node, prepared.Publication).ConfigureAwait(false); + if (initialTopology) { + await PublishSecondaryTopologyDocumentsAsync(node, options, prepared.Publication).ConfigureAwait(false); await PublishStateSurfacesAsync(node, options, prepared.Publication.Frame.PublishedAtUtc).ConfigureAwait(false); await PublishOdinSurfaceAnnouncementsAsync(node, options, prepared.Publication.Frame.PublishedAtUtc).ConfigureAwait(false); } + else + { + if (unityBundles == null) + throw new InvalidOperationException("Periodic publication requires the provider asset set."); + await PublishClientGameplayDocumentsAsync( + node, + options, + unityBundles, + prepared.Publication, + prepared.Catalog, + reactiveSurfaceState, + publishTopology: false).ConfigureAwait(false); + } await node.FlushAsync(soft: false).ConfigureAwait(false); await physicsPersistence.ActivateAsync().ConfigureAwait(false); } @@ -1722,13 +1748,9 @@ static async Task PublishHotEntityStateAsync( } } -static async Task PublishDaemonApiDocumentsAsync( +static async Task PublishDurableDaemonDocumentsAsync( AetheriaStateNode node, - AetheriaDaemonHostOptions options, - AetheriaUnityBundleArtifactSet unityBundles, - AetheriaRuntimeDaemonTickResult result, - bool publishTopology, - AetheriaReactiveSurfacePublicationState? reactiveSurfaceState = null) + AetheriaRuntimeDaemonTickResult result) { await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest) .ReplaceAsync(result.Frame) @@ -1736,14 +1758,6 @@ static async Task PublishDaemonApiDocumentsAsync( await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.ZoneRenderLatest) .ReplaceAsync(AetheriaRuntimeGameDocuments.ZoneRender(result.Frame)) .ConfigureAwait(false); - if (publishTopology && result.ProviderAdvertisement != null) - await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement) - .ReplaceAsync(result.ProviderAdvertisement) - .ConfigureAwait(false); - if (publishTopology) - await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.EveProviderAdvertisement) - .ReplaceAsync(BuildCoreProviderAdvertisement(options, result.Frame.PublishedAtUtc)) - .ConfigureAwait(false); if (result.Health != null) await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonHealth) .ReplaceAsync(result.Health) @@ -1752,6 +1766,42 @@ static async Task PublishDaemonApiDocumentsAsync( await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary) .ReplaceAsync(result.CommandBoundary) .ConfigureAwait(false); + if (result.StarbridgeSessionSummary != null) + await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary) + .ReplaceAsync(result.StarbridgeSessionSummary) + .ConfigureAwait(false); +} + +static async Task PublishClientGameplayDocumentsAsync( + AetheriaStateNode node, + AetheriaDaemonHostOptions options, + AetheriaUnityBundleArtifactSet unityBundles, + AetheriaRuntimeDaemonTickResult result, + AetheriaRuntimeCatalogSnapshot inputCatalog, + AetheriaReactiveSurfacePublicationState? reactiveSurfaceState, + bool publishTopology) +{ + var trace = publishTopology && string.Equals( + Environment.GetEnvironmentVariable("AETHERIA_TRACE_STARTUP_PHASES"), + "1", + StringComparison.Ordinal); + var phase = Stopwatch.StartNew(); + void TraceClientDocumentPhase(string name) + { + if (trace) + Console.WriteLine($"Aetheria client-bootstrap phase {name} took {phase.Elapsed.TotalMilliseconds:0.###}ms."); + phase.Restart(); + } + + if (publishTopology && result.ProviderAdvertisement != null) + await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement) + .ReplaceAsync(result.ProviderAdvertisement) + .ConfigureAwait(false); + if (publishTopology) + await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.EveProviderAdvertisement) + .ReplaceAsync(BuildCoreProviderAdvertisement(options, result.Frame.PublishedAtUtc)) + .ConfigureAwait(false); + TraceClientDocumentPhase("provider-advertisements"); if (publishTopology && result.AssetManifest != null) { await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest) @@ -1761,19 +1811,16 @@ static async Task PublishDaemonApiDocumentsAsync( .ReplaceAsync(BuildCoreAssetCatalog(unityBundles, result.AssetManifest)) .ConfigureAwait(false); } - if (result.StarbridgeSessionSummary != null) - await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary) - .ReplaceAsync(result.StarbridgeSessionSummary) - .ConfigureAwait(false); + TraceClientDocumentPhase("asset-catalog"); var gameSession = await node.MutableDocument(AetheriaStateNode.GameSessionStateKey) .ReadAsync().ConfigureAwait(false); - var inputCatalog = AetheriaRuntimeCatalogStore.OpenReadOnly(node.StatePath); await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.PilotInputCapability) .ReplaceAsync(AetheriaRuntimeInputCapabilityDocument.FromFrame( result.Frame, string.Equals(gameSession?.Mode, AetheriaGameSessionState.TerminusMode, StringComparison.Ordinal), inputCatalog).ToEveDocument()) .ConfigureAwait(false); + TraceClientDocumentPhase("input-capability"); var mainMenuState = await node.MutableDocument(AetheriaStateNode.MainMenuStateKey) .ReadAsync() .ConfigureAwait(false); @@ -1791,6 +1838,7 @@ static async Task PublishDaemonApiDocumentsAsync( .ConfigureAwait(false); reactiveSurfaceState?.Set(reactiveGameSurface.Version); } + TraceClientDocumentPhase("reactive-surface"); if (publishTopology) { var gameSurface = AetheriaRuntimeDaemonGameSurfaceBuilder.Build( @@ -1807,9 +1855,14 @@ static async Task PublishDaemonApiDocumentsAsync( .ConfigureAwait(false); await PublishDaemonSectorMapSurfaceAsync(node, result.Frame, inputCatalog).ConfigureAwait(false); } - if (!publishTopology) - return; + TraceClientDocumentPhase("game-topology"); +} +static async Task PublishSecondaryTopologyDocumentsAsync( + AetheriaStateNode node, + AetheriaDaemonHostOptions options, + AetheriaRuntimeDaemonTickResult result) +{ var commanderSurface = AetheriaRuntimeDaemonGameSurfaceBuilder.BuildCommander( result.Frame, result.Health ?? new AetheriaRuntimeDaemonHealthDocument(), @@ -2829,12 +2882,15 @@ static async Task EnsureGameSessionAsync( var expectedMode = string.IsNullOrWhiteSpace(run.GameMode) ? run.IsTutorial ? AetheriaGameSessionState.AetheriaMode : AetheriaGameSessionState.TerminusMode : run.GameMode; + var initialSimulationRate = options.UseTerminusFixture ? 0 : 1; var existing = await node.MutableDocument(AetheriaStateNode.GameSessionStateKey) .ReadAsync().ConfigureAwait(false); if (existing != null && string.Equals(existing.Mode, expectedMode, StringComparison.Ordinal) && string.Equals(existing.RunId, run.RunId, StringComparison.Ordinal) && - string.Equals(existing.ControlledEntityKey, run.CurrentEntityKey, StringComparison.Ordinal)) + string.Equals(existing.ControlledEntityKey, run.CurrentEntityKey, StringComparison.Ordinal) && + Math.Abs(existing.SimulationRate - initialSimulationRate) < 0.000001 && + Math.Abs((existing.EffectiveSimulationRate ?? existing.SimulationRate) - initialSimulationRate) < 0.000001) return; await node.MutableDocument(AetheriaStateNode.GameSessionStateKey) @@ -2845,8 +2901,8 @@ static async Task EnsureGameSessionAsync( RunId = run.RunId, ControlledEntityKey = run.CurrentEntityKey, EntrySurfaceId = AetheriaRuntimeDaemonGameSurfaceBuilder.PilotSurfaceId, - SimulationRate = 1, - EffectiveSimulationRate = 1, + SimulationRate = initialSimulationRate, + EffectiveSimulationRate = initialSimulationRate, UpdatedAtUtc = now }).ConfigureAwait(false); await node.FlushAsync().ConfigureAwait(false); @@ -3415,7 +3471,8 @@ static AetheriaRuntimeLoadoutItemCommit ToLoadoutItemCommit(AetheriaLoadoutItem? internal sealed record AetheriaPreparedPublication( AetheriaRuntimeDaemonTickResult Publication, - IReadOnlyList Physics); + IReadOnlyList Physics, + AetheriaRuntimeCatalogSnapshot Catalog); internal sealed class AetheriaManagedViewportDemandState { diff --git a/Aetheria.Unity/Packages/manifest.json b/Aetheria.Unity/Packages/manifest.json index 2ef0931ea..eb05743ec 100644 --- a/Aetheria.Unity/Packages/manifest.json +++ b/Aetheria.Unity/Packages/manifest.json @@ -10,6 +10,6 @@ "org.gamecult.cultlib": "https://github.com/GameCult/CultLib.git?path=/unity/org.gamecult.cultlib#cultlib-unity-v1.0.38", "org.gamecult.eve.plugin-fields": "https://github.com/GameCult/EvePlugins.git?path=/plugins/eve-plugin-fields/unity/org.gamecult.eve.plugin-fields#eve-plugin-fields-unity-v0.2.3", "org.gamecult.eve.surface": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.surface#eveunity-surface-v0.2.4", - "org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.97" + "org.gamecult.eve.unity-scene": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.98" } } diff --git a/Aetheria.Unity/Packages/packages-lock.json b/Aetheria.Unity/Packages/packages-lock.json index b65afd011..0f4294e5b 100644 --- a/Aetheria.Unity/Packages/packages-lock.json +++ b/Aetheria.Unity/Packages/packages-lock.json @@ -152,18 +152,18 @@ "hash": "e08fa08335f99e9edddeb706912eecfad07cb281" }, "org.gamecult.eve.unity-scene": { - "version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.97", + "version": "https://github.com/GameCult/EveUnity.git?path=/packages/org.gamecult.eve.unity-scene#eveunity-scene-v0.3.98", "depth": 0, "source": "git", "dependencies": { - "org.gamecult.cultlib": "1.0.36", + "org.gamecult.cultlib": "1.0.38", "org.gamecult.eve.plugin-fields": "0.2.3", "org.gamecult.eve.surface": "0.2.4", "com.unity.mathematics": "1.3.2", "com.unity.render-pipelines.universal": "17.4.0", "com.unity.modules.particlesystem": "1.0.0" }, - "hash": "44e338bd9eb4997f2235f7aa711b79bc5d5c12ff" + "hash": "002fbdf3570f533a8728d2a8f808025065d99532" }, "com.unity.modules.assetbundle": { "version": "1.0.0", diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 997eeb5b7..359f5f2eb 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -3573,9 +3573,39 @@ Ymir restart ownership is deliberately private and asymmetric: registered. - Verification layer: daemon smoke collects a live pickup, persists the public frame and private Ymir state, restores both into fresh sessions, and proves - the next tick cannot resurrect the pickup or duplicate cargo or feedback. Ymir unit - tests prove incremental suffix capture, exact chunk coverage, checksums, and - replay verifier convergence. + the next tick cannot resurrect the pickup or duplicate cargo or feedback. A + paused-frame smoke also proves frame zero creates a persistable Ymir world + while retaining the `-1` no-step cursor. Ymir unit tests prove incremental + suffix capture, exact chunk coverage, checksums, and replay verifier + convergence. + +Live client readiness and durable publication are separate authorities: + +- Owner: live gameplay publication owns client readiness; the single-flight + persistence worker owns restart durability and secondary projections. +- Inputs: both consume the same immutable completed tick, runtime catalog, + provider asset set, and Ymir persistence capture. +- Outputs: readiness publishes the provider advertisements, selected game + surface, input capability, asset catalog, reactive surface, first entity SoA + generation, and initial game/map topology. The worker publishes the durable + daemon frame, zone render, private Ymir state, state surfaces, health and + operator/commander/editor/menu projections. +- Derived state: startup timings, flush completion, socket drain, and secondary + projection availability are diagnostics; none decides whether the playable + provider surface exists. +- Forbidden writers: CultCache hard flushes, private Ymir writes, Odin + announcements, full-frame snapshots, and secondary Eve surfaces cannot gate + the simulation loop or retract a coherent live generation. +- Shared paths: first and periodic publication use the same prepared immutable + tick. Only one persistence task may run, and `--once` explicitly joins it + before exit; the live daemon continues ticking and publishing latest-only SoA + while that task completes. +- Cut line: client bootstrap no longer awaits full-frame/zone-render + persistence or rebuilds the runtime catalog from disk. Those owners cannot + regain readiness authority through a convenience wrapper. +- Verification layer: startup phase traces measure the live boundary directly; + the released generic EveUnity witness proves provider discovery, mapped + assets, QUIC SoA, commands and receipts while persistence runs concurrently. Remote realtime transport has one narrow owner: