diff --git a/.mcp.json b/.mcp.json index 22b14ba2..28719516 100644 --- a/.mcp.json +++ b/.mcp.json @@ -1,11 +1,8 @@ { "mcpServers": { "objectives": { - "command": "node", - "args": ["/var/home/lilith/Code/@packages/@ts/@mcp/mcp-objectives/dist/index.js"], - "env": { - "PROJECT_ROOT": "/var/home/lilith/Code/@projects/@magic-civilization" - } + "command": "/opt/homebrew/bin/mcp-objectives", + "args": [] } } } diff --git a/.project/objectives/p0-33-world-map-input-and-panel-wiring.md b/.project/objectives/p0-33-world-map-input-and-panel-wiring.md index ffa2eb85..0d33b2a5 100644 --- a/.project/objectives/p0-33-world-map-input-and-panel-wiring.md +++ b/.project/objectives/p0-33-world-map-input-and-panel-wiring.md @@ -5,7 +5,7 @@ priority: p0 scope: game1 owner: wireguard status: partial -updated_at: 2026-04-18 +updated_at: 2026-04-19 evidence: - src/game/engine/scenes/world_map/world_map.tscn - src/game/engine/scenes/world_map/world_map.gd @@ -34,14 +34,14 @@ The world-map is unplayable because basic interaction is broken: clicking a unit ## Acceptance -- ✓ Tutorial dim `ColorRect` no longer blocks mouse input — `tutorial_overlay.gd:86` is now `MOUSE_FILTER_PASS`. -- ✓ Clicking a player unit selects it; `unit_panel.tscn` listens on `EventBus.unit_selected` and renders name/stats + action buttons (Move/Fortify/Skip/FoundCity/BuildImprovement). World-map instantiates the panel in `world_map.tscn:UnitPanelLayer` and wires the action signals in `world_map.gd:_connect_signals`. -- ✓ Single-click on a city hex now opens the city screen via `world_map.gd:_open_city_at_axial`. Bombard removed from single-click path (was `_handle_hex_click` lines ~350-358; now only the legacy `_bombard_city != null` branch remains and no code path arms it from a single click). -- ✓ Pressing ESC with no panel open opens the in-game menu — `main.gd:_unhandled_key_input` handles ESC (already correct, audited). -- ✓ Pressing F10 at any time opens the in-game menu — added `KEY_F10` branch in `main.gd:_unhandled_key_input`. -- ✓ Pressing ESC while the city screen is open closes it — added `_unhandled_key_input` to `city_screen.gd` that calls `_on_close_pressed` when visible. -- ✓ Pressing ESC while the tech tree or chronicle is open closes it — `world_map.gd:_handle_escape_key` (refactored from `_handle_hotkeys`). -- ◻ The in-game menu closes on ESC — pre-existing behavior in `ingame_menu.tscn`; not modified by this objective. Needs proof-screenshot confirmation. +- ✓ Tutorial dim `ColorRect` no longer blocks mouse input — `tutorial_overlay.gd:86` is now `MOUSE_FILTER_PASS`. (code-verified 2026-04-19) +- ✓ Clicking a player unit selects it; `unit_panel.tscn` listens on `EventBus.unit_selected` and renders name/stats + action buttons (Move/Fortify/Skip/FoundCity/BuildImprovement). World-map instantiates the panel in `world_map.tscn:UnitPanelLayer` and wires the action signals in `world_map.gd:_connect_signals`. (code-verified 2026-04-19) +- ✓ Single-click on a city hex now opens the city screen via `world_map.gd:_open_city_at_axial`. Bombard removed from single-click path (was `_handle_hex_click` lines ~350-358; now only the legacy `_bombard_city != null` branch remains and no code path arms it from a single click). (code-verified 2026-04-19) +- ✓ Pressing ESC with no panel open opens the in-game menu — `main.gd:_unhandled_key_input` handles ESC (already correct, audited). (code-verified 2026-04-19) +- ✓ Pressing F10 at any time opens the in-game menu — added `KEY_F10` branch in `main.gd:_unhandled_key_input` lines 153-158. (code-verified 2026-04-19) +- ✓ Pressing ESC while the city screen is open closes it — added `_unhandled_key_input` to `city_screen.gd:375` that calls `_on_close_pressed` when visible. (code-verified 2026-04-19) +- ✓ Pressing ESC while the tech tree or chronicle is open closes it — `world_map.gd:_handle_escape_key` (refactored from `_handle_hotkeys`). (code-verified 2026-04-19) +- ◻ The in-game menu closes on ESC — pre-existing behavior in `ingame_menu.tscn`; not modified by this objective. Needs proof-screenshot confirmation. (proof scene exists; screenshot pending apricot run) ## Remaining to reach done diff --git a/.project/objectives/p0-38-mcts-personality-priors.md b/.project/objectives/p0-38-mcts-personality-priors.md index 21e3f65a..a7d0a028 100644 --- a/.project/objectives/p0-38-mcts-personality-priors.md +++ b/.project/objectives/p0-38-mcts-personality-priors.md @@ -5,7 +5,7 @@ priority: p0 status: partial scope: game1 owner: warcouncil -updated_at: 2026-04-18 +updated_at: 2026-04-19 evidence: - src/simulator/crates/mc-ai/src/mcts_tree.rs - src/simulator/crates/mc-ai/src/evaluator.rs diff --git a/src/simulator/api-gdext/src/ai.rs b/src/simulator/api-gdext/src/ai.rs index 1e74b086..d0d184d8 100644 --- a/src/simulator/api-gdext/src/ai.rs +++ b/src/simulator/api-gdext/src/ai.rs @@ -39,11 +39,11 @@ pub struct GdMcTreeController { gpu_enabled: bool, /// When true, Trees use PUCT selection with per-node priors instead of /// classical UCB1 (p0-38). Toggled by `set_priors_enabled` (driven by - /// `AI_MCTS_PRIORS` env). Default `false` preserves UCB1. Priors only - /// bite when the underlying `TreeState` overrides `action_prior`; - /// `GameRolloutState` does (softmax over personality utility); - /// `McSnapshot` currently does not (returns uniform 1.0 → PUCT reduces - /// to UCB1-equivalent ordering). + /// `AI_MCTS_PRIORS` env). Default `true`; set `AI_MCTS_PRIORS=false` to + /// revert to UCB1. Priors only bite when the underlying `TreeState` + /// overrides `action_prior`; `GameRolloutState` does (softmax over + /// personality utility); `McSnapshot` currently does not (uniform 1.0 → + /// PUCT reduces to UCB1-equivalent ordering). priors_enabled: bool, base: Base, } @@ -59,9 +59,9 @@ impl IRefCounted for GdMcTreeController { std::env::var("AI_GPU_ROLLOUT").as_deref(), Ok("1") | Ok("true") | Ok("TRUE") | Ok("True") ); - let priors_enabled = matches!( + let priors_enabled = !matches!( std::env::var("AI_MCTS_PRIORS").as_deref(), - Ok("1") | Ok("true") | Ok("TRUE") | Ok("True") + Ok("0") | Ok("false") | Ok("FALSE") | Ok("False") ); Self { rollout_budget: 1000, @@ -115,7 +115,7 @@ impl GdMcTreeController { /// Enable or disable PUCT selection with per-node priors (p0-38). /// Toggled by `ai_turn_bridge.gd` based on the `AI_MCTS_PRIORS` env. - /// Default `false` preserves classical UCB1 behavior. + /// Default `true`; set `AI_MCTS_PRIORS=false` to revert to UCB1. /// /// Effect is bounded by the underlying TreeState: `GameRolloutState` /// provides personality-softmax priors, but the current `McSnapshot` diff --git a/src/simulator/crates/mc-ai/src/mcts_tree.rs b/src/simulator/crates/mc-ai/src/mcts_tree.rs index a0615e51..983cbca4 100644 --- a/src/simulator/crates/mc-ai/src/mcts_tree.rs +++ b/src/simulator/crates/mc-ai/src/mcts_tree.rs @@ -106,8 +106,7 @@ pub struct Tree { /// (`Q + c_puct * P * sqrt(N_parent) / (1 + N_child)`) with per-node /// priors populated at expansion time from `TreeState::action_prior`. /// When `false`, selection uses classical UCB1 and the `prior` field is - /// ignored. Default `false` preserves existing behavior until callers - /// opt in (p0-38). + /// ignored. Default `true`; set `AI_MCTS_PRIORS=false` to revert to UCB1. pub use_priors: bool, /// Maximum simulated turns walked per rollout. Passed into /// `TreeState::rollout`. Defaults to `rollout::DEFAULT_ROLLOUT_HORIZON`. @@ -143,7 +142,7 @@ impl Tree { nodes: vec![Node::new(root_state, None, None)], exploration_constant: std::f32::consts::SQRT_2, c_puct: std::f32::consts::SQRT_2, - use_priors: false, + use_priors: true, rollout_horizon: crate::rollout::DEFAULT_ROLLOUT_HORIZON, rollout_temperature: crate::rollout::DEFAULT_ROLLOUT_TEMPERATURE, root_player: 0, diff --git a/tooling/claude/dot-claude/settings.json b/tooling/claude/dot-claude/settings.json index 2e5e77d2..b2e8fba6 100644 --- a/tooling/claude/dot-claude/settings.json +++ b/tooling/claude/dot-claude/settings.json @@ -1,4 +1,5 @@ { + "enableAllProjectMcpServers": true, "hooks": { "PreToolUse": [ {