diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index cd1f5a766..54ef3c3f4 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Aetheria.State.ApplyPending/Aetheria.State.ApplyPending.csproj b/Aetheria.State.ApplyPending/Aetheria.State.ApplyPending.csproj new file mode 100644 index 000000000..ca788873d --- /dev/null +++ b/Aetheria.State.ApplyPending/Aetheria.State.ApplyPending.csproj @@ -0,0 +1,13 @@ + + + Exe + net10.0 + enable + latest + enable + + + + + + diff --git a/Aetheria.State.ApplyPending/Program.cs b/Aetheria.State.ApplyPending/Program.cs new file mode 100644 index 000000000..95c755f8e --- /dev/null +++ b/Aetheria.State.ApplyPending/Program.cs @@ -0,0 +1,23 @@ +using Aetheria.State; + +var root = args.Length > 0 && !args[0].StartsWith("--", StringComparison.Ordinal) + ? Path.GetFullPath(args[0]) + : Directory.GetCurrentDirectory(); +var explicitStatePath = args.Length > 1 && !args[1].StartsWith("--", StringComparison.Ordinal) + ? args[1] + : ""; +var statePath = string.IsNullOrWhiteSpace(explicitStatePath) + ? AetheriaStatePaths.ResolveDefaultStatePath(root) + : Path.GetFullPath(explicitStatePath); +var deleteApplied = !args.Any(arg => string.Equals(arg, "--keep", StringComparison.OrdinalIgnoreCase)); + +await using var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-state-apply-pending"); +var report = await AetheriaRuntimeCommitLogApplier.ApplyPendingAsync(node, deleteApplied); + +Console.WriteLine($"Applied pending Aetheria runtime commits: {statePath}"); +Console.WriteLine($"Player settings: {report.AppliedPlayerSettings}"); +Console.WriteLine($"Loadout templates: {report.AppliedLoadoutTemplates}"); +Console.WriteLine($"Run checkpoints: {report.AppliedRunCheckpoints}"); +Console.WriteLine($"Commands applied: {report.AppliedPaths.Length}"); +if (!deleteApplied) + Console.WriteLine("Applied command files were kept because --keep was supplied."); diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index bd3fe5f6a..1f34b5abb 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -23,12 +23,12 @@ The Unity client no longer writes `PlayerSettings.msgpack`, `.loadout`, or `.zone` files. `AetheriaPlayerSettings` is the typed Verse replacement for `PlayerSettings.msgpack`, and `AetheriaLoadoutTemplate` is the typed Verse replacement for bespoke loadout files, with structured hull/equipment/cargo/ -docking item slots, nested child-entity loadouts, and weapon groups. Until -`Aetheria.State` is available to Unity as a runtime Verse package, Unity -settings and loadout edits are still session-local and run saving is disabled. -That is intentional: the missing runtime package is the owner gap, and the old -bespoke file formats must not keep acting as durable truth while the state spine -is being rebuilt. +docking item slots, nested child-entity loadouts, and weapon groups. Unity +settings, loadout saves, and run checkpoints now queue typed `.cc.pending` +runtime commit envelopes beside `GameData/aetheria-world.cc`. `Aetheria.State` +owns applying those envelopes into canonical typed state through +`AetheriaRuntimeCommitLogApplier`; the Unity-side command log is command-only +and cannot become durable truth by itself. The old `SavedGame`/`SavedZone` DTOs and `Galaxy` loader constructor have also been deleted; the new document family is live Verse run/zone state, not a bespoke save-file format. @@ -125,7 +125,20 @@ Use it after import when `GameData/aetheria-world.cc` changes. `Aetheria.State.Unity.Smoke` opens the materialized state through the runtime facade and proves read-only Unity-facing catalog access without the legacy -catalog reader. +catalog reader. It also proves runtime commit envelopes for settings and run +zone/entity snapshots can be queued, applied through `Aetheria.State`, and +cleared. + +`Aetheria.State.ApplyPending` is the bounded local applicator for queued Unity +runtime commits: + +```powershell +dotnet run --project .\Aetheria.State.ApplyPending\Aetheria.State.ApplyPending.csproj -- . +``` + +Pass an explicit state path as the second argument when applying a non-default +`.cc` file. Use `--keep` only for diagnostics; normal application deletes +successfully applied command files. Current rebuild notes: diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 094f43626..b8fb123f0 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -41,7 +41,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. files, and generated keyboard layout caches no longer write bespoke durable files. The legacy `PlayerSettings` runtime object is no longer decorated as a MessagePack - persistence shape. + persistence shape. `Aetheria.State.ApplyPending` is the repo-local applicator + entrypoint for draining `aetheria-world.cc.pending` into canonical typed state + until that worker is hosted as a daemon/CultMesh organ. - Shared domain state is still partly built around `DatabaseEntry`, GUID identity, MessagePack attributes, and static cache references. Newtonsoft, JsonKnownTypes, RethinkDB, LiteNetLib client transport, and the broken @@ -163,6 +165,11 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. commands after writing typed documents. Run checkpoint envelopes now carry current-zone and entity snapshots so the old `.zone` file path has a live typed runtime projection path. +- `Aetheria.State.ApplyPending` opens the typed state node and applies queued + Unity runtime command envelopes from `aetheria-world.cc.pending`, deleting + successfully applied command files by default. It is an operational bridge, + not a second state owner; the applicator delegates all writes to + `AetheriaStateNode`. - `AetheriaCatalogSurfaceProjector` now emits the first provider-owned Eve surface from typed catalog state. The importer materializes a `gamecult.eve.surface.v1` catalog operator document at @@ -521,6 +528,8 @@ First Aetheria surfaces to publish: - Done: extend run checkpoint commands to carry current-zone and entity snapshots into canonical `AetheriaZoneState` and `AetheriaEntitySnapshot` documents. + - Done: add `Aetheria.State.ApplyPending` as a bounded local applicator for + queued runtime commits until the drain loop is hosted as a daemon. - Done: stop legacy catalog pull/read paths from writing entries back to their source backing store. - Done: delete legacy catalog backing-store write/realtime APIs.