PR 2 of 2 for #46. Gives the LLM a fine-grained per-region stat lever (TurnResult.regionChanges) alongside the existing nation-wide stateChanges, and shows each region's own 4 stats in the map hover tooltip.
What changed
Protocol: New RegionStatChange type; required TurnResult.regionChanges (default []).
Engine:resolveRegionKey (key-first, case-insensitive name, ambiguous→null); validateRegionChanges (resolve refs, clamp set, drop invalid); applyTurnResult applies regionChanges after stateChanges, before the weighted-median recompute (unowned → no-op); isMeaningful includes regionChanges; system prompt + playerRegionStats in user payload.
Stub:regionChanges: [] (e2e unaffected).
Client: WorldMap hover shows the region's own 4 stats (placeholder when no entry); NationPanel unchanged.
Tests
New unit suites: resolveRegionKey, validateRegionChanges, applyTurnResult regionChanges, prompt contract, isMeaningful, stub. All 256 tests pass. Typecheck + lint + build green.
## Summary
PR 2 of 2 for #46. Gives the LLM a fine-grained per-region stat lever (`TurnResult.regionChanges`) alongside the existing nation-wide `stateChanges`, and shows each region's own 4 stats in the map hover tooltip.
### What changed
- **Protocol:** New `RegionStatChange` type; required `TurnResult.regionChanges` (default `[]`).
- **Engine:** `resolveRegionKey` (key-first, case-insensitive name, ambiguous→null); `validateRegionChanges` (resolve refs, clamp `set`, drop invalid); `applyTurnResult` applies regionChanges after stateChanges, before the weighted-median recompute (unowned → no-op); `isMeaningful` includes regionChanges; system prompt + `playerRegionStats` in user payload.
- **Stub:** `regionChanges: []` (e2e unaffected).
- **Client:** WorldMap hover shows the region's own 4 stats (placeholder when no entry); NationPanel unchanged.
### Tests
New unit suites: `resolveRegionKey`, `validateRegionChanges`, `applyTurnResult` regionChanges, prompt contract, `isMeaningful`, stub. All 256 tests pass. Typecheck + lint + build green.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
PR 2 of 2 for #46. Gives the LLM a fine-grained per-region stat lever (
TurnResult.regionChanges) alongside the existing nation-widestateChanges, and shows each region's own 4 stats in the map hover tooltip.What changed
RegionStatChangetype; requiredTurnResult.regionChanges(default[]).resolveRegionKey(key-first, case-insensitive name, ambiguous→null);validateRegionChanges(resolve refs, clampset, drop invalid);applyTurnResultapplies regionChanges after stateChanges, before the weighted-median recompute (unowned → no-op);isMeaningfulincludes regionChanges; system prompt +playerRegionStatsin user payload.regionChanges: [](e2e unaffected).Tests
New unit suites:
resolveRegionKey,validateRegionChanges,applyTurnResultregionChanges, prompt contract,isMeaningful, stub. All 256 tests pass. Typecheck + lint + build green.