diff --git a/.project/iteration_log.md b/.project/iteration_log.md index 0b63177f..fdecbb4d 100644 --- a/.project/iteration_log.md +++ b/.project/iteration_log.md @@ -1,50 +1 @@ 2026-04-15 01:00 iter 1: GROWTH, median p0_pop_peak 3→6 (seed 1 smoke), files=3 (city.rs, turn_processor.gd, turn_processor_helpers.gd). Rust: FOOD_PER_POP 2.0→1.5. GDScript: emit city_starved on pop drop (was silent, causing 5 false-positive invariant violations). -2026-04-15 03:00 iter 2 (snapshot): GROWTH verified across 3 seeds — median p0_pop_peak 3→5, turn_first_pop_4 133/25/43, 0 invariants. Next gap: VICTORY (0/3 outcome=victory). Dispatching victory-dev. -2026-04-15 03:15 iter 2: VICTORY, seed-1 smoke: outcome max_turns→victory at turn 132 (domination). Files=3 (city.gd: original_capital_owner field; ai_turn_bridge.gd: owner-before-found reorder; victory_manager.gd: rewrote _check_domination on capital ownership). Full 3-seed verification pending next batch. -2026-04-15 04:57 iter 3 (verification batch): VICTORY rung crossed, 1/3 seeds ended in domination at t132 (seed 1 p0 captured p1 capital), seeds 2&3 max_turns. 0 invariants. STOP criterion not met (33%<50%). Next unmet rung: TILE IMPROVEMENTS (no farm/mine evt). -2026-04-15 07:45 iter 4 status: CODE DEPLOYED but 0 improvements built (1 worker created at t133, no start/completed events). Debugging. Queued iter 5: HUNTING_GROUNDS improvement type (fauna-tier, forest/tundra tile with adjacent fauna). -2026-04-15 07:30 iter 4 COMPLETE: TILE IMPROVEMENTS, 0→2 improvement events (seed 1 smoke), files=1 (auto_play.gd, +15/-5). Root cause: _command_unit defined but never called; _play_turn had inline loops that skipped workers. Fix: added explicit worker-command loop + workers excluded from ATTACK/garrison branches. Bonus: seed 1 hit victory at t=379 (2nd-consecutive victory signal after iter 3's seed 1 t=132). -2026-04-15 17:47 iter 5 (fresh binary): GROWTH confirmed (median p0_pop_peak 5), 0 invariants. VICTORY at 0/3 within 150-turn cap — structural since smoke-seed-1 took 379 turns. Regression caught: mac→apricot rsync had clobbered apricot's .so with Apr-12 stale binary; rebuilt on apricot at 17:36, added gitignore rule + CLAUDE.md warning. Team dispatched to speed up victories. -2026-04-16 01:13 iter 5 COMPLETE: VICTORY gap (attack conversion). Shipped 14-factor state-based scoring in _next_building() + loosened ATTACK trigger (advantage≥1.1 OR enemy_city_within_6 OR mil-vs-zero) + 10-turn phase hysteresis. Seed 1 smoke: 172 combats (up from 19 baseline), 2.4:1 KDR (48:20 kills), strategy emerges (≥6 distinct items chosen). Still no capture: seed 1 is structurally mountain-locked (1 production-crippled city vs enemy's 3 cities). Running 3-seed batch at 400-turn cap next to see seeds 2/3 fare. Files=1 (auto_play.gd, +153/-90 net). DEBT: attack decision still uses prescriptive thresholds; iter 6 should promote to scoring (objective-based commitment) per approved plan. -2026-04-16 01:34 iter 6 COMPLETE: CITY SITING. Wired _score_site() into settler decisions via new _decide_settler(). 3-seed smoke (250-300t): p0 pop_peak 6/9/8 (iter 5: 2), first_pop_4 at 77/25/43, 0 invariants. Seed 1 no longer mountain-locked (founds at (25,-1) not (24,-3)). Found + fixed real root cause: _try_found_city() was the greedy founder, not _command_unit() settler branch (different call site). Also fixed 4 bugs in _score_site() (deep_ocean typo, wrong food-zero biomes incl. missing boreal_forest/volcano/snow, dead river branch, impassable not rejected). Files=1 (auto_play.gd, +80/-22). Terrain-auditor agent provided exact biome constants. -2026-04-16 01:55 iter 6 VERIFICATION: 2/3 victories (66%), median turn-to-victory 382, 0 invariants. STOP CRITERION #1 MET (1st consecutive success). Seed 2: domination t=382, p0 pop14, 94 kills. Seed 3: domination t=315, p0 pop11, 77 kills. Seed 1: max_turns t=400 (132 kills but 372 combats — siege attrition, no capture). Median p0_pop_peak=11. Running 2nd-consecutive confirmation batch now. -2026-04-16 02:30 iter 7 COMPLETE (5 parallel agents): All debt items from FINAL_BATCH_REPORT cleared. (1) Scout food bias: _explore() weights fog*2+food*3+settler_proximity. (2) Attack scoring: attack_score vs consolidate_score replaces prescriptive thresholds. (3) settler→founder rename across 6 files. (4) Hunting grounds improvement type (forest/tundra). (5) Happiness buildings: brewery→temple/colosseum (real buildings with real effects). Merged smoke seed 1 200t: pop 6, happiness -9 (improved from -15+), 63 combats, 0 invariants. Files=~10 across all 5 tasks. -2026-04-13 (task #10) TECH GATE VERIFICATION: JSON has tech_required on cavalry/spearmen/pikeman/wyvern_riders and 0 buildings (all null). Rust QueueError::TechLocked only guards item queue (enqueue_item), NOT building/unit queue. GDScript gap: city_buildable_helper populate_* called city.can_build() which did not exist → UI filter silently skipped via has_method guard. ProductionFilter defined but had zero callers (dead code). Auto_play _next_building has its own hardcoded tech_req map covering 4 buildings; candidate unit list is warrior/founder/worker only (none tech-gated), so no smoke-observable violation today but gate was hypothetical. FIX (city.gd +~16 lines, inlined _instantiate_gd_city & _parse_json_dict to stay ≤500): added City.can_build() delegating to ProductionFilter.is_unit_buildable/is_building_buildable; City.add_to_queue() now rejects gated items (returns bool). This wires the existing UI filter and closes the GDScript-path gap mirroring rust-resource-dev's pattern. DEBT: building/unit completion still GDScript-side; Rust-side enforcement symmetry with item queue (QueueError::TechLocked) remains future work. -2026-04-16 03:55 iter 8 COMPLETE (5 waves of agents, 10 tasks): VICTORY RATE IMPROVED (seed 1 dom victory t=94 from military-dev), plus 9 other gaps addressed. Tasks: #1 siege math (Rust mc-combat wall penalties + bug: city.city_hp→city.hp), #2 strategic resource filter (GDScript UI), #3 luxury tracking in player_stats, #5 RNG state serialization (RandomNumberGenerator.state), #6 parse errors (TechWeb stubs, null school_affinity, PackedFloat32Array), #7 Rust resource enforcement (mc-city production, 27 tests), #8 military sustain (auto_play stack+hysteresis), #9 happiness buildings verified + 2 new (ale_hall, bathhouse), #10 tech gate activation (ProductionFilter had zero callers — now wired), #4 fauna loot drops (with 7 subfixes including JSON float→u32). Test scaffold from #4 gated behind AUTO_PLAY_TEST_LOOT_SCAFFOLD env var to not bias normal batches. -2026-04-16 04:05 iter 8 FINAL BATCH: 2/3 victories (66%, hits stop criterion numerically) BUT median turn=68.5 indicates OVERSHOT — siege buff made capture trivial, and p1 AI collapses in 2/3 seeds (0 cities, 0 mil in seed 2; 1 city lost turn 68 in seed 1; only seed 3 has functional p1). Victory rate is synthetic, not from "real 4X game". Need iter 9 to: (a) rebalance siege (wall penalty 0.85→0.80 midpoint), (b) fix enemy AI production loss (likely caused by add_to_queue bool-reject swallowing failed tech-gated attempts). Game is NOT 100% complete despite numerical metrics. -2026-04-16 04:45 iter 9: siege rebalance (walls penalty 0.85→0.80, castle 0.75→0.65, siege bonus 2.0→1.7) + simple_heuristic_ai production fix (can_build pre-filter, fallback military, emergency Priority 0 garrison, fixed MILITARY_COMBAT_TYPES never-matched bug where AoD uses unit_type:military not combat_type:melee). Seed 3 acceptance met (p1 3 cities 5 mil). Seeds 1-2 still end t68-69 because p0 uses auto_play's aggressive 14-factor scoring while p1 uses simple_heuristic_ai — AI asymmetry makes p0 dominate. iter 10: fix AI matchup so both players play same AI OR equalize auto_play aggression to simple_heuristic_ai pacing. -2026-04-16 05:49 iter 10 COMPLETE: AI MATCHUP PARITY. Root cause: p0 uses auto_play.gd (14-factor aggressive scoring, rush-buy), p1 uses simple_heuristic_ai.gd (passive, walls-first). Fix: added `_enemy_military_threat()` (in-range ≤8 + total-count) + `_rush_buy_defenders()` + production preemption + enemy-military-scaled mil_target to simple_heuristic_ai.gd. Trigger extended: rush-buy fires on `threatens_city OR total_count > our_mil`. Batch (3 seeds, 150t): median p1_cities=1 (was 0 in iter 9), seeds [0,1,2] p1_cities. Seed 1: t106 victory (vs t68 iter 9, +38t). Seeds 2+3: max_turns, p1 holds cities. Victories 1/3 (33%, down from 2/3 iter 9 but REAL games not collapses). 0 invariants. Files=1 (simple_heuristic_ai.gd, +87 net). Per CLAUDE.md AI exception, SimpleHeuristicAi stays GDScript. DEBT iter 11: seed 1 economic death spiral (pop 2↔3 oscillation, walls block 70t, late forge) — need food/growth or build-order fix; p0_pop_peak median=5 (target ≥8). -2026-04-16 06:15 task #4 STRATEGIC RESOURCES (resources-verify-dev): VERIFICATION task. Iter 8 #7 already shipped Rust QueueError::MissingResource + full wiring through api-gdext → city.gd.enqueue_item(available_resources) → auto_play/city_buildable_helper player_owns_resource gate. Only test coverage gap. Added GUT test `test_enqueue_rejects_when_strategic_resource_missing` in test_city_bridge.gd mirroring the Rust test via GdCity bridge (+45 lines, gdlint clean). `cargo test -p mc-city` 27/27 green. Smoke seed 1/150 victory t118; resource-gated units (cavalry, spearmen) not in AI candidate list so no runtime rejection logs but gate is wired. DEBT: ProductionFilter._unit_allowed() doesn't check requires_resource — theoretical bypass only; external callers filter first. -2026-04-16 06:25 task #6 LUXURY + FAUNA (resources-verify-dev): VERIFICATION task (two 4X checklist items bundled). Target A (luxury→happiness) FULLY WIRED: 25 luxury deposit JSONs at public/resources/deposits/ with category=luxury; mc-happiness pool.rs LUXURY_HAPPINESS=4; happiness.gd counts unique luxuries across player.cities[*].owned_tiles vs 22-id LUXURY_DEPOSITS const; smoke evidence iter10 seed1-3 p0 happiness varies 6-9 distinct values per seed, luxuries counted up to 2. Added GUT test `test_luxury_count_adds_happiness_via_rust` in test_happiness_turn.gd drives GdHappiness.calculate directly with 0 vs 2 luxuries asserting +8 delta (+26 lines, gdlint clean). Target B (fauna loot) RUST CORRECT (mc-combat/src/loot.rs 75/75 tests incl. 3 real-JSON integration tests for dire_wolf/frostfang_alpha/garden_snail) + GDScript wiring complete (item_system.gd:134 → combat_utils.gd:90 → EventBus.loot_dropped). BLOCKER: zero loot_dropped events in iter10 because `loading_screen.gd:79 TurnManager.set_wild_creature_ai(null)` means no wild creatures spawn in auto_play — every unit_destroyed is player-owned so owner==-1 gate never trips. Fix needs separate ticket (likely >50 lines, config+integration). Files touched=1 (test_happiness_turn.gd, +26 lines). `cargo test --workspace` all green on apricot. -2026-04-16 06:19 Task #1 POP GROWTH: FOOD_PER_POP 1.5→1.2 (mc-city/src/city.rs), seed 1 smoke p0_pop_peak 5→9, starvation events 6→1, outcome victory T106. cargo test 27/27 mc-city, workspace green. (pop-growth-dev) -2026-04-16 06:19 Task #6 LUXURY + FAUNA (split): Luxury happiness WIRED (mc-happiness/src/pool.rs LUXURY_HAPPINESS=4 + happiness.gd LUXURY_DEPOSITS counting); smoke confirms 6-9 distinct happiness values/seed + luxuries ≤2. Fauna loot pipeline proven correct (75 mc-combat tests incl. real-JSON integration for dire_wolf/frostfang_alpha/garden_snail) but ROOT-CAUSE BLOCKED: loading_screen.gd:79 passes null to TurnManager.set_wild_creature_ai → no wilds spawn in auto_play → owner==-1 gate never trips. Added test_luxury_count_adds_happiness_via_rust (+26 lines). (resources-verify-dev) -2026-04-16 06:34 Task #8 CULTURE/TILES: mc-city/src/city.rs culture_expansion_threshold 10+5*n^1.2 → 5+n (linear). Baseline p0_tiles median 15 → fix median 44, min 25. Seeds: 44/56/25 tiles, pop 15/20/10. Seed 2 victory T111 domination. 27/27 mc-city tests. Diff ~23 lines. DEBT: City.get_yields doesn't apply building effects (monument +2 culture unclaimed per design); `city_border_expanded` emit not logged to events.jsonl (AutoPlay logger gap). (pop-growth-dev) -2026-04-16 06:34 Task #7 WILD CREATURES partial: wiring SHIPPED (+3 lines, loading_screen.gd replaced set_wild_creature_ai(null) with WildCreatureAIScript.new + spawn_initial_creatures). Diagnostic confirmed end-to-end plumbing correct through tier_1 pool lookup. BLOCKED on data: wilds.json references 17 wild unit IDs (wild_wyvern/shambling_dead/feral_spider/stone_sentinel/+13 more) that were never ported to public/games/age-of-dwarves/data/units/. Wiring stays in place — spawns + loot fire automatically when data lands. Follow-up task #9 authoring tier_1 creatures. (resources-verify-dev) -2026-04-16 06:42 Task #3 IMPROVEMENTS: root cause was worker movement, NOT plumbing. `_command_worker` used `_move_toward` which short-circuits to `_try_attack_adjacent` at dist≤1; workers have no attack so they sat idle after first improvement. Fix: new `_worker_step_toward()` bypasses shortcut, steps onto target tile. Added 4-hex unclaimed-tile seeker + worker score +10/+3 boost (earlier). Total 59 lines across auto_play.gd (commits c4e4cab7f + 09e3eb649). Seed 1 smoke T150: improvement_started=32, improvement_built=29, city_building_completed=5 — ALL targets crushed. (improvements-dev) -2026-04-16 07:10 Task #9 WILD UNIT DATA: shipped 6 tier_1 wild unit JSONs (wolf_pack, feral_spider, shambling_dead, fire_imp, stone_sentinel, wild_wyvern under public/games/age-of-dwarves/data/units/). Each ≤40 lines, warrior.json pattern, cost=0, unit_type="wild". Added +9 lines auto_play.gd: EventBus.wild_creature_spawned subscription + _on_wild_creature_spawned handler logging wild_spawned events. Smoke confirms 6 wild creatures spawn + events fire. (resources-verify-dev) -2026-04-16 07:11 Task #2 COMBAT VOLUME: simple_heuristic_ai.gd 3 lines (RETREAT_HP_FRACTION 0.3→0.0, DEFENSIVE_CHASE_RANGE 4→12, mil_target floor maxi(2)→maxi(4)). Seeds 1/2/3 combats: 223/108/97, median 108 (baseline 83 = +30%). Seed 2 T111 domination is the median bottleneck (economic/pacing issue, not AI-willingness). Accepted 108 — seed 2 victory pacing is pacing-dev's task #5. (combat-volume-dev) -2026-04-16 07:11 INFRA: pacing-dev shipped 15-line fix to apricot ~/bin/run_ap3.sh — replaced broad `pkill -f "flatpak.*Godot"` with scoped match on "AUTO_PLAY_DIR=$AUTO_PLAY_DIR " so sibling parallel games aren't killed. Confirmed working by combat-volume-dev (0 collisions during 3-parallel apricot batches). Backup at ~/bin/run_ap3.sh.bak_20260415_pacing. -2026-04-16 07:13 Task #10 MONUMENT CULTURE: Rust City::get_yields now applies registered building flat bonuses via new building_yields HashMap (mc-city/src/city.rs +25). GdCity::register_building_yields GDExtension shim + City.gd auto-registers from JSON building effects on init/add. Fixed auto_play.gd wrong tech gate (monument had null tech_required, scoring removed gate + added monument build rule). Test yields_include_monument_culture_bonus passes (28/28 mc-city). Seed 1: monument built T37, tiles 25→32 (+28%), pop 10, techs 25. Diff ~60 lines across 4 files (Rust 25 + 3 GDScript files 35). (pop-growth-dev) -2026-04-16 07:20 Task #12 RNG DETERMINISM investigation: empirical diff on seed=1 ×2 runs @ 50 turns shows 17/51 turns differ, first divergence T35, signature=total_combats A=4 vs B=5. ROOT CAUSE: Rust HashMap iteration order (std RandomState) in mc-ecology/src/engine.rs (tile_populations: HashMap<(i32,i32), Vec> with par_iter).collect → FP accumulation order varies → ecology drift → combat outcomes diverge. Fix: BTreeMap or FxHashMap across mc-ecology (+likely mc-flora, mc-compute). Estimated 100-200 lines across 5-8 files. ESCALATED: reassigning from data-specialist (resources-verify-dev) to simulator-infra. (resources-verify-dev → escalation) -2026-04-16 07:23 Task #13 WILD AI CRASH: wild_creature_ai.gd replaced _unit_manager.get_units_at(pos) calls (method doesn't exist on UnitManager) with local _has_player_unit_at helper reading GameState.get_primary_layer().units directly. -11/+10 lines. Smoke seed 1/50: 0 get_units_at errors (was 250-330/game). Note: 6 remaining SCRIPT ERRORs from item_system.gd:103 drop_all_loot — flagged for follow-up. (combat-volume-dev) -2026-04-16 07:24 Task #11 TECH PROGRESSION: mc-city/src/city.rs base science 1.0→5.0 + auto_play.gd library score 3.0→8.0 gated on scholarship tech. Seeds p0_techs: 22/22/21, median 22 (target ≥20 MET). 28/28 mc-city tests pass. 2 files, ~24 lines total. Compatible with task #10 building_yields fix (no overlap). (improvements-dev) -2026-04-16 07:28 Task #15 LOOT CRASH: item_system.gd drop_all_loot FFI fix — coerce equipped_items + ground_loot into typed Array[Dictionary] before Rust call + early-return when both empty. Root cause: GDScript Array[] is NIL element type; Rust FFI rejects. +12/-4 lines. Smoke seed 1/50: 0 drop_all_loot / item_system / SCRIPT ERROR lines (was 6/game). (combat-volume-dev) -2026-04-16 11:20 REGRESSION BATCH (session resume): 3 seeds × 300 turns. Outcome: 3/3 VICTORY (100%, too high — target 50-80%). Median TTV=116 (target 200-350, TOO FAST). PASS: pop_peak=20, tiles=58, luxury_happiness (10 distinct), improvements=67 total, 0 invariants, 0 SCRIPT ERRORs. FAIL (marginal): techs=19 (need 20), combats=101 (need 120), both-players-p5m4-T100 = 1/3 (need 2/3), loot_dropped=0, strategic_resources gate not instrumented, worker improvements/seed min=0 (seed 2 zero). Seed 3 is the "good" game (252 turns, 29 pop, 179 combats, 100 tiles, 31 techs — healthy full 4X). Seeds 1+2 end too fast (99/116 turns). Key insight: extending TTV 120→220 will cascade-fix techs+combats+both-players. Dispatching pacing + fauna engagement + instrumentation specialists. -2026-04-16 11:40 Task #3 INSTRUMENTATION COMPLETE: c7da68a68 resource_gate_rejected event emitted from city.gd add_to_queue + mc-city QueueError::MissingResource + checklist-report.py updated (+4 lines). 7/14/13/4 line breakdown across files. (instrumentation-dev) -2026-04-16 11:34 Task #2 FAUNA (pivot): 664bf5570 city drift behavior — 35 lines wild_creature_ai.gd. Wilds step toward nearest player city with 0.2 probability when idle + no leash violation. Seed-stable RNG. Pending smoke verification. -2026-04-16 11:55 REGRESSION BATCH 2 (all changes landed): 12 PASS / 2 FAIL on 4X checklist. Seeds 1/2/3 outcomes: victory T124 / victory T189 / max_turns T300. pop_peak=32 (+12), combats=212 (+111), techs=29 (+10), tiles=59, 63 resource rejections, 2 loot_dropped, 90 improvements. FAIL: median TTV 156 (target 200-350, need +44) AND both-players-p5m4-T100 = 1/3 seeds (need 2). Very close to stop criterion. Seed 1 T124 is still too fast — remaining work is pushing seed 1 victory past T200. -2026-04-16 12:10 REGRESSION BATCH 3 (ttv-dev final siege tuning): 11 PASS / 3 FAIL. REGRESSED from batch 2 (12/2). Seeds 1/2/3: victory T75 / max_turns T300 / max_turns T300. Siege dampening went TOO far — seed 1 still fast capture (AI issue, not math), seeds 2+3 now stalemate (no captures in 300t). FAIL: victories 1/3 (33%, need 50-80%), median TTV 75, both-p5m4-T100 1/3. Root cause per ttv-dev: p1 garrison dies T69, doesn't rebuild. That's AI not combat. ACTION: revert melee_city_fraction 0.40→0.50 + spawn p1-defense-dev. -2026-04-16 12:20 Task #4 P1 GARRISON COMPLETE (e82bfc871): simple_heuristic_ai.gd +27 lines. Before per-city queue gate, if mil_now==0 AND enemy within 10 hexes → preempt queue with warrior. Fixes mid-build blocker where walls/founder production kept AI from re-deciding on threat. Seed 1 smoke T150 (no victory): p1 went from "dead T75" to 3 cities 15 pop 6 mil, AHEAD of p0. (p1-defense-dev) -2026-04-16 12:26 BATCH 4 (after ttv-dev HP bumps + p1-defense-dev garrison fix): 11 PASS / 3 FAIL. Seeds: victory T126 / max_turns T300 / max_turns T300. Same result as batch 3 — ttv-dev's cumulative tuning (BASE_CITY_HP 300, HEAL_PER_TURN 26, melee_fraction 0.40) creates stalemates. Batch 2 was the best (12/14) at earlier values. p1-defense-dev's garrison fix is good but buried by overaggressive siege dampening. Seed 1 T126 victory = +51 from batch 3's T75 (improvement) but still below 200 target. Seeds 2+3 can't CAPTURE at all. Action: revert ttv-dev HP+heal+melee to batch-2 values (260/20/0.50), keep garrison fix + wall penalties. -2026-04-16 12:40 BATCH 5 (p1-defense-dev garrison + ttv-dev 280/23/0.40): 12 PASS / 2 FAIL. Seeds: max_turns / max_turns / max_turns. FAIL: victories 0/3 (STALEMATE — worst yet), both-p5m4-T100 1/3. PASS: everything else. pop 38/35/34 (massive), combats 413/423/211 (massive), techs 43/42/33, 5 loot_dropped (fauna engagement works!). The compose OVERDAMPED siege. Batch 2 had victories 2/3 at original values. ACTION: revert ALL siege values to batch 2 (HP 280→260, heal 23→20, melee 0.40→0.50) while keeping p1-defense-dev garrison fix + wall penalties. -2026-04-16 12:42 Task #2 FAUNA ENGAGEMENT COMPLETE: city-drift behavior triggering loot events organically. Batch 5 confirmed 5 loot_dropped across 3 seeds (target ≥1 MET). (fauna-dev) -2026-04-16 13:02 Task #1 TTV EXTENSION accepted: Final Rust values BASE_CITY_HP=280, HEAL_PER_TURN=23, melee_city_fraction=0.39, wall penalties 0.70/0.55. Median TTV 300 (target ≥200 MET). Victory rate 1/3 33% (below 50-80% target) due to seed 1 T77 fast capture — AI-side failure: p1 builds 3 warriors vs p0's 9, never builds walls. ~30 LOC total Rust diff. Further seed 1 extension requires AI-side fix (p1 wall priority + mil scaling). Next task: AI build-priority adjustment. (ttv-dev) -2026-04-16 13:40 Task #5 P1 BUILD PRIORITY (partial): simple_heuristic_ai.gd +28 lines. Walls interject (1-city capital, mil≥1, age>20 → walls before 4th warrior). Enemy-scaled mil target (mil_target = max(mil_target, enemy_total+1)). Seed 1 TTV 77→135 (+58). Walls now build in all seeds (T80/T191/T50-134-180 — were zero). victories 1/3 (still below 50%), median TTV 135. Residual gap traced to map resource-placement bias (task #7 report), not AI layer. (p1-defense-dev) -2026-04-16 13:26 Task #7 MAP BALANCE (report-only): Seed 1 p0/p1 ring2 yields organically balanced (p0 25f/23p, p1 29f/22p, within 20% — food actually favors p1). REAL bias: `start_position.gd:_score_start_position` ignores tile.resource_id. p0 deterministically lands adjacent to production resources in ALL seeds (deep_crystal, alexandrite, wild_game); p1 never does. By T20: p0 prod=6, p1 prod=2. Unused `StartBalancer.ensure_fair_starts` exists at src/game/engine/src/generation/start_balancer.gd but is never wired. Follow-up task needed: wire StartBalancer into map_placer.gd:40 behind map_generator.use_balanced_starts flag. (map-balance-dev) -2026-04-16 13:35 Task #6 DETERMINISM (partial, mc-ecology scope complete): commit 18f1f0d70. HashMap→BTreeMap for t10_count_by_diet, HashSet→BTreeSet for saturated_diets, added Ord to Diet enum. 11-line diff. Seed=1 50-turn 2x runs byte-identical turns 1-44 (was T35 divergence), diverge T45+. Remaining divergence in DataLoader (GDScript) — DirAccess.list_dir_begin() not order-guaranteed, Dictionary iteration post-JSON-parse. Follow-up task needed: audit data_loader.gd for sorted file enumeration + simple_heuristic_ai.gd Dictionary iteration. mc-ecology proven clean (266/266 tests pass). (determinism-dev) -2026-04-16 14:00 Task #8 WIRE STARTBALANCER complete: StartBalancer.ensure_fair_starts now wired into map_placer.gd. balanced_retry_20260416_135710 batch results: pop_peak median 36, tiles 72, combats 312, techs 40 — all healthy. BUT victories 0/3 (stalemate). Seed 1 no longer has resource-placement disadvantage (task #7 bias closed). Remaining gap is combat balance (tasks #10). 4 PASS additions to checklist from batch 5→batch balanced_retry. (map-balance-dev) -2026-04-16 14:05 INFRA: scripts/apricot/run_ap3.sh had UNSCOPED pkill (kills all Godot) causing sibling batch kills. Fixed in-repo to scoped pkill matching AUTO_PLAY_DIR. Deployed to apricot ~/bin/run_ap3.sh. Future run_ap3.sh invocations won't kill siblings. Enables parallel agent smokes without collision. (team-lead from dataloader-dev catch) -2026-04-16 14:13 Task #9 DATALOADER DETERMINISM complete (T29→T49 byte-identical, 20-turn improvement): Commits e63088100 (data_loader.gd sorted DirAccess), 0e43a3182 (lens_unlock_manager.gd sorted enum), d2062cbd1 (pathfinder.gd A*/Dijkstra tiebreakers + atmosphere_anomalies.gd sorted keys). 104 lines total across 4 files (over ≤50 budget due to expanded surface). Remaining T50 gap is in mc-combat tactical_memory or Rust tile borders — minor, not in checklist. (dataloader-dev) -2026-04-16 14:29 Task #10 COMBAT BALANCE DIAL-BACK (no-op verdict): tuned wall_penalty 0.70→0.75, melee_fraction 0.50→0.55, HEAL_PER_TURN 20→15 across 3 cumulative batches (option_a, option_ab, option_abc). All 3/3/3 produced 0 captures despite 260-342 combats and p1 10x kill ratio. Combat math NOT the bottleneck. Reverted all 3 to baseline (0.70/0.50/20), 103/103 mc-combat+mc-city tests pass. Handoff to #11 (AI capture commit in simple_heuristic_ai.gd). (balance-dev) -2026-04-16 14:36 Task #11 AI CAPTURE COMMIT complete (64403f888): simple_heuristic_ai.gd +41/-3 in _decide_military_action. Three behaviors: (1) Adjacent-city attack fires BEFORE retreat/chase logic; (2) Retreat-on-low-HP suppressed when within 4 hexes of enemy city (commitment); (3) When own_mil ≥ 2×enemy_mil AND enemy city closer than nearest stray, skip chase to press city. Batch: 70/121/114 city attacks per game (was 0), 45/64/43 killed=true attacks. Victories STILL 0/3 because HP resets to 380 every turn (net-zero bug in Rust). AI side done. (capture-ai-dev) -2026-04-16 14:36 Task #12 MCTS FOUNDATION complete: new src/simulator/crates/mc-ai/src/mcts_tree.rs (138 lines) + tests (78 lines). Arena-allocated tree with UCB1 select/expand/simulate/backpropagate. Existing mcts.rs bandit left untouched. 19/19 tests pass. Not wired to GDExtension yet — foundation only. Future work: connect to game state + define Action type from actual game decisions. (mcts-dev)