feat(@projects/@magic-civilization): ✨ update combat_balance extraction status
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
4e0668e33e
commit
90bf14c649
1 changed files with 31 additions and 2 deletions
|
|
@ -182,10 +182,39 @@ Estimated: ~2 hours.
|
|||
|
||||
Pre-existing 1-day estimate did not account for either finding. Revised:
|
||||
|
||||
- Phase 0a — Resolve `CombatBalance` duplication (~2 hr).
|
||||
- Phase 0a — Resolve `CombatBalance` duplication (~2 hr). **✓ Done 2026-05-09.**
|
||||
- Phase 0b — Move `ScoringWeights` group to mc-core (~1-2 hr).
|
||||
- Phase 1-7 — Original mc-state extraction (~1 day).
|
||||
- **Total: 1.5-2 days of focused work.**
|
||||
- **Remaining: ~1 day of focused work.**
|
||||
|
||||
## Phase 0a — done 2026-05-09
|
||||
|
||||
Unified `CombatBalance` into `mc-core::combat_balance::CombatBalance`
|
||||
(8-field struct: 5 JSON-canonical + 3 mc-ai-internal scoring fields).
|
||||
|
||||
- New file: `src/simulator/crates/mc-core/src/combat_balance.rs`. Public
|
||||
re-export at `mc_core::CombatBalance` and `mc_core::parse_combat_balance`.
|
||||
- `src/simulator/crates/mc-turn/src/combat_balance.rs` now a thin shim:
|
||||
re-exports `mc_core::combat_balance::CombatBalance`, retains
|
||||
`load_combat_balance` wrapper that maps `serde_json::Error` →
|
||||
`crate::end_conditions::ConfigError`.
|
||||
- `src/simulator/crates/mc-ai/src/policy.rs` — local `CombatBalance` +
|
||||
`Default` impl deleted; `pub use mc_core::CombatBalance;` added at
|
||||
module head. `mc_ai::CombatBalance` re-export from `lib.rs` continues
|
||||
to work transparently (re-export of re-export).
|
||||
- **Default-value bug fix**: previous `mc-turn` defaults disagreed with
|
||||
the canonical `combat_balance.json` on three fields. Defaults now
|
||||
match JSON exactly: `denial_value_factor 0.5 → 0.6`,
|
||||
`capture_civilian_xp_award 25 → 0`,
|
||||
`destroy_civilian_xp_award_multiplier 0.5 → 1.0`. Production behaviour
|
||||
was already correct (JSON wins on load); this aligns the
|
||||
deserialise-from-empty / `::default()` path with canonical content.
|
||||
- Verification on apricot:
|
||||
- `cargo check -p mc-core -p mc-ai -p mc-turn` ✓ clean.
|
||||
- `cargo test -p mc-core combat_balance` — 4/4 ✓.
|
||||
- `cargo test -p mc-ai --test capture_scoring` — 8/8 ✓.
|
||||
- `cargo test -p mc-turn --test ransom` — 12/12 ✓.
|
||||
- `cargo test -p mc-turn --lib combat_balance` — 2/2 ✓.
|
||||
|
||||
Given the cross-cutting nature (touches mc-core, mc-ai, mc-turn,
|
||||
mc-balance, all consumer crates, both API surfaces, plus 5+ test files)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue