From 5b60965dd7500e2d16564b644696eb65bad66afe Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 15:41:50 +0100 Subject: [PATCH] Add pending runtime commit applicator --- .voidbot/state/aetheria.cc | Bin 35761 -> 36132 bytes .../Aetheria.State.ApplyPending.csproj | 13 +++++++++ Aetheria.State.ApplyPending/Program.cs | 23 +++++++++++++++ Aetheria.State/README.md | 27 +++++++++++++----- docs/aetheria-perfect-machine-map.md | 11 ++++++- 5 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 Aetheria.State.ApplyPending/Aetheria.State.ApplyPending.csproj create mode 100644 Aetheria.State.ApplyPending/Program.cs diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index cd1f5a76650028737671d23482cf46db397ce336..54ef3c3f498e2126a6eb041beabc8ea7853042e7 100644 GIT binary patch delta 1595 zcma)6&x;&Y5Z0ZLWHnxv7!9Z?5H}(_JxQF=tdR{%b_rqvyIB=n6nXo)ru#YFuR8C& zo?#YoHV9t4D18VBBAC?$QT#C%J>`_65J8Xu{{fHr2gG{QJ>#xI@HSKZs_Lun`>KAp zIkWre%=cf-Jk&h%QtNE6c=pB3Pab@f))S=SR0thgeQ9U6k61a5b6>za|5E`Mhh1a!m zeF&rsvhqEcTsxH_NJ>-X0Cg7=%FuF}p*)JA*nVbi@TE+IN=LV=F8|81j0_Ue5gKlO zJy!-ngbOb+cS9 zfmG;RB#kj|!5B=I^Bhi?2nWvBXJ&J)nPhkajYS|634MUx38|h;p+n10KuC$1vj-?E zzjc|ee*h{MQ|_vPIZtVari(l)>0*8Uc(HTj@SvoFBNik-ww#iL)v#*YLjucLN@Cr! zF(zpOO0Z3sZ|5=T5VCwLQOt~DY%z+&#SJMkv858_)IR+u2pg+iTmcq?z37M5kf7*# zHmYe$HGE*KK*^_9H27L*8I!q&ZTrUq8^eXuzaD#YeL3fWjkjYeGPaE*!-RQN_XB0t zb;Zek4=k|b91AkG4p2|CwjbOw*d8qv_nOCx&sOJ(lgr13JIyK#kbMWl)0*$ zcS^{fZ1bgwQFbt_D-D-LiYvkie>5nUanUvx=gND0ezCQ=>qNw!yi)x2{)yo)=I7ee z-&KOteOca(AEzrPl6rZ7h97nxnVp>$Del%zPR{r9FN_cRZ-d)MtE1m6?$sVEsCKyc dX@{z$#b&EGbK~ap-}&L)8^6y^YP8O6{tZauOlJT9 delta 1209 zcmY*Zy-yTD6qf@HAbx}bVib8cS}4oM@ezm=2#9C^1)`B|*nQlt?9Hq*vmA$sClGs+ zEliAsiJ*zGkX$2)jkT491;#(XmeRuLo4H%iYBRI%z4?93Y`w_rJkNZ1lWEBI4`sWZ z!Jgivd;MJUCG+%PXOMPU5>dOB?qqxHPJLZl=Fv*|Qk~yk+8#meqYN0xnCl>q<_oTm z?s6mot`%@m0GCNw1S$kKmJ+#!HNg?0FjhdTKo>!A7Aap)gZ8C}bG|KCj3(-0gdRAq z>qN-Cfal;YN=36ozLXC%gdzvAqLL*cL7~=EqJVLa{xDC(S~=Tp$b$U$n(2AMAVQjE z0VuYD9ZNw-P?+|?XVeB^u#%pca*CvQfUXV%uN0bt3>(%&n^bLv4MEa4a&{^uxL^nx z4C57kV$n=cK$-|hMVqZ?MxW6G#YRP*NL{hL$^M=8qfn56PJU;vmB15joF~B!MM@{l zX{K>nc<8*<$Q2>o`!vJDis(iL^g2^$mU^I|$_hOP?)f6bjvNcwY7t^yY3Q(p5osML z8tRr1ln%lWIHG5isu&{*9HrGhWNSspAuS1vXH`+Kh@=)CP^K(UK8zd2zbHg)BV(gu z?0_gHxWn{f@1t$_D z9UW^@a~Ly{!shJ%LSS189fG)QzM5;M+(NM})> zu>`C-&O63kU&vWpQa_H&me($RZK|0}UOjHD}7$ zufmCj^r`3?NY*#bq^sU8dN{rvtg_XIDH$OKt KR%`nD7ybeT7r7Mx 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.