Owner greenlit "revive carefully". First safe step: make diplomacy.gd's contract
correct and prove it works in isolation, WITHOUT enabling the turn-loop call.
- diplomacy.gd now matches the current GdTrade.process_trades {ledger} contract:
_serialize_players emits the PlayerTradeInput shape (player_index, tile_luxuries,
tile_strategics, trade_willingness), sourcing each player's controlled luxuries +
strategics from owned tiles classified by resource `category`; process_turn reads
result["ledger"], stores it, and _apply_ledger_resources fans the ledger's
incoming_luxuries/incoming_strategics onto each player (buyer gains the resource).
- Removed the dead _apply_trade_changes/_apply_relation_changes (they matched an old
contract that returned new_trades/relation_changes; process_trades returns {ledger}).
- player.gd gains traded_strategics (field + serialize/deserialize); _clear_pair_luxuries
clears it on war. GdTradeLedger.incoming_luxuries #[func] added (mirrors incoming_strategics).
- test_diplomacy.gd: replaced the 4 stale _apply_trade_changes tests with ledger-based
tests, incl. a full round-trip (PlayerTradeInput JSON → process_trades → ledger →
_apply_ledger_resources → buyers gain wine/horses/silk/iron).
Verified: cargo check gdext; dylib rebuilt; canonical GUT 746/0 (both new tests pass).
Turn-loop call REMAINS disabled (next step enables it carefully). p3-23 stays partial.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>