magicciv/src
Natalie 916dcda55d test(@projects/@magic-civilization): p3-23 revival step 4 — verify trade tile-sourcing; full pipeline end-to-end proven
Added the last missing link test: _collect_tradeable_resources against a real GameMap.

- test_collect_tradeable_resources_classifies_owned_tiles: builds a GameMap with
  iron_ore×2 (strategic) + silk (luxury) deposit tiles owned by a player, asserts
  _collect_tradeable_resources returns strategics=[iron_ore,iron_ore] (dups kept for
  the MIN_COPIES_TO_TRADE surplus rule) + luxuries=[silk]. Proves _serialize_players'
  real DataLoader-category tile sourcing. NB: DataLoader maps the "resources" category
  to the deposits/ dir — served strategic ids are iron_ore/horses, not "iron".
- before_all loads the theme (category lookups need DataLoader). GUT 749/0.

Full inter-player trade pipeline now GUT-proven link-by-link AND headless-proven live:
real tiles → _collect_tradeable_resources (step 4) → process_trades → ledger →
traded_luxuries/strategics (step 1) → strategic build access (step 3); gold sale →
gold_flow_for → net gold (pre-existing); integration runs every round in a live 25-turn
arena without aborting the loop (step 2). Gold flow no longer inert — process_turn now
populates GameState.trade_ledger_json each round.

Only remaining for done: the deal UI (diplomacy panel + wire trade_agreed). Stays partial.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 23:08:26 -04:00
..
game test(@projects/@magic-civilization): p3-23 revival step 4 — verify trade tile-sourcing; full pipeline end-to-end proven 2026-06-25 23:08:26 -04:00
packages
simulator feat(@projects/@magic-civilization): 🔧 p3-23 revival step 1 — reconcile diplomacy↔process_trades contract (safe, isolation-proven) 2026-06-25 21:53:35 -04:00