aorecomp

Anarchy Online classic in the browser

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


commit 470d2423bd73425b4ed21817fb50d097e26607d1
parent 3c47febee558b3cbd1abedbf650f181b3fbe9635
Author: anon <anon@example.com>
Date:   Sat, 31 Oct 2026 07:01:46 +0000

Verify earned starter level two and preserve browser checkpoint poses

Diffstat:
MDEVELOPERS.md | 6++++--
MTODO.md | 34++++++++++++++++++++++++++++++++++
Mdocs/starter-progression.md | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/browser_game_test.go | 6++++++
Mtools/client/test_starter_equipment.mjs | 18+++++++++++++++---
5 files changed, 132 insertions(+), 5 deletions(-)

diff --git a/DEVELOPERS.md b/DEVELOPERS.md @@ -480,10 +480,12 @@ all five full-health private encounters and exact-book hand-in. It accounts for each corpse's single-award cash, any generated parts, laboratory use/locked retry, quiet recovery, the request fee and the advertised item/cash reward. Native ownership is compared with server state, observer isolation, page -reconnect and cold database loading, including all five saved encounter deaths. +reconnect and cold database loading, including final player poses and all five +saved encounter deaths. The artifact directory retains `ledger.json`, native screenshots/traces and a `world.sqlite` snapshot from the stopped simulation, including after a failed -browser run. Skills and rewards use ordinary native commands and production +browser run. Its forced final position checkpoint follows production shutdown. +Skills and rewards use ordinary native commands and production random rolls, without grants or edited characters/enemies. Earned levels, sales, purchases and actual reclaim remain broader regression work. diff --git a/TODO.md b/TODO.md @@ -3006,6 +3006,33 @@ with payloads and known client/server provenance. ## Thorough gameplay regression testing +- [x] [P1] Stop authored waypoint sequences after observed zoning. A mission + entrance admitted the starter during the second approach point; the script + then tried the third exterior coordinate inside the private world. The walk + helper already releases input across that transition. The training exit, + mission entry and mission exit sequences now stop on their destination + playfield before issuing another coordinate. Evidence: + `local/game-tests/starter-20261030-233628/client-0/trace.json`. The complete + corrected fresh mission and native cold restoration pass; see + [snapshot verification](docs/starter-progression.md#browser-snapshot-and-route-checkpoints). +- [x] [P1] Flush final player positions in stopped browser-test snapshots and + compare their cold poses. The fixture now follows production shutdown's + forced `flushPositions` before `flushWorld`; normal movement keeps its + twenty-second cadence. Go cold loading checks playfield, position and rotation, + and native page reconnect retains its stopped position. The fresh owner now + matches its saved position exactly, resolving the reproduced 10.65 m gap. + Two fresh cold clients retain both saved poses and all eighteen physical + items. See [snapshot verification](docs/starter-progression.md#browser-snapshot-and-route-checkpoints). +- [ ] [P1] Reconcile native and authoritative player facing after combat. + The earned starter's quiet level-2 capture has native quaternion + [0,-0.03982744,0,0.9992066], while its stopped database retains + [0,-0.68880874,0,0.7249431]. Position differs by only 0.11 m. Trace ordinary + turning, attack auto-facing and movement publication before changing either + side; distinguish visual facing, stale server orientation and checkpoint timing. + Capture the wire and both poses beside the attack: long quiet recovery evicts + its movement packets from the final trace's 2048-event window. Evidence: + `local/game-tests/starter-continue-20261030-230715/earned-level2-final/` and + `local/todo-progression-play/starter-pose-verification.json`. - [x] Keep browser rebuilds independent of reviewed server-world data. `make wasm` previously recopied ignored extraction output through its `assets` prerequisite, removing reviewed destination/arrival/requirement rows from `zone_links.yaml`. @@ -3483,6 +3510,13 @@ and server restarts. Turn every reproduced bug into a focused regression test. production rolls and training-ground resources. Earned levels, sales/purchases and actual reclaim remain broader regression work. See [maintained starter mission](docs/starter-progression.md#maintained-earned-starter-mission). + An ordinary continuation of that same saved starter now verifies earned + level 2, its 4000-IP award, qualified QL1 glove wear and further Body + Development/1HB training. Cold loading retains 111 HP, 5024 IP, 66 credits + and all fifteen owner items after the issued laboratory is exhausted. The + final corpse's one credit and part remain unclaimed and are excluded. This + continuation still needs its funded purchase and next-level encounter; see + [earned starter level](docs/starter-progression.md#earned-starter-checkpoint-reaches-level-two). A new two-client harness run now connects seven full-health ordinary kills, an earned Monster Part sale and funded mission request to all five private encounters, exact-book hand-in and earned QL1 Metaplast body armor. Rejected diff --git a/docs/starter-progression.md b/docs/starter-progression.md @@ -1476,3 +1476,76 @@ JavaScript checks pass. Logs are `starter-mission-go-focused.json`, `starter-mission-go-race.json`, `starter-mission-js-unit-final.log` and `starter-mission-native-final4.log` in that same directory. Owned test browsers and servers are closed. This milestone does not claim a full Go-suite rerun. + +## Earned starter checkpoint reaches level two + +The same `Starterowner` from the maintained six-kill mission checkpoint now +continues through nine more ordinary full-health Leet kills. The saved world is +loaded unchanged, with production combat and loot rolls. Normal Agility +training 6->8 costs 26 IP, then earned QL1 gloves 20 equip in clothes slot24. +The native Stats window shows melee/projectile/energy AC 1/11/1 with the issued +shirt still worn. All nine additional fights start at 84 player HP and 100 +enemy HP. The remaining twelve laboratory charges are consumed; later recovery +uses ordinary sitting regeneration, with full native/server HP before fighting. + +The fifteenth kill reaches level 2 with 1500 cumulative XP and 50 current-level +XP. Native stat52 is cumulative: `server/progression.go::experienceBounds` and +`applyExperienceAward_locked` publish 1500 with boundaries1450..4050. A temporary +continuation wait incorrectly expected native50 and stopped after this kill, +before corpse Use. Its one credit and part27 remain unclaimed and are excluded +from ownership. The actual level-up packet independently verifies the 4000-IP +award, level, XP boundaries and 100-XP kill amount; no reward is replayed. + +Normal Body Development and 1HB training 10->15 costs sixty IP each, leaving +5024. Maximum HP rises 84->91 at the earned level and 91->111 from training; +quiet recovery fills native/server HP to 111. The final wallet is 66. All fifteen +owner items, including nine QL1 parts and worn gloves 20, match native inventory +and stopped SQLite state. Learned nano43371 and the three health stims remain. +The observer retains seven issued items, zero XP/cash and 1500 IP. Its final +interest set excludes the owner, so this capture does not verify remote HP. + +`local/game-tests/starter-continue-20261030-230715/` retains the native inputs, +screenshots, each completed fight ledger, the partial fifteenth-kill capture +and stopped database. Go cold loading retains exact ownership, skills, health +and progress. Independent accounting is in +`local/todo-progression-play/tmp_verify_starter_level.py` and +`starter-level-verified.json`. Native/authoritative facing differs after combat +and has a separate P1 audit; the broader purchase and progression gate remains +open. + +## Browser snapshot and route checkpoints + +The stopped browser fixture now follows production shutdown: force the final +player position checkpoint, then flush world state. Normal movement retains its +twenty-second persistence cadence. Go cold loading compares each player's +playfield, position and quaternion as well as ownership and progress; native +page reconnect must retain the stopped position within compact-pose precision. + +The earlier `starter-20261030-224743` capture ended at native position +[99.75,115,151.625], while SQLite still held [89.30216,115.14444,153.66087], a +10.65 m gap. The corrected fresh `local/game-tests/starter-20261030-234342/` +passes all six fights, exact-book return, item/cash accounting, reconnect and +cold Go poses in 775.91 seconds. Native and saved owner position now agree +exactly at [99.625,115,151.625]. Its eleven items include four natural parts, +QL1 sleeve 21 and twelve remaining laboratory charges; cash 37, XP600 and +IP1170 are retained with full 84 HP. + +That rerun also fixes a scenario route error: an entrance can admit the player +before its last approach waypoint. The driver already releases movement when +it observes zoning, but the scenario must stop the remaining exterior points. +The training exit, mission entry and mission exit now break on their destination +playfield. A failed run had entered the private world and then attempted an +exterior coordinate inside it; no geometry or admission rule needed changing. + +Two fresh native clients load the corrected stopped database in +`local/game-tests/starter-cold-20261030-235739/`. Direct comparison with the input +SQLite snapshot verifies saved playfields, positions and facing, all eighteen +physical items and unchanged wallets/progress. Position error is zero for the +owner and 0.0982 m for the observer; quaternion dot products exceed 0.9999999. +The cold check passes in 29.56 seconds with empty client error lists. Seven +focused Go roots/fourteen cases and all 126 JavaScript checks pass. Evidence: +`local/todo-progression-play/starter-pose-go-focused.json`, +`starter-pose-js-unit.log`, `starter-pose-native-final.log`, +`starter-pose-cold-native.log`, `starter-pose-verification.json` and +`starter-cold-pose-verified.json`. Owned test processes are closed. Combat +auto-facing remains the separate audit described above. diff --git a/server/browser_game_test.go b/server/browser_game_test.go @@ -182,6 +182,10 @@ func TestBrowserStarterEquipment(t *testing.T) { cancel() <-stopped t.Logf("Browser artifacts: %s", output) + // Match production shutdown before saving the stopped simulation. + if failure := world.flushPositions(time.Now().Add(20 * time.Second)); failure != nil { + t.Fatal(failure) + } if failure := world.flushWorld(); failure != nil { t.Fatal(failure) } @@ -206,6 +210,8 @@ func TestBrowserStarterEquipment(t *testing.T) { } players++ if player.level != 1 || player.health != player.maximumHealth() || + player.playfield != restored.characters[player.id].playfield || + player.position != restored.characters[player.id].position || player.rotation != restored.characters[player.id].rotation || !reflect.DeepEqual(player.inventory.Items, restored.characters[player.id].inventory.Items) || !reflect.DeepEqual(player.inventory.references(), restored.characters[player.id].inventory.references()) || !reflect.DeepEqual(player.inventory.LearnedNanos, restored.characters[player.id].inventory.LearnedNanos) || diff --git a/tools/client/test_starter_equipment.mjs b/tools/client/test_starter_equipment.mjs @@ -365,8 +365,10 @@ try { const fights = [await fight(owner, enemy, 'outdoor')]; // Spend one earned credit on the first advertised contract at the original booth. - for (const [x, z] of [[62, 74], [62, 65], [52.5, 57.6], [52.5973, 55.1362]]) + for (const [x, z] of [[62, 74], [62, 65], [52.5, 57.6], [52.5973, 55.1362]]) { await owner.walk(x, z); + if (owner.local().playfield === 3000) break; + } await owner.wait('ordinary backyard arrival', state => owner.local(state)?.playfield === 3000, 60000); await owner.ready(); for (const [x, z] of [[102.5, 102], [102.5, 143], [104, 149.5], [103, 149.1]]) @@ -401,8 +403,10 @@ try { await owner.save(output + '/mission-accepted'); // Enter with the issued key and clear all five authored, full-health encounters. - for (const [x, z] of [[96.4, 150.1], [89.3, 153.6], [89.3, 151.2]]) + for (const [x, z] of [[96.4, 150.1], [89.3, 153.6], [89.3, 151.2]]) { await owner.walk(x, z); + if (owner.local().playfield === mission.world) break; + } await owner.wait('private mission arrival', state => owner.local(state)?.playfield === mission.world, 60000); await owner.ready(); const entered = await (await owner.page.request.get(url + '/test-state')).json(); @@ -466,7 +470,10 @@ try { // Return the allocated book to the issuing booth through native item-on-item Use. await owner.walk(15, 26.5); await jump(owner); - for (const z of [12.5, 10]) await owner.walk(15, z); + for (const z of [12.5, 10]) { + await owner.walk(15, z); + if (owner.local().playfield === 3000) break; + } await owner.wait('mission exterior return', state => owner.local(state)?.playfield === 3000, 60000); await owner.ready(); for (const [x, z] of [[89.3, 153.6], [96.4, 153.6], [99.8, 154], [99.8, 151.4]]) await owner.walk(x, z); @@ -520,8 +527,13 @@ try { await fs.writeFile(output + '/ledger.json', JSON.stringify({issued: before, trained: trained.stats, fights, mission, advertised, rewards, trainingUses, combatUses, inventory: final.inventory, health: final.health}, null, 2) + '\n'); + const reconnectPose = {playfield: owner.local().playfield, position: owner.local().position}; await owner.page.reload(); await owner.ready(); + assert.equal(owner.local().playfield, reconnectPose.playfield); + assert(Math.hypot(owner.local().position[0] - reconnectPose.position[0], + owner.local().position[1] - reconnectPose.position[1], owner.local().position[2] - reconnectPose.position[2]) < 0.5, + 'Page reconnect changed the stopped native position'); assert.deepEqual(owner.local().inventory.map(item => item.id).sort(), expected.map(item => item.ID).sort()); for (const item of expected) { const actual = owner.local().inventory.find(actual => actual.id === item.ID);