feat(rust): the live map (phase 14, protocol 11) #17

Merged
whitlocktech merged 1 commits from feat/phase-14-map into edge 2026-09-25 12:00:49 +00:00
Member

PLAN.md §30 as approved in docs#271, plus D119 and D120 from the build. Core is unchanged and MODULE_API did not move.

Server

  • Tables: rust_map_images holds one row per server: the picture as a MEDIUMBLOB, the geometry, the monuments and DERIVATION_VERSION. rust_map_overrides holds per-server switch overrides. Both are in the purge.sql pair.
  • mapImages.js (D110):
    • The board poll notices a new boot, wipe, seed or world size and asks map.info.
    • A new key or hash is fetched in slices, checked against its SHA-256, and stored in one statement.
    • One fetch per server at a time, with a backoff on failure. A stale slice abandons the whole fetch.
    • Render now (D109) is watched to completion.
  • mapLive.js (D111): one map.live per server per 5 s, whoever asks. Positions stay in memory only.
  • model/map:
    • Four layers (world and events public, players and bases staff by default), with a fleet default and a per-server override (D114).
    • The players layer is capped by presence (D113).
    • A linked viewer gets their own dot and their online first-party clan mates (D115, D117, D118).
    • A layer the viewer may not see is absent from the answer. It is never sent and then hidden.
  • Routes:
    • Public: /servers/:id/map, /map/image (immutable under its hash) and /map/live.
    • Admin: /servers/:id/map/fetch and /map/render.
    • The Map card rides the visibility PUT.
    • The Swagger fragment and routes.manifest.json were regenerated against the pinned core.

