npm warn Unknown env config "http-proxy". This will stop working in the next major version of npm.

> 36-jrpg-engine@0.8.43 test
> node tests/run-current.cjs


test_bgm_continuity.cjs
PASS same-track floor travel retains playing media and position
PASS different-track floor travel replaces old media
PASS deepest chest keeps BGM without restarting and rewards once
PASS disabled music stays disabled through floor and chest cleanup
PASS synth BGM timer is preserved during dungeon cleanup
PASS default state replacement still stops external audio
PASS pending play survives same-track dungeon transition
PASS pending stale playback cannot revive after state reset
8 tests passed (actual runtime functions; mocked DOM/audio, not audible browser QA).

test_dungeon_reentry.cjs
PASS normal reentry offers new only and does not regenerate on menu open
PASS first entry offers start
PASS normal new entry no replacement popup, new seed and serial
PASS repeat click cannot start second expedition
PASS recovery migration still confirms, preserves if cancelled
PASS accepted recovery migration starts new run
PASS recovery entrance clearly warns
PASS disabled dungeon has no start or resume
PASS not at entrance rejected
PASS stale click rejected
PASS preflight failure leaves original run untouched
PASS validation failure does not commit replacement
PASS stair return retains record, does not generate
PASS floor transition retains same record and no reset ledger
14 tests passed; focused actual function tests with mocked surrounding runtime. Save/load code unchanged, not exercised by this harness.

test_editor_roles.js
PASS legacy placement remains disabled
PASS config cloned without mutating source
PASS all roles serialize exact contract
PASS disable role removes only relevant references
PASS disabled override restores legacy
PASS empty inn selection throws
PASS blank price rejected not coerced zero
PASS negative price rejected
PASS fractional price rejected
PASS catalog includes zero-price materials but excludes key items
PASS unknown stored references visible for correction
PASS draft reads price and checkbox edits without committing
12 checks passed

test_trade_transactions.cjs
PASS valid per-NPC config and zero-price material buyback
PASS reject bad schema and unknown fields
PASS reject duplicate/unregistered/key sales and key buyback
PASS reject fractional zero negative and excessive buyback
PASS reject missing inn and forge dependencies
PASS preview is non-mutating and commit is atomic
PASS single-use quote rejects second commit
PASS forged quote rejected
PASS stale quote after switching NPC rejected
PASS stale owner and revision rejected
PASS changed inventory gold or equipment rejects quote
PASS changed NPC source role price hidden movement rejects quote
PASS changed item price and data rejects quote
PASS no buy-sell gold arbitrage
PASS reject invalid quantity without mutation
PASS reject absent item unsupported mode key and unlisted merchandise
PASS reject insufficient money inventory and overflow
PASS reject total amount overflow
PASS active delivery reserve sums and protects required units
PASS new delivery reservation invalidates quoted sale
PASS malformed request ledger blocks sale
PASS sell only bag duplicate and leave equipped gear untouched
PASS editor battle title and lab contexts blocked
PASS legacy NPC keeps sales but no implicit buyback
PASS empty explicit roles disable merchandise
PASS modal open close and cancel do not mutate inventory gold
PASS repeated confirmation click commits once
PASS old confirm after close and reopen cannot commit
PASS old catalog selection after another NPC cannot open quote
PASS fractional DOM quantity blocked before confirmation
PASS stale quote confirmation displays failure without mutation
PASS hidden disabled detached UI rejects action
PASS lightweight revision stable without relevant authoring changes
PASS lightweight revision tracks item facility and history changes
PASS facility changes invalidate pending transaction
{
  "source": "/workspace/scratch/035bb815a0ca/player_creation/work/36JRPG-v0.8.43/game.js",
  "sourceSha256": "9b10161c185d23357cbecd2b34223d31a41330a177239cedabfd5b38247864d4",
  "passed": 35,
  "failed": 0,
  "failures": [],
  "scope": "Actual NPC service functions extracted verbatim into Node VM; modeled dependencies and DOM. Not browser, rendering, audio, save-dialog, or whole-engine verification."
}

integrity.cjs
PASS runtime syntax and 15 embedded copies

audio_import.cjs
PASS 22 mock import checks; real codec NOT executed

