acdream/docs/research/2026-07-26-slice-j4-2-inventory-state.md
Erik d362172620 docs(runtime): close inventory state ownership
Record J4.2's single Runtime inventory transaction graph, complete Release evidence, exact-binary lifecycle/reconnect acceptance, rollback, and the J4.3 magic/player-sheet boundary. Synchronize architecture, roadmap, milestones, agent guidance, and durable memory.

Co-authored-by: Codex <codex@openai.com>
2026-07-26 08:29:06 +02:00

4.1 KiB

Modern runtime J4.2 — inventory transaction ownership

Status: COMPLETE Production commit: 011efbeaa72509b35ea7f4a442e50a2377ae1ea4 Parent plan: ../plans/2026-07-26-modern-runtime-slice-j4.md

Result

RuntimeInventoryState is the single presentation-independent owner for the live external-container state, item-mana state, shortcut assignments, desired spell-component counts, and the retail one-inventory-request-at-a-time transaction gate.

It borrows J3's exact ClientObjectTable; it does not construct or synchronize a second item collection. The live-session router, item interaction, retained UI, developer tools, current-runtime/plugin boundary, and future no-window hosts all observe those same owner instances.

InventoryTransactionState now owns the request/response gate previously split across App interaction code. It records the retail request token, matches the corresponding response, maintains the shared busy reference, tracks use reservations, and resets the transaction atomically. Callback failures are isolated after canonical state commits, so one observer cannot strand the busy cursor or prevent a later request.

Presentation-only state remains in App: pending backpack-slot projection, drag/drop hover and selection, cursor choice, item icons, panel layout, and optimistic visual placement. App may borrow the Runtime transaction owner but cannot dispose or replace it.

Retail basis

The ownership move preserves the already-ported retail transaction behavior:

  • ACCWeenieObject::RecordRequest at 0x0058C220;
  • ACCWeenieObject::RecordResponse at 0x0058CAB0;
  • ClientUISystem::UsageCallback at 0x00565B20;
  • 2026-07-23-retail-use-busy-ownership-pseudocode.md;
  • 2026-07-13-retail-give-item-pseudocode.md.

ACE and Holtburger remain interpretation cross-checks as recorded in the busy-ownership pseudocode. No request ordering, wire packet, optimistic move, rollback, use-completion, or cursor behavior changed in J4.2.

Automated evidence

  • Runtime suite: 157 passed.
  • App suite: 3,770 passed / 3 established skips.
  • Core suite: 3,305 passed / 2 established skips.
  • Complete Release solution: 8,515 passed / 5 established skips.
  • Release build: pass, zero errors. A clean rebuild reports 17 established test warnings; the J4.2 diff introduces none.
  • git diff --check: pass.

The focused matrix covers exact object-table identity, external-container open/replace/close, item-mana replacement, shortcut/component replacement, request/response matching, use reservations, dispatch failure rollback, observer failure isolation, reset/reconnect, borrowed lifetime, idempotent disposal, and two independent Runtime instances.

One parallel full-suite run hit the established allocation-sensitive portal projection test with a 1,536-byte measurement. The isolated App rerun passed, and an immediate complete-solution rerun passed all 8,515 tests without a code change.

Exact-binary connected evidence

logs/connected-world-gate-20260726-082057/report.json passed on exact source and embedded binary commit 011efbeaa72509b35ea7f4a442e50a2377ae1ea4:

  • six capped checkpoints through login, outdoor/dungeon/facility travel and revisit plus one fresh-process uncapped reconnect checkpoint;
  • 244.011-second capped route and 61.422-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

J4.2 changes lifetime ownership and failure containment only. It introduces no new retail behavior and retires no registered divergence, so the divergence register is unchanged.

Rollback

git revert 011efbeaa72509b35ea7f4a442e50a2377ae1ea4

Do not revert J3's canonical entity/object ownership to mask an inventory transaction failure.

Next boundary

J4.3 moves construction and lifetime of the coupled Spellbook and LocalPlayerState into Runtime. Immutable DAT spell tables remain supplied by the content host; retained spellbook, active-effect, character-sheet, and paperdoll presentation remain in App/UI.