Client

  • A Map tab: Leaflet over the picture, the game's own grid, and a legend that lists the hidden layers with who can see them. It polls every 10 s while visible.
  • D120: Leaflet is a lazy split chunk (dist/leaflet-<hash>.js) beside entry.js, not in it.
    • release.yml now copies every dist/*.js.
    • checkExternals.js and build.test.js hold both ends of that.
    • The chunk is 76 KB gz: Vite's library mode does not strip whitespace. It loads only on the Map tab.
  • The Map card on Admin → Rust visibility, with Fetch again, and Render now with the stall stated.
  • Capability map, for Android leg D (phase 15).

Checks: 337 server tests and 54 client tests pass. check:imports, check:bundle, check:swagger, check:engagement, check:externals and the frozen manifest are clean.

Walked against real core main and both rigs; all eight §30.4 steps pass. Walk details: docs PR, §30.7–§30.9.

What needs you:

  • The admin Map card in a browser. Signing in means typing a password, so that was left to your review.

  • The player map walk in PLAYER_WALK.md.

  • AI-assisted: Claude Code (Claude Opus 5.5)

🤖 Generated with Claude Code

https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY

[PLAN.md §30](https://gitea.whitlocktech.com/RunicGateway/docs/src/branch/main/modules/rust/PLAN.md) as approved in docs#271, plus D119 and D120 from the build. **Core is unchanged and `MODULE_API` did not move.** **Server** - **Tables:** `rust_map_images` holds one row per server: the picture as a `MEDIUMBLOB`, the geometry, the monuments and `DERIVATION_VERSION`. `rust_map_overrides` holds per-server switch overrides. Both are in the `purge.sql` pair. - **`mapImages.js` (D110):** - The board poll notices a new boot, wipe, seed or world size and asks `map.info`. - A new key or hash is fetched in slices, checked against its SHA-256, and stored in one statement. - One fetch per server at a time, with a backoff on failure. A `stale` slice abandons the whole fetch. - Render now (D109) is watched to completion. - **`mapLive.js` (D111):** one `map.live` per server per 5 s, whoever asks. Positions stay in memory only. - **`model/map`:** - Four layers (world and events public, players and bases staff by default), with a fleet default and a per-server override (D114). - The players layer is capped by presence (D113). - A linked viewer gets their own dot and their online first-party clan mates (D115, D117, D118). - **A layer the viewer may not see is absent from the answer.** It is never sent and then hidden. - **Routes:** - Public: `/servers/:id/map`, `/map/image` (immutable under its hash) and `/map/live`. - Admin: `/servers/:id/map/fetch` and `/map/render`. - The Map card rides the visibility `PUT`. - The Swagger fragment and `routes.manifest.json` were regenerated against the pinned core. **Client** - **A Map tab:** Leaflet over the picture, the game's own grid, and a legend that lists the hidden layers with who can see them. It polls every 10 s while visible. - **D120:** Leaflet is a lazy split chunk (`dist/leaflet-<hash>.js`) beside `entry.js`, not in it. - `release.yml` now copies every `dist/*.js`. - `checkExternals.js` and `build.test.js` hold both ends of that. - The chunk is 76 KB gz: Vite's library mode does not strip whitespace. It loads only on the Map tab. - **The Map card on Admin → Rust visibility**, with Fetch again, and Render now with the stall stated. - Capability `map`, for Android leg D (phase 15). **Checks:** 337 server tests and 54 client tests pass. `check:imports`, `check:bundle`, `check:swagger`, `check:engagement`, `check:externals` and the frozen manifest are clean. **Walked** against real core `main` and both rigs; all eight §30.4 steps pass. Walk details: docs PR, §30.7–§30.9. **What needs you:** - The **admin Map card in a browser**. Signing in means typing a password, so that was left to your review. - The **player map walk** in `PLAYER_WALK.md`. - [x] AI-assisted: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
wtclaude added 1 commit 2026-09-25 11:33:11 +00:00
feat(rust): the live map (phase 14, protocol 11)
All checks were successful
PR Checks / server-tests (pull_request) Successful in 28s
PR Checks / client-build (pull_request) Successful in 27s
PR Checks / frozen-manifest (pull_request) Successful in -1m9s
0cb9bdd1f0
PLAN.md §30 as approved, plus D119/D120 from the build.

Server:
- rust_map_images (one row per server: picture as MEDIUMBLOB, geometry,
  monuments, DERIVATION_VERSION) and rust_map_overrides; purge.sql pair.
- mapImages.js: D110. The board poll notices a new boot/wipe/seed/size and
  asks map.info; a new key or hash from the free Rust+ cache (or a render
  kept on disk) is fetched in slices, checked against its SHA-256 and stored
  in one statement. One fetch per server, a backoff on failure, `stale`
  abandons a fetch that straddles a map change. Render now (D109) is
  admin-only and watched to completion.
- mapLive.js: D111. One map.live per server per 5 s whoever asks; positions
  are held in memory only.
- model/map: four layers (world, events public; players, bases staff), a
  fleet default plus per-server override (D114), the players layer capped by
  presence (D113), own dot and online first-party clan mates for a linked
  viewer (D115, D117, D118). A layer the viewer may not see is absent from
  the answer, never sent and hidden.
- Routes: public /servers/:id/map, /map/image (immutable under its hash),
  /map/live; admin /servers/:id/map/fetch and /render; the Map card on the
  visibility PUT. Swagger fragment and frozen manifest regenerated.

Client:
- A Map tab: Leaflet over the picture in CRS.Simple, the game's own grid
  (labels only when a cell is wide enough to hold one), a legend that lists
  hidden layers with who can see them, polled every 10 s while visible.
- D120: Leaflet is a lazy split chunk beside entry.js, not in it. release.yml
  copies every dist/*.js; checkExternals and build.test.js hold both ends.
- The Map card on Admin -> Rust visibility, with Fetch again and Render now.

Capability `map` declared for the Android app (phase 15).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
whitlocktech merged commit cf4d183181 into edge 2026-09-25 12:00:49 +00:00
whitlocktech deleted branch feat/phase-14-map 2026-09-25 12:00:50 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RunicGateway/Module-Rust#17
No description provided.