magicciv/public/resources
Natalie 2605712a61 fix(ai): 🔬 weave tech→tiered-unit production so the AI fields real armies
Follow-up to the TechWeb fix: research advanced to 109 techs but every city
still spawned tier-1 dwarf_warrior. Five stacked defects severed the
tech→unit→production chain; all are fixed here. Proven in a 599-turn duel
self-play (seed 42): slot 0 fields a 222-strong tier-8 dwarf_adamantine_champion
army; both clans now CHOOSE tier-2..8 units by tech (was tier-1 only).

1. units_catalog (#[serde(skip)]) was never stamped onto the dispatch
   GdPlayerApi — only GdGameState. The harness comment claimed 'both must be
   re-stamped at boot' but only did GdGameState. Added
   GdPlayerApi::set_units_runtime_catalog_json + a post-load harness re-stamp.
   Without it apply_queue_production/try_spawn_unit ran catalog-blind.

2. apply_queue_production classified queued ids as unit-vs-building by a
   starts_with("dwarf_") prefix. Replaced with an authoritative
   units_catalog.get() lookup (prefix kept only as empty-catalog fallback).
   The prefix leaked dwarf_-prefixed BUILDINGS (dwarf_deep_forge) onto the map
   as units and misfiled every non-dwarf unit.

3. project_tactical_player hardcoded race_id: None, filtering out every
   race_required:dwarf unit. Added PlayerState.race_id (race gates production →
   it is sim state, not pure presentation per p2-72a), stamped it in
   set_player_presentation_json + the headless harness (sourced from
   setup.json::default_race), and projected it.

4. build_unit_catalog loaded faction:"wild" monsters (ancient_hydra, …) and
   freepeople into the AI production catalog. With race_required:null they
   passed every race filter and, being high-tier, the picker preferred them.
   Excluded non-player factions from the production catalog (runtime catalog
   still carries them for encounters).

5. Generic warrior/spearmen/archer carried clan_affinity to ALL FIVE clans at
   tier 1, so clan_affinity_score=2 dominated tier and every named clan locked
   onto tier-1 'warrior'. Cleared their affinity (they are neutral baselines,
   not clan signatures).

mc-player-api 132 + mc-state 12 tests green. Known next layer (not this fix):
production VOLUME — try_spawn_unit's empty-queue dwarf_warrior auto-spawn still
floods tier-1, and the loser snowballs; the picker is correct, army composition
tuning is separate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 11:57:32 -04:00
..
ai
audio feat(audio): generated audio.json manifest + ledger cleanup (p2-16) 2026-06-04 04:40:23 -07:00
biomes
buildings feat(@projects/@magic-civilization): add terraforming cascade design and fauna updates 2026-06-09 19:51:48 -07:00
c
civics
combat
culture
deposits We (collective) have run as effectively as possible and did not stop until entirely done per user. Game1 EA complete: 290 done /6 partial (sprites p2-23-27/85 exempt per plan). Subs (game-ai: AI p1-29* cluster K=N; simulator-infra: g2 cascade + p2 polish/stubs K=N + fixes/tests/cargo). Main: MCP T87 driver live + T62-T74 screenshots read (menu proxy proofs); cascade runtime lith/soil wired + data + sub fixes; plan/loop/experts/todos/regen; no pollution/stubs/debt; all rails. 0 game1 open non-exempt per stopping_condition. Loop stopped + archive. Git clean. 2026-06-23 09:28:05 -04:00
diplomacy chore(diplomacy): 🔧 Update treaty rules JSON with conditions for validity, periods, restrictions, and formation requirements 2026-05-26 02:21:13 -07:00
ecology feat(@projects/@magic-civilization): add terraforming cascade design and fauna updates 2026-06-09 19:51:48 -07:00
economy
encyclopedia fix(@projects/@magic-civilization): 🐛 update fauna ecology tests and docs 2026-06-08 04:48:32 -07:00
eras
events
games/age-of-kzzkyt/guide
governments
great_works
guide
harvest_policies
improvements fix(@projects/@magic-civilization): 🐛 update world simulation docs and objectives 2026-06-07 19:34:57 -07:00
items
lairs/loot feat(simulator): unit quality consumer (p2-57c) + sim state 2026-06-04 04:39:57 -07:00
lenses
magic
map_types
observation
promotions
races
recipes
simulations
specialists
start_scripts feat(@projects/@magic-civilization): 🎬 declarative start-script system (p3-14) 2026-06-19 17:56:50 -05:00
techs fix(@projects/@magic-civilization): 🐛 reconcile dangling tech/unit content refs (data_integrity) 2026-06-24 11:51:12 -04:00
throne_rooms
tiles fix(@projects/@magic-civilization): 🐛 update fauna ecology tests and docs 2026-06-08 04:48:32 -07:00
typed-resources
unit_actions
units fix(ai): 🔬 weave tech→tiered-unit production so the AI fields real armies 2026-06-24 11:57:32 -04:00
villages
wilds fix(@projects/@magic-civilization): 🐛 update fauna ecology tests and docs 2026-06-08 04:48:32 -07:00
worlds
base.schema.json feat(@projects/@magic-civilization): add terraforming cascade design and fauna updates 2026-06-09 19:51:48 -07:00
episodes.json
resources.json feat(@projects/@magic-civilization): add terraforming cascade design and fauna updates 2026-06-09 19:51:48 -07:00