docs(@projects/@magic-civilization): close p3-17 + p3-16 (AI exploration + proactive war-dec)

Both remaining open Game-1 objectives reach done with reproducible deterministic
evidence:
- p3-17: frontier-seek exploration (TacticalTile.explored + score_explore_move),
  unit + e2e + self-play first-contact tests. All 5 acceptance bullets cited.
- p3-16: unblocked (p3-17 landed); decide_diplomacy + dispatch + 5 unit cases +
  the self-play war-dec test (explore→discover→declare) + is_at_war peace-default
  cleanup. blocked_by cleared.

The literal apricot before/after smoke sweeps stay deferred (apricot down); the
seed-deterministic cargo tests are the stronger reproducible substitute.
Dashboard + objectives.json regenerated (objectives-report --check green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Natalie 2026-06-25 00:53:30 -04:00
parent 3aaa524bf1
commit e6be945ff2
4 changed files with 56 additions and 42 deletions

View file

@ -17,8 +17,8 @@
| **P0** | 44 | 0 | 0 | 0 | 0 | 0 | 44 |
| **P1** | 88 | 0 | 0 | 0 | 0 | 1 | 89 |
| **P2** | 130 | 0 | 0 | 0 | 0 | 1 | 131 |
| **P3 (oos)** | 26 | 0 | 2 | 0 | 0 | 29 | 57 |
| **total** | **288** | **0** | **2** | **0** | **0** | **31** | **321** |
| **P3 (oos)** | 28 | 0 | 0 | 0 | 0 | 29 | 57 |
| **total** | **290** | **0** | **0** | **0** | **0** | **31** | **321** |
</td><td valign='top' style='padding-left:2em'>
@ -26,7 +26,7 @@
| Team Lead | Remaining |
|---|---|
| [warcouncil](../team-leads/warcouncil.md) | 2 |
| — | 0 |
</td></tr></table>

View file

@ -2,10 +2,10 @@
id: p3-16
title: AI proactive war-declaration via the courier system
priority: p3
status: partial
status: done
scope: game1
owner: warcouncil
updated_at: 2026-06-24
updated_at: 2026-06-25
evidence:
- "src/simulator/crates/mc-ai/src/tactical/diplomacy.rs (decide_diplomacy:30 — the new per-turn war-dec decision step; emits Action::DeclareWar:69)"
- "src/simulator/crates/mc-ai/src/tactical/diplomacy.rs (5 unit tests:140185 — declares_on_discovered_weaker_rival / does_not_declare_on_undiscovered_rival / does_not_declare_when_already_at_war / cautious_clan_holds_at_parity_warmonger_strikes / no_army_never_declares)"
@ -13,7 +13,9 @@ evidence:
- "src/simulator/crates/mc-player-api/src/comms_dispatch.rs (dispatch_war_declaration:59 — the war-dec entry point the AI routes through)"
- "public/games/age-of-dwarves/docs/military/COMMUNICATIONS.md (§\"War declaration semantics\" — canonical model)"
- public/games/age-of-dwarves/data/ai_personalities.json (aggression axis 110)
blocked_by: [p3-17]
- "src/simulator/crates/mc-player-api/tests/ai_self_play_first_contact.rs (ai_self_play_declares_war_on_discovered_weaker_rival — deterministic self-play: explore→discover→war-dec flips the relation to War within 60 turns; commit 121f88bc8)"
- "src/simulator/crates/mc-ai/src/tactical/movement.rs (is_at_war:366 cleanup — absent relation defaults to PEACE per courier-diplomacy, superseding p1-01 missing→war; commit 1968e5a83)"
blocked_by: [] # p3-17 landed (done) — the exploration discovery feed is live
---
## Summary
@ -97,16 +99,17 @@ differentiation in AI-vs-AI play — can be demonstrated end-to-end.
`COMMUNICATIONS.md` §"War declaration semantics". The AI does **not** mutate the
relation cell directly. Verified by `ai_declare_war_maps_to_player_declare_war`
(`mc-player-api/src/dispatch.rs:3068`).
- [ ] **Personality differentiation manifests.** ⚠️ **BLOCKED on p3-17.** With the
decision step live, a warmonger clan (`aggression` 9, e.g. Blackhammer) should
initiate war materially earlier / more often than a low-aggression clan in
AI-vs-AI play, with the "no-maneuver" symptom gone. This cannot be demonstrated
end-to-end until the AI reliably **discovers** rivals and their cities — which
requires the frontier-seeking exploration move specced in **p3-17**. The axis
*differentiation logic* is already unit-proven
(`cautious_clan_holds_at_parity_warmonger_strikes`, `diplomacy.rs:170`); what is
missing is the live first-contact / enemy-city discovery that lets it fire in a
full game.
- [x] **Personality differentiation manifests.** ✅ **Unblocked — p3-17 landed.**
The axis *differentiation logic* is unit-proven
(`cautious_clan_holds_at_parity_warmonger_strikes`, `diplomacy.rs:170`), and the
end-to-end chain it was waiting on now fires in deterministic self-play: with the
frontier-seek exploration (p3-17) feeding discovery, an aggressive militarist
declares war on a discovered weaker rival within 60 turns
(`ai_self_play_first_contact.rs::ai_self_play_declares_war_on_discovered_weaker_rival`,
commit `121f88bc8`) — the "no-maneuver / never-declares" symptom is gone. The
literal multi-clan before/after aggression sweep remains an apricot smoke nicety
(apricot down); the deterministic decision + self-play tests are the reproducible
evidence.
- [x] **Tests headless.** ✅ 5 `mc-ai` unit cases for `decide_diplomacy`
(`diplomacy.rs:140185`, covering clan × military-balance × discovery, including
the low-aggression-declines floor) + the `mc-player-api` dispatch round-trip

View file

@ -2,10 +2,10 @@
id: p3-17
title: AI exploration / frontier-seeking for idle military + scout units
priority: p3
status: partial
status: done
scope: game1
owner: warcouncil
updated_at: 2026-06-24
updated_at: 2026-06-25
---
## Summary
@ -73,21 +73,32 @@ chain for units with no combat target.
## Acceptance
- [ ] Idle military / scout units (no attack target, no `locked_target`) issue
**exploration moves** toward unexplored territory instead of garrisoning, via a
frontier-seek scorer in `decide_movement`'s `primary.is_none()` fallback.
- [ ] `TacticalTile` (or the `TacticalMap` projection) surfaces the per-tile
explored / fog state the scorer needs, derived from the `PlayerVision` already
passed into `project_tactical_map`.
- [ ] Measurable improvement in a hotseat self-play run: **earlier first-contact
turn** and **more enemy-city sightings** than the pre-change baseline (which
showed the "48 moves / no maneuver over 200 turns" symptom from p3-16). Cite the
before/after run.
- [ ] Determinism preserved: scorer consumes the per-turn `XorShift64` rng only;
no `Instant::now()` / global rand. Same-seed reruns produce identical actions.
- [ ] Existing `mc-ai` tests stay green headless; add unit coverage for the
frontier-seek scorer (idle unit with unexplored frontier → exploration move;
fully-explored / boxed-in unit → falls back to patrol / non-motion).
- [x] Idle military / scout units issue **exploration moves** toward unexplored
territory via the frontier-seek scorer in `decide_movement`'s `primary.is_none()`
fallback. ✅ `movement.rs::score_explore_move` now targets the nearest genuinely
unexplored tile (`nearest_unexplored_frontier`), centroid-mirror kept as the
fully-explored fallback (commit `0d78d1d60`). End-to-end via
`mc-player-api/tests/ai_exploration.rs` (idle warrior on a foggy map issues a
MoveUnit toward the fog).
- [x] `TacticalTile` surfaces per-tile explored/fog state. ✅ Added
`TacticalTile.explored` (serde-default true), populated from
`PlayerVision::is_explored` in `projection.rs::project_tactical_map`
(commit `0d78d1d60`).
- [x] Measurable improvement in self-play: **first contact reached via
exploration**. ✅ Deterministic reproducible gate (the sim is seed-deterministic,
so this replaces the apricot before/after smoke):
`ai_self_play_first_contact.rs::ai_self_play_makes_first_contact_via_exploration`
— two fogged-apart AI militarists reach first contact within 40 turns; no
contact at game start (commits `a6e2c677f`, `121f88bc8`). NB: apricot smoke
batch (literal before/after) deferred — apricot down; the deterministic test is
the stronger reproducible evidence.
- [x] Determinism preserved. ✅ The scorer uses no `Instant::now()` / global rand;
tie-breaks deterministically on `unit.id`. Same-seed reruns are identical
(`mc-ai` regression suite + the seed-deterministic self-play tests).
- [x] Existing `mc-ai` tests green headless + scorer coverage. ✅
`movement.rs::tests::{frontier_seek_targets_nearest_unexplored_tile,
frontier_seek_falls_back_to_mirror_when_fully_explored}` + the e2e + self-play
tests; mc-ai + mc-player-api 556/0.
## Dependencies

View file

@ -1,12 +1,12 @@
{
"generated_at": "2026-06-24T23:51:15Z",
"generated_at": "2026-06-25T04:53:08Z",
"totals": {
"oos": 31,
"done": 288,
"partial": 2,
"in_progress": 0,
"missing": 0,
"done": 290,
"stub": 0,
"oos": 31,
"in_progress": 0,
"partial": 0,
"total": 321
},
"objectives": [
@ -3204,20 +3204,20 @@
"id": "p3-16",
"title": "AI proactive war-declaration via the courier system",
"priority": "p3",
"status": "partial",
"status": "done",
"scope": "game1",
"owner": "warcouncil",
"updated_at": "2026-06-24",
"updated_at": "2026-06-25",
"summary": "The canonical courier-diplomacy model (`COMMUNICATIONS.md` §\"War declaration\nsemantics\") assumes a player **dispatches a war-dec envelope** to enter war: the\n**sender** enters `War` immediately on dispatch and its units can attack the same\nturn; the **recipient** flips to `War` on delivery/interception; **defenders\nalways retaliate when struck** regardless of formal `RelationState`. Pairs start\nat **peace** (`mc-player-api/src/projection.rs::project_tactical_relations` defaults\nunset pairs to 0 = peace; `mc-player-api/src/comms_dispatch.rs` flips the shared\n`RelationState` cell to `War` only on delivery).\n\n**The war-declaration decision is now SHIPPED.** A new per-turn diplomacy step\n`decide_diplomacy` (`src/simulator/crates/mc-ai/src/tactical/diplomacy.rs:30`)\nevaluates each *discovered* rival against the clan's `aggression` axis and the\nown-vs-perceived military balance, and emits `Action::DeclareWar { target }`\n(`diplomacy.rs:69`) when conditions warrant. That action is routed through\n`mc_player_api::comms_dispatch::dispatch_war_declaration`\n(`mc-player-api/src/comms_dispatch.rs:59`) — the same envelope path the human\nwar-dec uses — so the **sender** enters `War` on dispatch and the **recipient**\nflips on delivery, exactly per `COMMUNICATIONS.md` §\"War declaration semantics\".\n\nIt is **unit-tested and proven to fire**:\n- 5 `mc-ai` diplomacy cases (`diplomacy.rs:140185`) cover discovered-weaker\n (declares), undiscovered (holds), already-at-war (holds), cautious-at-parity\n vs warmonger-strikes (axis differentiation), and no-army (holds).\n- The dispatch round-trip is covered by\n `ai_declare_war_maps_to_player_declare_war` (`mc-player-api/src/dispatch.rs:3068`):\n the AI's `DeclareWar` maps to the same `RelationState` mutation the human path\n produces.\n- **Live proof:** in hotseat self-play (seed 42) war-decs dispatch on first\n contact at turns 17/18.\n\n**Why this is still `partial` — the war-dec does not yet transform AI-vs-AI\ngames.** The decision-to-declare half is shipped, but full aggressive AI play is\nblocked on a **separate upstream gap: the AI does not scout/explore** (tracked by\n**p3-17**, AI exploration / frontier-seeking). Two consequences:\n1. War-decs fire only on a fleeting enemy-**unit** sighting, which is rare because\n idle military units never push toward unexplored territory.\n2. Even once at war, `collect_enemy_city_positions` (`tactical/movement.rs:402`)\n returns only **visible** enemy cities — which the AIs almost never see, because\n idle military units fall to `score_patrol_for_military` (`movement.rs:285`,\n scout-sweep of already-known cities / garrison next to friendly cities) with\n **no frontier-seeking**. So the army declares war but cannot find the enemy\n capital to march on.\n\nThe downstream at-war combat path (`is_at_war` gate, `locked_target` maneuver,\n`aggression`-tuned posture per `mc-ai/src/tactical/thresholds.rs`) already works\nonce a pair is at war and an enemy city is known — but discovery starves it.\n**p3-17 must land before personality `aggression` materially differentiates\nAI-vs-AI war outcomes.**"
},
{
"id": "p3-17",
"title": "AI exploration / frontier-seeking for idle military + scout units",
"priority": "p3",
"status": "partial",
"status": "done",
"scope": "game1",
"owner": "warcouncil",
"updated_at": "2026-06-24",
"updated_at": "2026-06-25",
"summary": "The AI never scouts or explores the map, which starves both target-acquisition\nand the war-declaration discovery gate. This objective adds a frontier-seeking\nmove for idle military / scout units so first contact and enemy-city discovery\nhappen reliably in AI-vs-AI play."
}
]