Files
windroost/tools
wushenghua 66b6cf2926 refactor: unify upgrade cost + long-run stability gate (PRODUCTION/49 goal)
Wrote PRODUCTION/49 as the authoritative ongoing-optimization goal after
analyzing what remains. Executed all owner-independent items:

A1 upgrade cost single source of truth: game_root hardcoded 120*1.15^(lvl-1)
in two places while battle HUD read mvp_battle_rules.json — a balance change
would desync displayed cost from the actual debit. All three call sites now use
ProfileStore.upgrade_cost(level) (rules-driven). upgrade_cost_test proves the
helper matches an independent formula at Lv1/5/12, the skyport card shows the
authoritative cost, and the real debit equals it (210 at Lv5). 5 stages pass.

A2 long-run stability gate: new longrun_stability_test drives 400 frames of a
real battle with continuous damage/VFX and asserts floating numbers <=16,
roster cards constant (3), pop tweens <=4, visible units <=5, and no growth
from warmup to frame 400. This guards the leak classes fixed earlier.

A4 evidence audit updated (PRODUCTION/48 sections 4b/4c) with all fixes and
the one honest design-open item (ultimate energy recharge has no authoritative
sim contract, so not invented).

Both tests registered in run_p2_checks.sh. Full gate P2_CHECKS_PASS, log audit
clean, 0 script/lambda errors. prototype/ untracked.
2026-11-18 05:09:32 +08:00
..