feat: split RU-ARK into mainland + New Earth + Severnaya Zemlya (v0.25.0, #31) #40

Merged
kamilkrzywda merged 2 commits from feat/31-split-arkhangel into master 2026-10-14 19:57:50 +02:00
Owner

Split the 78-part RU-ARK mega-region into three features — a pure re-grouping of the existing polygon parts (no new geometry, no coordinate changes); the new features are inserted immediately after RU-ARK (stable file order RU-ARK | RU-ARK-NE | RU-ARK-SZ | RU-AST):

  • RU-ARK — the mainland (33 parts, ~393,256 km²). Its key arkhangel-sk-lhbk is unchanged → ownership-safe for existing Nation.territory lists and SQLite games.
  • RU-ARK-NE — New Earth / Franz Josef Land (42 parts, ~15,721 km²) → new key new-earth-eikt. Genuinely isolated (≥100 km from land) → empty adjacency list.
  • RU-ARK-SZ — Severnaya Zemlya (3 parts, ~1,210 km²) → new key severnaya-zemlya-awqp. Its islet rings share boundary vertices with the coarsened mainland ring (a contact that pre-existed inside the single pre-split feature — no coordinate change), so it records one SZ ↔ arkhangel-sk-lhbk adjacency pair (deviation from the original "both islands isolated" expectation, recorded as-is).

Details

  • New idempotent pipeline stage scripts/split-arkhangel.mjs (npm run split:regions), run between fill:regions and build:region-keys: deterministic, a second run is a no-op that writes nothing, fails loudly on a mis-split / missing feature / non-MultiPolygon. Parts are classified by centroid (turf — allowed in .mjs only): main = lat < 76, SZ = 76 ≤ lat < 79.5 AND lon ≥ 55, NE = lat ≥ 79.5.
  • Manifests regenerated with the real scripts (still idempotent, byte-identical re-run): public/region-keys.json and public/region-adjacency.json → 1,798 entries each (was 1,796); adjacency pairs 4,470 → 4,471 (the one new pair is the SZ ↔ mainland contact).
  • Fixed-point dataset unchanged except feature count (1,796 → 1,798): parts/rings/vertices (11,794 / 11,795 / 164,801) and the single hole (KZ-KZY) identical before/after.
  • Tests 164 → 168: scripts/regions.test.ts (1,798 features + new 3-features pin), scripts/region-keys.test.ts (1,798 keys + key-stability pin), scripts/region-adjacency.test.ts (1,798 + new island-adjacency test), server/regions.test.ts (1,798 + RUS expansion now 82 sub-regions incl. all three keys). No e2e assertion references the old counts — CI e2e unaffected.
  • LLM / engine / stub untouched. At game creation RUS auto-owns all three (80 → 82 sub-regions).
  • Docs: AGENTS.md (Stack, Layout, Commands table, region-territory bullet), CHANGELOG.md v0.25.0, version bump 0.24.0 → 0.25.0.

Fixes #31

Split the 78-part `RU-ARK` mega-region into three features — a **pure re-grouping of the existing polygon parts** (no new geometry, no coordinate changes); the new features are inserted immediately after `RU-ARK` (stable file order `RU-ARK | RU-ARK-NE | RU-ARK-SZ | RU-AST`): - `RU-ARK` — the mainland (33 parts, ~393,256 km²). Its key **`arkhangel-sk-lhbk` is unchanged** → ownership-safe for existing `Nation.territory` lists and SQLite games. - `RU-ARK-NE` — New Earth / Franz Josef Land (42 parts, ~15,721 km²) → new key `new-earth-eikt`. Genuinely isolated (≥100 km from land) → **empty** adjacency list. - `RU-ARK-SZ` — Severnaya Zemlya (3 parts, ~1,210 km²) → new key `severnaya-zemlya-awqp`. Its islet rings share boundary vertices with the coarsened mainland ring (a contact that pre-existed inside the single pre-split feature — no coordinate change), so it records **one** SZ ↔ `arkhangel-sk-lhbk` adjacency pair (deviation from the original "both islands isolated" expectation, recorded as-is). **Details** - New **idempotent** pipeline stage `scripts/split-arkhangel.mjs` (`npm run split:regions`), run between `fill:regions` and `build:region-keys`: deterministic, a second run is a no-op that writes nothing, fails loudly on a mis-split / missing feature / non-MultiPolygon. Parts are classified by centroid (turf — allowed in `.mjs` only): main = lat < 76, SZ = 76 ≤ lat < 79.5 AND lon ≥ 55, NE = lat ≥ 79.5. - **Manifests regenerated** with the real scripts (still idempotent, byte-identical re-run): `public/region-keys.json` and `public/region-adjacency.json` → **1,798 entries each** (was 1,796); adjacency pairs 4,470 → 4,471 (the one new pair is the SZ ↔ mainland contact). - **Fixed-point dataset unchanged except feature count** (1,796 → 1,798): parts/rings/vertices (11,794 / 11,795 / 164,801) and the single hole (KZ-KZY) identical before/after. - **Tests 164 → 168**: `scripts/regions.test.ts` (1,798 features + new 3-features pin), `scripts/region-keys.test.ts` (1,798 keys + key-stability pin), `scripts/region-adjacency.test.ts` (1,798 + new island-adjacency test), `server/regions.test.ts` (1,798 + RUS expansion now **82** sub-regions incl. all three keys). No e2e assertion references the old counts — CI e2e unaffected. - **LLM / engine / stub untouched.** At game creation RUS auto-owns all three (80 → 82 sub-regions). - Docs: `AGENTS.md` (Stack, Layout, Commands table, region-territory bullet), `CHANGELOG.md` v0.25.0, version bump 0.24.0 → 0.25.0. Fixes #31
kamilkrzywda added 2 commits 2026-10-14 19:55:18 +02:00
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-10-14 19:55:23 +02:00
kamilkrzywda merged commit 867b2eb0a1 into master 2026-10-14 19:57:50 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/History#40