Re-coarsen RU-ARK Arctic-coast band into RU-PEO + RU-YAM (#41)
CI / build + unit + e2e (pull_request) Successful in 2m34s
CI / build + unit + e2e (pull_request) Successful in 2m34s
#41: re-partition the RU-ARK mainland's 28-part lat>=68 Arctic-coast band into two new regions via a new turf-free, idempotent pipeline stage scripts/split-arkhangel-band.mjs (npm run split:regions:band), mirroring the #31 split: - RU-PEO (Pechora, 13 parts, ~37,678 km2) -> key pechora-qwhs - RU-YAM (Yamal, 15 parts, ~51,722 km2) -> key yamal-gosw - RU-ARK keeps its id/name/key arkhangel-sk-lhbk (ownership-safe); the 5-part lat<68 core (~305,229 km2) stays RU-ARK. Pure re-partition: no geometry moved (byte-identical union). The two new features are inserted immediately after RU-ARK-SZ. Manifests regenerated with the real scripts (1,798 -> 1,800 keys + adjacency; adjacency pairs 4,471 -> 4,473). Fixed-point dataset unchanged except feature count (11,794 parts / 11,795 rings / 164,801 verts / 1 KZ-KZY hole). Four dataset/manifest tests updated (RUS 82 -> 84 sub-regions). Version 0.25.0 -> 0.26.0. Fixes #41
This commit is contained in:
@@ -28,7 +28,7 @@ renders territorial ownership; the whole thing persists to SQLite and streams ov
|
||||
- Backend: Node 22 + Express — one process serving the built client, `/api` (REST), and `/sse`
|
||||
- Persistence: `better-sqlite3` (one row per game, full `GameState` as JSON)
|
||||
- Map: MapLibre GL (`maplibre-gl`) — remote OpenFreeMap `dark` basemap + a **sub-national**
|
||||
choropleth from `public/regions.geo.json` (1,798 sub-regions; feature `id` = `<ISO_A3>-<nn>`,
|
||||
choropleth from `public/regions.geo.json` (1,800 sub-regions; feature `id` = `<ISO_A3>-<nn>`,
|
||||
`properties.parent` = the country's ISO_A3). Ownership is at **region-key** granularity
|
||||
(v0.19, #16 P1): every sub-region is addressed by a stable key from
|
||||
`public/region-keys.json`, `Nation.territory` holds those keys, and each sub-region is
|
||||
@@ -36,7 +36,9 @@ renders territorial ownership; the whole thing persists to SQLite and streams ov
|
||||
across shared land borders (frontier-biased transfers, verified with the `getNeighbours`
|
||||
function-calling tool) instead of whole countries. Since v0.25 (#31) the old RU-ARK
|
||||
mega-region is split into the mainland (`RU-ARK`, key unchanged) plus the New Earth
|
||||
(`RU-ARK-NE`) and Severnaya Zemlya (`RU-ARK-SZ`) island groups.
|
||||
(`RU-ARK-NE`) and Severnaya Zemlya (`RU-ARK-SZ`) island groups; since v0.26 (#41) the
|
||||
mainland's 28-part Arctic-coast band is further re-partitioned into Pechora (`RU-PEO`)
|
||||
and Yamal (`RU-YAM`) (the 5-part lat < 68 core stays `RU-ARK`/`arkhangel-sk-lhbk`).
|
||||
- The LLM client is a thin OpenAI chat-completions wrapper over native `fetch` with an
|
||||
**injectable transport** (mirrors `mesh-bot/src/llm`), with two entry points: plain
|
||||
`chat()` and `chatWithTools()` — a bounded OpenAI function-calling loop (max 6 tool
|
||||
@@ -60,12 +62,13 @@ history/
|
||||
├── presets/ # 5 scenario JSON files + index.json (manifest)
|
||||
├── public/
|
||||
│ ├── countries.geo.json # 177 countries, id=ISO_A3 (input to the region generator)
|
||||
│ ├── regions.geo.json # 1,798 sub-regions, id=<ISO_A3>-<nn>, parent=ISO_A3 (the choropleth)
|
||||
│ ├── region-keys.json # feature id -> region key, 1,798 entries (the ownership/LLM address space, #16 P1)
|
||||
│ └── region-adjacency.json # region key -> bordering region keys, 1,798 entries (the getNeighbours data, #16 P2)
|
||||
│ ├── regions.geo.json # 1,800 sub-regions, id=<ISO_A3>-<nn>, parent=ISO_A3 (the choropleth)
|
||||
│ ├── region-keys.json # feature id -> region key, 1,800 entries (the ownership/LLM address space, #16 P1)
|
||||
│ └── region-adjacency.json # region key -> bordering region keys, 1,800 entries (the getNeighbours data, #16 P2)
|
||||
├── scripts/ # the geo/manifest data pipeline — .mjs (turf allowed HERE only;
|
||||
│ │ # never imported by .ts): generate → coarsen → cleanup → smooth →
|
||||
│ │ # fill-gaps → split-arkhangel → build-region-keys → build-region-adjacency
|
||||
│ │ # fill-gaps → split-arkhangel → split-arkhangel-band → build-region-keys
|
||||
│ │ # → build-region-adjacency
|
||||
│ └── *.test.ts # turf-free vitest tests pinning the dataset + both manifests
|
||||
├── shared/ # NO runtime deps — the single source of truth
|
||||
│ ├── types.ts # domain types (Nation, GameState, RoundItem, Preset, …)
|
||||
@@ -112,11 +115,12 @@ history/
|
||||
| `npm run dev` | Express on :4321 (tsx watch) + Vite on :5173 (proxies `/api`,`/sse`) concurrently |
|
||||
| `npm run build` | `vite build` (client → `dist/`) then `tsup server/index.ts` → `server/dist/index.js` |
|
||||
| `npm start` | run the compiled server (`node server/dist/index.js`) on :4321 |
|
||||
| `npm test` | vitest unit tests (`server/` + `scripts/`; 151 tests) |
|
||||
| `npm test` | vitest unit tests (`server/` + `scripts/`; 168 tests) |
|
||||
| `npm run typecheck` | `tsc --noEmit` (strict) across src/server/shared/e2e/configs |
|
||||
| `npm run lint` | ESLint flat config |
|
||||
| `npm run e2e` | Playwright, fully deterministic (`LLM_STUB=1`); **runs in CI on every PR** (see below) |
|
||||
| `npm run split:regions` | (re)apply the #31 Arkhangel'sk split (`RU-ARK` → mainland + `RU-ARK-NE` + `RU-ARK-SZ`) — idempotent no-op once applied |
|
||||
| `npm run split:regions:band` | (re)apply the #41 Arctic-coast-band split (`RU-ARK` mainland's 28-part lat ≥ 68 band → `RU-PEO` + `RU-YAM`) — idempotent no-op once applied |
|
||||
| `npm run build:region-keys` / `build:region-adjacency` | (re)generate the `public/region-keys.json` / `region-adjacency.json` manifests — deterministic + idempotent (byte-identical re-run) |
|
||||
| `docker compose up -d --build` | prod image on :4321, routed via Traefik at `history.dev.kkhost.pl` |
|
||||
|
||||
@@ -199,6 +203,14 @@ history/
|
||||
`fill:regions` and `build:region-keys`, no-op once applied); the two island groups get their own
|
||||
region keys and adjacency entries (New Earth is genuinely isolated → empty adjacency; Severnaya
|
||||
Zemlya's islet rings touch the coarsened mainland ring, so it records one SZ↔mainland pair).
|
||||
Since v0.26 (#41) the mainland's 28-part Arctic-coast band (centroid lat ≥ 68) is further
|
||||
re-partitioned by the idempotent `scripts/split-arkhangel-band.mjs` stage (run between
|
||||
`split:regions` and `build:region-keys`, no-op once applied) into Pechora (`RU-PEO`,
|
||||
`pechora-qwhs`, 13 parts) and Yamal (`RU-YAM`, `yamal-gosw`, 15 parts) — a pure re-partition
|
||||
(no geometry moved → the union is byte-identical) that keeps `RU-ARK`'s id/name/key
|
||||
`arkhangel-sk-lhbk` stable and inserts the two new features immediately after `RU-ARK-SZ`; the
|
||||
5-part lat < 68 core stays `RU-ARK` (a single ~305k km² polygon — splitting it needs turf
|
||||
clipping, not a pure re-partition).
|
||||
- **Nation ops — “LLM proposes, player confirms” (v0.23, #16 P4a; v0.24, #16 P4b).**
|
||||
`TurnResult.nationOps` (required in the schema) carries the LLM’s proposed **`NationOp`s** — a
|
||||
discriminated union of `rename` / `split` / `merge`, all three of which are now applied on confirm
|
||||
|
||||
Reference in New Issue
Block a user