magicciv/src
Natalie 8a5fb9e8f3 refactor(@projects/@magic-civilization): ♻️ canonical Rust building-catalog transform (single source of truth)
The building effects→yield aggregation existed only in GDScript
(ai_turn_bridge_state.gd::build_building_catalog), and the mc-player-api bench
kept a third hand-written copy of the resulting TacticalBuildingSpec literals
(fixed costs/yields/gates) that drifted from public/resources/buildings/*.json.

Add `mc_ai::tactical::parse_building_catalog` as the ONE Rust implementation of
the transform: parses authored building docs (object or array shape), aggregating
each `effects[]` entry into the scalar yield fields with the exact same
effect-type→field mapping the GDScript builder uses (food/production/gold|trade/
science|research/culture/defense|city_hp|wall_hp/happiness, gpp_*/great_work_slots_*
prefixes). Empty gate strings → None; missing tier → 1. Unit-tested.

The bench `build_building_catalog` now loads granary/forge/library/walls straight
from the canonical JSON through this transform — no hand-maintained specs, can't
drift. (granary is correctly tech-gated by husbandry now.) The engine bridge can
adopt the same fn to retire the GDScript copy — follow-up.

mc-ai + mc-player-api green: 547/0, incl. 3 new parser tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 22:34:17 -04:00
..
game test(@projects/@magic-civilization): 🐛 install encounter rates + reframe militarist gold assertion 2026-06-24 12:02:38 -04:00
packages
simulator refactor(@projects/@magic-civilization): ♻️ canonical Rust building-catalog transform (single source of truth) 2026-06-24 22:34:17 -04:00