aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit 133f5d83392001dc82a7eda88ecc17d31abed612
parent a5ee4be7dff656638e8c4dcfd1869d80ef8bd80a
Author: anon <anon@example.com>
Date:   Sat, 24 Oct 2026 13:57:59 +0000

Verify native bank recovery after rejected optimistic splits

Diffstat:
MTODO.md | 10++++++----
Mdocs/bank-storage.md | 21++++++++++++++++++---
2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -870,10 +870,12 @@ and unresolved indoor lifecycle are explicit in [flight](docs/vehicles.md#yalmah without changing IDs/counts/placements. The native validator displays the inventory-full message without sending a transfer. Depositing one item then withdrawing succeeds into the freed slot with the original instance/count. -- [ ] Exercise a server-rejected optimistic bank split in the WASM UI. Check - identity/count conservation, source restoration and continued usability. - Packet tests alone do not establish native UI recovery; an equip-delay split - attempt was blocked locally before it sent a request. +- [x] Exercise a server-rejected optimistic bank split in the WASM UI. A test + harness changes the retained count to zero after the native Ctrl-split has + already created its temporary stack. Repeated server snapshots remove that + stack and restore the original quantities without changing SQLite. Returning + the held cursor item allows a normal split and withdrawal afterward. See + [bank storage](docs/bank-storage.md) for the captured native state and wire proof. - [ ] Implement Briefcase of Holding remote bank access using its authored profession, skill, title-level and combat conditions; research bank CASH/XP semantics and historical filled-bag deletion policy. diff --git a/docs/bank-storage.md b/docs/bank-storage.md @@ -178,9 +178,24 @@ succeeded into the freed slot with its original ID and two-charge quantity. Evidence is retained in `local/bank-failure-smoke/` with wire captures, native heap reads, OPFS layout data, screenshots and SQLite snapshots. -Rejected optimistic bank splits still need a native UI recovery check. The -native client locally blocked splitting during equipment delay; that run does -not establish receipt of a server rejection or snapshot. +A separate hardware WASM check in `local/bank-split-rejection-smoke/` verifies +server-rejected optimistic splits. A browser-only test hook changes the next +bank split's retained count from one to zero immediately before WebSocket send. +At that point a native heap read proves the client already has a one-charge +source and a temporary two-charge clone. Each of two rejected attempts receives +BankIIR, removes the clone and restores the original three-charge source. +SQLite item values, placements and allocation high-water mark remain unchanged; +the other bank stacks, worn pistol, ordinary items and backpack child survive. +The cursor still holds its selected source, so the test returns it to an empty +bank cell before continuing. A normal split, both withdrawals, an ordinary merge +and redeposit then succeed, preserving six total Essence charges and the kept +original instance. This verifies the current server's correction policy; the +fault hook does not reproduce an original server's rejection decision. +A full browser reconnect preserved the final items, counts, placements and +backpack child. `verification.json` in that bundle checks the packet mutation, +optimistic and restored native inventories, SQLite snapshots and subsequent +operations. Focused bank split/stack Go tests also passed twice (8.452 seconds). + The full-bank rejection above was performed locally by the native client; it does not prove receipt of the server rejection packet. Owned test players, items, clients and browser contexts were removed after verification, with other