docs(@projects/@magic-civilization): verify victory json parser tests

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-08 21:28:34 -07:00
parent 2fc602ef75
commit e747d9c7cb

View file

@ -39,7 +39,7 @@ The `GameOver { reason, winner }` event is fired by `mc-turn::end_conditions` (R
## Acceptance
- [x] **`mc-turn::end_conditions::GameOver` event** authored with `GameOverReason` enum (`LastSurvivor`, `ConditionMet { condition: VictoryType }`, `TurnLimit`, `Resigned { clan }`) and `winner: Option<ClanId>`. Fired from the turn-end pipeline via `TurnEvent::GameOver` in `events_emitted`. Unit tests: `LastSurvivor` fires when N-1 clans eliminated; `TurnLimit` fires when `turn >= turn_limit` and picks highest-score winner; `Resigned` fires on the player action. ✓ `cargo test -p mc-turn --test game_over_event` — 3/3 pass (`last_survivor_fires_when_one_alive`, `turn_limit_fires_at_max_turns`, `resigned_fires_on_player_action`). `VictoryConfig::turn_limit: Option<u32>` added (`#[serde(default)]`). `GameState::pending_resignations: BTreeSet<u8>` added. `TurnEvent::GameOver` variant added to `mc-replay::event` with string payload to avoid dep-inversion.
- [-] ◐ **`victory.json` + parser** — `victory.json` authored at `public/games/age-of-dwarves/data/victory.json` with all 6 Game-1 conditions (domination/economic/culture/science/city_count/score) and threshold values mirroring `mc-turn::victory::VictoryConfig` defaults (city_count=28, gold=60k, culture=600k, science_chain=6 techs ascending cost^1.4, turn_limit=500). Parser side: `VictoryConfig::default()` carries identical values; explicit JSON-load helper not yet wired (would supersede `Default` impl). Per-turn `check_victory_at_turn` already evaluates all 6 paths (`mc-turn/src/victory.rs:230-292`). Remaining: `evaluate_conditions(state) -> Option<GameOver>` typed wrapper + per-condition fires-under-crafted-inputs tests.
- [x] **`victory.json` + parser** — `victory.json` authored at `public/games/age-of-dwarves/data/victory.json` with all 6 Game-1 conditions (domination/economic/culture/science/city_count/score) and threshold values mirroring `mc-turn::victory::VictoryConfig` defaults (city_count=28, gold=60k, culture=600k, science_chain=6 techs ascending cost^1.4, turn_limit=500). `mc-turn::end_conditions::load_conditions(json) -> Result<VictoryConfig, ConfigError>` deserialises with `serde_json` and silently ignores `_doc`/`_conditions` advisory fields. ✓ `cargo test -p mc-turn --test victory_json` — 7/7 pass on apricot: `test_victory_json_loads_with_all_six_conditions` (verifies all field values from JSON match doc), plus 6 fires-under-crafted-inputs (`domination`, `economic`, `culture`, `science`, `city_count`, `score`).
- [x] **`awards.json` + `compute_awards`** — file authored with the eight awards from the design doc; `mc-replay::compute_awards(history, defs)` returns `Vec<AwardWinner { award_id, clan, value }>`. Tests: each award resolves correctly on a 50-turn fixture; ties broken deterministically (lowest `clan_id`). ✓ `cargo test -p mc-replay --test award_computation` — 2/2 pass (`compute_awards_returns_8`, `compute_awards_handles_ties`). `TurnSnapshot` widened: `buildings_built_total: u32`, `culture_total: f32`.
- [x] **`end_game_summary.gd` scene** — single scene skeleton at `src/game/engine/scenes/menus/end_game_summary.gd` with hero strip + four sections (standings, graph, awards, timeline) + five-button footer. Hero strip resolves via `ThemeVocabulary` (`endgame_banner_victory`, `endgame_banner_defeat`, `endgame_banner_gameover` + per-reason flavour keys). Awards section renders one card per `AwardWinner` from `_awards: Array[Dictionary]` passed via `setup()` — no award logic in GDScript (Rail-1). All five footer actions wired. `.tscn` not yet authored (requires godot-engine or godot-renderer); `_awards` population via GdReplayPlayer bridge pending GDExtension wiring. ✓ All strings via ThemeVocabulary. ✓ Rail-1 compliant.
- [ ] **All five footer actions wired**: