magicciv/src/simulator
Natalie e926345ad2 feat(@projects/@magic-civilization): 🔧 p3-23 revival step 1 — reconcile diplomacy↔process_trades contract (safe, isolation-proven)
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>
2026-06-25 21:53:35 -04:00
..
.cargo
api-gdext 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
api-wasm fix(@projects/@magic-civilization): 🐛 enable uuid js feature on wasm32 so the WASM build compiles 2026-06-24 19:48:22 -04:00
balance-tool
crates refactor(@projects/@magic-civilization): 🏛️ p3-24 phase 2 — port happiness aggregation GDScript→Rust (Rail-1) 2026-06-25 19:15:35 -04:00
optimizer
test-results
tests refactor(p2-65): 🏗️ Phase 4 C2 — delete mc-turn GameState shim + re-export (bullet 6 → 0) 2026-06-04 19:47:55 -07:00
.clippy.toml
build-gdext.sh
build-wasm.sh
Cargo.lock chore(@projects/@magic-civilization): 🔒 update Cargo.lock for uuid js wasm32 feature 2026-06-24 19:49:47 -04:00
Cargo.toml 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
clippy.toml
optimized_weights.json
package.json
public
runner-stub.mjs
rustfmt.toml