Files
coorl-lost-cities/web
coolguyandClaude Opus 4.8 299c788545 Fix web client interaction and layout bugs
Placing a card locked the turn in: the chosen card left the hand and no
affordance reverted the placement, forcing the move through. Clicking the
chosen destination again or pressing Escape now steps the selection back.

A failing ONNX inference left the AI's turn unadvanced, permanently
stalling the game. The AI turn now falls back to the heuristic policy.

Other fixes: the score plaque no longer covers hand cards (plaques become
compact chips at narrow widths and hand spacing tracks the viewport),
opponent cards drawn from a discard pile render face up, long expedition
stacks stay inside their lane, undo no longer bumps the generation counter
on empty history, and small viewports scroll instead of clipping.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LmyprzuzanXRhpomc3Ga1i
2026-07-14 21:04:27 +09:00
..
2026-07-14 20:09:03 +09:00
2026-07-14 19:49:03 +09:00
2026-07-14 19:49:03 +09:00
2026-07-14 19:49:03 +09:00
2026-07-14 20:09:03 +09:00
2026-07-14 19:49:03 +09:00
2026-07-14 19:49:03 +09:00
2026-07-14 19:49:03 +09:00
2026-07-14 19:49:03 +09:00

COOLRL Lost Cities Web

Browser-only Lost Cities client. The rules engine, observation builder, and PPO inference all run on the device; there is no application server.

The verified final JAX PPO policy is committed at public/models/jax-ppo.onnx (3.1 MB). Vite copies it to the static build, and the app resolves the asset relative to the deployed site so it works on GitHub Pages, GitLab Pages, or a normal web root. Its size and SHA-256 are recorded in public/models/jax-ppo.json.

Pushes to main build and publish the client through the repository's GitHub Pages and GitLab Pages workflows. Each workflow supplies the correct base URL for its host.

Setup

Install and run the checked-in final policy:

cd web
npm ci
npm run dev

Build the same static bundle used by a host:

npm run build
npm run preview

To replace the shipped policy, export a verified Orbax checkpoint from the repository root. The exporter writes both the ONNX file and its public metadata manifest:

uv run --with onnx scripts/export_jax_ppo_onnx.py \
  --checkpoint /path/to/checkpoint \
  --output web/public/models/jax-ppo.onnx

The policy tries WebGPU first and falls back to ONNX Runtime WebAssembly. If the model asset is absent, the UI remains playable using a simple local heuristic and reports that fallback in the header.

Checks

cd web
npm test
npm run build

The TypeScript engine follows src/lost_cities_jax/engine.py and its 96-action atomic action space. Cross-runtime fixtures can be regenerated with:

uv run python scripts/generate_web_parity_fixture.py