editor_036.cjs
PASS home boot clean / no departure warning
PASS new project needs save
PASS menu map
PASS menu facilities
PASS menu encounterForm
PASS menu party
PASS menu npc
PASS menu enemyForm
PASS menu itemForm
PASS menu skills
PASS menu classesForm
PASS menu eventVisual
PASS menu activitiesForm
PASS menu assets
PASS menu audio
PASS menu database
PASS menu balanceForm
PASS menu customize
PASS menu pack
PASS menu natural
PASS menu battleTest
PASS menu transactions
PASS menu eventGui
PASS menu maps
PASS menu events
PASS menu quests
PASS menu enemies
PASS menu encounters
PASS menu items
PASS menu characterJson
PASS loaded project is clean
PASS unapplied live input warns before leaving
PASS unapplied name retained across menus
PASS draft warns on creator home
PASS applied edit warns / undo does not silently mark saved
PASS JSON request checkpoints and explains download verification
PASS export excludes drafts, still warns for pending input
PASS failed download never clears unsaved flag
PASS editor HTML save checkpoints
PASS BGM counted as exact bytes in total and UI
PASS base64 padding excluded
PASS empty music slot is automatically selected
PASS BGM add GUI uses music_2 and file display name
PASS cancel name edit keeps old value
PASS blank name rejected
PASS rename keeps internal ID and escapes text
PASS name undo
PASS detached rename ignored
PASS rename preserves map assignment
PASS referenced music cannot be deleted
PASS music names survive project/pack roundtrips
PASS saved editor remains clean in isolated test
PASS test leaves definitions intact
PASS draft warns while testing
PASS player distribution does not replace a project save
PASS async ZIP cannot mark newer changes saved
PASS current ZIP checkpoints
PASS ZIP retains BGM bytes and names
PASS in-progress media warns even after save
PASS ended media no longer warns when clean
PASS creator saves only to files; legacy browser projects can be opened without rewriting storage
PASS deletion reduces byte total / undo restores
PASS old project checkpoint rejected for new project
PASS no uncaught DOM errors
{"suite":"editor_036","passed":64,"nativeBrowser":false}

title_bgm_038.cjs
PASS initial title offers OFF without autoplay
PASS external play starts synchronously in click, no WebAudio required
PASS settings return and new-game cancel retain music
PASS new game carries live ON and starts current map track
PASS runtime save loading carries live ON
PASS portable save resume carries live ON
PASS browser continue carries live ON
PASS OFF remains OFF across start and saved enabled=true
PASS rejected play restores OFF and offers retry
PASS retry succeeds
PASS pending ON then OFF cannot revive audio
PASS late title play rejection cannot turn off new session
PASS late title play completion cannot stop loaded session
PASS synth without WebAudio fails safely to OFF
PASS synth starts after context resume and survives new game
{"suite":"title_bgm_038","passed":15,"nativeBrowser":false}

buildings_039.cjs
PASS boot and eight distinct 4x4–6x4 built-in raster buildings
PASS placement is one history edit and preserves ground
PASS footprint blocks 15 cells and doorway allows 1
PASS undo/redo groups picture footprint and raster asset
PASS explicit allow cannot pierce wall, explicit block cannot close owned doorway
PASS legacy H remains one-cell blocked and untouched
PASS placement rejects bounds, overlap, walls and legacy H atomically
PASS placement leaves a walkable front approach
PASS all relevant locks block place move remove and doorway edits
PASS generic foreground panel cannot edit a grouped building
PASS door connection uses standard portal and validates destination
PASS move updates image, footprint, depth anchor and linked doorway together
PASS remove preserves unrelated portal, restores terrain and is undoable
PASS Project JSON and Pack preserve complete building and linked entrance
PASS Project ZIP roundtrip embeds raster and restores building collisions
PASS project file round trip preserves grouped building
PASS playtest does not change authoring data
PASS import rejects corrupted or partial grouping without changing open project
PASS schema2 lookalike building metadata stays inert and prevents implicit activation
PASS all eight presets can place/remove and have exactly one doorway
PASS raster asset ID collision never overwrites user bytes
PASS detached building button cannot mutate after navigation
PASS keyboard stamp commits once and Escape cancels arm
PASS door dialog invalid target, cancellation and detached submit are safe
PASS existing building approaches and portal sources cannot be obstructed
PASS doorway height difference cannot create inaccessible building
PASS pending cell drafts stop footprint edits without discarding input
PASS mouse stamp is preview-only until release, commits once, preserves history grouping
PASS pointer cancel, outside release, and touch scroll never place
PASS touch tap places exactly one grouped building
PASS navigation cancels in-flight stamp and disarms it
PASS button-focused Escape keeps editor open and cancels placement
PASS runtime walking blocks walls and transfers through linked doorway
PASS exported editor/player include grouped data and latest runtime
PASS no uncaught DOM errors
{"suite":"buildings_039","passed":35,"nativeBrowser":false}

default_tiles_040.cjs
PASS fresh project initializes all9 village images without global common-tile overrides
PASS new project ground, passability, start and entities unchanged
PASS editor palette immediately points at all9 actual built-in images
PASS new 30x18 and32x18 maps get defaults without changing existing maps
PASS old project remains legacy on read and gets default only on new map
PASS new map asset registration and map creation undo/redo atomically
PASS different selected preset and custom mappings survive new-map creation and duplication
PASS explicit legacy unassignment survives save, load and duplicate
PASS schema2 lookalike tileset extension stays opaque on load
PASS default helper rejects active and opaque existing mappings
PASS user assets with built-in IDs are preserved under collision-safe new IDs
PASS canceled new project/new map never installs assets or changes current content
PASS Project JSON, Game Pack and native ZIP roundtrips preserve defaults
PASS standalone player and editor exports embed default assets with no external dependency
PASS generated map inherits default and undo/redo includes newly installed assets in old project
PASS generated map reuses existing default assets and retains one-map history
PASS fresh blank and derived example factories get default; committed sample file stays untouched
PASS blank template reset defaults only when explicitly confirmed
PASS existing widescreen starter import remains unchanged apart from normal pre-existing normalization
PASS no uncaught DOM errors
{"suite":"default_tiles_040","passed":20,"nativeBrowser":false}

