Phase 3: trade/end-game client, bot simulator, first balance pass

Built:
- Client: trade screen, world/end-game screen (landing sites, shipping, node build, final ranking), report sharing + alliance reports tab, alert describers for all notification types, error-code strings (en+nb) for every server CODE.
- tools/bot.js (+ tools/bot/): 50 headless bots against the real server in-process with a fake clock; resource/unit conservation ledger, exit 1 on broken invariants. docs/BALANCE.md has method and every run behind a number.
- Balance changes (evidence in docs/BALANCE.md): secondQueueCoreLevel 10 -> 3, TRANSPORT.capacityPerLink 500 -> 1000 (end game was shipping-limited in bot runs).
- Server fixes: POST /reports/:id/share 500 without a pending reportCleanup; bounced link shipments were silent about cargo overflow.

Tested: npm test 207/207 (new: bot determinism + invariants, client alerts/world/i18n over CODES, two regression tests that failed before their fix); openapi check up to date. Real-browser scratch runs (not in repo): WebSocket push shows an incoming-attack banner ~214 ms after launch, polling fallback ~52 s, 15 scripted flows, 71 screenshots.

NOT tested: Playwright suite (e2e/ still empty), real devices/Safari, nginx proxy websockets, throttled networks, HTTP-level bot load. NOT claimed: balance. Bots are not humans; open balance items (loot waste, escrow refund clipping, no garrisons at landing sites, end game not scaling with world speed) are listed in docs/BALANCE.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
This commit is contained in:
jvanvik 2026-10-11 20:24:41 +02:00
parent d84b0c9d12
commit 931f59e11e
49 changed files with 4750 additions and 59 deletions

View file

@ -21,6 +21,7 @@
<header id="topbar">
<div class="brand"><span class="brand-mark" aria-hidden="true"></span><span id="title">UPSTREAM</span></div>
<span id="netstate" class="netstate" role="status" aria-live="polite" hidden></span>
<button id="world-pill" class="netstate ended-pill" type="button" data-keep hidden></button>
</header>
<section id="hud" class="hud" aria-label="Resources" hidden></section>
<main id="view"></main>
@ -35,13 +36,18 @@
<script src="js/i18n.js" defer></script>
<script src="js/strings/military.js" defer></script>
<script src="js/strings/social.js" defer></script>
<script src="js/strings/alerts.js" defer></script>
<script src="js/strings/trade.js" defer></script>
<script src="js/strings/world.js" defer></script>
<script src="js/api.js" defer></script>
<script src="js/ui.js" defer></script>
<script src="js/social.js" defer></script>
<script src="js/render.js" defer></script>
<script src="js/milcore.js" defer></script>
<script src="js/endcore.js" defer></script>
<script src="js/main.js" defer></script>
<script src="js/milstate.js" defer></script>
<script src="js/alertkinds.js" defer></script>
<script src="js/ws.js" defer></script>
<script src="js/screens/auth.js" defer></script>
<script src="js/screens/pop.js" defer></script>
@ -57,5 +63,8 @@
<script src="js/screens/alliance.js" defer></script>
<script src="js/screens/messages.js" defer></script>
<script src="js/screens/rankings.js" defer></script>
<script src="js/screens/cargo-ui.js" defer></script>
<script src="js/screens/trade.js" defer></script>
<script src="js/screens/world.js" defer></script>
</body>
</html>