From 9d0d9b07e0944a6b075dca30054d63642784ef16 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 26 Jul 2026 08:46:12 +0200 Subject: [PATCH] docs(runtime): close magic and player ownership Record J4.3's coupled Runtime character graph, desired-component single ownership, complete Release evidence, exact-binary lifecycle/reconnect acceptance, rollback, and the J4.4 projection boundary. Synchronize architecture, roadmap, milestones, agent guidance, and durable memory. Co-authored-by: Codex --- AGENTS.md | 13 ++- CLAUDE.md | 13 ++- docs/architecture/acdream-architecture.md | 3 +- docs/plans/2026-04-11-roadmap.md | 9 +- docs/plans/2026-05-12-milestones.md | 9 +- .../2026-07-24-modern-runtime-architecture.md | 5 +- .../2026-07-25-modern-runtime-slice-j.md | 10 +- .../2026-07-26-modern-runtime-slice-j4.md | 21 +++- .../2026-07-26-slice-j4-3-character-state.md | 107 ++++++++++++++++++ 9 files changed, 175 insertions(+), 15 deletions(-) create mode 100644 docs/research/2026-07-26-slice-j4-3-character-state.md diff --git a/AGENTS.md b/AGENTS.md index 89474ae4..76f75c07 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -251,7 +251,13 @@ use-reservation, and one-request-at-a-time state while borrowing J3's exact object table. Runtime tests pass 157/157, App tests pass 3,770/3 skips, the complete Release suite passes 8,515/5 skips, and the exact-binary seven-checkpoint lifecycle/reconnect gate passes with graceful exits and zero -failures. J4.3 magic/player-sheet ownership is active. J0's rollback is +failures. J4.3 is complete at `d02a12ce`: `RuntimeCharacterState` owns the +exact coupled spellbook/local-player graph; content, routing, retained UI, +reset, and shutdown borrow it, and the duplicate desired-component snapshot is +deleted. Runtime tests pass 162/162, App tests pass 3,772/3 skips, the complete +Release suite passes 8,522/5 skips, and the exact-binary seven-checkpoint +lifecycle/reconnect gate passes with graceful exits and zero failures. J4.4 +character projections are active. J0's rollback is `git revert b632672e5ccabfb44c551e08f1c411ab2669c44a`. J1's rollback is `git revert 854d9e9cd13092bd5aaa3cf025d73eeb4600e9f8`. @@ -272,6 +278,8 @@ J4.1's rollback is `git revert c9d25ade50c0a5c4f7db5b6cca680e01e35cc18e`. J4.2's rollback is `git revert 011efbeaa72509b35ea7f4a442e50a2377ae1ea4`. +J4.3's rollback is +`git revert d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6`. Slice H's retained UI/frame, bounded-light, and pooled/borrowed/direct network work is complete; the exact seven-checkpoint connected lifecycle/reconnect gate passes. Slice I is closed in @@ -280,7 +288,8 @@ executes from `docs/plans/2026-07-25-modern-runtime-slice-j.md`; J3.6 closeout is `docs/research/2026-07-26-slice-j3-6-lifetime-closeout.md`; J4 executes from `docs/plans/2026-07-26-modern-runtime-slice-j4.md`; J4.1 closeout is `docs/research/2026-07-26-slice-j4-1-communication-state.md`; J4.2 closeout is -`docs/research/2026-07-26-slice-j4-2-inventory-state.md`. The exact G4 +`docs/research/2026-07-26-slice-j4-2-inventory-state.md`; J4.3 closeout is +`docs/research/2026-07-26-slice-j4-3-character-state.md`. The exact G4 visual rollback is `git revert ef1d263337997bb030eadb7b8e71d73dc659907a`; do not revert G3 or the portal-warmup corrections. Evidence: diff --git a/CLAUDE.md b/CLAUDE.md index f2951778..f3f249c9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -249,7 +249,13 @@ use-reservation, and one-request-at-a-time state while borrowing J3's exact object table. Runtime tests pass 157/157, App tests pass 3,770/3 skips, the complete Release suite passes 8,515/5 skips, and the exact-binary seven-checkpoint lifecycle/reconnect gate passes with graceful exits and zero -failures. J4.3 magic/player-sheet ownership is active. J0's rollback is +failures. J4.3 is complete at `d02a12ce`: `RuntimeCharacterState` owns the +exact coupled spellbook/local-player graph; content, routing, retained UI, +reset, and shutdown borrow it, and the duplicate desired-component snapshot is +deleted. Runtime tests pass 162/162, App tests pass 3,772/3 skips, the complete +Release suite passes 8,522/5 skips, and the exact-binary seven-checkpoint +lifecycle/reconnect gate passes with graceful exits and zero failures. J4.4 +character projections are active. J0's rollback is `git revert b632672e5ccabfb44c551e08f1c411ab2669c44a`. J1's rollback is `git revert 854d9e9cd13092bd5aaa3cf025d73eeb4600e9f8`. @@ -270,6 +276,8 @@ J4.1's rollback is `git revert c9d25ade50c0a5c4f7db5b6cca680e01e35cc18e`. J4.2's rollback is `git revert 011efbeaa72509b35ea7f4a442e50a2377ae1ea4`. +J4.3's rollback is +`git revert d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6`. Slice H's retained UI/frame, bounded-light, and pooled/borrowed/direct network work is complete; the exact seven-checkpoint connected lifecycle/reconnect gate passes. Slice I is closed in @@ -278,7 +286,8 @@ executes from `docs/plans/2026-07-25-modern-runtime-slice-j.md`; J3.6 closeout is `docs/research/2026-07-26-slice-j3-6-lifetime-closeout.md`; J4 executes from `docs/plans/2026-07-26-modern-runtime-slice-j4.md`; J4.1 closeout is `docs/research/2026-07-26-slice-j4-1-communication-state.md`; J4.2 closeout is -`docs/research/2026-07-26-slice-j4-2-inventory-state.md`. The exact G4 +`docs/research/2026-07-26-slice-j4-2-inventory-state.md`; J4.3 closeout is +`docs/research/2026-07-26-slice-j4-3-character-state.md`. The exact G4 visual rollback is `git revert ef1d263337997bb030eadb7b8e71d73dc659907a`; do not revert G3 or the portal-warmup corrections. Evidence: diff --git a/docs/architecture/acdream-architecture.md b/docs/architecture/acdream-architecture.md index d48fef0c..58466f61 100644 --- a/docs/architecture/acdream-architecture.md +++ b/docs/architecture/acdream-architecture.md @@ -221,7 +221,8 @@ src/ RuntimeCommunicationState.cs -> one chat/social owner + ordered stream RuntimeInventoryState.cs -> exact object-table borrower + inventory transaction/session-state owner - -> J3 and J4.1–J4.2 complete; J4.3 magic/player ownership active + RuntimeCharacterState.cs -> coupled spellbook/local-player owner + -> J3 and J4.1–J4.3 complete; J4.4 character projections active -> may reference Core, Core.Net, Content, and Plugin.Abstractions only -> must never reference App, UI, Silk.NET, OpenAL, Arch, or ImGui diff --git a/docs/plans/2026-04-11-roadmap.md b/docs/plans/2026-04-11-roadmap.md index ae9f46dd..11790514 100644 --- a/docs/plans/2026-04-11-roadmap.md +++ b/docs/plans/2026-04-11-roadmap.md @@ -1,6 +1,6 @@ # acdream — strategic roadmap -**Status:** Living document. Updated 2026-07-26. **M3 landed; M4 is active.** M3's retail casting/UI, R6 locomotion/collision/projectile/teleport/radar rebaseline, deterministic fresh-login/portal world lifecycle, and final two-client portal observer flow are user-gated. All eight slices of the behavior-preserving ownership campaign in [`docs/architecture/code-structure.md`](../architecture/code-structure.md), their automated closeout, and the user's connected visual matrix are complete. Modern Runtime J3's canonical entity/object lifetime plus J4.1 communication/social and J4.2 inventory-transaction ownership are closed; J4.3 magic/player-sheet ownership is active. Issue #225's lifestone/particle alpha comparison remains a separate rendering visual gate. +**Status:** Living document. Updated 2026-07-26. **M3 landed; M4 is active.** M3's retail casting/UI, R6 locomotion/collision/projectile/teleport/radar rebaseline, deterministic fresh-login/portal world lifecycle, and final two-client portal observer flow are user-gated. All eight slices of the behavior-preserving ownership campaign in [`docs/architecture/code-structure.md`](../architecture/code-structure.md), their automated closeout, and the user's connected visual matrix are complete. Modern Runtime J3's canonical entity/object lifetime plus J4.1 communication/social, J4.2 inventory-transaction, and J4.3 magic/player-sheet ownership are closed; J4.4 character projections are active. Issue #225's lifestone/particle alpha comparison remains a separate rendering visual gate. **Purpose:** One source of truth for where the project is and where it's going. Every observed defect or missing feature has a named phase that owns it; when something looks wrong in-game, look here to find the phase that'll address it. Implementation details live in per-phase specs under `docs/superpowers/specs/`, not in this file. --- @@ -1721,7 +1721,12 @@ port in any phase — no separate listing here. > one-request-at-a-time state while borrowing J3's exact object table. Its 157 > Runtime tests, 3,770 App tests / 3 skips, 8,515-test / 5-skip complete > Release suite, and exact-binary seven-checkpoint lifecycle/reconnect gate -> pass. J4.3 magic/player-sheet ownership is active. +> pass. J4.3 is complete at `d02a12ce`: Runtime owns the exact coupled +> spellbook/local-player graph, content and every graphical/no-window consumer +> borrow it, and the duplicate desired-component snapshot is deleted. Its 162 +> Runtime tests, 3,772 App tests / 3 skips, 8,522-test / 5-skip complete +> Release suite, and exact-binary seven-checkpoint lifecycle/reconnect gate +> pass. J4.4 character projections are active. > The historical exact cutover > rollback remains > `git revert ef1d263337997bb030eadb7b8e71d73dc659907a`. Slice H is complete: diff --git a/docs/plans/2026-05-12-milestones.md b/docs/plans/2026-05-12-milestones.md index a1372032..5cd58465 100644 --- a/docs/plans/2026-05-12-milestones.md +++ b/docs/plans/2026-05-12-milestones.md @@ -197,7 +197,12 @@ residency is `0/0/0` at every stable checkpoint and teardown converges. Slice I one-request-at-a-time state while borrowing J3's exact object table. Its 157 Runtime tests, 3,770 App tests / 3 skips, 8,515 full Release tests / 5 skips, and exact-binary seven-checkpoint lifecycle/reconnect route pass. - J4.3 magic/player-sheet ownership is active under + J4.3 is complete at `d02a12ce`: Runtime owns the exact coupled + spellbook/local-player graph, content and presentation borrow it, and the + duplicate desired-component snapshot is deleted. Its 162 Runtime tests, + 3,772 App tests / 3 skips, 8,522 full Release tests / 5 skips, and + exact-binary seven-checkpoint lifecycle/reconnect route pass. J4.4 character + projections are active under [`2026-07-25-modern-runtime-slice-j.md`](2026-07-25-modern-runtime-slice-j.md). Slice-I closeout evidence is [`../research/2026-07-25-slice-i7-closeout.md`](../research/2026-07-25-slice-i7-closeout.md). @@ -213,6 +218,8 @@ Slice-J3.5 closeout evidence is [`../research/2026-07-26-slice-j3-5-canonical-delta-stream.md`](../research/2026-07-26-slice-j3-5-canonical-delta-stream.md). Slice-J3.6 closeout evidence is [`../research/2026-07-26-slice-j3-6-lifetime-closeout.md`](../research/2026-07-26-slice-j3-6-lifetime-closeout.md). +Slice-J4.3 closeout evidence is +[`../research/2026-07-26-slice-j4-3-character-state.md`](../research/2026-07-26-slice-j4-3-character-state.md). The historical exact G4 visual rollback remains `git revert ef1d263337997bb030eadb7b8e71d73dc659907a`. diff --git a/docs/plans/2026-07-24-modern-runtime-architecture.md b/docs/plans/2026-07-24-modern-runtime-architecture.md index 40020b83..4b8389f0 100644 --- a/docs/plans/2026-07-24-modern-runtime-architecture.md +++ b/docs/plans/2026-07-24-modern-runtime-architecture.md @@ -12,8 +12,9 @@ and object-table lifetime to Runtime, exact graphical projection identity to App, and one ordered canonical entity/object stream plus direct views to all hosts and closed the failure-safe owner ledger. J4.1 moved communication and social ownership into Runtime at `c9d25ade`; J4.2 moved inventory transaction -ownership into Runtime at `011efbea`; J4.3 magic/player-sheet ownership is the -active execution point. +ownership into Runtime at `011efbea`; J4.3 moved the coupled magic/player-sheet +owner into Runtime at `d02a12ce`; J4.4 character projections are the active +execution point. **Scope:** Reconcile and sequence the existing Modern Pipeline (`MP`) and Linux/headless (`LH`) tracks using the 2026-07-24 connected performance audit. diff --git a/docs/plans/2026-07-25-modern-runtime-slice-j.md b/docs/plans/2026-07-25-modern-runtime-slice-j.md index 76badbe6..4a52268b 100644 --- a/docs/plans/2026-07-25-modern-runtime-slice-j.md +++ b/docs/plans/2026-07-25-modern-runtime-slice-j.md @@ -1,6 +1,6 @@ # Modern runtime Slice J — presentation-independent runtime -**Status:** J0–J3 COMPLETE; J4.1–J4.2 COMPLETE; J4.3 magic/player ownership active +**Status:** J0–J3 COMPLETE; J4.1–J4.3 COMPLETE; J4.4 character projections active **Parent:** `2026-07-24-modern-runtime-architecture.md`, Slice J **Authorization:** the user approved Slices F–L, including the otherwise-frozen Slice J gameplay-owner moves, on 2026-07-24 @@ -239,7 +239,13 @@ Runtime owns external-container, item-mana, shortcut/component, shared-busy, use-reservation, and one-request-at-a-time state while borrowing J3's exact object table. Its 157 Runtime tests, 3,770 App tests / 3 skips, 8,515 complete Release tests / 5 skips, and exact-binary seven-checkpoint -lifecycle/reconnect gate pass. J4.3 magic/player-sheet ownership is active. +lifecycle/reconnect gate pass. J4.3 completed at `d02a12ce`: +`RuntimeCharacterState` owns the coupled spellbook and local player sheet; +content, routing, retained UI, reset, and shutdown borrow it, and the duplicate +desired-component snapshot is gone. Its 162 Runtime tests, 3,772 App tests / 3 +skips, 8,522 complete Release tests / 5 skips, and exact-binary +seven-checkpoint lifecycle/reconnect gate pass. J4.4 character projections are +active. Detailed execution begins with a source-ownership inventory. Move one coherent lifetime group at a time in this order: diff --git a/docs/plans/2026-07-26-modern-runtime-slice-j4.md b/docs/plans/2026-07-26-modern-runtime-slice-j4.md index 2b2809ec..147a0ef6 100644 --- a/docs/plans/2026-07-26-modern-runtime-slice-j4.md +++ b/docs/plans/2026-07-26-modern-runtime-slice-j4.md @@ -1,6 +1,6 @@ # Modern runtime Slice J4 — gameplay-state lifetime groups -**Status:** J4.1–J4.2 COMPLETE; J4.3 ACTIVE +**Status:** J4.1–J4.3 COMPLETE; J4.4 ACTIVE **Parent:** `2026-07-25-modern-runtime-slice-j.md`, J4 **Production base:** `77c013998b902724d66e487589a4ea18538e1ea6` **Authorization:** the user approved Slices F–L, including Slice J gameplay @@ -23,8 +23,8 @@ ordering and its existing retail-derived algorithms. |---|---|---| | J4.1 communication/social | complete | `c9d25ade50c0a5c4f7db5b6cca680e01e35cc18e`; 152 Runtime tests, 3,765 App tests / 3 skips, 8,494 complete Release tests / 5 skips, and `logs/connected-world-gate-20260726-075109/report.json` pass | | J4.2 inventory transactions | complete | `011efbeaa72509b35ea7f4a442e50a2377ae1ea4`; 157 Runtime tests, 3,770 App tests / 3 skips, 8,515 complete Release tests / 5 skips, and `logs/connected-world-gate-20260726-082057/report.json` pass | -| J4.3 magic/player sheet | active | move the coupled `Spellbook` and `LocalPlayerState` owner graph while retaining immutable DAT catalog installation | -| J4.4 character projections | pending | starts only after J4.3 acceptance | +| J4.3 magic/player sheet | complete | `d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6`; 162 Runtime tests, 3,772 App tests / 3 skips, 8,522 complete Release tests / 5 skips, and `logs/connected-world-gate-20260726-083921/report.json` pass | +| J4.4 character projections | active | move remaining character options/skill-derived state and expose the borrowed J4 view/command surface | | J4.5 combined cleanup | pending | combined failure, no-window, connected, and nine-stop closeout | ## Current ownership inventory @@ -120,6 +120,8 @@ Exact evidence is recorded in ### J4.3 — spell, enchantment, vital, attribute, and skill state +**Completed 2026-07-26 at `d02a12ce`.** + - Move construction/lifetime of the coupled `Spellbook` and `LocalPlayerState` into Runtime. - Preserve one-time immutable `SpellTable` installation from App content. @@ -133,6 +135,13 @@ Gate: complete PlayerDescription, incremental updates, spell/enchantment add/remove, favorite/filter/component changes, cooldowns, vital modifiers, clear/reconnect, ViewModel revisions, and graphical/direct trace parity. +Result: `RuntimeCharacterState` constructs and owns the exact coupled +`Spellbook` and `LocalPlayerState`. Content installs immutable DAT metadata +through that owner; routing, retained UI, reset, and shutdown borrow it. The +interim desired-component mirror was deleted, leaving the spellbook as the +only mutable component-count owner. Exact evidence is recorded in +[`../research/2026-07-26-slice-j4-3-character-state.md`](../research/2026-07-26-slice-j4-3-character-state.md). + ### J4.4 — character settings and player-state projections - Move remaining presentation-independent character options and skill-derived @@ -201,3 +210,9 @@ J4.2 is independently reversible with: ```text git revert 011efbeaa72509b35ea7f4a442e50a2377ae1ea4 ``` + +J4.3 is independently reversible with: + +```text +git revert d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6 +``` diff --git a/docs/research/2026-07-26-slice-j4-3-character-state.md b/docs/research/2026-07-26-slice-j4-3-character-state.md new file mode 100644 index 00000000..67b56ae9 --- /dev/null +++ b/docs/research/2026-07-26-slice-j4-3-character-state.md @@ -0,0 +1,107 @@ +# Modern runtime J4.3 — magic and player-sheet ownership + +**Status:** COMPLETE +**Production commit:** `d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6` +**Parent plan:** `../plans/2026-07-26-modern-runtime-slice-j4.md` + +## Result + +`RuntimeCharacterState` is the single presentation-independent owner for the +coupled `Spellbook` and `LocalPlayerState`. The coupling is structural: +vital-max calculations read active enchantments from that exact spellbook, so +the two objects cannot be independently replaced or reconstructed by a host. + +The Runtime live-session router, App content loader, retained UI, developer +tools, command routing, reset manifest, shutdown transaction, and future +no-window host all borrow this one graph. `GameWindow` retains read-only +compatibility properties only and no longer constructs either Core owner. + +The App content host still opens portal.dat and projects immutable retail spell +metadata. It installs that table exactly once through the Runtime owner; no DAT +or App type enters `AcDream.Runtime`. + +The interim desired-component snapshot introduced during J4.2 was deleted. +`Spellbook.DesiredComponents` is now the only mutable desired-component owner, +alongside learned spells, favorites, filters, active enchantments, and +cooldowns. Inventory retains item/component objects and shortcut state, but no +second component-count model. + +Session reset preserves the accepted order: spellbook state clears before the +App magic request projection, while local-player vitals/attributes/skills/ +properties/positions clear later at their existing reset edge. Direct Runtime +disposal clears both halves, aggregates observer failures, and remains +retryable until convergence. + +## Retail basis + +J4.3 changes lifetime ownership only. It preserves the existing retail-derived +wire and reset mechanisms: + +- `CPlayerSystem::OnEndCharacterSession @ 0x00562870`; +- `PlayerModule::Clear @ 0x005D48A0`; +- `CPlayerSystem::Begin @ 0x0055D410`; +- PlayerDescription `0x0013` manifest replacement; +- live spell/enchantment and vital update routing; +- `CEnchantmentRegistry::OnCooldown @ 0x005943C0`; +- `CreatureVital::GetMaxValue @ 0x0058F2DD`. + +The current magic behavior and its DAT/UI research remain recorded in +`claude-memory/project_magic_ui_and_casting.md`. + +## Automated evidence + +- Runtime suite: 162 passed. +- App suite: 3,772 passed / 3 established skips. +- Core suite: 3,305 passed / 2 established skips. +- Core.Net suite: 600 passed. +- UI abstractions: 545 passed. +- Complete Release solution: 8,522 passed / 5 established skips. +- Release build: pass, zero errors and 17 established test warnings. +- `git diff --check`: pass. + +Focused coverage proves exact spellbook/local-player coupling, immutable +metadata installation, desired-component single ownership, independent +Runtime instances, group-specific reset, retryable disposal after failures, +production construction uniqueness, exact session routing, retained-UI +borrowing, and shutdown ordering. Existing Core/Core.Net suites continue to +cover complete PlayerDescription replacement, incremental spell/enchantment/ +vital changes, cooldowns, favorites, filters, skills, attributes, properties, +positions, and ViewModel invalidation behavior. + +## Exact-binary connected evidence + +`logs/connected-world-gate-20260726-083921/report.json` passed on exact source +and embedded binary commit +`d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6`: + +- six capped checkpoints through login, outdoor/dungeon/facility travel and + revisit plus one fresh-process uncapped reconnect checkpoint; +- 243.672-second capped route and 61.329-second reconnect route; +- both sessions exited gracefully with code zero; +- zero failures. + +Its only warning is the established set of 25 expected world-edge landblock +misses. + +## Divergence audit + +The slice changes owner placement, reset composition, and failure containment +without changing retail algorithms or wire behavior. No divergence row was +added or retired. + +## Rollback + +```text +git revert d02a12ceac54d035797b4c58f2fc2f0ccad9a4d6 +``` + +Revert J4.3 before J4.2 if the gameplay-state groups ever need to be unwound. +Do not revert J3's canonical entity/object ownership to mask a character-state +failure. + +## Next boundary + +J4.4 moves the remaining presentation-independent character options and +skill-derived command/bot projections into Runtime, then exposes borrowed +immutable views and synchronous typed commands over all J4 owner groups. +Controller, camera, input, animation, paperdoll, and panel state remain in App.