From c5062822ed61ad71fef1b3682ff9cb32505a401b Mon Sep 17 00:00:00 2001 From: Natalie Date: Thu, 14 May 2026 23:14:06 -0700 Subject: [PATCH] =?UTF-8?q?docs(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=85=20update=20playerstate=20priors=20acceptance=20criter?= =?UTF-8?q?ia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../p1-42b-playerstate-priors-plumbing.md | 48 +++++++++++++++++-- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/.project/objectives/p1-42b-playerstate-priors-plumbing.md b/.project/objectives/p1-42b-playerstate-priors-plumbing.md index 7ae0710c..1b70c645 100644 --- a/.project/objectives/p1-42b-playerstate-priors-plumbing.md +++ b/.project/objectives/p1-42b-playerstate-priors-plumbing.md @@ -2,7 +2,7 @@ id: p1-42b title: "Plumb per-personality building_category_weights + wonder_priorities through mc-turn PlayerState + GDScript bridge" priority: p2 -status: stub +status: done scope: game1 category: ai owner: warcouncil @@ -51,7 +51,45 @@ through to the Rust scorer. ## Acceptance -- [ ] `PlayerState` carries `building_category_weights` + `wonder_priorities`. -- [ ] `project_player` seeds `TacticalPlayerState::building_priors` from `PlayerState`, not `default()`. -- [ ] All 5 clan personality JSONs author non-neutral weights. -- [ ] `mc-ai/tests/personality_building_bias.rs` — identical city state, production-axis personality scores `forge` higher than `marketplace`; wealth-axis personality reverses. +- [x] `PlayerState` carries `building_category_weights` + `wonder_priorities`. + - Evidence: `src/simulator/crates/mc-turn/src/game_state.rs` — added + `pub building_priors: mc_ai::tactical::state::BuildingPriors` field + (wraps both maps in one struct, mirrors how the tactical state already + carries them). `#[serde(default)]` keeps pre-p1-42b saves loading. +- [x] `project_player` (i.e. `project_tactical_player`) seeds + `TacticalPlayerState::building_priors` from `PlayerState`, not `default()`. + - Evidence: `src/simulator/crates/mc-player-api/src/projection.rs:1158-1166` + now reads `player.building_priors.clone()` straight through. Covered by + `tactical_building_priors_round_trip_from_player_state` + + `tactical_building_priors_default_for_unstamped_player` (both pass on + apricot, see `cargo test -p mc-player-api --lib tactical_building_priors`). + - Bridge wiring: `api-gdext/src/lib.rs::set_player_personality_json` + now reads `building_category_weights` and `wonder_priorities` from the + personality JSON envelope and stamps them onto + `PlayerState::building_priors`. Absent keys reset to empty so re-stamping + can never leak a prior clan's priors. +- [x] All 5 clan personality JSONs author non-neutral weights. + - Evidence: `public/games/age-of-dwarves/data/ai_personalities.json` — + every clan (`ironhold`, `goldvein`, `blackhammer`, `deepforge`, + `runesmith`) now carries both `building_category_weights` (7 cats) and + `wonder_priorities` (clan-flavoured wonder picks). Schema accepts via + `additionalProperties: true`. JSON validates (`python3 -c "import json; ..."`). +- [x] `mc-ai/tests/personality_building_bias.rs` — identical city state, + production-axis personality scores `forge` higher than `marketplace`; + wealth-axis personality reverses. + - Evidence: new integration test at + `src/simulator/crates/mc-ai/tests/personality_building_bias.rs`. + Drives `decide_tactical_actions` end-to-end with neutral strategic + axes (isolating the priors path from the cycle-5 axis fall-through) + and a two-building catalog. Result on apricot: + ``` + running 2 tests + test empty_priors_fall_through_to_default_behaviour ... ok + test production_priors_pick_forge_wealth_priors_pick_marketplace ... ok + test result: ok. 2 passed; 0 failed + ``` +- [x] Headless regression check — `cargo test -p mc-turn --lib` (220 + passed), `cargo test -p mc-player-api --lib` (91 passed), `cargo test -p + mc-ai` (full suite green incl. `ultimate_lookahead_stress` + the new + `personality_building_bias`), `cargo check -p magic-civ-physics-gdext` + clean. No regressions touched.