kamilkrzywda
b237fe8dd4
feat: Resources & Industry — per-region resource profiles + industry LLM lever (v0.36.0, #59 )
...
CI / build + unit + e2e (pull_request) Successful in 2m11s
- scripts/build-region-resources.mjs: deterministic, idempotent builder →
public/region-resources.json (1,800 entries; FNV-1a hash × area factor, 0–1, 2dp)
- server/regions.ts: hasResources()/resourceOf() optional-manifest loader
- shared/types.ts: RegionResources, IndustryType/INDUSTRY_TYPES, IndustryProject,
GameState.industry
- shared/protocol.ts: IndustryOps, TurnResult.industry, deriveNationResources
(area×population-weighted average, 2dp)
- server/engine.ts: isIndustryType, validateIndustryOps, applyIndustryOps
(per-region SET, first-declared-type wins), applyIndustryEffects
(INDUSTRY_ECONOMY_BONUS=1, +1 when region industry≥0.5; sole-owner only;
0/2+ owner regions kept but no boost; re-derive after), system+user prompt
contract lines, runTurn resourceOf opt, nationResources in user payload
- server/db.ts: legacy-row industry default migration
- server/stub.ts: industry:{projects:[]} in stub result; resources/industry
in StubPayload (never read)
- server/index.ts: resourceOf wired to jump route
- All test fixtures updated; new describe blocks in engine.test.ts,
protocol.test.ts, regions.test.ts, db.test.ts
- CHANGELOG.md v0.36.0, AGENTS.md docs, package.json 0.36.0
Fixes #59
2026-10-15 18:23:05 +00:00
kamilkrzywda
22805a3be6
v0.28.0 ( #46 ): per-region stats — area×population-weighted-median Nation.stats (PR 1 of 2)
CI / build + unit + e2e (pull_request) Successful in 2m34s
2026-10-15 00:17:19 +00:00
kamilkrzywda
a129c2ab81
v0.27.0 ( #44 ): LLM-placed named map point markers
...
CI / build + unit + e2e (pull_request) Successful in 2m36s
- shared: 8 MarkerTypes + MARKER_TYPE_INFO (label/color/glyph); MapMarker;
GameState.markers (required, [] at init); TurnResult.markers {add,remove};
MarkerSpec/MarkerInfo; FNV-1a 4-char markerId; MAX_MARKERS=400.
- data: new public/region-centroids.json (1,800 anchors = largest-part centroid
+ spread ~0.1x min-bbox) built by new idempotent scripts/build-region-centroids.mjs.
- server: regions.ts centroid loader (public/ then dist/); engine applyTurnResult
marker ops (remove -> owner-recompute -> add, jitter, cap, never throws);
prompt documents the contract; buildUserPrompt carries markers; stub marker-free.
- client: WorldMap symbol layer rendered as canvas per-type icons (glyph CDN dead);
hover tooltip shows name; click focuses owning nation.
- tests: 168 -> 189 (centroids script, regions centroids, db legacy, engine markers).
2026-10-14 22:37:29 +00:00
kamilkrzywda
f6ad554823
Re-coarsen RU-ARK Arctic-coast band into RU-PEO + RU-YAM ( #41 )
...
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
2026-10-14 19:26:49 +00:00
kamilkrzywda
f593af5ba5
feat: split RU-ARK into mainland + New Earth + Severnaya Zemlya — idempotent stage, manifests 1,798 (v0.25.0, #31 )
2026-10-14 17:54:45 +00:00
kamilkrzywda
f53f9072f4
Build region-adjacency manifest (Stage 1 of #16 P2)
...
Generate public/region-adjacency.json: regionKey -> neighbourKeys, built
from regions.geo.json (bbox proximity reject + @turf/boolean-intersects
arbitration; symmetric, deduped, no self-refs). Deterministic + idempotent.
This is the data backing the LLM's getNeighbours tool (Stage 2) which lets
it move contiguous frontier regions instead of whole countries.
2026-10-14 10:05:06 +00:00
kamilkrzywda
2b84c34f41
Add region-key manifest (build:region-keys) + public/region-keys.json (v0.19 P1 of #16 )
...
Deterministic <name-slug>-<4char> key per sub-region: name via NFKD strip +
fold table (ə ø ð đ œ ł) + a-z0-9 collapse; 4-char from FNV-1a of the stable
feature id, salted on within-slug collision so all 1,796 keys are unique.
Builtins only (no @turf). Idempotent (byte-identical on re-run).
2026-10-14 08:32:36 +00:00
kamilkrzywda
b1081eefde
Fill no-one's-land gaps between merged sub-regions (v0.17.0)
...
CI / build + unit + e2e (pull_request) Successful in 2m19s
Part of #16
2026-10-13 15:18:31 +00:00
kamilkrzywda
f1cc4fbc10
Smooth jagged sub-national region boundaries (v0.16.0)
...
CI / build + unit + e2e (pull_request) Successful in 2m18s
Part of #16
2026-10-13 09:42:44 +00:00
kamilkrzywda
8eedc37e05
Clean up holes/gaps in sub-national regions (v0.15.0)
...
CI / build + unit + e2e (pull_request) Successful in 2m15s
Part of #16
2026-10-12 13:51:47 +00:00
kamilkrzywda
7bf11fa5b9
Coarsen sub-national regions to ~100km floor (v0.14.0)
...
CI / build + unit + e2e (pull_request) Successful in 1m47s
Part of #16
2026-10-12 09:52:52 +00:00
kamilkrzywda
99188b5b15
Replace geometric sub-regions with real historical regions (v0.13.0)
...
CI / build + unit + e2e (pull_request) Successful in 2m34s
Part of #16
2026-10-12 08:33:07 +00:00
kamilkrzywda
d5285ce28d
Add sub-national regional dataset + generator (v0.11.0)
...
CI / build + unit + e2e (pull_request) Successful in 1m21s
Fixes #16
2026-10-12 00:33:11 +00:00
kamilkrzywda and OpenCode
e2936e85bb
History: AI-driven alternate-history simulator
...
Pax Historia-style sim where the LLM is the world engine.
- React 19 + Vite 6 + Tailwind v4 + shadcn/ui frontend
- Express single-port backend (/api + /sse + built client + SPA fallback)
- SQLite (better-sqlite3) persistence, one row per game
- MapLibre choropleth map (OpenFreeMap dark + ISO_A3 regions)
- Defensive turn loop: strip fences, balanced-{} extract, parse, clamp 0-100,
retry-once nudge, generic 'unclear' fallback; never crashes on bad output
- 5 seed presets (wwii-1939, coldwar-1955, modern-2025, no-wwii-1940, aegis-2400)
- LLM client over native fetch w/ injectable transport (mesh-bot pattern);
LLM_STUB=1 deterministic transport for tests/e2e
- Unit (vitest, 19) + deterministic Playwright e2e
- Multi-stage node:22-slim Docker + Traefik (history.dev.kkhost.pl:4321)
Co-Authored-By: OpenCode <opencode@users.noreply.github.com >
2026-10-10 21:20:23 +00:00