From f45c22abf3ca67f17c370a3e81459378735a1152 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 13 Jun 2026 10:14:38 +0100 Subject: [PATCH] Add typed loadout template state --- .voidbot/state/aetheria.cc | Bin 22504 -> 23006 bytes Aetheria.State.Smoke/Program.cs | 43 ++++++++ Aetheria.State/AetheriaDocumentRegistry.cs | 2 + Aetheria.State/AetheriaStateNode.cs | 12 +++ .../AetheriaRuntimeStateDocuments.cs | 96 ++++++++++++++++++ Aetheria.State/README.md | 27 +++-- docs/aetheria-perfect-machine-map.md | 15 ++- 7 files changed, 183 insertions(+), 12 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 8017522ec96aaaa3aac36db2245e0a858ee4fbba..d24c848530413549a53bf1fb89cb1a7b763878bd 100644 GIT binary patch delta 1488 zcmZ`(O^6&t6n56QN!)-xSrgc>>{G-*nCacwjP8$`U6&Y8)?~9W3QHiV>3-c^+3v1R zRrQP`$RM7)2%(N16A74z%AA8B5wa(}M#OVGg`9=ptM2L9R+CFp{is*(`@Z+RcmMm^ zpM%;D*T)VlEjQ>lnNmd%oCXgjd2<=jo=A4i!sq4kpeDH0%)U3#WsRd zUQQ{MD~*YZ&Nptvc>H^9rYz)~)A>8-^91_}%J_Ow>BF*6m+KIemYJ(FNqE96it2z@ zGM?J{b#R#s1hiSNZb5D5NbHXr^2h_a!ZrOdrFf7O87%Rji!2pMBak9XL5*814wy>| zlYQt)u2I#&k1`e7gG7;HLI<1JA(ecNR-lsSNED0JswA<)I~K@D3L)X$9LWZAw?SE@ zBmODVTqMp7Qb^I^-p=`i>wXW;u?`MpAm%)Z=qn_ZtUMvwm(kSR9}4AjfbQV3{)7J_uSv_An$2fsDG8{hlI zHHrSc6Xt63p!sU{;KXLp6FVAa-{dPNR!-*Q@#N{Sjx6RhA$h5_r6*M+v^o3ysoA*= zDLULEX2reo!U%Di>DhqX5z__`p4oX}-t2w*P_1PSyf}4?)O>uJbBjFg+0ib9Ib$1R_haRQ|7JjFoxp{1A3YbqJP;N*DqiG3fOUQf}%wH>ahN_$~ z4_96@V&R$E1v{6|Ij%~jxD1U(zJ<)^i$`j!=Ii%gJ(BOK|MAL=V{Wa!Iaw^od1q;< zwRK&yfcp6I;P2I+Ym+yISvP5_6*lse!R@t){S%cO^W*yA-R1d4Ghdz)>$fYh*N01X f+&oy1EAe9ae)d6sH?}Zm?+&I<|FpjnY;FAmkC+%q delta 1339 zcma)6OKTHR6gF)seJBW8s-X0&bYsT0dGw*6eW;XbEmfp+cQbR6T$#Cdy!TGp2%5D^ znZHmG)Z!ysMGy-v#f>OFmb&#HcxIBBqy<3;Ve;kNbI$je`=gop{XFwxyXWBaY++`$ zFl9{^CpR8uM#9~m2SXh!{L?!c%HFNCEH^b1mksot?76bjJl$uHHCE=(R8esTC9JX< zmkNAVcO`Q)FohuGCin_9sv0`LG?=|6P_Vj2yqUrLxw0^R*Xb`;`;bl%8ax)XjCMlnDnWrc*qtxr1%`*`-C|R~|rx!bWX{7cY!70JnUpX_Nh4 zP$_f3lMcEXHo2+Fz(Ay1iD|qfjH+9Y4GK+czwE9B!f+4C5$?KROQDSlY_nJRw(e&W zEkTxUH;}5%fvIv0HVsI8rz8Y4Qju`!Vl9fm1>8cV5lU3=NLpP;19glJ%UVR2($%)F zbC%ggsya~CH1`6RMJ^F{njgfEJ~LJ8B~=kl$#FUP6;boiU_57iu>5Y`1+}Jj(LX5_m-{;?Dn$5-G!QrmI!;ihA t=>?Y0#TQs+(registry), CultNetDocumentBinding.ForDocument(registry), CultNetDocumentBinding.ForDocument(registry), + CultNetDocumentBinding.ForDocument(registry), CultNetDocumentBinding.ForDocument(registry), CultNetDocumentBinding.ForDocument(registry), CultNetDocumentBinding.ForDocument(registry), @@ -51,6 +52,7 @@ public static class AetheriaDocumentRegistry typeof(AetheriaMigrationLedger), typeof(AetheriaLegacyCatalogQuarantine), typeof(AetheriaPlayerSettings), + typeof(AetheriaLoadoutTemplate), typeof(AetheriaRunState), typeof(AetheriaZoneState), typeof(AetheriaEntitySnapshot), diff --git a/Aetheria.State/AetheriaStateNode.cs b/Aetheria.State/AetheriaStateNode.cs index 32a1c0afc..79e664ddb 100644 --- a/Aetheria.State/AetheriaStateNode.cs +++ b/Aetheria.State/AetheriaStateNode.cs @@ -183,6 +183,18 @@ public sealed class AetheriaStateNode : IAsyncDisposable, IDisposable return Database.GetAsync(new CultRecordKey("global:aetheria.player_settings.v1")); } + public Task> PutLoadoutTemplateAsync( + CultRecordKey key, + AetheriaLoadoutTemplate loadout) + { + return Database.PutAsync(key, loadout); + } + + public Task GetLoadoutTemplateAsync(CultRecordKey key) + { + return Database.GetAsync(key); + } + public Task> PutRunStateAsync(CultRecordKey key, AetheriaRunState run) { return Database.PutAsync(key, run); diff --git a/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs b/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs index d103968a1..d3cddcee4 100644 --- a/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs +++ b/Aetheria.State/Documents/AetheriaRuntimeStateDocuments.cs @@ -20,6 +20,102 @@ public sealed class AetheriaPlayerSettings public string LastUpdatedAtUtc { get; set; } = ""; } +[CultDocument("aetheria.loadout_template", "aetheria.loadout_template.v1")] +[MessagePackObject] +public sealed class AetheriaLoadoutTemplate +{ + [Key(0)] + [CultName] + public string Name { get; set; } = ""; + + [Key(1)] + public string OwnerPlayerKey { get; set; } = ""; + + [Key(2)] + public AetheriaEntityLoadout RootEntity { get; set; } = new(); + + [Key(3)] + public string CreatedAtUtc { get; set; } = ""; + + [Key(4)] + public string UpdatedAtUtc { get; set; } = ""; +} + +[MessagePackObject] +public sealed class AetheriaEntityLoadout +{ + [Key(0)] + [CultName] + public string Name { get; set; } = ""; + + [Key(1)] + public string Kind { get; set; } = ""; + + [Key(2)] + public string FactionKey { get; set; } = ""; + + [Key(3)] + public AetheriaLoadoutItem Hull { get; set; } = new(); + + [Key(4)] + public AetheriaLoadoutItemSlot[] Equipment { get; set; } = []; + + [Key(5)] + public AetheriaLoadoutItemSlot[] CargoBays { get; set; } = []; + + [Key(6)] + public AetheriaLoadoutItemSlot[] DockingBays { get; set; } = []; + + [Key(7)] + public AetheriaCargoBayLoadout[] CargoContents { get; set; } = []; + + [Key(8)] + public AetheriaCargoBayLoadout[] DockingBayContents { get; set; } = []; + + [Key(9)] + public int[] DockingBayAssignments { get; set; } = []; + + [Key(10)] + public int[][] WeaponGroups { get; set; } = []; + + [Key(11)] + public AetheriaEntityLoadout[] Children { get; set; } = []; +} + +[MessagePackObject] +public sealed class AetheriaLoadoutItem +{ + [Key(0)] + [CultReference(typeof(AetheriaItemDefinition))] + public string ItemKey { get; set; } = ""; + + [Key(1)] + public double Quality { get; set; } = 1.0; + + [Key(2)] + public double Durability { get; set; } = 1.0; + + [Key(3)] + public int Quantity { get; set; } = 1; +} + +[MessagePackObject] +public sealed class AetheriaLoadoutItemSlot +{ + [Key(0)] + public AetheriaGridCoord Position { get; set; } = new(); + + [Key(1)] + public AetheriaLoadoutItem Item { get; set; } = new(); +} + +[MessagePackObject] +public sealed class AetheriaCargoBayLoadout +{ + [Key(0)] + public AetheriaLoadoutItemSlot[] Items { get; set; } = []; +} + [CultDocument("aetheria.run_state", "aetheria.run_state.v1")] [MessagePackObject] public sealed class AetheriaRunState diff --git a/Aetheria.State/README.md b/Aetheria.State/README.md index 184cdc59e..81efa7d3b 100644 --- a/Aetheria.State/README.md +++ b/Aetheria.State/README.md @@ -11,18 +11,20 @@ The first live state file is `GameData/aetheria-world.cc`. It is generated by machine-local absolute paths. Legacy files such as `GameData/AetherDB.msgpack` are migration inputs only. -The typed runtime state model is split into player settings, run state, zone -state, entity snapshots, item slots, weapon groups, action-bar bindings, and -stat grids. Do not preserve `SavedGame` or `EntityPack` as opaque payloads in -the new store; they are source shapes for migration, not portable state -authority. +The typed runtime state model is split into player settings, loadout templates, +run state, zone state, entity snapshots, item slots, weapon groups, action-bar +bindings, and stat grids. Do not preserve `SavedGame` or `EntityPack` as opaque +payloads in the new store; they are source shapes for migration, not portable +state authority. The Unity client no longer writes `PlayerSettings.msgpack`, `.loadout`, or -`.zone` files. Until `Aetheria.State` is available to Unity as a runtime Verse -package, player settings and loadout edits are 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. +`.zone` files. `AetheriaLoadoutTemplate` is now 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 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. 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. @@ -81,6 +83,11 @@ published Eve catalog surface. It does not deserialize legacy `DatabaseEntry` objects and does not write state. Unity can use this as the first package boundary once CultLib/Eve runtime packaging is available. +`Aetheria.State.Smoke` writes and reopens a typed loadout template in addition +to world, catalog, player settings, and run state. That smoke is the current +proof that loadouts have a durable Verse state shape without reviving `.loadout` +serialization. + `Aetheria.State.Verify` opens a materialized state file and checks that the typed migration ledger matches the actual item, corporation, and name-file records in the `.cc` store. It also verifies the canonical legacy-ID lookup API diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 0dc3b322e..6148286d5 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -39,6 +39,13 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. deleted. The dead `SavedStory` JSON DTO is deleted. `ZonePack` and `EntityPack` remain as runtime construction/loadout snapshots, but no longer declare themselves as MessagePack persistence documents. +- `Aetheria.State` now defines `AetheriaLoadoutTemplate` as the typed Verse + replacement for bespoke `.loadout` files. It stores structured hull, + equipment, cargo bay, docking bay, child-entity, assignment, and weapon-group + state through record-key references and typed value slots instead of opaque + `EntityPack` serialization. Unity has not wired its save/loadout UI to this + document yet, so the old in-memory `EntityPack` path is still a runtime + construction helper, not durable authority. - `LegacyCatalogBoundary` opens `LegacyCatalogCache` as the only concrete pull-only catalog cache. Runtime consumers receive `ILegacyCatalogReader`, so old MessagePack backing stores may hydrate in-memory domain objects for @@ -157,7 +164,9 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. catalog reads emit in-memory domain objects only; the old local save and editor catalog write paths have been cut. Migrated catalog documents are addressed through `AetheriaCatalogKeys` and `AetheriaStateNode` legacy-ID - methods, not importer-local string concatenation. The catalog operator UI is + methods, not importer-local string concatenation. Loadout templates have a + typed state document and node put/get path; Unity's save button still needs + to call it through the runtime Verse package. The catalog operator UI is emitted as a typed Eve surface document derived from the catalog snapshot. - Derived state: UI panels, generated keyboard layouts, editor rows, and serialized legacy payloads are projections, migration inputs, or disabled @@ -269,6 +278,8 @@ First Aetheria surfaces to publish: - Done: import recursive typed behavior payloads so future behavior factories no longer have to depend on legacy `BehaviorData` objects just to see authored behavior fields. + - Done: add typed `AetheriaLoadoutTemplate` documents and smoke coverage so + `.loadout` no longer lacks a durable Verse replacement. - Remaining: add typed documents/mappers for runtime object graphs, typed behavior factory construction, simulation state, and any catalog fields not covered by the stable scalar/fingerprint/payload pass. @@ -326,7 +337,7 @@ First Aetheria surfaces to publish: - `dotnet list package --vulnerable --include-transitive` is clean for active maintained projects. - CultCache smoke proves write, flush, reopen, query, and typed reference - resolution. + resolution, including loadout templates as the `.loadout` replacement. - CultMesh smoke proves node start, typed put/get, subscription, flush, and reopen. - Eve surface smoke proves provider-owned surface documents are generated from