display_scale.cjs
PASS desktop defaults to 80% and home offers 80/90/100 without writing storage
PASS explicit scale is applied and stored; invalid values are rejected
PASS narrow/touch fallback preserves preference and restores desktop scale
PASS unsupported CSS zoom safely stays at 100%
PASS print switches coordinate math to 100% and restores saved preference
PASS storage denied still applies scale and shows a session-only warning
PASS editor setting preserves its DOM, focus, scroll, project and save state
PASS map metadata drafts survive setting changes without applying them
PASS pointer cell selection accounts for 80% display and independent map zoom
PASS pan uses CSS layout distance rather than scaled physical pointer distance
PASS scale switch cancels an in-flight gesture without editing project data
PASS keyboard cell navigation is independent of display scale
PASS editor and player exports carry settings, styles and no project scale field
PASS play canvas fit uses visual bounds once, not a second shrink
PASS sandbox testplay has no second scale while standalone player keeps its preference
PASS stored supported scales load; malformed stored scales fall back without overwriting storage
PASS every distributed embedded style and runtime matches the canonical sources
PASS no uncaught DOM errors
{"suite":"display_scale","passed":18,"nativeBrowser":false}

project_limits.cjs
Project JSON, ZIP input, escaped embedded JSON and HTML accept the boundary and reject one excess byte.

chapters.cjs
PASS portable file builds a detached fresh state without old map or quests
PASS only selected story switches pass, including false values
PASS different source and protagonist IDs rejected before mutation
PASS ordinary adventure saves are rejected by chapter import
PASS malformed numbers, reserved keys, unbounded arrays and wrong types rejected
PASS disabled categories use sequel defaults instead of source content
PASS missing companions and wrong equipment slots are reported; new gear remains valid
PASS chapter configuration rejects self-reference and unknown field names
PASS prototype chapter export is unavailable in the editor
PASS valid settings survive JSON and GamePack snapshots
PASS author can edit and commit chapter settings in the pack panel
Chapter checks passed: 11

player_creation_review.cjs
PASS missing config preserves fixed protagonist
PASS configured fields, labels and initial focus
PASS cancel preserves current run and definitions
PASS Escape preserves state
PASS required and oversize reject before reset
PASS IME composition cannot start
PASS name only, no grants, safe rendering
PASS repeated stale submit inert
PASS AI omits private/unshared facts
PASS save persists and restores full profile
PASS author exports omit private runtime profile
PASS exported standalone boots with opt-in creation and no prior identity
PASS forged sharing, unknown and oversized fields reject
PASS old save does not inherit profile
PASS cross-work save rejected transactionally
PASS invalid creator configurations reject
PASS disabled config keeps fixed fresh identity
PASS chapter-start staging waits for confirmation and retains transferred mechanics
PASS creator can enable, select fields, defaults and required inputs
19 focused checks passed. jsdom only.

player_appearance_review.cjs
PASS strict raster sources and geometry
PASS source byte ceiling before decode
PASS normalize bounds and metadata-free RGBA
PASS decode mismatch and failure reject
PASS SAVE rejects corrupt, noncanonical and over-limit RGBA
PASS candidate config validates missing refs and reserved IDs
PASS author candidate selection prepares preview without mutating author assets
PASS upload invalid type/size recovers Start control
PASS pending start blocked, clear invalidates stale decode
PASS cancel invalidates pending decode without run changes
PASS successful local upload retains neither filename nor original compressed bytes
PASS out-of-order decoding keeps latest selection
PASS unallowlisted candidate is refused and Start recovers
PASS creator disabled uploads and image categories hide controls
PASS run-local images persist and do not alter coordinates, stats or author assets
PASS portrait overrides expression/face; walking affects only actual player
PASS SAVE restore includes image and corrupted restore is atomic
PASS images excluded from AI and every author export
PASS no image residual after no-profile load or new game
19 independent image review checks passed. Source parsing is real; browser decode, canvas pixels and visual rendering are mocked.

map_expansion_assets.cjs
Map expansion assets passed: 8 transparent buildings, 45 unique raster tiles, 8 immutable opt-in presets, provenance and SHA-256 verified.
Terrain integration passed: five applications, reapplication no-ops, clean unassignment, user-asset ID collisions, and all existing map/event/collision data preserved.

All current suites passed. DOM/audio mocks do not verify native rendering or sound.
npm notice
npm notice New major version of npm available! 11.9.0 -> 12.2.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v12.2.2
npm notice To update run: npm install -g npm@12.2.2
npm notice
