commit 217051f4fd64a92a8d09e6c4c2d5df05572ce704
parent 904b81734a90c4d33b507024f23e5754720da44e
Author: anon <anon@example.com>
Date: Wed, 4 Nov 2026 09:49:50 +0000
Refresh native resources after ability item modifiers
Diffstat:
3 files changed, 51 insertions(+), 41 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -4114,18 +4114,15 @@ and server restarts. Turn every reproduced bug into a focused regression test.
both directions during wear/removal without writes or deadline changes.
No product defect reproduced on this path; see
[backpack joins](docs/backpacks.md#stack-join-during-pending-equipment).
-- [ ] [P0] Refresh resources after clearing an empty stale weapon hand.
- Reproduction: retain a QL75 LIZARD at101:6 after a controlled earlier bank
- transfer, then remove it normally. The baseline retained maximum/current nano681
- while the server committed672; native attack rating already returned to54.
- The stale correction now sends current owner foundations/points, and native
- nano672/Psychic200 match. Same-page re-equip restores Psychic215, but native
- max nano resets681 ->672 two frames after the correct681 packet. A pre-change
- handler comparison reproduces that separate rollover, so this item stays open.
- Complete the native681 ->672 ->681 flow with13 loaded rounds, the separate100
- stack and both IDs retained after page/cold loading. Keep the failing native
- regression; do not replace it with a delay or claim its later checks passed.
- See [stale weapon resources](docs/inventory.md#stale-weapon-resource-foundations).
+- [x] [P0] Refresh resources after clearing an empty stale weapon hand.
+ A controlled earlier bank transfer leaves a native QL75 LIZARD at101:6.
+ Refusal now publishes the owner's current resource foundations and points.
+ Same-page re-equip also refreshes native maxima after applying the weapon's
+ Psychic modifier, preventing a later unworn-value overwrite. The unchanged
+ short WASM regression verifies nano681 ->672 ->681, visible Psychic200 ->215,
+ 13 loaded rounds and the separate100 stack, with both IDs retained through
+ page replay and cold ownership. This is controlled-fixture evidence. See
+ [stale weapon resources](docs/inventory.md#stale-weapon-resource-foundations).
- [x] [P0] Refresh derived resources after correcting a stale worn source.
Reproduction: retain worn Pioneer152039 after an earlier controlled bank
transfer, then remove its stale source102:19. Its ability effects clear, but
diff --git a/client/game/kkr.dll/lifted-0034.c b/client/game/kkr.dll/lifted-0034.c
@@ -4363,6 +4363,13 @@ L_36074822:
L_36074827:
RECOMP_ICALL(MEM32(eax + 0x20)); /* 0x36074827: call dword ptr [eax + 0x20] */
RECOMP_FLAGS_IN();
+ /* Apply Stamina/Psychic trickle to resource maxima after the modifier. */
+ PUSH32(esp, 0);
+ PUSH32(esp, 0);
+ PUSH32(esp, 0);
+ ecx = esi;
+ RECOMP_ICALL(0x36075910u);
+ RECOMP_FLAGS_IN();
L_3607482A:
PUSH32(esp, edi); /* 0x3607482A: push edi */
L_3607482B:
diff --git a/docs/inventory.md b/docs/inventory.md
@@ -362,35 +362,41 @@ test verifies exact resources, repeated correction and cold banked ownership of
weapon1 with13 rounds. Related Go checks pass91 roots/648 results, and native axe
and Pioneer companions pass17.44s/16.92s through page/cold checks.
-The full `TestBrowserStaleWeaponResources` remains a failing P0 regression.
-Its corrected refusal reaches native872/672/54/872/672 and visible Psychic200.
-Same-page withdrawal/re-equip retains weapon1 with13 rounds and energy stack2
-with100, and visible Psychic becomes215. The correct server max-nano681 packet
-arrives, but raw221 and the original Stats window reset to672 two frames later.
-This is not merely a raw-stat-versus-modifier difference. The test fails before
-its page/cold completion checks; those have not been verified for this flow.
-The retained corrected diagnostic is
-`local/stale-inventory-move/20261104-003612/6/`.
-
-A Go source overlay of the pre-change handler reproduces the same re-equip
-rollover at `local/stale-inventory-move/20261104-005517/6/`, while also retaining
-the original over-cap681 current nano. Its temporary driver bypasses only the
-known stale-refusal mismatch to reach re-equip; it is diagnostic evidence, not
-completion proof. The production regression keeps both strict assertions.
-
-Bounded original-client analysis confirms creation-only FullUpdate100b38b0,
-attachment10063340 and native resource recalculation10075910 from OnWear10090640
-and character-model paths. Getter1006dfb0 reaches effective-skill10075ca0 and
-10075c60 for mode0, so this does not establish that server681 is wrong. Runtime
-attribution of the later221 writer and its inputs is still missing; neither a
-timed extra packet nor a speculative packet reorder was added. Evidence IDs
-`ev_6ad357ca30912f7fdb800917d4ad31823cfef2a1722a3a1c335b0e528b4b13fd`,
-`ev_b4d5ae1d699414865d843278ce68cea55597339306b6d2e5d9a5b9585b27340c`
-and `ev_3a4f7b1d8c9a5bbb700a04162c7815315fb5efec704abe05482bf3106e343f28`
-are retained with29 original-binary records in
-`local/stale-weapon-resources/native-equipment.json`, bound to the original
-KKR digest documented above. The research boundary and exact partial validation
-are in `local/stale-weapon-resources/README.md` and `validation.json`.
+The re-equip path also needs a native resource refresh after the weapon's
+ability modifier is applied. Runtime tracing attributes the overwrite to local
+refresh100714a0 calling calculator10075910 with NanoPool54: it writes maximum
+nano672 after the server's681 update, then modifier callback100bd600 applies
+Psychic+15. The modifier map and raw-stat array remain the same objects. The
+visible skills subsequently show Psychic215/NanoPool57, while the uncorrected
+Stats window retains maximum nano672.
+
+The Stamina/Psychic branch of client modifier insertion36074730 now invokes
+existing calculator36075910 immediately after storing the modifier. It retains
+the original regeneration invalidation and uses the existing resource formula
+and local-character guards. The final maximum therefore includes the applied
+ability trickle without depending on a later dirty-bit refresh or a timed
+server correction.
+
+The unchanged `TestBrowserStaleWeaponResources` passes in21.75s with the clean
+published WASM bundle. Native/server nano maxima agree681 ->672 ->681; current
+nano remains672 after re-equip. Inspected Skills captures show Psychic200 ->215
+and NanoPool54 ->57, and the Stats window shows672/681 after re-equip. The same
+physical weapon1 retains13 loaded rounds, stack2 retains100, page replay agrees
+with server resources, and cold database loading preserves both exact items.
+The passing capture is `local/stale-inventory-move/20261104-014626/6/`.
+Related checks pass8 roots/17 results in74.297s, including native Pioneer
+recovery16.61s and loaded-weapon reclaim/cold replay47.22s.
+
+The original-client getter10075ca0 includes ability modifiers through10073fa0
+and10074a30, supporting the server's681 maximum. Modifier callback100bd600 and
+flag setter100030b0 are retained in
+`local/weapon-nano-rollover/modifier-route-evidence.json`; dependency getters
+are in `dependency-evidence.json` in that directory. These records are bound
+to original KKR SHA256a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0.
+The correction deliberately adds the resource refresh to the original modifier
+path. Exact runtime ordering, discarded experiment and verification are recorded
+in `local/weapon-nano-rollover/README.md` and `validation.json`. Earlier partial
+repair evidence remains in `local/stale-weapon-resources/`.
## Native visual order