Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

R-ENEMY-005: the operation cards give unit orders under gdd-0.1 (#749 part 2) (#2087)

Beri1f4a9d3a1830
diff --git a/changelog.d/laneOI-749-p2.md b/changelog.d/laneOI-749-p2.md
new file mode 100644
index 000000000..0b54c2d60
--- /dev/null
+++ b/changelog.d/laneOI-749-p2.md
@@ -0,0 +1,15 @@
+- The 1948 operation cards can now give orders to units on the map (R-ENEMY-005). Under GDD 0.1, choosing The Ten
+ Days' historical option sends Kiryati toward Ramle and Carmeli toward the Syrian bridgehead at Mishmar HaYarden;
+ Operation Yoav's sends the Negev Brigade toward Beersheba and Givati toward Huleiqat; Operation Hiram's sends Carmeli
+ toward Manara and the 7th Brigade toward al-Malikiyya (refused while the ALA holds it); launching Operation Horev
+ sends Golani toward the Julis camp; and pressing the Latrun offensive sends Harel toward the Latrun police fort. Each
+ order follows the player's own go-to rules. The other alternative options give no orders until sources are found.
+- An operation's order ends with the operation: the unit stops when the dates of its anchor or order target in `map/units_1948.yaml` end
+ (Carmeli on 19 July 1948, Kiryati on 16 August 1948, Golani on 24 February 1949, the Egypt armistice). Kiryati's order
+ runs one turn past Operation Dani, so Kiryati takes Ramla in the August turn; Lod is not taken. Its march goes round
+ enemy-held places it was not sent to, so Golani no longer takes Nazareth on the way. A refused order shows a short message, in English
+ and Hebrew.
+- An operation's order never takes the last Israeli unit off an occupied place: launching Operation Horev while Golani
+ alone holds an occupied Nazareth leaves Golani there, and the occupation goes on. A second Israeli unit there lets the
+ order go ahead, and the player's own orders are never held back. The held order shows a short message, in English
+ and Hebrew.
diff --git a/content/events/latrun_proposal.yaml b/content/events/latrun_proposal.yaml
index 14a1afe07..4e1fa53e8 100644
--- a/content/events/latrun_proposal.yaml
+++ b/content/events/latrun_proposal.yaml
@@ -46,6 +46,13 @@ options:
- { target: security, delta: 0.025 }
- { target: intl_standing, delta: -0.10 }
- { target: morale, delta: -0.02 }
+ # Unit orders (R-ENEMY-005; owner, 1 November 2026, #2087: "Harel at Sha'ar HaGai", Harel ordered from its Sha'ar HaGai
+ # anchor toward Latrun). Harel to the Latrun police fort's hex, map/units_1948.yaml line 792 (harel's order target "Latrun
+ # police fort", the latrun_fort location's coordinates): the objective of Ben-Gurion's proposal of 26 September 1948,
+ # this card's source, not a position the brigade held. The order ends with the Sha'ar HaGai window, on 22 December 1948.
+ # An enemy unit on the fort's hex refuses it, as it would the player's, and the turn's refusals say so.
+ unit_orders:
+ - { unit: harel, q: -3, r: 25 }
sources:
- { url: "https://bengurionarchive.bgu.ac.il/en/node/6251", checked: 2026-10-10 }
- { url: "https://in.bgu.ac.il/bgi/israelis/DocLib/Pages/2012/ליאור-לביד.pdf", checked: 2026-10-10 }
diff --git a/content/events/operation_hiram.yaml b/content/events/operation_hiram.yaml
index ee51296cc..962f61c56 100644
--- a/content/events/operation_hiram.yaml
+++ b/content/events/operation_hiram.yaml
@@ -34,6 +34,15 @@ options:
set_rung: 5
effects:
- { target: security, delta: 0.02 }
+ # Unit orders (R-ENEMY-005; owner, 1 November 2026, #2087: "military operations must have unit orders", sourced places
+ # only). Carmeli to Manara, 29 October 1948 to the Lebanon armistice, map/units_1948.yaml line 242 (carmeli's order target
+ # "Manara"; he.wiki Operation Hiram and the Haganah Heritage lexicon); the 7th Brigade to al-Malikiyya, 31 October 1948
+ # to the Lebanon armistice, line 628 (brigade_7's order target; Dupuy p. 104); war-1948.md section 3, the Hiram row (line 145).
+ # The hexes are the targets' own (map/unit_anchor_hexes.yaml). An enemy unit on al-Malikiyya's hex refuses the 7th
+ # Brigade's order, as it would the player's, and the turn's refusals say so.
+ unit_orders:
+ - { unit: carmeli, q: 15, r: 3 }
+ - { unit: brigade_7, q: 14, r: 4 }
- id: advance_into_lebanon
text: Advance further into Lebanon
text_he: להתקדם הלאה לתוך לבנון
@@ -42,6 +51,7 @@ options:
effects:
- { target: security, delta: 0.025 }
- { target: intl_standing, delta: -0.08 }
+ # No unit orders: no source places a unit for this alternative (R-ENEMY-005, #749), until one is found.
sources:
- { url: "https://en.wikipedia.org/wiki/Operation_Hiram", checked: 2026-10-10 }
- { url: "https://www.un.org/unispal/document/auto-insert-211203/", checked: 2026-10-14 }
diff --git a/content/events/operation_horev.yaml b/content/events/operation_horev.yaml
index f65f39fc1..784a1caeb 100644
--- a/content/events/operation_horev.yaml
+++ b/content/events/operation_horev.yaml
@@ -1,11 +1,14 @@
# yaml-language-server: $schema=../schema/event.schema.json
id: operation_horev
title: Operation Horev
-text: '{defense_minister} proposes an offensive against the Egyptian army in the south, under Yigal Allon, with five brigades.'
+# The last sentence of text and text_he (the Nazareth garrison rule, R-ENEMY-005): owner ruling, 2 November 2026, #2087,
+# verbatim: "Add the line (Recommended)". The owner signed off these exact words in English and Hebrew, so the ruling is
+# the native read of the Hebrew sentence.
+text: '{defense_minister} proposes an offensive against the Egyptian army in the south, under Yigal Allon, with five brigades. If Golani alone holds Nazareth, it stays there.'
# For the native reviewer (#564): מבצע חורב and יגאל אלון follow he.wiki "מבצע חורב"
# (https://he.wikipedia.org/wiki/מבצע_חורב).
title_he: מבצע חורב
-text_he: 'הצעת {defense_minister} היא לפתוח במתקפה נגד הצבא המצרי בדרום, בפיקוד יגאל אלון ובהשתתפות חמש חטיבות.'
+text_he: 'הצעת {defense_minister} היא לפתוח במתקפה נגד הצבא המצרי בדרום, בפיקוד יגאל אלון ובהשתתפות חמש חטיבות. אם חטיבת גולני לבדה מחזיקה בנצרת, היא נשארת שם.'
anchor: hard
tags: [security, war-casualties]
office: defense_minister
@@ -28,6 +31,14 @@ options:
set_rung: 5
effects:
- { target: security, delta: 0.02 }
+ # Unit orders (R-ENEMY-005; owner, 31 October 2026, #749: sourced anchors only): Golani to the Julis camp. The
+ # war-1948 Horev row (research_notes/M4 war mode/war-1948.md section 3, line 149) is the source for Golani taking part;
+ # it does not name Julis. Julis comes from the units file's anchor (map/units_1948.yaml line 135, golani's anchor
+ # "Julis camp", from December 1948; he.wiki, the end_note at line 129: in December 1948 the brigade moved to the Julis
+ # camp). The hex is the anchor's own (map/unit_anchor_hexes.yaml). The order ends with that anchor's window, on
+ # 24 February 1949 (the owner's answer 1 on #2087).
+ unit_orders:
+ - { unit: golani, q: -8, r: 28 }
- id: hold
# Game assumption: the notes give no alternative to launching; this one names no advocate.
text: Hold the lines and wait for talks with Egypt
@@ -35,6 +46,7 @@ options:
alternative: { basis: design }
effects:
- { target: security, delta: -0.01 }
+ # No unit orders: no source places a unit for this alternative (R-ENEMY-005, #749), until one is found.
sources:
- { url: "https://www.jewishvirtuallibrary.org/jsource/History/horev.html", checked: 2026-10-10 }
# IDF and Defence Establishment Archives (Ministry of Defence), "Operation Horev - Operation Ayin", 5 January 2015:
diff --git a/content/events/operation_yoav.yaml b/content/events/operation_yoav.yaml
index d3277521b..a4ff58288 100644
--- a/content/events/operation_yoav.yaml
+++ b/content/events/operation_yoav.yaml
@@ -28,6 +28,14 @@ options:
set_rung: 5
effects:
- { target: security, delta: 0.025 }
+ # Unit orders (R-ENEMY-005; owner, 1 November 2026, #2087: "military operations must have unit orders", sourced places
+ # only). Negev to Beersheba, 21 October 1948 to the Egypt armistice, map/units_1948.yaml line 929 (negev's order target
+ # "Beersheba"); Givati to Huleiqat, 20 October to 1 November 1948, line 460 (givati's order target "Huleiqat"); both on the
+ # IDF account of Yoav (Jewish Virtual Library, a source of this card); war-1948.md section 3, the Yoav row (line 143).
+ # The hexes are the targets' own (map/unit_anchor_hexes.yaml).
+ unit_orders:
+ - { unit: negev, q: -10, r: 35 }
+ - { unit: givati, q: -9, r: 29 }
- id: push_to_hebron
text: Let Allon push on into the Hebron hills and the Jericho valley
text_he: לאפשר לאלון להתקדם לתוך הר חברון ובקעת יריחו
@@ -37,6 +45,7 @@ options:
effects:
- { target: security, delta: 0.03 }
- { target: intl_standing, delta: -0.08 }
+ # No unit orders: no source places a unit for this alternative (R-ENEMY-005, #749), until one is found.
sources:
# Kept for Allon's request to push into the Hebron hills and the Jericho valley and Ben-Gurion's refusal, mainly for
# fear of British involvement, and for the 14 October start; the IDF History Department study below has the
diff --git a/content/events/ten_days.yaml b/content/events/ten_days.yaml
index bad202d23..62cd8a3dd 100644
--- a/content/events/ten_days.yaml
+++ b/content/events/ten_days.yaml
@@ -36,6 +36,17 @@ options:
set_rung: 5
effects:
- { target: security, delta: 0.025 }
+ # Unit orders (R-ENEMY-005; owner, 31 October 2026, #749: sourced anchors only). Dani (owner, 1 November 2026, #2087:
+ # "Kiryati to Ramle"): Kiryati to Ramle, 12-20 July 1948, map/units_1948.yaml line 372 (kiryati's order target "Ramle";
+ # the IDF account of Operation Danny, Jewish Virtual Library, and Ben-Gurion's diary of 12 July 1948); research_notes/M4 war mode/
+ # war-1948.md section 3, the Dani row (line 139). It replaces Yiftach's order to Lydda, which reached nobody: Yiftach has
+ # no unit on the board (no anchor on 15 May 1948, R-UNIT-006). Brosh, in the same Ten Days: Carmeli facing the Syrian
+ # bridgehead at Mishmar HaYarden, 9-19 July 1948, map/units_1948.yaml line 207 (carmeli's anchor); war-1948.md section 3,
+ # the Brosh row (line 141). The hexes are the target's and the anchor's own (map/unit_anchor_hexes.yaml); Kiryati's is
+ # Ramla's capture target (-3, 24), not the hex Ramla shares with Rehovot (owner, 2 November 2026, #2087).
+ unit_orders:
+ - { unit: kiryati, q: -3, r: 24 }
+ - { unit: carmeli, q: 14, r: 6 }
- id: southern_front
# Game assumption: a design alternative. The notes found no cabinet debate in July; Ben-Gurion's diary of 11 July
# records Yadin asking where forces should go next [S].
@@ -51,6 +62,7 @@ options:
set_rung: 5
effects:
- { target: security, delta: 0.015 }
+ # No unit orders: no source places a unit for this alternative (R-ENEMY-005, #749), until one is found.
sources:
- { url: "https://en.wikipedia.org/wiki/Operation_Danny", checked: 2026-10-10 }
- { url: "https://en.wikipedia.org/wiki/1948_Arab–Israeli_War", checked: 2026-10-10 }
diff --git a/content/map/unit_anchor_hexes.yaml b/content/map/unit_anchor_hexes.yaml
index b88c1c4be..9040fc838 100644
--- a/content/map/unit_anchor_hexes.yaml
+++ b/content/map/unit_anchor_hexes.yaml
@@ -1,5 +1,6 @@
# Generated by tools/unit_anchor_hexes.py from units_1948.yaml and hexes.json (hexgrid.settlement_hex).
-# Do not edit by hand: rerun the tool after changing either input. anchor is the index in the row's anchors list.
+# Do not edit by hand: rerun the tool after changing either input. anchor is the index in the row's anchors list,
+# target the index in its order_targets list (R-ENEMY-005: where an operation card may send the unit).
anchors:
- { id: golani, anchor: 0, q: 11, r: 11 }
- { id: golani, anchor: 1, q: -8, r: 28 }
@@ -30,3 +31,10 @@ anchors:
- { id: iraqi_expeditionary_force, anchor: 1, q: 6, r: 15 }
- { id: lebanese_army, anchor: 0, q: 14, r: 4 }
- { id: arab_liberation_army, anchor: 0, q: 14, r: 4 }
+order_targets:
+ - { id: carmeli, target: 0, q: 15, r: 3 }
+ - { id: kiryati, target: 0, q: -3, r: 24 }
+ - { id: givati, target: 0, q: -9, r: 29 }
+ - { id: brigade_7, target: 0, q: 14, r: 4 }
+ - { id: harel, target: 0, q: -3, r: 25 }
+ - { id: negev, target: 0, q: -10, r: 35 }
diff --git a/content/map/units_1948.yaml b/content/map/units_1948.yaml
index 4283a47bf..4beddaaa7 100644
--- a/content/map/units_1948.yaml
+++ b/content/map/units_1948.yaml
@@ -234,6 +234,29 @@ units:
- {url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%91%D7%A6%D7%A2_%D7%91%D7%A8%D7%95%D7%A9', checked: '2026-10-15'}
- {url: 'https://en.wikipedia.org/wiki/Mishmar_HaYarden_(moshava)', checked: '2026-10-15'}
- {url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%91%D7%A6%D7%A2_%D7%97%D7%99%D7%A8%D7%9D', checked: '2026-10-15'}
+ # order_targets: where an operation card sends the unit (R-ENEMY-005), each with an anchor's keys and rules: a named
+ # place, sourced, with a dated window whose `to` ends the card's order. The map never draws them and they start no unit:
+ # only the cards' unit_orders (the sim) and tools/unit_anchor_hexes.py read them (owner, 2 November 2026, #2087,
+ # option 1). The sim refuses one with no `sources` or no `from`/`to` date.
+ order_targets:
+ - place: Manara
+ place_he: "מנרה"
+ place_he_review: agent-checked
+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%A0%D7%A8%D7%94', checked: '2026-11-01'}]
+ lon: 35.54444
+ lat: 33.19583
+ from: '1948-10-29'
+ since: 29 October 1948
+ to: '1949-03-23'
+ end_basis: front_armistice
+ front: lebanon
+ note: "Operation Hiram: he.wiki has Carmeli's main task to block a possible Syrian attack in the Manara and Misgav Am area; the Haganah Heritage lexicon (Brigade 2 Carmeli) has the brigade operate in the Galilee in Hiram at the end of October and take the border road. The lexicon names the border road, not Manara. No source read gives the brigade's departure, so the window ends on the Lebanon armistice."
+ sources:
+ # he.wiki, מבצע חירם, section חטיבת כרמלי: "חטיבת כרמלי שתפקידה המרכזי היה לבלום מתקפה סורית אפשרית באזור מנרה ומשגב עם" (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%91%D7%A6%D7%A2_%D7%97%D7%99%D7%A8%D7%9D', checked: '2026-11-01'}
+ # Organisation of Haganah Heritage, Lexicon, "Brigade 2 Carmeli": "במבצע חירם בשלהי אוקטובר פעלה החטיבה בגליל, ותפסה את כביש הגבול ורצועת כפרים בלבנון" (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://hahagana.org.il/lexicon/lexiconpage/?itemId=47620', checked: '2026-11-01'}
+ - {url: 'https://en.wikipedia.org/wiki/Manara,_Israel', checked: '2026-11-01'}
sources:
- {url: 'https://en.wikipedia.org/wiki/Carmeli_Brigade', checked: '2026-10-11'}
- {url: 'https://en.wikipedia.org/wiki/Golani_Brigade', checked: '2026-10-11'}
@@ -345,6 +368,29 @@ units:
# Organisation of Haganah Heritage, Lexicon, "Brigade 5 Givati": in February 1948 the decision to set up the Kiryati Brigade in Tel Aviv.
- {url: 'https://hahagana.org.il/lexicon/lexiconpage/?itemId=47227', checked: '2026-10-15'}
- {url: 'https://en.wikipedia.org/wiki/Tel_Aviv', checked: '2026-10-11'}
+ order_targets:
+ - place: Ramle
+ place_he: "רמלה"
+ place_he_review: agent-checked
+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%A8%D7%9E%D7%9C%D7%94', checked: '2026-11-01'}]
+ lon: 34.8625
+ lat: 31.9275
+ from: '1948-07-12'
+ since: 12 July 1948
+ to: '1948-08-16'
+ end_basis: source
+ end_note: "Operation Dani ended on 19 July 1948 (as Yiftach's Lydda window). The game runs this order one turn longer, to 16 August 1948, under the owner's ruling (2 November 2026, #2087): \"Longer order: takes Ramla (Recommended)\". 16 August is the end set under that ruling, not a sourced date: it is the earliest end that lets Kiryati reach Ramla's capture hex on the 15 August turn."
+ note: "Operation Dani (owner, 1 November 2026, #2087: \"Kiryati to Ramle\"): the IDF account (Jewish Virtual Library) has Kiryati units take Ramle on 12 July 1948, which surrendered after a brief engagement; Ben-Gurion's diary of that day has Ramle announce it would sign a surrender. A detachment of the brigade, which the brigade token stands for: he.wiki names the 42nd Battalion, on Wikipedia only. No source read gives the units' departure, so the window ends with the operation, as Yiftach's Lydda window. An order target: the token stays at Tel Aviv."
+ sources:
+ # IDF account of Operation Danny, republished by the Jewish Virtual Library: "On July 12, Kiryati units took Ramle, which surrendered after a brief engagement." (agent read 2026-11-01; a person's check pending; research_notes/M4 war mode/kiryati-ramle-july-1948.md).
+ - {url: 'https://jewishvirtuallibrary.org/jsource/History/Danny.html', checked: '2026-11-01'}
+ # Ben-Gurion's diary, 12 July 1948: "Ramle (the population) also announced that at ten they would sign a surrender" (agent read 2026-11-01; a person's check pending). It names no unit.
+ - {url: 'https://web.archive.org/web/20260118233403/https://bengurionarchive.bgu.ac.il/en/node/9409', checked: '2026-11-01'}
+ # en.wiki, Operation Dani, the table of communities captured: "Ramle / 12 July 1948 / Arab Legion withdrew / Kiryati Brigade" (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://en.wikipedia.org/wiki/Operation_Dani', checked: '2026-11-01'}
+ # he.wiki, מבצע דני: "ב-12 ביולי בבוקר תפס כוח של גדוד 42 את סכנת פאנוס, ובהמשך אותו יום חתמו נכבדי רמלה על הסכם כניעה מול מפקדי 'קרייתי'" (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%91%D7%A6%D7%A2_%D7%93%D7%A0%D7%99', checked: '2026-11-01'}
+ - {url: 'https://en.wikipedia.org/wiki/Ramla', checked: '2026-11-01'}
- id: givati
name: Givati Brigade
name_he: "חטיבת גבעתי"
@@ -410,6 +456,24 @@ units:
- {url: 'https://hahagana.org.il/lexicon/lexiconpage/?itemId=47227', checked: '2026-10-15'}
- {url: 'https://he.wikipedia.org/wiki/%D7%97%D7%98%D7%99%D7%91%D7%AA_%D7%90%D7%9C%D7%9B%D7%A1%D7%A0%D7%93%D7%A8%D7%95%D7%A0%D7%99', checked: '2026-10-15'}
- {url: 'https://en.wikipedia.org/wiki/Gedera', checked: '2026-10-11'}
+ order_targets:
+ - place: Huleiqat
+ place_he: "חוליקאת"
+ place_he_review: agent-checked
+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%97%D7%95%D7%9C%D7%99%D7%A7%D7%90%D7%AA', checked: '2026-11-01'}]
+ lon: 34.64972
+ lat: 31.60083
+ from: '1948-10-20'
+ since: 20 October 1948
+ to: '1948-11-01'
+ end_basis: source
+ end_note: "As the Gedera window: the Haganah Heritage lexicon (Brigade 5 Givati) has the brigade moved to the centre of the country in November 1948; he.wiki Alexandroni: in November 1948 the Alexandroni Brigade replaced it at the Faluja pocket."
+ note: "Operation Yoav: the IDF account (Jewish Virtual Library) has Givati attack the Huleiqat defence system on 19-20 October 1948 and take it, opening the road to the Negev. An order target: the token stays at Gedera."
+ sources:
+ # IDF account of Operation Yoav, republished by the Jewish Virtual Library: "He tasked the 'Givati' Brigade to attack the formidable Huleiqat defense system south on 19-20 October which was successful in capturing the complex" (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://jewishvirtuallibrary.org/jsource/History/Yoav.html', checked: '2026-11-01'}
+ - {url: 'https://hahagana.org.il/lexicon/lexiconpage/?itemId=47227', checked: '2026-10-15'}
+ - {url: 'https://en.wikipedia.org/wiki/Hulayqat', checked: '2026-11-01'}
- id: etzioni
name: Etzioni Brigade
name_he: "חטיבת עציוני"
@@ -560,6 +624,23 @@ units:
sources:
- {url: 'https://he.wikipedia.org/wiki/%D7%97%D7%98%D7%99%D7%91%D7%94_7', checked: '2026-10-11'}
- {url: 'https://en.wikipedia.org/wiki/Ein_Shemer', checked: '2026-10-11'}
+ order_targets:
+ - place: al-Malikiyya
+ place_he: "אל-מאלכיה"
+ place_he_review: agent-checked
+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%9C%D7%9B%D7%99%D7%94', checked: '2026-10-22'}]
+ lon: 35.50806
+ lat: 33.10528
+ from: '1948-10-31'
+ since: 31 October 1948
+ to: '1949-03-23'
+ end_basis: front_armistice
+ front: lebanon
+ note: "Operation Hiram: Dupuy, Elusive Victory (1978), p. 104: \"Carmel himself, with his 7th Brigade column, moved northeastward from Sasa, capturing first the village of Saliha and then Malkiya\", and \"at about dawn on the 31st, Operation Hiram drew to a close\" (research_notes/Map/lebanese-army-15-may-1948-1871.md)."
+ sources:
+ # Dupuy, Elusive Victory (1978), p. 104 (agent read 2026-10-28; a person's check pending).
+ - {url: 'https://web.stanford.edu/group/tomzgroup/pmwiki/uploads/1793-1978-Dupuy-a-CLH.pdf', checked: '2026-10-28'}
+ - {url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%91%D7%A6%D7%A2_%D7%97%D7%99%D7%A8%D7%9D', checked: '2026-11-01'}
- id: brigade_8
name: 8th Brigade
name_he: "חטיבה 8"
@@ -707,6 +788,22 @@ units:
- {url: 'https://www.izkor.gov.il/en_5b66232e91a0aeffce2c5c9082b5de0c', checked: '2026-10-15'}
- {url: 'https://en.wikipedia.org/wiki/Operation_Horev', checked: '2026-10-11'}
- {url: "https://en.wikipedia.org/wiki/Sha'ar_HaGai", checked: '2026-10-11'}
+ order_targets:
+ - place: Latrun police fort
+ place_he: "משטרת לטרון"
+ place_he_review: agent-checked
+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%9E%D7%A9%D7%98%D7%A8%D7%AA_%D7%9C%D7%98%D7%A8%D7%95%D7%9F', checked: '2026-10-18'}]
+ lon: 34.98036
+ lat: 31.8381
+ from: '1948-09-26'
+ since: 26 September 1948
+ to: '1948-12-22'
+ end_basis: source
+ end_note: "As the Sha'ar HaGai window: Operation Horev, from 22 December 1948, in the south; no place is given for the brigade there."
+ note: "Not a position the brigade held: the objective of Ben-Gurion's proposal of 26 September 1948 \"to attack and conquer Latrun\", which the cabinet rejected (his diary), the latrun_proposal card's press_offensive option. Owner, 1 November 2026, #2087: Harel, from its Sha'ar HaGai anchor, to the Latrun fort's hex. The coordinates are the latrun_fort location's (map/locations_1948.yaml). An order target: the token stays at Sha'ar HaGai."
+ sources:
+ # Ben-Gurion's diary, 26 September 1948 (Ben-Gurion Archive): "my proposal to attack and conquer Latrun [...] the proposal was rejected" (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://bengurionarchive.bgu.ac.il/en/node/6251', checked: '2026-11-01'}
- id: yiftach
name: Yiftach Brigade
name_he: "חטיבת יפתח"
@@ -828,6 +925,25 @@ units:
- {url: 'https://en.wikipedia.org/wiki/Negev_Brigade', checked: '2026-10-11'}
- {url: 'https://he.wikipedia.org/wiki/%D7%97%D7%98%D7%99%D7%91%D7%AA_%D7%94%D7%A0%D7%92%D7%91', checked: '2026-10-11'}
- {url: 'https://en.wikipedia.org/wiki/Nir_Am', checked: '2026-10-11'}
+ order_targets:
+ - place: Beersheba
+ place_he: "באר שבע"
+ place_he_review: agent-checked
+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%91%D7%90%D7%A8_%D7%A9%D7%91%D7%A2', checked: '2026-11-01'}]
+ lon: 34.7867
+ lat: 31.2522
+ from: '1948-10-21'
+ since: 21 October 1948
+ to: '1949-02-24'
+ end_basis: front_armistice
+ front: egypt
+ note: "Operation Yoav: the IDF account (Jewish Virtual Library) has two Negev Brigade battalions with major elements of the 8th Brigade take Beersheba on 21 October 1948; it \"had surrendered to Israeli forces\" by 09:00. No source read gives the brigade's departure, so the window ends on the Egypt armistice, as Golani's Julis window. An order target: the token stays at Nir Am."
+ sources:
+ # IDF account of Operation Yoav, republished by the Jewish Virtual Library (agent read 2026-11-01; a person's check pending).
+ - {url: 'https://jewishvirtuallibrary.org/jsource/History/Yoav.html', checked: '2026-11-01'}
+ # The Knesset's summary of the War of Independence: Beersheba taken on 21 October 1948.
+ - {url: 'https://m.knesset.gov.il/About/Occasion/Documents/IndependenceWar.pdf', checked: '2026-10-14'}
+ - {url: 'https://en.wikipedia.org/wiki/Beersheba', checked: '2026-11-01'}
# --- Air: the first fighter squadron ---------------------------------------------------------------------------------
- id: squadron_101
name: 101 Squadron
diff --git a/content/schema/event.schema.json b/content/schema/event.schema.json
index 31644d703..3f23052d3 100644
--- a/content/schema/event.schema.json
+++ b/content/schema/event.schema.json
@@ -159,6 +159,20 @@
"else": { "properties": { "delta": { "type": "integer", "minimum": -2147483647, "maximum": 2147483647 } } }
}
},
+ "unit_orders": {
+ "type": "array",
+ "description": "R-ENEMY-005 (GDD loop only, applied under gdd-0.1 only): go-to orders for the unit of a map/units_1948.yaml row, toward one of that row's anchor hexes in map/unit_anchor_hexes.yaml, through the player's own go-to.",
+ "items": {
+ "type": "object",
+ "additionalProperties": false,
+ "required": ["unit", "q", "r"],
+ "properties": {
+ "unit": { "type": "string", "minLength": 1 },
+ "q": { "type": "integer" },
+ "r": { "type": "integer" }
+ }
+ }
+ },
"unlock_projects": {
"type": "array",
"description": "R-EFX-008 (GDD loop only): projects.yaml ids of locked kinds this option makes available to StartProject. A sensitive event may not unlock (R-EFX-005).",
diff --git a/docs/RELEASING.md b/docs/RELEASING.md
index ba53d767f..5e3efc9d4 100644
--- a/docs/RELEASING.md
+++ b/docs/RELEASING.md
@@ -28,10 +28,10 @@ macOS IL2CPP parity check is not an MVP release gate.
"$UNITY" -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression gzip -shareable -logFile "$PWD/unity-build-web-gz.log"
git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.asset
golden_expect=(); while read -r name hash; do [[ -z "$name" || "$name" == \#* ]] || golden_expect+=(--expect "GOLDEN OK $name $hash"); done < sim/Statecraft.Sim.Tests/golden/manifest.txt
- # one GOLDEN OK line per manifest golden (#394), e.g. "GOLDEN OK hash1950 74fbe989d84a987728ba983a263714dcbe05abc2768033c15c3aed212cf34b63"
- # and "GOLDEN OK hash1952 d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66"
+ # one GOLDEN OK line per manifest golden (#394), e.g. "GOLDEN OK hash1950 ac38d6c76c3e0e397365370e63cd23ed00b1b12928cecc4b6aea418440b76d2c"
+ # and "GOLDEN OK hash1952 22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78"
uv run tools/web_check.py unity/Builds/Web-gzip --query "golden&smoke=5" "${golden_expect[@]}" \
- --expect "SMOKE OK 5 turns 1948-10-15 9255f2bcda06ed50e38b9f77927998be5f3aef1f7206733dadaf2e2de29509c6"
+ --expect "SMOKE OK 5 turns 1948-10-15 803f0f321fe12c056cccbf7adb52027e064ec3afd215717b9816c1122263ace7"
uv run tools/web_check.py unity/Builds/Web-gzip --startscreen new --timeout 300 --stall 90
uv run tools/web_check.py unity/Builds/Web-gzip --startscreen recording --timeout 300 --stall 90
uv run tools/web_check.py unity/Builds/Web-gzip --startscreen new --query lang=he --timeout 300 --stall 90
@@ -66,7 +66,7 @@ macOS IL2CPP parity check is not an MVP release gate.
"$UNITY" -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression gzip -decompressionFallback -shareable -out Builds/Web-pages -logFile "$PWD/unity-build-web-pages.log"
git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.asset
uv run tools/web_check.py unity/Builds/Web-pages --query "golden&smoke=5" "${golden_expect[@]}" \
- --expect "SMOKE OK 5 turns 1948-10-15 9255f2bcda06ed50e38b9f77927998be5f3aef1f7206733dadaf2e2de29509c6"
+ --expect "SMOKE OK 5 turns 1948-10-15 803f0f321fe12c056cccbf7adb52027e064ec3afd215717b9816c1122263ace7"
uv run tools/web_check.py unity/Builds/Web-pages --startscreen new --timeout 300 --stall 90
uv run tools/web_check.py unity/Builds/Web-pages --startscreen recording --timeout 300 --stall 90
uv run tools/web_check.py unity/Builds/Web-pages --startscreen new --query lang=he --timeout 300 --stall 90
diff --git a/docs/WRITING_EVENTS.md b/docs/WRITING_EVENTS.md
index 2e346d905..aa456825a 100644
--- a/docs/WRITING_EVENTS.md
+++ b/docs/WRITING_EVENTS.md
@@ -243,6 +243,7 @@ Each option has:
| `grant_units` | no | GDD loop only. A list of `{ type, n, at }`: see "grant_units and city_effects". |
| `city_effects` | no | GDD loop only. A list of `{ city, field, delta }`: see "grant_units and city_effects". |
| `unlock_projects` | no | GDD loop only. A list of `projects.yaml` ids: see "grant_units and city_effects". |
+| `unit_orders` | no | GDD loop only, applied under gdd-0.1 only. A list of `{ unit, q, r }`: see "unit_orders". |
| `alternative` | on every option that did not happen, in an event with a historical option | Who put it forward, on what record. See below. |
| `rejoin` | no | Consequence cards only. The id of the event whose road the card follows; choosing this option returns later cards to the recorded course (R-ALT-009). See "kind". |
@@ -311,6 +312,17 @@ These act on the GDD records, so only content whose `eras.yaml` sets `systems.lo
An event with a sensitive tag may carry no grant, no positive `city_effects` delta and no unlock; a cut is allowed (R-EFX-005).
+### unit_orders
+
+- `unit_orders: [{ unit: golani, q: -7, r: 24 }]` gives the unit of a `map/units_1948.yaml` row a go-to order toward
+ hex (`q`, `r`) when the option is chosen or delegated (R-ENEMY-005). The hex must be one of that row's own anchor
+ hexes in `map/unit_anchor_hexes.yaml`, so a card never sends a unit where no source puts it; cite the anchor's line in
+ a comment. The order goes through the player's own go-to: one the player could not give changes nothing, and the
+ player is told so. The order ends on the anchor's `to` date (the loader refuses an anchor with none), and its march
+ goes round every enemy-held place but its hex.
+- It applies under gdd-0.1 only. Under gdd-0.3 the loader still checks it and the unit gets no order; the legacy loop
+ ignores it.
+
### sources
```yaml
diff --git a/docs/determinism.md b/docs/determinism.md
index a00468651..f654eea90 100644
--- a/docs/determinism.md
+++ b/docs/determinism.md
@@ -61,9 +61,9 @@ final `GameState.Hash()` is pinned:
| Run | Ends | Hash |
|---|---|---|
-| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `74fbe989d84a987728ba983a263714dcbe05abc2768033c15c3aed212cf34b63` |
-| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66` |
-| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66` |
+| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `ac38d6c76c3e0e397365370e63cd23ed00b1b12928cecc4b6aea418440b76d2c` |
+| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78` |
+| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78` |
`hash1952` stops at the first turn on or after 1 January 1952, which is the game's last turn, so it is the same run as
`mvp-end` (`DeterminismTests.TheWholeGameToItsEndIsFixed`). Both names are kept (spec 2026-10-12 section 3 step 6): a
@@ -72,7 +72,7 @@ player check enumerate the manifest, so it and every scenario are checked withou
A further value is pinned for the browser smoke run (`?smoke=5`: the golden seed, five turns played through the UI's own
buttons, answering each event with its first option while the turn's Attention pays for it, the rest left to their
-ministers): `SMOKE OK 5 turns 1948-10-15 9255f2bcda06ed50e38b9f77927998be5f3aef1f7206733dadaf2e2de29509c6`.
+ministers): `SMOKE OK 5 turns 1948-10-15 803f0f321fe12c056cccbf7adb52027e064ec3afd215717b9816c1122263ace7`.
It depends on the UI path as well as the sim (which option is first, the turn grid), so re-record it when either changes.
Check every WebGL build with every manifest entry (plus the UI-path smoke line) with:
@@ -83,7 +83,7 @@ while read -r name hash; do
golden_expect+=(--expect "GOLDEN OK $name $hash")
done < sim/Statecraft.Sim.Tests/golden/manifest.txt
uv run tools/web_check.py unity/Builds/Web-<compression> --query "golden&smoke=5" "${golden_expect[@]}" \
- --expect "SMOKE OK 5 turns 1948-10-15 9255f2bcda06ed50e38b9f77927998be5f3aef1f7206733dadaf2e2de29509c6"
+ --expect "SMOKE OK 5 turns 1948-10-15 803f0f321fe12c056cccbf7adb52027e064ec3afd215717b9816c1122263ace7"
```
`smoke-orders` (GDD Phase 5 PR 15, #754) is the same kind of browser run for the unit orders (`?smoke-orders`, desktop
@@ -461,3 +461,42 @@ The hash reads the state keys, so it never sees a record outside its window. An
| #1183: the 4.4 km hex bake (owner, 21 Oct 2026; one re-pin, alone in its merge slot) | scenario-mvp-defeat | `9e2afc15` | unit positions on the 4.4 km grid; the run's late indicators differ (housing, morale, standing) with the different fights; as in reckless, the 7th Brigade is gone and the Legion ends at strength 3 (the snapshots) (was `b7d3848d`) |
| #1183: the 4.4 km hex bake (owner, 21 Oct 2026; one re-pin, alone in its merge slot) | scenario-mvp-occupy-cost | `0bc59565` | Golani's unit is 5 movement points from Nazareth at 4.4 km, so the scenario moves it on 15 May to (9, 11) and onto Nazareth on 15 June, answers Occupy on 15 July and runs to 15 January 1949 (`since=1948-07-15`); as in reckless, the 7th Brigade is gone and the Legion ends at strength 3 (the snapshots) (was `9fcc7bae`) |
| #1183: the 4.4 km hex bake (owner, 21 Oct 2026; one re-pin, alone in its merge slot) | scenario-mvp-annex-nazareth | `b6df4284` | `mvp-occupy-cost`'s steps one turn later, then `end_occupation nazareth annex` on 15 January 1949, run to 15 February 1949; as in reckless, the 7th Brigade is gone and the Legion ends at strength 3 (the snapshots) (was `8fe6d129`) |
+| #749 part 2: the operation cards' unit orders (R-ENEMY-005; owner, 31 Oct 2026: "GDD 0.1 only", "Sourced anchors only"; owner's answer 1 on #2087: "Orders expire with the operation") | hash1950 | `01d5dea9` | the reference player answers `ten_days` `central_front` on 15 July 1948: Carmeli (unit 1) sets out from Haifa toward its Brosh anchor and reaches 8,8, in the Lower Galilee, that turn; its order ends with the anchor's window (19 July), so on 15 August it stops there. It answers `operation_horev` `launch` on 15 December 1948: Golani (unit 0) sets out from Yavne'el toward the Julis camp, goes round Nazareth (no capture), and on 15 March 1949, after its order ended with the Egypt armistice (24 February), stops at 3,14, between Zikhron Ya'akov and Hadera, short of Julis. No fighting and no capture; the final state differs from main's only in where the two brigades stand (was `8578966e`) |
+| #749 part 2: as above | hash1952 | `ece2105d` | same orders as hash1950; Golani stays at 3,14 and Carmeli at 8,8 to the end (was `385ba3b5`) |
+| #749 part 2: as above | mvp-end | `ece2105d` | same run as hash1952 (was `385ba3b5`) |
+| #749 part 2: as above | smoke5 | `6da1203f` | the smoke run's first option of `ten_days` sends Carmeli toward its Brosh anchor; it stops at 8,8 on 15 August 1948. No snapshot is kept for this run (was `7bdf646a`) |
+| #749 part 2: as above | scenario-reckless | `a6328f59` | Horev's delegated order takes Golani round Nazareth; it stops at 3,14 on 15 March 1949 (was `a2ca9626`) |
+| #749 part 2: as above | scenario-cautious | `725c9465` | as reckless, and the delegated `ten_days` sends Carmeli to 8,8, where it stops on 15 August 1948 (was `c06d89f0`) |
+| #749 part 2: as above | scenario-mvp-absorb-first | `e9b657e7` | both orders, as in cautious; no capture and no fighting (was `9c98ae51`) |
+| #749 part 2: as above | scenario-mvp-defeat | `6dc76d20` | both orders, as in cautious; no fighting, so no extra RNG draws, and the delegated cards and the defeat are as on main (was `b7d3848d`) |
+| #749 part 2: as above | scenario-mvp-occupy-cost | `2110fe92` | Carmeli stops at 8,8 as in cautious; Golani holds Nazareth for the scenario and the run ends on 15 December 1948, before Horev's order; Nazareth's capture and Occupy are unchanged (was `9fcc7bae`) |
+| #749 part 2: as above | scenario-mvp-annex-nazareth | `12110c4b` | both orders: Golani leaves the annexed Nazareth for Julis and is on its way at 5,12 when the run ends on 15 January 1949, its order standing to 24 February; the annexation is unchanged (was `8fe6d129`) |
+| #2087, the owner's rulings of 1 November 2026 ("military operations must have unit orders"; Dani: "Kiryati to Ramle"; Latrun: Harel toward the fort): Kiryati to Ramle replaces Yiftach to Lydda, and Yoav, Hiram and Latrun's `press_offensive` give orders to new sourced order targets (R-ENEMY-005; owner, 2 November 2026, option 1: `order_targets` in `map/units_1948.yaml`, not anchors) | hash1950 | `f4a7288f` | `ten_days` on 15 July 1948: Kiryati (unit 3) reaches Ramle's hex the same turn and takes Lydda and Ramle (their residents flee, as for every capture); no decision is taken, so on 15 August it withdraws to the next hex, -2,21, and both are under enemy control again. `operation_yoav` on 15 October: Givati (unit 4) reaches Huleiqat; the Egyptian unit next to it attacks twice, and on 15 November Givati, down to strength 1 of 3, falls back to -7,26; the Negev Brigade (unit 7) marches south and takes Beersheba on 15 December, then withdraws to -8,31 on 15 January 1949, and Beersheba is under enemy control again. `operation_hiram` on 15 November: Carmeli (unit 1) sets out from 8,8 for Manara; the ALA attacks it on 15 January 1949 (strength 2 to 1) and it reaches Manara on 15 February. The 7th Brigade's order (unit 13) is refused on 15 November, every run, because the ALA's unit holds al-Malikiyya; the turn's refusals say so. The combat draws shift the RNG, so the Arab Legion's attack on Harel on 15 October costs it nothing (strength 5, was 4). The reference player answers `latrun_proposal` with the vote, so Harel's order is never given (was `01d5dea9`) |
+| #2087, as above | hash1952 | `452562ce` | same as hash1950; nothing moves after 15 February 1949 (was `ece2105d`) |
+| #2087, as above | mvp-end | `452562ce` | same run as hash1952 (was `ece2105d`) |
+| #2087, as above | smoke5 | `54f201ca` | the smoke run's first option of `ten_days` sends Kiryati to Ramle, which it takes on 15 July 1948 (was `6da1203f`) |
+| #2087, as above | scenario-reckless | `ad599eb9` | no `ten_days` in this run. Givati is destroyed at Huleiqat by the Egyptian unit's second attack on 15 November 1948; the Negev Brigade takes Beersheba on 15 December and still holds it, awaiting a decision, when the run ends on 15 April 1949; Carmeli, sent from Haifa toward Manara, is destroyed by the ALA at 13,4 on 15 February 1949; the 7th Brigade's order is refused on 15 November (was `a6328f59`) |
+| #2087, as above | scenario-cautious | `d8724383` | Kiryati takes Lydda and Ramle on 15 July 1948 and holds them, awaiting a decision, to the run's end; Givati is destroyed at Huleiqat on 15 November; the Negev Brigade takes Beersheba on 15 December; Carmeli is destroyed by the ALA on 15 January 1949; the 7th Brigade's order is refused (was `725c9465`) |
+| #2087, as above | scenario-mvp-absorb-first | `a2b5fe92` | as cautious, to 15 January 1950 (was `e9b657e7`) |
+| #2087, as above | scenario-mvp-defeat | `918b56ff` | as cautious; the extra combat draws shift the RNG, so the delegated `iraqi_exodus` card draws `airlift` instead of `pace` (morale, international standing and housing differ from that card on), and on 15 December 1951 the last turn's withdrawal takes Kiryati out of Lydda and Ramle and the Negev Brigade out of Beersheba. The run still ends in defeat (was `6dc76d20`) |
+| #2087, as above | scenario-mvp-occupy-cost | `59cae466` | the run ends on 15 December 1948: Kiryati holds Lydda and Ramle, awaiting a decision; Givati was destroyed at Huleiqat on 15 November; the Negev Brigade is one hex short of Beersheba and Carmeli on its way at 10,7, both orders standing; Nazareth's capture and Occupy are unchanged (was `2110fe92`) |
+| #2087, as above | scenario-mvp-annex-nazareth | `3f92f80e` | the run ends on 15 January 1949: Kiryati holds Lydda and Ramle and the Negev Brigade Beersheba, all awaiting a decision; Givati was destroyed at Huleiqat; Carmeli is on its way at 11,6; the annexation is unchanged (was `12110c4b`) |
+| #2087 merged with main after #1183 (the 4.4 km grid): the order targets and the cards' order hexes re-derived with `tools/unit_anchor_hexes.py` (Kiryati's Ramle, since `e5e74883d` Ramla's capture hex (-3, 24), Carmeli's Manara (15, 3), the 7th Brigade's al-Malikiyya (14, 4), Givati's Huleiqat (-9, 29), the Negev Brigade's Beersheba (-10, 35), Harel's Latrun (-3, 25); Golani's Julis anchor (-8, 28) and Carmeli's Brosh anchor (14, 6) are main's), one re-pin on the merged tree | hash1950 | `48abe729` | only the unit positions and one capture move; the economy lines are main's. The delegated and answered card orders now run on the 4.4 km hexes: Golani's Horev order (to 24 February 1949) leaves it at 4,14; Carmeli ends at Manara (15,3); Kiryati stops on (-4,24) when the Dani order ends on 20 July 1948 (the next rows run it to 16 August, and it takes Ramla); Givati holds Huleiqat (-9,29); the Negev Brigade takes Beersheba on 15 January 1949 and ends next to it at -9,35. The 7th Brigade's Hiram order to (14,4) is refused on 15 November 1948 while the ALA holds that hex, as before (was `74fbe989`) |
+| #2087 merged with main after #1183, as above | hash1952 | `43061114` | same run as hash1950; nothing moves after 1950 (was `d7429694`) |
+| #2087 merged with main after #1183, as above | mvp-end | `43061114` | same run as hash1952 (was `d7429694`) |
+| #2087 merged with main after #1183, as above | smoke5 | `a968abbc` | the smoke run's first option of `ten_days` sends Kiryati toward Ramle and Carmeli to (14,6). No snapshot is kept for this run (was `9255f2bc`) |
+| #2087 merged with main after #1183, as above | scenario-reckless | `4f3ca893` | no `ten_days` in this run. Golani ends at 4,14 as in hash1950; Carmeli is on its way to Manara at 13,3, its order standing to 23 March 1949; Givati holds Huleiqat; the Negev Brigade takes Beersheba on 15 January 1949 and holds it, awaiting a decision (was `63cab812`) |
+| #2087 merged with main after #1183, as above | scenario-cautious | `be999e93` | as hash1950, with Beersheba awaiting a decision at the run's end (was `e7ad49bf`) |
+| #2087 merged with main after #1183, as above | scenario-mvp-absorb-first | `1e14658d` | as cautious (was `b589c9dc`) |
+| #2087 merged with main after #1183, as above | scenario-mvp-defeat | `8435fb3b` | the unit positions and Beersheba's capture as in hash1950; the defeat is unchanged (was `9e2afc15`) |
+| #2087 merged with main after #1183, as above | scenario-mvp-occupy-cost | `f3bab7ca` | the run now stops on 15 December 1948, one turn earlier: the 15 December turn delegates Operation Horev, whose order would take Golani off Nazareth and end the occupation this scenario measures. Nazareth still waits for EndOccupation since 15 July 1948; the one-turn-shorter run differs in the economy, the events and the arrivals, and on 15 December the 7th Brigade still holds (-4,25) at strength 1 under the Legion's attack (was `0bc59565`) |
+| #2087 merged with main after #1183, as above | scenario-mvp-annex-nazareth | `ca015736` | Nazareth is annexed on 15 December 1948, a turn earlier, in the turn that delegates Horev, before its order takes Golani away (a month later there would be no occupation to end); the upkeep stops a month earlier (debt IL 0.04m lower). Golani is on its way toward Julis at 4,14 and Carmeli toward Manara at 15,5 when the run ends on 15 February 1949; Beersheba is taken on 15 January 1949 and awaits a decision (was `b6df4284`) |
+| #2087, the owner's Dani ruling of 2 November 2026 ("Longer order: takes Ramla (Recommended)"): Kiryati's Ramle order target runs to 16 August 1948 instead of 20 July (`map/units_1948.yaml`), one re-pin on the tree merged with main `573b9d7ac` | hash1950 | `ac38d6c7` | the 15 July 1948 turn still leaves Kiryati on (-4,24), one hex short of Ramla's capture hex (-3,24) after going round Lod; the order now stands on 15 August, so Kiryati steps onto (-3,24) and takes Ramla that turn (`since=1948-09-15`, fled). Lod is not taken by the card. The reference player then raids Ramla (`HistoricalAI.cs:24-27`), so Kiryati withdraws to -2,24 and Ramla is under enemy control again at the run's end (an ownerless record, `fled`); the other units, Beersheba and the economy lines are unchanged (was `48abe729`) |
+| #2087, the longer Dani order, as above | hash1952 | `22f2c8da` | same run as hash1950: Ramla taken in the 15 August 1948 turn, then raided, so Kiryati is at -2,24 and Ramla is under enemy control at the end (was `43061114`) |
+| #2087, the longer Dani order, as above | mvp-end | `22f2c8da` | same run as hash1952 (was `43061114`) |
+| #2087, the longer Dani order, as above | smoke5 | `803f0f32` | the smoke run's first option of `ten_days` gives the longer Dani order, so its run to 15 October 1948 differs from the 15 August turn on. No snapshot is kept for this run (was `a968abbc`) |
+| #2087, the longer Dani order, as above | scenario-cautious | `0be86235` | Kiryati takes Ramla in the 15 August 1948 turn and holds it on (-3,24), Ramla awaiting a decision at the run's end (was `be999e93`) |
+| #2087, the longer Dani order, as above | scenario-mvp-absorb-first | `53c208c2` | as cautious (was `1e14658d`) |
+| #2087, the longer Dani order, as above | scenario-mvp-defeat | `6782cce4` | Ramla taken in the 15 August 1948 turn, then raided, so Kiryati is at -2,24 and Ramla is under enemy control at the end, as hash1950; the defeat is unchanged (was `8435fb3b`) |
+| #2087, the longer Dani order, as above | scenario-mvp-occupy-cost | `612e9feb` | as cautious: Kiryati holds Ramla on (-3,24), awaiting a decision; the run still stops on 15 December 1948 (was `f3bab7ca`) |
+| #2087, the longer Dani order, as above | scenario-mvp-annex-nazareth | `c8195c09` | as cautious: Kiryati holds Ramla on (-3,24), awaiting a decision; Nazareth's annexation is unchanged (was `ca015736`) |
diff --git a/docs/gdd/military-combat.md b/docs/gdd/military-combat.md
index b894cf356..13579bafd 100644
--- a/docs/gdd/military-combat.md
+++ b/docs/gdd/military-combat.md
@@ -22,7 +22,7 @@ I command identifiable units between hexes, preview strength, and earn combat ex
- The player's artillery fires alone at an enemy unit within its range; it never holds ground, and firing it spends Arms (`Q-ARTY-1`, decided 15 October 2026 [S3]; owner, 23 October 2026, #1402 and #1398: "One unit per attack, Civ" and "Approve, start building"). The armoured car carries more movement points and its own combat factor (`Q-ARTY-2`, decided 15 October 2026 [S3]). Artillery's on-screen name is Artillery (ארטילריה) until a sourced gun type arrives (`Q-ARTY-4`, decided 15 October 2026 [S3]); which vehicles and guns are modelled stays open (`Q-ART-2`).
*Amir's #1668 proposal that attacks and artillery fire spend no Arms agrees with the retained `gdd-0.3` rule (`R-COMBAT-004`, owner ruling, 25 October 2026); it was not one of the 30 October 2026 conflicts ([conflict decision](../GDD.md#30-october-2026-conflict-decisions)). Replacement-group Arms use keeps its own rule.* [S20]
-- Enemy forces act in the first resolver step after the player's orders (impact spec §2.3 [S8]; owner, 23 October 2026, #1402 and #1398: "Approve, start building"). In Historical mode they follow a script from two-source positions at 15 May and 11 June 1948 [S9], then act on simple goals; in Open mode goals only (`Q-ENEMY-1`, decided 15 October 2026 [S3]). A goal is: hold a fortified position, or attack an adjacent enemy unit when the strength ratio meets a threshold; no RNG (`Q-ENEMY-2`, decided 15 October 2026 [S3]). Enemy armies receive no reinforcements until a dated per-army figure is sourced (`Q-ENEMY-3`, decided 15 October 2026 [S3]). Enemy units need no supply (`Q-ENEMY-4`, decided 15 October 2026 [S3]). The four operation cards, `ten_days`, `operation_yoav`, `operation_hiram`, `operation_horev`, give orders to units already on the board, and that resets their sensitivity review; (`Q-ENEMY-5`, the owner's pick, 15 October 2026 [S4]). **Then decided (owner, 31 October and 1 November 2026, "military openrations must have unit orders" [S22]):** every military-operation card gives unit orders, each from a sourced, dated anchor: the four cards above and the attack option of `latrun_proposal`. Latrun orders Harel from its Sha'ar HaGai anchor to Latrun ("Harel at Sha'ar HaGai (Recommended)"); Dani orders Kiryati to Ramle ("Kiryati to Ramle (Recommended)").
+- Enemy forces act in the first resolver step after the player's orders (impact spec §2.3 [S8]; owner, 23 October 2026, #1402 and #1398: "Approve, start building"). In Historical mode they follow a script from two-source positions at 15 May and 11 June 1948 [S9], then act on simple goals; in Open mode goals only (`Q-ENEMY-1`, decided 15 October 2026 [S3]). A goal is: hold a fortified position, or attack an adjacent enemy unit when the strength ratio meets a threshold; no RNG (`Q-ENEMY-2`, decided 15 October 2026 [S3]). Enemy armies receive no reinforcements until a dated per-army figure is sourced (`Q-ENEMY-3`, decided 15 October 2026 [S3]). Enemy units need no supply (`Q-ENEMY-4`, decided 15 October 2026 [S3]). The four operation cards, `ten_days`, `operation_yoav`, `operation_hiram`, `operation_horev`, give orders to units already on the board (`Q-ENEMY-5`, the owner's pick, 15 October 2026 [S4]). Which units, whose, and which orders: the player's brigades at their sourced anchors only (owner, 31 October 2026, #749), and every military operation gives some (owner, 1 November 2026, #2087); a place an operation sent a unit to that is not one of its anchors is a sourced, dated order target (owner, 2 November 2026, #2087). Kiryati to Ramle (the owner's "Kiryati to Ramle", which replaced Yiftach to Lydda, as Yiftach is not on the board) and Carmeli facing the Syrian bridgehead on `ten_days`'s historical option, the Negev Brigade to Beersheba and Givati to Huleiqat on `operation_yoav`'s, Carmeli to Manara and the 7th Brigade to al-Malikiyya on `operation_hiram`'s, Golani to the Julis camp on `operation_horev`'s, and Harel toward the Latrun police fort on `latrun_proposal`'s `press_offensive`; none for the other alternatives until sources are found; under `gdd-0.1` only; the cards keep their review status and the owner reviews the changed cards (R-ENEMY-005).
- The war state is what war events set; in the GDD game loop the security order and call-up are refused with their reason (`Q-WAR-1`, decided 15 October 2026 [S3]; `D-C4`). The clock that forced war after fifty-two weeks from March 1948 is retired (`Q-WAR-2`, decided 15 October 2026 [S3]). During a truce attacks are refused with "a truce is in force"; movement is allowed. The refusal lasts from the first_truce acceptance until the turn covering 8 July 1948, and from the second_truce acceptance until the turn covering 15 October 1948 — the dates the fighting resumed in the MFA chronology [S10] (`Q-WAR-3`, decided 15 October 2026 [S3]). The `set_rung` command keeps acting outside the GDD loop (`Q-WAR-4`, decided 15 October 2026 [S3]). A war loss is enemy units holding a player's GDD city hex at the end of a turn (`Q-WAR-5`, decided 15 October 2026 [S3]); Phase 7 turns it into the defeat ending.
*Considered and declined (owner, 30 Oct 2026; keep the recorded ruling; [conflict decision](../GDD.md#30-october-2026-conflict-decisions)): Amir's #1668 proposed returning every final defeat condition to open (owner). Under `gdd-0.3` the economic defeat remains, and a war loss alone does not end the game ([rules](../rules/mvp.md#defeat)).* [S1]
diff --git a/docs/rules/mvp.md b/docs/rules/mvp.md
index a66458ff1..5fb441b59 100644
--- a/docs/rules/mvp.md
+++ b/docs/rules/mvp.md
@@ -56,7 +56,7 @@ R-CTRL-011: Occupy (Q-OCC-1 (a), owner, 18 October 2026, #783 batch 3): `Resolve
R-CTRL-012: The occupation timer (Q-OCC-3 (a), owner, 18 October 2026, #783 batch 4: one X for every place). Occupy sets the record's `Turns` to `mvp.occupation_turns`, X, a design value: 3 monthly turns (owner, 27 October 2026, #1712, "3 turns, keep upkeep", https://github.com/eyalgolan/statecraft-israel/issues/1712#issuecomment-6461246243; confirmed by the owner on 1 November 2026, "3 turns (27 Oct)"), replacing the 6 monthly turns the owner accepted on 22 October 2026 (https://github.com/eyalgolan/statecraft-israel/pull/1324#issuecomment-6338594839). Resolver step 10, after step 9's arrivals and before objectives and score (step 11), takes each occupied place in ordinal id order and counts one turn off, the Occupy turn included; at 0 the place's state is `awaiting_end`, where it awaits `EndOccupation` (Phase 6 PR 7) and the count stops. `Turns` is written to the hash as `turns=` only when non-zero (R-CTRL-002). The step draws nothing from the RNG.
-R-CTRL-013: Withdrawal before the timer ends (Q-OCC-2 (a), owner, 18 October 2026, #783 batch 3: allowed, and it becomes a Raid). An occupation lasts while an Israeli military unit is on the place's hex. When step 10 finds none on an occupied or `awaiting_end` place (the player moved them out, or they were lost), the occupation ends as a Raid does: the record is removed, so the place is under enemy control again at once, its residents unchanged, and no upkeep is paid that turn. Nothing else changes, and nothing is refunded. A halutz left on the hex keeps nothing. For a fled place the timer's raid keeps the ownerless fled record and its line says the residents fled when it was captured (OWNER QUESTION 2 (b), owner, 24 October 2026, #799). The owner's rulings of 27 October 2026 on #1712 ("Existing Raid/Occupy", "3 turns, keep upkeep"; https://github.com/eyalgolan/statecraft-israel/issues/1712#issuecomment-6461246243) and of 1 November 2026 ("30 Oct wins for the MVP (Recommended)") leave it as written: a withdrawal on the occupation's second turn returns the town and clears its timer, and a retake is a new capture, whose Occupy starts a fresh timer. It holds unchanged under gdd-0.3 (`OccupyTests.WithdrawingOnTurnTwoAndRetakingIsTheSameUnderGdd03`).
+R-CTRL-013: Withdrawal before the timer ends (Q-OCC-2 (a), owner, 18 October 2026, #783 batch 3: allowed, and it becomes a Raid). An occupation lasts while an Israeli military unit is on the place's hex. When step 10 finds none on an occupied or `awaiting_end` place (the player moved them out, or they were lost), the occupation ends as a Raid does: the record is removed, so the place is under enemy control again at once, its residents unchanged, and no upkeep is paid that turn. Nothing else changes, and nothing is refunded. A halutz left on the hex keeps nothing. For a fled place the timer's raid keeps the ownerless fled record and its line says the residents fled when it was captured (OWNER QUESTION 2 (b), owner, 24 October 2026, #799). The owner's rulings of 27 October 2026 on #1712 ("Existing Raid/Occupy", "3 turns, keep upkeep"; https://github.com/eyalgolan/statecraft-israel/issues/1712#issuecomment-6461246243) and of 1 November 2026 ("30 Oct wins for the MVP (Recommended)") leave it as written: a withdrawal on the occupation's second turn returns the town and clears its timer, and a retake is a new capture, whose Occupy starts a fresh timer. It holds unchanged under gdd-0.3 (`OccupyTests.WithdrawingOnTurnTwoAndRetakingIsTheSameUnderGdd03`). An operation card's order never takes the last Israeli unit off an occupied place (R-ENEMY-005; owner, 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)"). That rule covers only the cards' orders: the player's own orders (a move, a go-to, Send home) and combat (a unit's loss, its surrender, or its retreat after an enemy attack, R-COMBAT-003) can still leave an occupied place with no Israeli unit, and step 10 then ends the occupation as above.
R-CTRL-014: `EndOccupation(settlement, outcome)` answers the end of an occupation (#799). It is one deferred command kind (not instant, R-TURN-004) with one `attention_cost.end_occupation`, set at 0 as a design value proposed on #799 (D-A6: unit orders are free). It is valid only for a place in `awaiting_end` with an Israeli military unit on its hex, as Occupy needs (R-CTRL-011), and an outcome of `annex` or `withdraw`; the unit is checked for both outcomes. Otherwise it is refused with a reason, the state unchanged and the Attention refunded. It draws nothing from the RNG. Saved as `endocc <settlement> <outcome>`; scenario kind `end_occupation`. The owner's rulings of 27 October 2026 on #1712 (https://github.com/eyalgolan/statecraft-israel/issues/1712#issuecomment-6461246243) set the occupation it ends at "3 turns, keep upkeep" (R-CTRL-012), and the owner's ruling of 1 November 2026, "30 Oct wins for the MVP (Recommended)", keeps its outcomes to Annex and Withdraw for the MVP (R-CTRL-015, R-CTRL-016). Each option's preview equals its result (`EndOccupationTests.TheEndPreviewIsTheOutcome`), and annexing a stayed town adds one city and no unit (`EndOccupationTests.AnnexingAStayedRealTownAddsOneCityAndNoUnit`). It holds unchanged under gdd-0.3: Occupy, the three turns, Annex and the unit's leaving end every turn as under gdd-0.1, the Attention pool aside (`EndOccupationTests.OccupyThenAnnexIsTheSameUnderGdd03`).
@@ -340,7 +340,7 @@ R-COMBAT-010: Under exact identity `gdd-0.3` only, an effective map-location hex
## The enemy
-Phase 5 PR 10, part 1 (#749). Q-ENEMY-1 to Q-ENEMY-4 are the plan's recommendations (owner, 15 October 2026, #375: "Take all recommendations"). The march's turns (through the 15 June 1948 turn, until the first truce ends on 8 July) are the owner's (owner, 21 October 2026, #749); so is the truce guard (R-ENEMY-006, same ruling). The scripted anchor's choice, the goal order, `mvp.enemy_attack_ratio_percent` and the truce guard's turn-middle reading are agent defaults proposed on #749 and #1263. The operation cards' orders (Q-ENEMY-5, the plan's R-ENEMY-005) are part 2.
+Phase 5 PR 10, part 1 (#749). Q-ENEMY-1 to Q-ENEMY-4 are the plan's recommendations (owner, 15 October 2026, #375: "Take all recommendations"). The march's turns (through the 15 June 1948 turn, until the first truce ends on 8 July) are the owner's (owner, 21 October 2026, #749); so is the truce guard (R-ENEMY-006, same ruling). The scripted anchor's choice, the goal order, `mvp.enemy_attack_ratio_percent` and the truce guard's turn-middle reading are agent defaults proposed on #749 and #1263. The operation cards' orders (Q-ENEMY-5, the plan's R-ENEMY-005) are part 2: its ruleset, its byte pins and its orders are the owner's (31 October 2026, #749).
R-ENEMY-001: Resolver step 1, before combat, gives every enemy military unit its orders, in ascending unit id, from the state alone: two equal states get the same orders. They go through the player's own checks with the sides swapped (`Movement.Move`, `Combat.Give`, `Orders.Give`), and a refused order changes nothing. So an enemy unit may not enter a hex holding a player unit, water or a full hex (R-MOVE-003), and, as R-MOVE-005's mirror, no locality's hex that is not on `mvp.enemy_held_localities`: while enemy capture (R-CTRL-006) is unbuilt, no enemy move ends on a player's locality. Its attacks pay no Arms (Q-ENEMY-4: no enemy supply). Step 1 draws nothing from the RNG (Q-ENEMY-2). An annexed target counts as an Israeli town for enemy movement (R-CTRL-016, #799).
@@ -350,6 +350,8 @@ R-ENEMY-003: An enemy unit off its script attacks the first neighbouring hex, in
R-ENEMY-004: No enemy unit arrives or grows in Phase 5 (Q-ENEMY-3): no turn adds an enemy unit, until a dated per-army figure is chosen under CONTENT_POLICY section 1.
+R-ENEMY-005: An option of an event may give go-to orders to units (`unit_orders`, Q-ENEMY-5): each names a `map/units_1948.yaml` row and a hex that must be one of that row's anchor hexes or order target hexes in `map/unit_anchor_hexes.yaml`, or the loader refuses it, naming the file and the field. When the option is chosen or delegated, each order in list order goes to the row's starting unit (R-UNIT-006: the unit with id i is the i-th starting force) through the player's own go-to (R-MOVE-009), with the movement points the turn's orders have already spent; a refused order changes nothing, as the player's does, and the turn's refusals list it as the player's refused orders are listed (`Orders.RefusedCardOrder`, shown in English and Hebrew); a row with no unit on the board orders nobody. A card's order never takes the last Israeli military unit off an occupied place, occupied or awaiting its end (R-CTRL-013; owner, 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)"): it is not given to that unit, and on any later turn of its march a card's order whose unit is now the last one there is taken away at the route step, the unit staying where it is; either way the turn's refusals list it with `Orders.RefusedLastGarrison`, as the other refused orders are listed. A second Israeli unit on the place lets the order go ahead, and the player's own go-to is never held back. Each unit is checked on its own, when its turn comes: in the option's list order when the card gives its orders, and in ascending unit id at the route step (R-MOVE-009). So of two Israeli units on one occupied place that both march on a card's orders, the one checked first goes, and the other, then the last one there, stays: at the route step the lower id goes and the higher id stays (`EnemyAITests.OfTwoUnitsOnACardsMarchTheHigherIdStays`). A held order is taken away, not kept for later: a unit that arrives on the place afterwards does not restart it. So when Horev is launched with Golani alone on an occupied Nazareth, Golani stays and the occupation goes on. Only sourced anchors receive orders (owner, 31 October 2026, #749: "Sourced anchors only"), and every military operation gives some (owner, 1 November 2026, #2087: "military operations must have unit orders"). A place an operation sent a unit to that is not one of its anchors is a row's `order_targets` entry (owner, 2 November 2026, #2087, option 1): sourced and dated as an anchor, read only by the cards' orders and `tools/unit_anchor_hexes.py`, never drawn and never a start; the loader refuses one with no `sources` or no `from`/`to` date. Kiryati's Ramle, Givati's Huleiqat, the Negev Brigade's Beersheba, Carmeli's Manara, the 7th Brigade's al-Malikiyya and Harel's Latrun police fort are order targets: `ten_days`'s historical option sends Kiryati to Ramle (Operation Dani; the owner's "Kiryati to Ramle", which replaced Yiftach's order to Lydda, as Yiftach has no unit on the board) and Carmeli to face the Syrian bridgehead at Mishmar HaYarden (Operation Brosh); `operation_yoav`'s sends the Negev Brigade to Beersheba and Givati to Huleiqat; `operation_hiram`'s sends Carmeli to Manara and the 7th Brigade to al-Malikiyya, which is refused while the ALA's unit holds that hex, as in the historical run; `operation_horev`'s sends Golani to the Julis camp; and `latrun_proposal`'s `press_offensive` sends Harel toward the Latrun police fort, the objective of Ben-Gurion's proposal of 26 September 1948 (owner, same day), refused while an enemy unit holds the fort. Kiryati's Ramle target is Ramla's capture target (-3, 24), not the (-4, 24) Ramla shares with Rehovot on the 4.4 km grid (owner, 2 November 2026, #2087: "Send it to Ramla's target"; `tools/unit_anchor_hexes.py`). Every other alternative option gives none until sources are found. The orders apply under `gdd-0.1` only: under `gdd-0.3` the loader still checks them and the cards stay effect-free for units until a 0.3 accounting contract exists (owner, same ruling: "GDD 0.1 only"); the legacy loop has no units and ignores them. Orders expire with the operation (the owner's answer 1 on #2087, 31 October 2026): a card's order ends on the `to` date of the anchor or order target it names, its window in `map/units_1948.yaml` (Carmeli's Brosh anchor to 19 July 1948, Kiryati's Ramle target to 16 August 1948, one turn past Operation Dani's end on 19 July, so the order takes Ramla on the 15 August turn and not Lod (owner, 2 November 2026, #2087: "Longer order: takes Ramla (Recommended)"), Givati's Huleiqat target to 1 November 1948, Harel's Latrun target to 22 December 1948, as its Sha'ar HaGai window, Golani's Julis anchor and the Negev Brigade's Beersheba target to 24 February 1949, the Egypt armistice, and Carmeli's Manara and the 7th Brigade's al-Malikiyya targets to 23 March 1949, the Lebanon armistice), and from the first turn on or after that day the unit stops where it stands (`card_order_ended`), arrived or not; the loader refuses an order to an anchor with no `to`. The anchor's dates, not the card's: the card's window is when the decision is open. A card's march goes round every enemy-held locality (R-MOVE-005, open target or not) but the hex it was sent to, so it never ends on, or captures, a place it was not sent to; a route that cannot go round is refused. The player's own go-to, which may end on an open target and capture it, is unchanged, and replaces a card's order. The four cards keep their review status (owner, same ruling: "Re-pin; you sign off").
+
R-ENEMY-006: No enemy unit attacks inside a truce window (owner, 21 October 2026, #749): the first truce from 11 June to 8 July 1948 and the second from 18 July to 15 October 1948, half-open, the dates of `events/first_truce.yaml`, `events/second_truce.yaml`, `events/ten_days.yaml` and `events/operation_yoav.yaml` (the same windows as `map/control_hexes_1948_49.yaml`'s truce periods). A turn is in a truce when its middle day is (agent default): a monthly turn spans a truce's edge, and the middle puts it on the side that holds most of its days. So the turns of 15 June to 15 September 1948 are truce turns, and those of 15 May and 15 October 1948 are not. On a truce turn every enemy unit's standing attack ends first, whatever the unit then does (owner, #1263): it may still move on its script (R-ENEMY-002), and a unit off its script fortifies (R-ENEMY-003's else branch). The guard remains date-driven in every mode, whatever the truce cards' answers; #750 separately made accepted truce cards bind the player's attacks (R-COMBAT-009).
## The war state
diff --git a/sim/Statecraft.Sim.Tests/CaptureTests.cs b/sim/Statecraft.Sim.Tests/CaptureTests.cs
index fe74b476d..923c4f03c 100644
--- a/sim/Statecraft.Sim.Tests/CaptureTests.cs
+++ b/sim/Statecraft.Sim.Tests/CaptureTests.cs
@@ -24,7 +24,7 @@ public class CaptureTests
/// <summary>A target row. Stayed by default, so every Raid, Occupy and Deport test keeps its behaviour (#799 plan, Task 1);
/// the annexation values are fixture values (people 60, employed_share 0.5), not history.</summary>
- static string Target(string id, int q, int r, bool fled = false) => FormattableString.Invariant(
+ internal static string Target(string id, int q, int r, bool fled = false) => FormattableString.Invariant(
$" - {{ id: {id}, q: {q}, r: {r}, operation: fixture_operation, sources: [{{ url: \"https://example.org/{id}\", checked: 2026-10-18 }}], ")
+ (fled ? "residents: fled, " : "residents: stayed, ")
+ FormattableString.Invariant($"residents_sources: [{{ url: \"https://example.org/{id}/residents\", checked: 2026-10-18 }}], ")
diff --git a/sim/Statecraft.Sim.Tests/DollarsTests.cs b/sim/Statecraft.Sim.Tests/DollarsTests.cs
index f72c55dd0..a920f77c1 100644
--- a/sim/Statecraft.Sim.Tests/DollarsTests.cs
+++ b/sim/Statecraft.Sim.Tests/DollarsTests.cs
@@ -467,7 +467,7 @@ options:
{
var orders = perTurn > 0 && s.Rung >= 4 ? new Command[] { new ConvertDollars(perTurn) } : Array.Empty<Command>();
var r = Simulation.Step(Real, s, orders);
- Assert.Empty(r.Rejected);
+ Assert.DoesNotContain(r.Rejected, j => !WarEvents1948Tests.IsTheMalkiyaRefusal(j)); // R-ENEMY-005: Hiram's refused order, pinned there
s = r.State;
if (s.Date == new DateTime(1949, 4, 15)) april = s.Debt;
if (crisis == null && s.ActiveSituations.Contains(EconomySystem.FxCrisis)) crisis = s.Date;
diff --git a/sim/Statecraft.Sim.Tests/EnemyAITests.cs b/sim/Statecraft.Sim.Tests/EnemyAITests.cs
index fec7c8bf0..103cbf45c 100644
--- a/sim/Statecraft.Sim.Tests/EnemyAITests.cs
+++ b/sim/Statecraft.Sim.Tests/EnemyAITests.cs
@@ -390,7 +390,15 @@ public class EnemyAITests
foreach (var u in s.Units.Values.Where(IsEnemy))
if ((u.Q, u.R) != start[u.Id]) Assert.DoesNotContain((u.Q, u.R), players);
}
- Assert.Empty(s.Settlements);
+ // No capture but the card orders' own targets: Horev's delegated go-to (R-ENEMY-005) takes Golani round Nazareth, an
+ // enemy-held place it was not sent to (the owner's answer 1 on #2087), while the delegated Yoav order sends the Negev
+ // Brigade to Beersheba, which a card's march may take, and the Dani order sends Kiryati to Ramla's capture target
+ // (-3, 24), not the (-4, 24) Ramla shares with Rehovot at 4.4 km (owner, 2 November 2026, #2087: "Send it to Ramla's
+ // target"; tools/unit_anchor_hexes.py). From Tel Aviv the march goes round Lod's (-3, 23), which the card did not send
+ // it to, so on 15 July 1948 Kiryati stops on (-4, 24), one hex short. The order runs to 16 August 1948 (owner,
+ // 2 November 2026, #2087: "Longer order: takes Ramla"), so on 15 August Kiryati takes Ramla; Lod is not taken by the card.
+ Assert.Equal(new[] { "beersheba", "ramla" }, s.Settlements.Keys.OrderBy(k => k, StringComparer.Ordinal));
+ Assert.All(s.Settlements.Values, x => Assert.Equal("israel", x.Owner));
}
// R-ENEMY-001: what the enemy does is named on its cause (Cause.EnemyOrder), for the turn report (#1293): a scripted
@@ -436,6 +444,376 @@ public class EnemyAITests
s = r.State;
}
}
+ // R-ENEMY-005 (Q-ENEMY-5; owner, 31 October 2026, #749): an operation card's option gives a go-to order to a unit of a
+ // units_1948.yaml row, toward one of that row's own anchor hexes, through the player's own go-to (Movement.GiveGoTo).
+ // The loader refuses a row it does not know, and a hex that is not one of the row's anchors; a card's
+ // order that breaks a movement rule is refused like the player's and changes nothing. Fixture values: one brigade row
+ // starting on (0, 0), with a second anchor on (4, 0).
+ [Fact]
+ public void OperationCardOrdersAreValidated()
+ {
+ const string Rows = "units:\n- id: brig\n service: army\n side: israel\n status: draft\n"
+ + " strength: { value: 30, as_of: '1948-05-15' }\n anchors:\n"
+ + " - { place: Here, lon: 34.29, lat: 33.35, from: '1948-05-15', to: '1949-01-01' }\n"
+ + " - { place: There, lon: 34.30, lat: 33.35, from: '1948-06-01', to: '1949-01-01' }\n";
+ const string Hexes = "anchors:\n - { id: brig, anchor: 0, q: 0, r: 0 }\n - { id: brig, anchor: 1, q: 4, r: 0 }\n";
+ static string Card(string order) => "id: probe\ntitle: Fixture\ntext: Fixture.\nfrom: 1948-05-15\noptions:\n"
+ + " - id: ok\n text: Accept\n historical: true\n unit_orders: [" + order + "]\n";
+ static Dictionary<string, string> Files() => Fixture.Gdd(new Dictionary<string, string>
+ {
+ ["unit_types.yaml"] = Types, ["map/hexes.json"] = MovementTests.Board(), ["corridors.yaml"] = "corridors: []\n",
+ ["map/units_1948.yaml"] = Rows, ["map/unit_anchor_hexes.yaml"] = Hexes,
+ });
+ static ContentException Refused(Dictionary<string, string> files, string order) =>
+ Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(files, new() { ["probe.yaml"] = Card(order) })));
+
+ var unknown = Refused(Files(), "{ unit: nobody, q: 4, r: 0 }");
+ Assert.Equal(("events/probe.yaml", "events[probe].options[ok].unit_orders[0].unit"), (unknown.File, unknown.Field));
+ var invented = Refused(Files(), "{ unit: brig, q: 3, r: 0 }");
+ Assert.Equal("events[probe].options[ok].unit_orders[0]", invented.Field);
+ Assert.Contains("not an anchor", invented.Message);
+ // The legacy loop reads the shared cards too: the order does not stop it loading, and it has no units to order.
+ Assert.Empty(ContentLoader.Load(Fixture.Write(null, new() { ["probe.yaml"] = Card("{ unit: brig, q: 4, r: 0 }") })).StartingForces);
+
+ var c = ContentLoader.Load(Fixture.Write(Files(), new() { ["probe.yaml"] = Card("{ unit: brig, q: 4, r: 0 }") }));
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ Assert.Equal(("brig", (0, 0)), (c.StartingForces[0].Row, (s.Units[0].Q, s.Units[0].R)));
+ Assert.Contains("probe", s.PendingEvents);
+ // The card's order is the player's go-to, with the movement points the turn's orders have already spent.
+ var card = Simulation.Preview(c, s, new Command[] { new Move(0, 1, 0), new ChooseEventOption("probe", "ok") });
+ var mine = Simulation.Preview(c, s, new Command[] { new Move(0, 1, 0), new UnitOrder(0, Movement.GoTo, 4, 0) });
+ Assert.Empty(card.Rejected);
+ Assert.Equal((Movement.GoTo, "4,0", 3, 0), (card.State.Units[0].Order, card.State.Units[0].OrderTarget, card.State.Units[0].Q, card.State.Units[0].R));
+ Assert.Equal((mine.State.Units[0].Q, mine.State.Units[0].R, mine.State.Units[0].Order), (card.State.Units[0].Q, card.State.Units[0].R, card.State.Units[0].Order));
+ // Left to the cabinet at End turn, the card gives the same order.
+ var left = Simulation.Step(c, s, Array.Empty<Command>()).State.Units[0];
+ Assert.Equal((Movement.GoTo, "4,0"), (left.Order, left.OrderTarget));
+ // An enemy unit holds the anchor: the player's go-to is refused, and the card's order changes nothing (and is reported,
+ // ARefusedCardOrderIsReportedLikeThePlayersOwn).
+ s.Units.Add(9, Enemy(9, 4, 0, 1));
+ var held = Simulation.Preview(c, s, new Command[] { new ChooseEventOption("probe", "ok") });
+ Assert.Equal(Orders.RefusedCardOrder, Assert.Single(held.Rejected).Reason);
+ Assert.Equal(("", 0, 0), (held.State.Units[0].Order, held.State.Units[0].Q, held.State.Units[0].R));
+ Assert.Equal("An enemy unit holds that hex", Assert.Single(Simulation.Preview(c, s, new Command[] { new UnitOrder(0, Movement.GoTo, 4, 0) }).Rejected).Reason);
+ }
+
+ // R-ENEMY-005 (owner, 31 October 2026, #749: "Sourced anchors only"; 1 November 2026, #2087: "military operations must
+ // have unit orders", "Kiryati to Ramle", Harel toward Latrun; 2 November 2026, option 1: the new ones are order targets,
+ // not anchors): only these sourced places receive orders. Every other alternative option gives none until sources are found.
+ [Fact]
+ public void OnlyTheSourcedAnchorsReceiveCardOrders()
+ {
+ var orders = Real.Events.SelectMany(e => e.Options.SelectMany(o => o.UnitOrders.Select(x => (e.Id, o.Id, o.Historical, x.Unit, x.Q, x.R))));
+ Assert.Equal(new[]
+ {
+ ("latrun_proposal", "press_offensive", false, "harel", -3, 25), // Latrun police fort, harel order_targets[0]
+ ("operation_hiram", "stop_at_ceasefire", true, "carmeli", 15, 3), // Manara, carmeli order_targets[0]
+ ("operation_hiram", "stop_at_ceasefire", true, "brigade_7", 14, 4), // al-Malikiyya, brigade_7 order_targets[0]
+ ("operation_horev", "launch", true, "golani", -8, 28), // Julis camp, golani anchors[1]
+ ("operation_yoav", "stop_at_ceasefire", true, "negev", -10, 35), // Beersheba, negev order_targets[0]
+ ("operation_yoav", "stop_at_ceasefire", true, "givati", -9, 29), // Huleiqat, givati order_targets[0]
+ ("ten_days", "central_front", true, "kiryati", -3, 24), // Ramle, kiryati order_targets[0]
+ ("ten_days", "central_front", true, "carmeli", 14, 6), // facing the Syrian bridgehead, carmeli anchors[1]
+ }, orders.OrderBy(x => x.Item1, StringComparer.Ordinal));
+ }
+
+ // R-ENEMY-005, the owner's rulings of 1 November 2026 on #2087: each operation card's option orders the named unit, on the
+ // board, to the named hex, until its order target's `to`. The reference game (GoldenRun) is played to the card's turn; an enemy
+ // unit standing on the hex is taken off first (the ALA on al-Malikiyya), as that refusal is pinned by
+ // WarEvents1948Tests.NoTurnBeforeTheArmisticeRefusesAnOrder and ARefusedCardOrderIsReportedLikeThePlayersOwn.
+ [Theory]
+ [InlineData("ten_days", "central_front", "1948-07-15", "kiryati", -3, 24, "1948-08-16")]
+ [InlineData("operation_yoav", "stop_at_ceasefire", "1948-10-15", "negev", -10, 35, "1949-02-24")]
+ [InlineData("operation_yoav", "stop_at_ceasefire", "1948-10-15", "givati", -9, 29, "1948-11-01")]
+ [InlineData("operation_hiram", "stop_at_ceasefire", "1948-11-15", "carmeli", 15, 3, "1949-03-23")]
+ [InlineData("operation_hiram", "stop_at_ceasefire", "1948-11-15", "brigade_7", 14, 4, "1949-03-23")]
+ [InlineData("latrun_proposal", "press_offensive", "1948-09-15", "harel", -3, 25, "1948-12-22")]
+ public void AnOperationCardOrdersItsUnitToItsHex(string card, string option, string turn, string row, int q, int r, string until)
+ {
+ static DateTime Day(string d) => DateTime.Parse(d, System.Globalization.CultureInfo.InvariantCulture);
+ var s = GoldenRun.Play(Real, Day(turn));
+ Assert.Equal(Day(turn), s.Date);
+ int id = Real.StartingForces.FindIndex(f => f.Row == row);
+ Assert.True(s.Units.ContainsKey(id), row);
+ foreach (var held in s.Units.Values.Where(u => u.Side != Movement.PlayerSide && (u.Q, u.R) == (q, r)).Select(u => u.Id).ToList())
+ s.Units.Remove(held);
+ if (!s.PendingEvents.Contains(card)) s.PendingEvents.Add(card);
+ var rejected = new List<Rejection>();
+ var why = new List<Cause>();
+ Assert.Null(EventSystem.Choose(Real, s, card, option, why, rejected: rejected));
+ Assert.DoesNotContain(rejected, x => x.Command is UnitOrder o && o.Unit == id); // Hiram's other order may be refused
+ var hex = FormattableString.Invariant($"{q},{r}");
+ Assert.Contains(why, x => x.Key == WhyKeys.OnItsWay && x.Args.Contains(hex));
+ // The go-to moves the unit at once as far as its points reach (R-MOVE-008): either it is there, or the order stands.
+ var u = s.Units[id];
+ if ((u.Q, u.R) != (q, r))
+ {
+ Assert.Equal((Movement.GoTo, hex), (u.Order, u.OrderTarget));
+ Assert.Equal(Day(until), s.CardOrders[id]);
+ }
+ }
+
+ // R-ENEMY-005, the owner's answer 1 on #2087 ("Orders expire with the operation", 31 October 2026): a fixture game of one
+ // operation card. One brigade row starting on (0, 0); the card orders it to its second anchor's hex (q, r), whose
+ // window ends on `to`. With `held`, town_a (1, 0) is an enemy-held locality and an open target (R-MOVE-005, #1304).
+ // Fixture values, not history.
+ static Content CardGame(int q, int r, string to, string board, bool held = false)
+ {
+ var rows = "units:\n- id: brig\n service: army\n side: israel\n status: draft\n"
+ + " strength: { value: 30, as_of: '1948-05-15' }\n anchors:\n"
+ + " - { place: Here, lon: 34.29, lat: 33.35, from: '1948-05-15', to: '1949-01-01' }\n"
+ + " - { place: There, lon: 34.30, lat: 33.35, from: '1948-05-15', to: '" + to + "' }\n";
+ var hexes = FormattableString.Invariant($"anchors:\n - {{ id: brig, anchor: 0, q: 0, r: 0 }}\n - {{ id: brig, anchor: 1, q: {q}, r: {r} }}\n");
+ var card = "id: probe\ntitle: Fixture\ntext: Fixture.\nfrom: 1948-05-15\noptions:\n"
+ + FormattableString.Invariant($" - id: ok\n text: Accept\n historical: true\n unit_orders: [{{ unit: brig, q: {q}, r: {r} }}]\n");
+ var files = Fixture.Gdd(new Dictionary<string, string>
+ {
+ ["unit_types.yaml"] = Types, ["map/hexes.json"] = board, ["corridors.yaml"] = "corridors: []\n",
+ ["map/units_1948.yaml"] = rows, ["map/unit_anchor_hexes.yaml"] = hexes,
+ });
+ if (held)
+ {
+ files["rules.yaml"] = files["rules.yaml"].Replace("enemy_held_localities: []", "enemy_held_localities: [town_a]");
+ files["settlement_targets.yaml"] = "targets:\n" + CaptureTests.Target("town_a", 1, 0);
+ files["map/settlements_1948.yaml"] = Fixture.Files["map/settlements_1948.yaml"].Replace("type: town", "type: arab_town");
+ }
+ return ContentLoader.Load(Fixture.Write(files, new() { ["probe.yaml"] = card }));
+ }
+
+ // (a) The order ends when its anchor's window ends (the anchor's `to`, sourced in units_1948.yaml), so the unit stops
+ // where it is: no late arrival. With a later end the same march arrives on the next turn.
+ [Fact]
+ public void ACardOrderEndsWhenItsAnchorsWindowEnds()
+ {
+ var c = CardGame(5, 0, "1948-05-20", MovementTests.Board());
+ var first = Simulation.Step(c, Simulation.NewGame(c, 1, Mode.Historical), new Command[] { new ChooseEventOption("probe", "ok") });
+ Assert.Equal((3, 0, Movement.GoTo), (first.State.Units[0].Q, first.State.Units[0].R, first.State.Units[0].Order));
+ Assert.Equal(new DateTime(1948, 5, 22), first.State.Date); // weekly turns: the window has ended
+ var next = Simulation.Step(c, first.State, Array.Empty<Command>());
+ Assert.Equal((3, 0, ""), (next.State.Units[0].Q, next.State.Units[0].R, next.State.Units[0].Order));
+ Assert.Contains(next.Why, x => x.Key == WhyKeys.CardOrderEnded && x.Args.SequenceEqual(new[] { "5,0" }));
+
+ var open = CardGame(5, 0, "1948-06-01", MovementTests.Board());
+ var later = Simulation.Step(open, Simulation.NewGame(open, 1, Mode.Historical), new Command[] { new ChooseEventOption("probe", "ok") });
+ later = Simulation.Step(open, later.State, Array.Empty<Command>());
+ Assert.Equal((5, 0, ""), (later.State.Units[0].Q, later.State.Units[0].R, later.State.Units[0].Order));
+ // An order to an anchor with no end could outlast its operation: the loader refuses it.
+ var endless = Assert.Throws<ContentException>(() => CardGame(5, 0, "", MovementTests.Board()));
+ Assert.Equal(("events/probe.yaml", "events[probe].options[ok].unit_orders[0]"), (endless.File, endless.Field));
+ Assert.Contains("no 'to' date", endless.Message);
+ }
+
+ // R-ENEMY-005, the owner's option 1 on #2087 (2 November 2026): a card may order a row's unit to one of its `order_targets`,
+ // sourced and dated as an anchor but never drawn and never a start; the order ends on the target's `to`. The loader
+ // refuses a target with no sources or no from/to date. Fixture values: one brigade row on (0, 0), a target on (4, 0).
+ static Content OrderTargetGame(string target)
+ {
+ var rows = "units:\n- id: brig\n service: army\n side: israel\n status: draft\n"
+ + " strength: { value: 30, as_of: '1948-05-15' }\n anchors:\n"
+ + " - { place: Here, lon: 34.29, lat: 33.35, from: '1948-05-15', to: '1949-01-01' }\n"
+ + " order_targets:\n - { place: There, lon: 34.30, lat: 33.35" + target + " }\n";
+ const string Hexes = "anchors:\n - { id: brig, anchor: 0, q: 0, r: 0 }\norder_targets:\n - { id: brig, target: 0, q: 4, r: 0 }\n";
+ const string Card = "id: probe\ntitle: Fixture\ntext: Fixture.\nfrom: 1948-05-15\noptions:\n"
+ + " - id: ok\n text: Accept\n historical: true\n unit_orders: [{ unit: brig, q: 4, r: 0 }]\n";
+ var files = Fixture.Gdd(new Dictionary<string, string>
+ {
+ ["unit_types.yaml"] = Types, ["map/hexes.json"] = MovementTests.Board(), ["corridors.yaml"] = "corridors: []\n",
+ ["map/units_1948.yaml"] = rows, ["map/unit_anchor_hexes.yaml"] = Hexes,
+ });
+ return ContentLoader.Load(Fixture.Write(files, new() { ["probe.yaml"] = Card }));
+ }
+
+ [Fact]
+ public void ACardOrdersAUnitToASourcedDatedOrderTarget()
+ {
+ const string Sources = ", sources: [{ url: 'https://example.org/a', checked: '2026-11-02' }]";
+ var c = OrderTargetGame(", from: '1948-05-15', to: '1948-05-20'" + Sources);
+ var start = Assert.Single(c.StartingForces);
+ Assert.Equal((0, 0), (start.Q, start.R)); // a target starts no unit
+ var first = Simulation.Step(c, Simulation.NewGame(c, 1, Mode.Historical), new Command[] { new ChooseEventOption("probe", "ok") });
+ Assert.Empty(first.Rejected);
+ Assert.Equal((3, 0, Movement.GoTo), (first.State.Units[0].Q, first.State.Units[0].R, first.State.Units[0].Order));
+ var next = Simulation.Step(c, first.State, Array.Empty<Command>()); // the target's `to` has passed: the order ends
+ Assert.Contains(next.Why, x => x.Key == WhyKeys.CardOrderEnded && x.Args.SequenceEqual(new[] { "4,0" }));
+
+ foreach (var (target, field) in new[]
+ {
+ (", from: '1948-05-15', to: '1948-05-20'", "units[brig].order_targets[0].sources"),
+ (", from: '1948-05-15', to: '1948-05-20', sources: []", "units[brig].order_targets[0].sources"),
+ (", to: '1948-05-20'" + Sources, "units[brig].order_targets[0].from"),
+ (", from: '1948-05-15'" + Sources, "units[brig].order_targets[0].to"),
+ })
+ {
+ var e = Assert.Throws<ContentException>(() => OrderTargetGame(target));
+ Assert.Equal(("map/units_1948.yaml", field), (e.File, e.Field));
+ }
+ }
+
+ // (b) The card's march never ends on an enemy-held place it was not sent to: it goes round town_a, where the player's
+ // own go-to on the same route ends its first turn and captures it (unchanged). (2, 0) is desert, so the cheapest way
+ // runs through town_a and the way round costs one more.
+ [Fact]
+ public void ACardOrderGoesRoundAnEnemyHeldPlaceItWasNotSentTo()
+ {
+ var c = CardGame(2, 0, "1949-01-01", MovementTests.Board((2, 0, "desert")), held: true);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ var mine = Simulation.Preview(c, s, new Command[] { new UnitOrder(0, Movement.GoTo, 2, 0) });
+ Assert.Equal((1, 0), (mine.State.Units[0].Q, mine.State.Units[0].R));
+ Assert.Equal(new[] { "town_a" }, mine.State.Settlements.Keys);
+
+ var card = Simulation.Step(c, s, new Command[] { new ChooseEventOption("probe", "ok") });
+ Assert.NotEqual((1, 0), (card.State.Units[0].Q, card.State.Units[0].R));
+ Assert.Empty(card.State.Settlements);
+ var arrived = Simulation.Step(c, card.State, Array.Empty<Command>());
+ Assert.Equal((2, 0, ""), (arrived.State.Units[0].Q, arrived.State.Units[0].R, arrived.State.Units[0].Order));
+ Assert.Empty(arrived.State.Settlements);
+ }
+
+ // (c) A refused card order is told to the player the way a refused order of the player's is: a rejection with a reason
+ // the UI has in English and Hebrew (SimBridge.ReasonKeys). Here an enemy unit holds the anchor, chosen and delegated.
+ [Fact]
+ public void ARefusedCardOrderIsReportedLikeThePlayersOwn()
+ {
+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ s.Units.Add(9, Enemy(9, 4, 0, 1));
+ foreach (var commands in new[] { new Command[] { new ChooseEventOption("probe", "ok") }, Array.Empty<Command>() })
+ {
+ var r = Simulation.Step(c, s, commands);
+ var refused = Assert.Single(r.Rejected);
+ Assert.Equal(Orders.RefusedCardOrder, refused.Reason);
+ var order = Assert.IsType<UnitOrder>(refused.Command);
+ Assert.Equal((0, Movement.GoTo, (int?)4, (int?)0), (order.Unit, order.Order, order.Q, order.R));
+ Assert.Equal((0, 0, ""), (r.State.Units[0].Q, r.State.Units[0].R, r.State.Units[0].Order));
+ }
+ }
+
+ // Review of #2087, optional 1: a delegated card's order shares the movement points a Move spent in the same turn, as a
+ // chosen card's does (OperationCardOrdersAreValidated). Unshared, the unit would arrive on (4, 0).
+ [Fact]
+ public void ADelegatedCardOrderSharesTheTurnsMovementPoints()
+ {
+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());
+ var r = Simulation.Step(c, Simulation.NewGame(c, 1, Mode.Historical), new Command[] { new Move(0, 1, 0) });
+ Assert.Equal((3, 0, Movement.GoTo), (r.State.Units[0].Q, r.State.Units[0].R, r.State.Units[0].Order));
+ }
+
+ // R-ENEMY-005, R-CTRL-013 (owner, 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)"; the option: "A
+ // delegated order never pulls the last unit out of an occupied town; Golani's order is skipped (or another unit goes) and
+ // the card says so"). mvp-occupy-cost's state on 15 December 1948: Golani (unit 0) alone on Nazareth, which awaits the end
+ // of its occupation, and Operation Horev pending. The turn delegates Horev's historical option (a hard anchor in
+ // Historical mode, no draw), whose order sends Golani to the Julis camp (-8, 28).
+ // Red without the rule: GiveGoTo gives Golani the go-to and Advance moves it off Nazareth at once, so the turn lists no
+ // refusal for unit 0 (Assert.Single fails), Golani is no longer on Nazareth's hex, and step 10 finds no unit there and
+ // ends the occupation as a Raid (R-CTRL-013), so Nazareth's record is gone (the last assert fails with a missing key).
+ [Fact]
+ public void HorevsOrderNeverTakesTheLastUnitOffNazareth()
+ {
+ var s = AloneInNazareth("1948-12-15");
+ Assert.Contains("operation_horev", s.PendingEvents);
+ var r = Simulation.Step(Real, s, Array.Empty<Command>());
+ var refused = Assert.Single(r.Rejected, j => j.Command is UnitOrder { Unit: 0 });
+ Assert.Equal(Orders.RefusedLastGarrison, refused.Reason);
+ var order = Assert.IsType<UnitOrder>(refused.Command);
+ Assert.Equal((Movement.GoTo, (int?)-8, (int?)28), (order.Order, order.Q, order.R));
+ var golani = r.State.Units[0];
+ Assert.Equal((Nazareth.Q, Nazareth.R), (golani.Q, golani.R));
+ Assert.NotEqual(Movement.GoTo, golani.Order);
+ Assert.False(r.State.CardOrders.ContainsKey(0));
+ Assert.Equal(SettlementControl.AwaitingEnd, r.State.Settlements["nazareth"].State);
+ }
+
+ // The same turn with a second Israeli unit on Nazareth: Golani is not the last, so Horev's order goes ahead ("or another
+ // unit goes" is not built: the card orders the unit it names) and the second unit keeps the occupation. Green with or
+ // without the rule; it is red for a rule that is too wide, one that held back any unit on an occupied place.
+ [Fact]
+ public void HorevsOrderGoesAheadWhenAnotherUnitHoldsNazareth()
+ {
+ var s = AloneInNazareth("1948-12-15");
+ var g = s.Units[0];
+ var second = s.NextId++;
+ s.Units.Add(second, new Unit(second, g.Type, g.Q, g.R, g.Service, g.Side, g.Strength, "", "", g.HomeCity, g.Full));
+ var r = Simulation.Step(Real, s, Array.Empty<Command>());
+ Assert.DoesNotContain(r.Rejected, j => j.Command is UnitOrder { Unit: 0 });
+ Assert.Equal((Movement.GoTo, "-8,28"), (r.State.Units[0].Order, r.State.Units[0].OrderTarget));
+ Assert.NotEqual((Nazareth.Q, Nazareth.R), (r.State.Units[0].Q, r.State.Units[0].R));
+ Assert.Equal((Nazareth.Q, Nazareth.R), (r.State.Units[second].Q, r.State.Units[second].R));
+ Assert.Equal(SettlementControl.AwaitingEnd, r.State.Settlements["nazareth"].State);
+ }
+
+ // "Never": the check holds on every turn of the march, not only when the card gives the order. A card's go-to still
+ // standing for Golani alone on Nazareth (as when the march ends a turn on Nazareth and the unit that held it is then lost,
+ // or a second unit there let the order go ahead but Golani could not move that turn and the other unit then left) is taken
+ // away at the route step, listed with the same reason, and Golani stays. The order is cleared, not paused: nothing brings
+ // it back. The 15 November 1948 turn is used, before Horev, so Horev's
+ // own order is not in the turn; Hiram's orders name Carmeli and the 7th Brigade, not Golani.
+ // Red without the rule: ContinueRoutes advances the card's go-to, Golani leaves Nazareth, no refusal names unit 0, and step
+ // 10 ends the occupation. The player's own go-to (no CardOrders entry) is never held back: Golani leaves.
+ [Fact]
+ public void AStandingCardOrderStopsRatherThanEmptyNazareth()
+ {
+ var s = AloneInNazareth("1948-11-15");
+ Assert.DoesNotContain("operation_horev", s.PendingEvents);
+ var g = s.Units[0];
+ s.Units[0] = new Unit(g.Id, g.Type, g.Q, g.R, g.Service, g.Side, g.Strength, Movement.GoTo, "-8,28", g.HomeCity, g.Full, g.CombatXp);
+ var mine = Simulation.Step(Real, s, Array.Empty<Command>()); // the player's go-to, before the card's entry is added
+ Assert.DoesNotContain(mine.Rejected, j => j.Command is UnitOrder { Unit: 0 });
+ Assert.NotEqual((Nazareth.Q, Nazareth.R), (mine.State.Units[0].Q, mine.State.Units[0].R));
+
+ s.CardOrders[0] = new DateTime(1949, 2, 24); // Golani's Julis anchor's window (R-ENEMY-005)
+ var r = Simulation.Step(Real, s, Array.Empty<Command>());
+ Assert.Equal(Orders.RefusedLastGarrison, Assert.Single(r.Rejected, j => j.Command is UnitOrder { Unit: 0 }).Reason);
+ Assert.Equal((Nazareth.Q, Nazareth.R, ""), (r.State.Units[0].Q, r.State.Units[0].R, r.State.Units[0].Order));
+ Assert.False(r.State.CardOrders.ContainsKey(0));
+ Assert.Equal(SettlementControl.AwaitingEnd, r.State.Settlements["nazareth"].State);
+ }
+
+ // R-ENEMY-005, R-CTRL-013, the tie-break (review of #2087, C1): two Israeli units on Nazareth, both on a card's march to
+ // the Julis camp. The route step takes the units in ascending id and checks each as it comes (Movement.ContinueRoutes,
+ // SettlementControl.LastGarrison): Golani (unit 0) is not the last, so it marches off; the second unit, a higher id, is
+ // then the last one there, so its order is taken away and it stays. The 15 December 1948 state is the one
+ // HorevsOrderGoesAheadWhenAnotherUnitHoldsNazareth uses, where a card's march takes Golani off Nazareth. Only the route
+ // step runs, so Horev's own order is not in it.
+ // Red without the rule: both march and Nazareth is left with no unit, and no refusal names the second unit. Red for a
+ // check made once for the hex before either moved (neither is the last, so both march), or for one in descending id
+ // (Golani would stay and the second unit would march).
+ [Fact]
+ public void OfTwoUnitsOnACardsMarchTheHigherIdStays()
+ {
+ var s = AloneInNazareth("1948-12-15");
+ var g = s.Units[0];
+ var second = s.NextId++;
+ Assert.True(second > 0);
+ foreach (var id in new[] { 0, second })
+ {
+ s.Units[id] = new Unit(id, g.Type, g.Q, g.R, g.Service, g.Side, g.Strength, Movement.GoTo, "-8,28", g.HomeCity, g.Full, id == 0 ? g.CombatXp : 0);
+ s.CardOrders[id] = new DateTime(1949, 2, 24); // Golani's Julis anchor's window (R-ENEMY-005)
+ }
+ var rejected = new List<Rejection>();
+ Movement.ContinueRoutes(Real, s, new Dictionary<int, int>(), new List<Cause>(), rejected);
+ Assert.DoesNotContain(rejected, j => j.Command is UnitOrder { Unit: 0 });
+ Assert.NotEqual((Nazareth.Q, Nazareth.R), (s.Units[0].Q, s.Units[0].R));
+ Assert.Equal(Orders.RefusedLastGarrison, Assert.Single(rejected, j => j.Command is UnitOrder o && o.Unit == second).Reason);
+ Assert.Equal((Nazareth.Q, Nazareth.R, ""), (s.Units[second].Q, s.Units[second].R, s.Units[second].Order));
+ Assert.False(s.CardOrders.ContainsKey(second));
+ }
+
+ static SettlementTarget Nazareth =>Real.SettlementTargets.Single(t => t.Id == "nazareth");
+
+ /// <summary>mvp-occupy-cost played to <paramref name="until"/> (its own steps, the run's end replaced): Golani (unit 0,
+ /// the first starting force) alone on Nazareth, which awaits the end of its occupation. The card orders apply under
+ /// gdd-0.1 only (EventSystem.Resolve), which the real content is.</summary>
+ static GameState AloneInNazareth(string until)
+ {
+ Assert.NotEqual(SaveGame.Gdd03Ruleset, Real.Ruleset);
+ Assert.Equal("golani", Real.StartingForces[0].Row);
+ var text = System.IO.File.ReadAllText(System.IO.Path.Combine(ScenarioTests.Dir(), "mvp-occupy-cost.yaml"));
+ var s = Scenario.Parse(System.Text.RegularExpressions.Regex.Replace(text, "(?m)^until: .*$", "until: " + until)).Play(Real);
+ Assert.Equal(DateTime.Parse(until, System.Globalization.CultureInfo.InvariantCulture), s.Date);
+ Assert.Equal(new[] { 0 }, s.Units.Values.Where(u => (u.Q, u.R) == (Nazareth.Q, Nazareth.R) && u.Side == Movement.PlayerSide).Select(u => u.Id));
+ Assert.Equal(SettlementControl.AwaitingEnd, s.Settlements["nazareth"].State);
+ return s;
+ }
// R-ENEMY-003, #2114 (O4, owner ruling 1 Nov 2026): under exact gdd-0.3 the threshold is the catalogue's
// combat.enemy_attack_ratio, 1.5:1 (150%); gdd-0.1 keeps mvp.enemy_attack_ratio_percent (the fixture's 200).
diff --git a/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs b/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs
index fc1c465db..1d49cbd09 100644
--- a/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs
+++ b/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs
@@ -401,13 +401,13 @@ public class Gdd03EventRulesTests
"jerusalem_ceasefire:b850682a7736dcf2870550322f32a2d5c30963a05529dc9162dd68c9234648d6", // re-pinned for #1065 (Beri's native Hebrew read)
"jerusalem_demilitarisation_guard:a9693784deafaad901268afd8a0c47a2f5b7d5f75eba33d6180f94b62913fb53", // re-pinned for #1065 (owner's native read; flag removed in 05b5777d9), then for the stale reviewer comment (comment-only)
"jerusalem_military_government:526dbc88eabe4691e3ee1f3ed2c5fdeb640f11ae0a7a632c63066175b9c18176", // re-pinned for #1065 (Beri's native Hebrew read)
- "latrun_proposal:169933e28b8fc3085c5e74176a731d83f1e1955ed0ffac9a706029f738353bf5", // re-pinned for #1065 (Beri's native Hebrew read)
+ "latrun_proposal:c35f17ffa48d949b432ce9205a245048bd50bf660940206245e8f0d6f5b62916", // re-pinned for #1065 (Beri's native Hebrew read), then for #2087 (R-ENEMY-005 unit order: Harel toward Latrun; owner rulings, 1 and 2 November 2026, order targets; hex re-derived on the 4.4 km grid by tools/unit_anchor_hexes.py and its units_1948.yaml line citations updated; card text, Hebrew and review status unchanged)
"law_of_return:d04bb849bbb6fa089afc6e1123f8335aa1b03f49bc025f9d1c6746c48d27b398", // re-pinned for #1065 (Beri's native Hebrew read)
"maabarot_policy:12e53e14fe3b045f7c18b75ac7af68acf079c17968baf6c82df2435675eb0884", // re-pinned for #1065 (Beri's native Hebrew read)
"ministry_supply_crisis:2de253de7bafb65f0168bdc151dc0b47fec94843ad6f13bf3ac092d7015b55f9", // re-pinned for #1065 (Beri's native Hebrew read)
- "operation_hiram:c8db23f9a331b0cf517e4762fe8f71dc286548ada77115b9500a93bce6ba740e", // re-pinned for #1065 (Beri's native Hebrew read)
- "operation_horev:6e018d54d46b46676d5ab56bc2fcedbeffab23a00334f75b415aec1713507f51", // re-pinned for #1065 (Beri's native Hebrew read)
- "operation_yoav:3d2e9a9a4416a4277e4c17da1e442895bda562c238e6f459c45b6ab89a9133fe", // re-pinned for #1065 (Beri's native Hebrew read)
+ "operation_hiram:e7c661e53f93576d8a135008e0d1e623430967a36729b58b67a4af195165bccf", // re-pinned for #1065 (Beri's native Hebrew read), then for #2087 (R-ENEMY-005 unit orders: Carmeli to Manara, the 7th Brigade to al-Malikiyya; owner rulings, 1 and 2 November 2026, order targets; hexes re-derived on the 4.4 km grid by tools/unit_anchor_hexes.py and its units_1948.yaml line citations updated; card text, Hebrew and review status unchanged)
+ "operation_horev:373bf144ad21c326eed5895d7bf57b2d73e922c8589bab47da812e2f96f5fb45", // re-pinned for #1065 (Beri's native Hebrew read), then for #2087 (R-ENEMY-005 unit orders; owner ruling, 31 October 2026; hex re-derived on the 4.4 km grid by tools/unit_anchor_hexes.py; review status unchanged), then re-pinned for the Horev garrison line (owner, 2 November 2026, "Add the line (Recommended)", #2087)
+ "operation_yoav:c4af1976488006f26f06cddaa6a9e3379d0193f5c5c22c8e789ccff64dabfefc", // re-pinned for #1065 (Beri's native Hebrew read), then for #2087 (R-ENEMY-005 unit orders: Negev to Beersheba, Givati to Huleiqat; owner rulings, 1 and 2 November 2026, order targets; hexes re-derived on the 4.4 km grid by tools/unit_anchor_hexes.py and its units_1948.yaml line citations updated; card text, Hebrew and review status unchanged)
"rafah_force_pressure:37ca577e1b93f241035d8bf322810f311a084427307c5722f4122238aa9ec6b8", // re-pinned for #1065 (owner's native read; flag removed in 05b5777d9), then for the stale reviewer comment (comment-only)
"railway_complete:98d06d62c88d889e3e4a98f954fb04727695c37f58c6ccef94449fc16e88bd04", // re-pinned for #1065 (owner's native read; flag removed in 8fbcb2aff), then for the stale reviewer comment (comment-only)
"reparations_claim:5412e71f4f5a90a92bd86622eb1a169feee45f0ba2fe82c5ab40bd8f3d43cafd", // re-pinned for #1065 (Beri's native Hebrew read)
@@ -415,8 +415,72 @@ public class Gdd03EventRulesTests
"rhodes_talks:c5c9cdf906f75e2672e5eedaeadab7f224df96f666a3097813903b81ec06f4f6", // re-pinned for #1065 (Beri's native Hebrew read)
"second_truce:22eeb171849bac248d58cec944c03bac6aee56c96a192aabf0aba2b7e02b19f6", // re-pinned for #1065 (Beri's native Hebrew read)
"sinai_withdrawal:4abcd39e509c3d404523f7a5609bdb8e1e5180c19524367790ba7adf0af9e06b", // re-pinned for #1065 (Beri's native Hebrew read)
- "ten_days:7fece9c0eb4f56ece79a7247e430fb679d3d4d826165e598fd0bd982099a412a", // re-pinned for #1065 (Beri's native Hebrew read)
+ "ten_days:0be9dc54863d46b935428e7a6fd1c9d8fe21194960c976d3ed4283b9e1088962", // re-pinned for #1065 (Beri's native Hebrew read), then for #2087 (R-ENEMY-005 unit orders: Kiryati to Ramle replaces Yiftach to Lydda, sent to Ramla's capture target; owner rulings, 1 and 2 November 2026, order target; hexes re-derived on the 4.4 km grid by tools/unit_anchor_hexes.py and its units_1948.yaml line citations updated; card text, Hebrew and review status unchanged)
};
+ // R-ENEMY-005 (owner, 31 October 2026, #749: "GDD 0.1 only"): the operation cards' unit orders apply under gdd-0.1; under
+ // gdd-0.3 the cards stay effect-free for units until a 0.3 accounting contract exists (R-EFX-001/005).
+ [Theory]
+ [InlineData(false)]
+ [InlineData(true)]
+ public void OperationCardOrdersApplyUnderGdd01Only(bool modern)
+ {
+ var c = Real(modern);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ Assert.Equal("golani", c.StartingForces[0].Row);
+ var before = s.Units[0];
+ s.PendingEvents.Add("operation_horev");
+ Assert.Null(EventSystem.Choose(c, s, "operation_horev", "launch", new List<Cause>()));
+ var after = s.Units[0];
+ Assert.Equal(modern ? (before.Order, before.OrderTarget) : (Movement.GoTo, "-8,28"), (after.Order, after.OrderTarget));
+ }
+ // R-ENEMY-005, R-CTRL-013 (owner, 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)"; owner, 31 October
+ // 2026, #749: "GDD 0.1 only"): Golani alone on Nazareth in the `occupied` state, its timer still running (the EnemyAITests
+ // cases are all `awaiting_end`), and Horev launched. Under gdd-0.1 the order is held back with Orders.RefusedLastGarrison
+ // and Golani stays; under gdd-0.3 the card gives no unit order, so nothing is refused, RefusedLastGarrison never appears,
+ // and Golani is untouched.
+ // Red without the rule's `occupied` half (SettlementControl.LastGarrison reading only `awaiting_end`): under gdd-0.1 the
+ // order is given, or refused with another reason, so no RefusedLastGarrison names unit 0. Red for a check made outside
+ // the gdd-0.3 guard (EventSystem.Resolve): under gdd-0.3 a RefusedLastGarrison would appear.
+ [Theory]
+ [InlineData(false)]
+ [InlineData(true)]
+ public void TheLastGarrisonRuleHoldsForAnOccupiedPlaceUnderGdd01Only(bool modern)
+ {
+ var c = Real(modern);
+ Assert.Equal(modern, c.Ruleset == SaveGame.Gdd03Ruleset);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ Assert.Equal("golani", c.StartingForces[0].Row);
+ var nazareth = c.SettlementTargets.Single(t => t.Id == "nazareth");
+ var g = s.Units[0];
+ s.Units[0] = new Unit(g.Id, g.Type, nazareth.Q, nazareth.R, g.Service, g.Side, g.Strength, "", "", g.HomeCity, g.Full, g.CombatXp);
+ Assert.Equal(new[] { 0 }, s.Units.Values.Where(u => (u.Q, u.R) == (nazareth.Q, nazareth.R) && u.Side == Movement.PlayerSide).Select(u => u.Id));
+ s.Settlements["nazareth"] = new SettlementControl(Movement.PlayerSide, SettlementControl.Occupied, s.Date, turns: 3);
+ s.PendingEvents.Add("operation_horev");
+ var rejected = new List<Rejection>();
+ Assert.Null(EventSystem.Choose(c, s, "operation_horev", "launch", new List<Cause>(), rejected: rejected));
+ Assert.Equal(modern ? Array.Empty<string>() : new[] { Orders.RefusedLastGarrison },
+ rejected.Where(j => j.Command is UnitOrder { Unit: 0 }).Select(j => j.Reason));
+ if (modern) Assert.DoesNotContain(rejected, j => j.Reason == Orders.RefusedLastGarrison);
+ Assert.Equal((nazareth.Q, nazareth.R, "", ""), (s.Units[0].Q, s.Units[0].R, s.Units[0].Order, s.Units[0].OrderTarget));
+ Assert.False(s.CardOrders.ContainsKey(0));
+ Assert.Equal(SettlementControl.Occupied, s.Settlements["nazareth"].State);
+ }
+ // Review of #2087, optional 2: under gdd-0.3 the loader still checks the cards' orders (owner, 31 October 2026, #749), so
+ // a Horev order to a hex that is not one of golani's anchors is refused there too.
+ [Fact]
+ public void Gdd03StillRefusesACardOrderToAHexNoAnchorHas()
+ {
+ var root = RealContentTests.ContentRoot();
+ var e = Assert.Throws<ContentException>(() => ContentLoader.Load(rel =>
+ {
+ var path = Path.Combine(root, rel);
+ var text = File.Exists(path) ? File.ReadAllText(path) : null;
+ if (rel == "eras.yaml") return text!.Replace("loop: gdd", "loop: gdd, ruleset: gdd-0.3");
+ return rel == "events/operation_horev.yaml" ? text!.Replace("{ unit: golani, q: -8, r: 28 }", "{ unit: golani, q: -8, r: 27 }") : text;
+ }, Directory.GetFiles(Path.Combine(root, "events"), "*.yaml").Select(p => "events/" + Path.GetFileName(p))));
+ Assert.Equal(("events/operation_horev.yaml", "events[operation_horev].options[launch].unit_orders[0]"), (e.File, e.Field));
+ Assert.Contains("not an anchor", e.Message);
+ }
[Fact]
public void AllFortyOneSourceRecordsIncludingReviewsAndHebrewAreUnchanged()
{
diff --git a/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs b/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs
index 30881786c..55c5227b7 100644
--- a/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs
+++ b/sim/Statecraft.Sim.Tests/MoneyCausesTests.cs
@@ -312,7 +312,7 @@ public class MoneyCausesTests
for (int t = 1; t < 1000 && s.GameOver == null; t++)
{
var r = Simulation.Step(Real, s, GoldenRun.Orders(Real, s));
- Assert.Empty(r.Rejected);
+ Assert.DoesNotContain(r.Rejected, j => !WarEvents1948Tests.IsTheMalkiyaRefusal(j)); // R-ENEMY-005: Hiram's refused order, pinned there
foreach (var w in r.Why)
{
if (w.Key == CauseKeys.Paid) paid.Add(w.Args[0]);
diff --git a/sim/Statecraft.Sim.Tests/OccupyTests.cs b/sim/Statecraft.Sim.Tests/OccupyTests.cs
index fe831c0af..fcc0bb3fa 100644
--- a/sim/Statecraft.Sim.Tests/OccupyTests.cs
+++ b/sim/Statecraft.Sim.Tests/OccupyTests.cs
@@ -231,7 +231,7 @@ public class OccupyTests
var real = ContentLoader.Load(RealContentTests.ContentRoot());
var sc = Scenario.Parse(System.IO.File.ReadAllText(System.IO.Path.Combine(ScenarioTests.Dir(), "mvp-occupy-cost.yaml")));
var s = sc.Play(real);
- Assert.Equal(new DateTime(1949, 1, 15), s.Date);
+ Assert.Equal(new DateTime(1948, 12, 15), s.Date);
var ctrl = s.Settlements["nazareth"];
Assert.Equal((Movement.PlayerSide, SettlementControl.AwaitingEnd, 0, new DateTime(1948, 7, 15)), (ctrl.Owner, ctrl.State, ctrl.Turns, ctrl.Since));
}
diff --git a/sim/Statecraft.Sim.Tests/OldSaveCompatibilityTests.cs b/sim/Statecraft.Sim.Tests/OldSaveCompatibilityTests.cs
index 15043d47e..572b3edee 100644
--- a/sim/Statecraft.Sim.Tests/OldSaveCompatibilityTests.cs
+++ b/sim/Statecraft.Sim.Tests/OldSaveCompatibilityTests.cs
@@ -2,13 +2,14 @@ using System.IO;
using Statecraft.Sim;
/// <summary>
-/// The fixture is a real gdd-0.1 save written by v0.3.4. Replay drift under gdd-0.1 means a v0.3.4 player's save
-/// no longer loads identically; that is a release blocker, not a fixture to regenerate.
+/// The fixture is a real gdd-0.1 save written by v0.3.4. It delegates ten_days and chooses operation_yoav, whose unit
+/// orders now apply under gdd-0.1 (R-ENEMY-005), so it replays differently by design (owner, 3 Nov 2026, #2087). Any
+/// other replay change still needs an owner decision, not a fixture to regenerate.
/// </summary>
public class OldSaveCompatibilityTests
{
[Fact]
- public void V034Gdd01SaveStillLoadsIdentically()
+ public void V034Gdd01SaveStillLoadsAndReportsReplayDiffers()
{
var content = ContentLoader.Load(RealContentTests.ContentRoot());
var repo = Directory.GetParent(RealContentTests.ContentRoot())!.FullName;
@@ -20,15 +21,13 @@ public class OldSaveCompatibilityTests
var loaded = GameSession.Load(content, text, out var warnings);
- // The replay and the open turn first: with other content, drift only adds replay_differs, so checking the
- // warnings first would hide which part drifted.
- // If this fails after a deliberate gdd-0.1 rule or design-value change (a golden re-pin, docs/determinism.md),
- // v0.3.4 players' saves no longer replay identically: they load with replay_differs (GameSession.Load). That needs an
- // owner decision, not a fixture update or deleting this test (as #1780's hand-pinned hash tests were).
- Assert.Equal(saved.FinalHash, loaded.State.Hash());
+ // Owner, 3 Nov 2026, #2087, option (a) "Accept replay differs": a v0.3.4 save that chose or delegated an
+ // operation card replays differently now that the cards' unit orders apply under gdd-0.1, and loads with
+ // replay_differs. No v0.3.4 save that never touches these cards was produced, so this save checks the accepted
+ // outcome: it still loads, keeps its open order and warns content_changed plus replay_differs, nothing else.
var order = Assert.IsType<UnitOrder>(Assert.Single(loaded.Committed));
Assert.Equal((3, Orders.Fortify), (order.Unit, order.Order));
- Assert.Equal(new[] { GameSession.ContentChanged }, warnings);
+ Assert.Equal(new[] { GameSession.ContentChanged, GameSession.ReplayDiffers }, warnings);
}
}
diff --git a/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs b/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs
index c487c5b18..39eea58f4 100644
--- a/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs
+++ b/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs
@@ -171,7 +171,7 @@ public class SliceSmokeTests
Assert.Equal(turn + 1, recorded.Count);
Assert.Equal(o.Orders, recorded.Sum(batch => batch.Count));
foreach (var cmd in cmds.Where(x => r.Rejected.All(j => j.Command != x))) o.Carried.Add(cmd.Kind);
- foreach (var x in r.Rejected)
+ foreach (var x in r.Rejected.Where(j => !WarEvents1948Tests.IsTheMalkiyaRefusal(j)))
o.Failures.Add($"turn {turn + 1}: refused {Describe(x.Command)}: {x.Reason}");
if (guard != null) Check(turn + 1, c, guard, Shown(c, g).ToList(), o);
if (reload)
diff --git a/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs b/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs
index ad14b8ba0..c6345cea7 100644
--- a/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs
+++ b/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs
@@ -203,14 +203,40 @@ public class WarEvents1948Tests
}
/// <summary>Every card is answered by HistoricalAI on the turn it appears, and nothing is refused for attention
- /// (fix round 1: attention at or under the cap on every turn).</summary>
+ /// (fix round 1: attention at or under the cap on every turn). One known refusal: Operation Hiram's order to the 7th
+ /// Brigade (R-ENEMY-005; owner, 1 November 2026, #2087), refused on the 15 November 1948 turn because the ALA's unit
+ /// still holds al-Malikiyya, as the player's own go-to would be.</summary>
[Fact]
public void NoTurnBeforeTheArmisticeRefusesAnOrder()
{
foreach (var t in Run)
- Assert.True(t.Rejected.Count == 0, $"turn {t.Start:yyyy-MM-dd}: refused {string.Join("; ", t.Rejected.Select(r => r.Reason))}");
+ Assert.True(t.Rejected.All(IsTheMalkiyaRefusal), $"turn {t.Start:yyyy-MM-dd}: refused {string.Join("; ", t.Rejected.Select(r => r.Reason))}");
+ Assert.Equal(new[] { new DateTime(1948, 11, 15) }, Run.Where(t => t.Rejected.Any(IsTheMalkiyaRefusal)).Select(t => t.Start));
}
+ /// <summary>A game played with no commands at all, as Unity's CityPanelTests play the site's build turns (#2087, their
+ /// EditMode failure on round 4): every unanswered card is delegated (R-EVT-003), and the one refusal is the delegated Hiram
+ /// card's order to the 7th Brigade, on the 15 November 1948 turn, the seventh. A turn with no card order refuses nothing.</summary>
+ [Fact]
+ public void AnUntouchedGameRefusesOnlyHiramsOrderToTheSeventhBrigade()
+ {
+ var s = GameSession.New(C, GoldenRun.Seed, Mode.Historical).State;
+ var refused = new List<(int Turn, DateTime Start, Rejection X)>();
+ for (int turn = 1; turn <= 12; turn++)
+ {
+ var r = Simulation.Step(C, s, new Command[0]);
+ refused.AddRange(r.Rejected.Select(x => (turn, s.Date, x)));
+ s = r.State;
+ }
+ var only = Assert.Single(refused);
+ Assert.Equal((7, new DateTime(1948, 11, 15)), (only.Turn, only.Start));
+ Assert.True(IsTheMalkiyaRefusal(only.X), only.X.Reason);
+ }
+
+ /// <summary>Operation Hiram's refused card order: the 7th Brigade (unit 13, R-UNIT-009) to al-Malikiyya (14,4).</summary>
+ internal static bool IsTheMalkiyaRefusal(Rejection x) =>
+ x.Reason == Orders.RefusedCardOrder && x.Command is UnitOrder { Unit: 13, Q: 14, R: 4 };
+
[Fact]
public void TheHistoricalRunMovesThroughTheTruces()
{
diff --git a/sim/Statecraft.Sim.Tests/golden/hash1950.txt b/sim/Statecraft.Sim.Tests/golden/hash1950.txt
index d764467f9..908b18aed 100644
--- a/sim/Statecraft.Sim.Tests/golden/hash1950.txt
+++ b/sim/Statecraft.Sim.Tests/golden/hash1950.txt
@@ -116,13 +116,13 @@ city{
tiberias=6,2,8,2,1,c0.18928571428571433 [3FC83A83A83A83AA]
zikhron_yaakov=2,1,2,1,1,c0.35 [3FD6666666666666]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@15,3|side=israel|strength=2
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-2,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-9,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
@@ -137,5 +137,8 @@ cproj[
16:housing@tel_aviv,-4,22/done,1949-10-15
17:housing@tel_aviv,-3,21/4,3FDB851EB851EB88
next=18
+ctrl{
+ beersheba=since=1949-01-15,fled=1
+ ramla=since=1948-09-15,fled=1
food=3003,1001,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/hash1952.txt b/sim/Statecraft.Sim.Tests/golden/hash1952.txt
index e1c319201..3a07cfdc1 100644
--- a/sim/Statecraft.Sim.Tests/golden/hash1952.txt
+++ b/sim/Statecraft.Sim.Tests/golden/hash1952.txt
@@ -139,13 +139,13 @@ city{
tiberias=6,2,13,2,0,c0 [0000000000000000]
zikhron_yaakov=2,1,4,1,0,c0 [0000000000000000]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@15,3|side=israel|strength=2
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-2,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-9,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
@@ -171,5 +171,8 @@ cproj[
next=21
obj{
yishuvim=1951-09-15
+ctrl{
+ beersheba=since=1949-01-15,fled=1
+ ramla=since=1948-09-15,fled=1
food=2733,1390,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txt
index db0e50114..ba5db30cf 100644
--- a/sim/Statecraft.Sim.Tests/golden/manifest.txt
+++ b/sim/Statecraft.Sim.Tests/golden/manifest.txt
@@ -2,14 +2,14 @@
# Tests read this file. To accept a deliberate change: STATECRAFT_UPDATE_GOLDEN=1 dotnet test sim/Statecraft.sln
# rewrites this file, the snapshots and the GoldenRun.cs constants; then update docs/determinism.md and tools/web_check.py
# (GoldenManifestTests names any place that is out of date) and add a row to the rebaseline history.
-hash1950 74fbe989d84a987728ba983a263714dcbe05abc2768033c15c3aed212cf34b63
-hash1952 d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66
-smoke5 9255f2bcda06ed50e38b9f77927998be5f3aef1f7206733dadaf2e2de29509c6
+hash1950 ac38d6c76c3e0e397365370e63cd23ed00b1b12928cecc4b6aea418440b76d2c
+hash1952 22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78
+smoke5 803f0f321fe12c056cccbf7adb52027e064ec3afd215717b9816c1122263ace7
smoke-orders 08d9800eda4462ef165cc7ea6285fad059c030c0f87ad563e35c9789cc352d78
-scenario-reckless 63cab8127b7c7130cd4bcad9e2134fc3465021fae7d01a913feee0d59217e607
-scenario-cautious e7ad49bf09d4cadec1f2b3e1c61b659aefa1c705653f7d272a61b858a97cada3
-scenario-mvp-absorb-first b589c9dc5bc57bbbbe5093591cb54348b8cf35e629d6bb78ac3b0c3c74bf4d83
-mvp-end d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66
-scenario-mvp-defeat 9e2afc15a7a25ef0695d2caa4e64640d6cae7d5faae5a07cd8a0c4cd1ce5a58b
-scenario-mvp-occupy-cost 0bc59565107c46e95adccbf9cb863a710bb1ed8066b8b27e4c8206b5005f756e
-scenario-mvp-annex-nazareth b6df4284762b44e5e8156fe74f1ad3a8b7c7f7217f79f0b2533737b5c1df846d
+scenario-reckless 4f3ca8933d77d83e00f15c75b0ba0e076b01d1c12991680d444c0e023eccd32a
+scenario-cautious 0be862353fd0248f225ff9a3fcfd0cfe1430a1876536121ddc437026fd71c6f7
+scenario-mvp-absorb-first 53c208c25512c6dc586d51150f83d5b6a5f34a24f07f45e649b73958d30c6158
+mvp-end 22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78
+scenario-mvp-defeat 6782cce4a8707e8b31e17ccf5563a233a1b17abcfe9f1cc2453d31b5a635faa5
+scenario-mvp-occupy-cost 612e9feb843c815ad2b00fe640bc6f81600c883b6b2885315fbe043982ce2ea5
+scenario-mvp-annex-nazareth c8195c095f3408ed68bffda8e4d6bfe34fb1ee6602954ba757f6e84e80a4c2ec
diff --git a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt
index e1c319201..3a07cfdc1 100644
--- a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt
+++ b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt
@@ -139,13 +139,13 @@ city{
tiberias=6,2,13,2,0,c0 [0000000000000000]
zikhron_yaakov=2,1,4,1,0,c0 [0000000000000000]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@15,3|side=israel|strength=2
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-2,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-9,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
@@ -171,5 +171,8 @@ cproj[
next=21
obj{
yishuvim=1951-09-15
+ctrl{
+ beersheba=since=1949-01-15,fled=1
+ ramla=since=1948-09-15,fled=1
food=2733,1390,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt
index 8c78f4c27..ec4673179 100644
--- a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt
@@ -109,18 +109,21 @@ city{
tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]
zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@15,3|side=israel|strength=2
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-3,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-10,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=3|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14
12:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4
next=14
+ctrl{
+ beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1
+ ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1
food=2427,809,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt
index 6563f0a9a..40555dae9 100644
--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt
@@ -117,13 +117,13 @@ city{
tiberias=6,2,8,2,1,c0.18928571428571433 [3FC83A83A83A83AA]
zikhron_yaakov=2,1,2,1,1,c0.35 [3FD6666666666666]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@15,3|side=israel|strength=2
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-3,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-10,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=3|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
@@ -390,6 +390,9 @@ cproj[
next=273
obj{
absorb_immigrants=1950-01-15
+ctrl{
+ beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1
+ ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1
score=100
scoreparts=100,0,0
food=3003,1001,0
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt
index 50fbc3a7a..0df15b2ac 100644
--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt
@@ -3,7 +3,7 @@ ind{
food_supply=0.4 [3FD999999999999A]
housing=0.4144342978298799 [3FDA86176EE148A1]
intl_standing=0.6100000000000001 [3FE3851EB851EB86]
- morale=0.7026433377953827 [3FE67C0DE192AB9E]
+ morale=0.7026567681936653 [3FE67C2A0BF68E18]
security=0.5146288293457033 [3FE077D6E0F3CB40]
pol{
border_settlement=0.2 [3FC999999999999A]
@@ -13,9 +13,9 @@ eff{
border_villages_secure=0.03462882934570313 [3FA1BADEB313BE24]
building_houses=0.07429382257461548 [3FB304EB8240B780]
food_lifts_cohesion=0.03992187500000001 [3FA470A3D70A3D72]
- homes_lift_morale=0.062423321459211145 [3FAFF5F318599A80]
+ homes_lift_morale=0.06243079858799369 [3FAFF6EDFC65AE5C]
safety_lifts_morale=0.050239859619140646 [3FA9B909F40A287B]
- work_lifts_cohesion=0.040058281717030846 [3FA48284E3D1344F]
+ work_lifts_cohesion=0.04006423498653092 [3FA4834CA6034814]
shift{
food_supply=0 [0000000000000000]
housing=0 [0000000000000000]
@@ -40,11 +40,11 @@ pop{
veterans=657677.6664788157 [4124121B553CB61A]
sit[
treasury=0 [0000000000000000]
-debt=30.98210973710249 [403EFB6B8B31F038]
+debt=30.94210973710249 [403EF12E1A8E192E]
fx=84.39862659316444 [40551983191D3D42]
rung=5;cf=0;
mob=0.8 [3FE999999999999A]
-stab=0.6262824805357506 [3FE40A818E7EAE89]
+stab=0.626287693608005 [3FE40A8C7D3DE075]
att=4 [4010000000000000]
fired[
altalena
@@ -101,20 +101,25 @@ city{
tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]
zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]
units[
- 0:veteran_soldier@8,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4|order=go_to|target=-8,28
+ 1:veteran_soldier@15,5|side=israel|strength=2|order=go_to|target=15,3
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-3,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-10,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=3
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14
12:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4
+cardorders{
+ 0=1949-02-24
+ 1=1949-03-23
next=14
ctrl{
+ beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1
nazareth=owner=israel,state=annexed,since=1948-07-15
+ ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1
food=2304,768,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt
index 102a38c9b..353a13799 100644
--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt
@@ -138,19 +138,22 @@ city{
tiberias=6,2,13,2,0,c0 [0000000000000000]
zikhron_yaakov=2,1,4,1,0,c0 [0000000000000000]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@15,3|side=israel|strength=2
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-2,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-9,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=3|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14
12:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4
next=14
+ctrl{
+ beersheba=since=1949-01-15,fled=1
+ ramla=since=1948-09-15,fled=1
food=0,1390,1390
exhausted=3
arms=132
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt
index 8ce44c350..7dc218680 100644
--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt
@@ -1,27 +1,27 @@
-1949-01-15;8709371129873692656;Historical;8;
+1948-12-15;15755400384260045787;Historical;7;
ind{
food_supply=0.4 [3FD999999999999A]
- housing=0.41912251055925737 [3FDAD2E738F7A4A9]
+ housing=0.4196029067993164 [3FDADAC626809D49]
intl_standing=0.5 [3FE0000000000000]
- morale=0.6716277836052675 [3FE57DF98CB56D46]
- security=0.5236917724609377 [3FE0C2153F7CED93]
+ morale=0.6676494389238152 [3FE55D625B2BDB6E]
+ security=0.4874423632812501 [3FDF3241743E9640]
pol{
border_settlement=0.2 [3FC999999999999A]
housing_construction=0.3 [3FD3333333333333]
maabarot=0 [0000000000000000]
eff{
- border_villages_secure=0.033691772460937505 [3FA1400C49BA5E36]
- building_houses=0.0722834300994873 [3FB2812AB851EB85]
- food_lifts_cohesion=0.03984375000000001 [3FA4666666666668]
- homes_lift_morale=0.06197826633453369 [3FAFBB9D85F06F69]
- safety_lifts_morale=0.04911054199218752 [3FA92504577D955A]
- work_lifts_cohesion=0.04069522527854631 [3FA4D6012B597372]
+ border_villages_secure=0.032442363281250004 [3FA09C49129888F9]
+ building_houses=0.06960290679931641 [3FB1D17F0068DB8C]
+ food_lifts_cohesion=0.03968750000000001 [3FA451EB851EB853]
+ homes_lift_morale=0.06101609664916992 [3FAF3D807746887A]
+ safety_lifts_morale=0.045976847656250014 [3FA78A47021D10B4]
+ work_lifts_cohesion=0.0409689946183953 [3FA4F9E358126F9E]
shift{
food_supply=0 [0000000000000000]
housing=0 [0000000000000000]
intl_standing=0 [0000000000000000]
morale=-0.07000000000000006 [BFB1EB851EB851F0]
- security=0.19000000000000017 [3FC851EB851EB858]
+ security=0.15500000000000014 [3FC3D70A3D70A3DC]
bud{
agriculture_minister=0.07 [3FB1EB851EB851EC]
defense_minister=0.45 [3FDCCCCCCCCCCCCD]
@@ -32,25 +32,24 @@ bud{
labour_minister=0.1 [3FB999999999999A]
prime_minister=0.15 [3FC3333333333333]
pop{
- africa=9739.110001692712 [40C3058E1489145A]
- america_oceania=535.0499244151753 [4080B8663EC59399]
- asia=7512.155402122331 [40BD5827C86EF924]
- europe=81633.61444656934 [40F3EE19D4C5ED07]
- unknown=12145.947428858311 [40C7B8F945594CDE]
- veterans=656752.739703733 [41240AE17ABA729C]
+ africa=7621.365133953232 [40BDC55D796B33CA]
+ america_oceania=444.70367847041564 [407BCB42445B155A]
+ asia=4408.892745337446 [40B138E48AF55BFD]
+ europe=71221.43389461128 [40F16356F13B79D6]
+ unknown=11038.512855756235 [40C58F41A541E64C]
+ veterans=655829.1137019362 [412403AA3A3723E3]
sit[
treasury=0 [0000000000000000]
-debt=24.4905919260477 [40387D976EB60E78]
-fx=80.85238326859616 [4054368D728D91CC]
+debt=17.99688825186829 [4031FF3411878A7A]
+fx=76.85902112083348 [405336FA33B92365]
rung=5;cf=0;
mob=0.8 [3FE999999999999A]
-stab=0.6395673523227227 [3FE47755F3BA17C9]
+stab=0.6577489846986975 [3FE50C4799484270]
att=4 [4010000000000000]
fired[
altalena
bernadotte_assassination
degania_defence
- elections_1949
first_truce
idf_founding
jerusalem_ceasefire
@@ -59,25 +58,20 @@ fired[
operation_hiram
operation_horev
operation_yoav
- rhodes_talks
second_truce
- sinai_withdrawal
ten_days
pending[
- sinai_withdrawal
- rhodes_talks
- elections_1949
+ jerusalem_ceasefire
+ operation_horev
chosen{
altalena=enforce
bernadotte_assassination=outlaw
degania_defence=jordan_valley
first_truce=accept
idf_founding=one_army
- jerusalem_ceasefire=keep
jerusalem_military_government=military_government
latrun_proposal=accept_vote
operation_hiram=stop_at_ceasefire
- operation_horev=launch
operation_yoav=stop_at_ceasefire
second_truce=comply
ten_days=central_front
@@ -87,34 +81,39 @@ map[
mapturn=0001-01-01:0;
over=
city{
- hadera=12,5,12,5,1,c0.35 [3FD6666666666666]
- haifa=99,42,101,42,4,c0.347029702970297 [3FD635BC123FDF8E]
- jerusalem=84,29,86,29,4,c0.3465116279069767 [3FD62D3F1B62D3F1]
- netanya=12,5,12,5,1,c0.35 [3FD6666666666666]
+ hadera=12,5,12,5,0,c0.35 [3FD6666666666666]
+ haifa=99,42,99,42,3,c0.35 [3FD6666666666666]
+ jerusalem=84,29,84,29,3,c0.35 [3FD6666666666666]
+ netanya=12,5,12,5,0,c0.35 [3FD6666666666666]
petah_tikva=22,10,22,10,1,c0.35 [3FD6666666666666]
rehovot=13,5,13,5,1,c0.35 [3FD6666666666666]
- rishon_lezion=10,5,10,5,1,c0.35 [3FD6666666666666]
+ rishon_lezion=10,5,10,5,0,c0.35 [3FD6666666666666]
rosh_pinna=1,0,1,0,0,c0.35 [3FD6666666666666]
safed=2,1,2,1,0,c0.35 [3FD6666666666666]
- tel_aviv=248,106,255,106,9,c0.3458823529411765 [3FD622EFBC895623]
+ tel_aviv=248,106,248,106,8,c0.35 [3FD6666666666666]
tiberias=6,2,6,2,0,c0.35 [3FD6666666666666]
zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]
units[
0:veteran_soldier@8,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 1:veteran_soldier@11,8|side=israel|strength=2|order=go_to|target=15,3
2:veteran_soldier@0,17|side=israel|strength=4
- 3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 3:veteran_soldier@-3,24|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
6:veteran_soldier@-3,26|side=israel|strength=1
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-11,35|side=israel|strength=1|order=go_to|target=-10,35
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
- 9:arab_legion@-3,25|side=jordan|strength=3
+ 9:arab_legion@-3,25|side=jordan|strength=3|order=attack|target=-4,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14
12:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4
+ 13:veteran_soldier@-4,25|side=israel|strength=1|full=2
+cardorders{
+ 1=1949-03-23
+ 7=1949-02-24
next=14
ctrl{
nazareth=owner=israel,state=awaiting_end,since=1948-07-15
-food=2253,751,0
+ ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1
+food=2208,736,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt
index 441261b6b..5d18a38b3 100644
--- a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt
@@ -107,18 +107,22 @@ city{
tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]
zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]
units[
- 0:veteran_soldier@11,11|side=israel|strength=4
- 1:veteran_soldier@6,9|side=israel|strength=2
+ 0:veteran_soldier@4,14|side=israel|strength=4
+ 1:veteran_soldier@13,3|side=israel|strength=2|order=go_to|target=15,3
2:veteran_soldier@0,17|side=israel|strength=4
3:veteran_soldier@-3,21|side=israel|strength=3
- 4:veteran_soldier@-6,26|side=israel|strength=3
+ 4:veteran_soldier@-9,29|side=israel|strength=3
5:veteran_soldier@0,26|side=israel|strength=3
- 7:veteran_soldier@-11,31|side=israel|strength=1
+ 7:veteran_soldier@-10,35|side=israel|strength=1
8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27
9:arab_legion@-3,25|side=jordan|strength=3|order=fortify|target=-3,25
10:syrian_army@15,6|side=syria|strength=3|order=fortify|target=15,6
11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14
12:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4
+cardorders{
+ 1=1949-03-23
next=14
+ctrl{
+ beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1
food=2427,809,0
arms=12
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml b/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml
index 7ede42ba1..ae35f9589 100644
--- a/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml
+++ b/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml
@@ -1,8 +1,11 @@
# Annexing a stayed town (#799): mvp-occupy-cost's two steps, then the answer to the end of the occupation. Golani's unit
# (id 0) moves onto Nazareth's hex on the second turn (the first stops short at 4.4 km hexes, #1183) and captures it
# (R-CTRL-004); the scenario answers with Occupy on 15 July 1948 (R-CTRL-011), the timer runs out after three turn
-# resolutions, on 15 October 1948 (R-CTRL-012), and on 15 January 1949 the
-# scenario annexes Nazareth (R-CTRL-016). Nazareth's residents stayed (#793), so it becomes one city by the starting-city
+# resolutions, on 15 October 1948 (R-CTRL-012), and on 15 December 1948 the
+# scenario annexes Nazareth (R-CTRL-016), in the turn that delegates Operation Horev: the annexation runs with the
+# turn's orders, before Horev is delegated, so Nazareth is no longer occupied when the last-garrison check runs and
+# Horev's order sends Golani from the annexed town toward the Julis camp (R-ENEMY-005, R-CTRL-013, #2087). Nazareth's
+# residents stayed (#793), so it becomes one city by the starting-city
# rule from its census-day count (OWNER QUESTION 1 (a) on #799; the owner approved the count on 24 October 2026), the
# upkeep stops and the unit may leave (OWNER QUESTION 3 (a)). It plays the real content, so it moves whenever a rule or
# value it reaches changes, Nazareth's approved count included.
@@ -18,6 +21,6 @@ steps:
- on: 1948-07-15
commands:
- { kind: resolve_capture, settlement: nazareth, outcome: occupy }
- - on: 1949-01-15
+ - on: 1948-12-15
commands:
- { kind: end_occupation, settlement: nazareth, outcome: annex }
diff --git a/sim/Statecraft.Sim.Tests/scenarios/mvp-occupy-cost.yaml b/sim/Statecraft.Sim.Tests/scenarios/mvp-occupy-cost.yaml
index 3314a5721..b61c8abf9 100644
--- a/sim/Statecraft.Sim.Tests/scenarios/mvp-occupy-cost.yaml
+++ b/sim/Statecraft.Sim.Tests/scenarios/mvp-occupy-cost.yaml
@@ -3,12 +3,16 @@
# R-MOVE-005; at 4.4 km hexes, #1183, it is 5 movement points away, so the first turn stops at (9, 11)) and captures it
# when the move ends (R-CTRL-004). The next turn the scenario answers with Occupy (R-CTRL-011).
# Step 10 charges the upkeep each turn and counts the timer down (R-CTRL-012), so the place waits for EndOccupation
-# (#799) when the run stops on 15 January 1949: the timer runs out after three turn resolutions from the choice, on
-# 15 October 1948 (owner, 27 October 2026, #1712), and the place waits from then on, still paying the upkeep. It
-# plays the real content, so it moves whenever a rule or value it reaches changes. The paired mvp-deport-cost is not
-# here: Deport is out of play in the real content (mvp.deport_in_play: false, #800).
+# (#799) when the run stops on 15 December 1948: the timer runs out after three turn resolutions from the choice, on
+# 15 October 1948 (owner, 27 October 2026, #1712), and the place waits from then on, still paying the upkeep. The run
+# stops before the 15 December turn resolves, the turn that delegates Operation Horev, so Horev's order is not in it.
+# Had it run that turn, the order would not take Golani away: Golani is the last Israeli unit on the occupied Nazareth,
+# so the order is held back and the occupation goes on (R-ENEMY-005, R-CTRL-013, #2087;
+# EnemyAITests.HorevsOrderNeverTakesTheLastUnitOffNazareth plays this run to that turn). It plays the real content, so
+# it moves whenever a rule or value it reaches changes. The paired mvp-deport-cost is not here: Deport is out of play in
+# the real content (mvp.deport_in_play: false, #800).
name: mvp-occupy-cost
-until: 1949-01-15
+until: 1948-12-15
steps:
- on: 1948-05-15
commands:
diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.cs
index e39a0282a..8e3f26410 100644
--- a/sim/Statecraft.Sim/Content.cs
+++ b/sim/Statecraft.Sim/Content.cs
@@ -1045,6 +1045,8 @@ namespace Statecraft.Sim
public List<CityEffect> CityEffects { get; set; } = new List<CityEffect>();
/// <summary>R-EFX-008: locked projects.yaml kinds this option makes available, in list order (D-H2, Q-HFX-1).</summary>
public List<string> UnlockProjects { get; set; } = new List<string>();
+ /// <summary>R-ENEMY-005: go-to orders this option gives to units of map/units_1948.yaml rows, in list order (Q-ENEMY-5).</summary>
+ public List<UnitOrderEffect> UnitOrders { get; set; } = new List<UnitOrderEffect>();
/// <summary>Who put this non-historical option forward, and on what record (R-ALT-003). Null when absent.</summary>
public OptionAlternative? Alternative { get; set; }
/// <summary>The event whose historical course this consequence option rejoins (R-ALT-009), or empty.</summary>
@@ -1061,6 +1063,15 @@ namespace Statecraft.Sim
public string At { get; set; } = "";
}
+ /// <summary>An option's go-to order (R-ENEMY-005) for the unit of the map/units_1948.yaml row <see cref="Unit"/>, toward
+ /// hex (<see cref="Q"/>, <see cref="R"/>), which must be one of that row's anchor or order target hexes (map/unit_anchor_hexes.yaml).</summary>
+ public sealed class UnitOrderEffect
+ {
+ public string Unit { get; set; } = "";
+ public int Q { get; set; }
+ public int R { get; set; }
+ }
+
/// <summary>An option's change to one field of a city (R-EFX-004): housing_capacity or job_slots by whole units, or the
/// housing condition by a number from -1 to 1. A double, so one key carries both; the loader checks each field's kind.</summary>
public sealed class CityEffect
@@ -1409,6 +1420,16 @@ namespace Statecraft.Sim
/// <summary>The forces a Historical game starts with (map/units_1948.yaml; R-UNIT-006), in file order: the unit with id i
/// of a new game is the i-th. Empty in the legacy loop.</summary>
public List<StartingForce> StartingForces = new List<StartingForce>();
+ /// <summary>Every anchor's hex of map/unit_anchor_hexes.yaml by (row id, anchor index), the only hexes an operation
+ /// card may order a row's unit to (R-ENEMY-005). Empty in the legacy loop.</summary>
+ public Dictionary<(string Row, int Anchor), (int Q, int R)> UnitAnchorHexes = new Dictionary<(string Row, int Anchor), (int Q, int R)>();
+ /// <summary>The end of each anchor's window (its `to` in map/units_1948.yaml) by (row id, anchor index): a card's order to
+ /// the anchor's hex ends on that day (R-ENEMY-005; the owner's answer 1 on #2087). Empty in the legacy loop.</summary>
+ public Dictionary<(string Row, int Anchor), DateTime> UnitAnchorEnds = new Dictionary<(string Row, int Anchor), DateTime>();
+ /// <summary>Each row's order targets (map/units_1948.yaml `order_targets`; owner, 2 November 2026, #2087, option 1) by
+ /// (row id, index): the hex unit_anchor_hexes.yaml gives it and its `to`, the day a card's order to it ends. An operation
+ /// card may order the row's unit there as to an anchor (R-ENEMY-005). Empty in the legacy loop.</summary>
+ public Dictionary<(string Row, int Target), (int Q, int R, DateTime To)> UnitOrderTargets = new Dictionary<(string Row, int Target), (int Q, int R, DateTime To)>();
/// <summary>The GDD designated sites (sites.yaml), in file order. Empty in the legacy loop.</summary>
public List<Site> Sites = new List<Site>();
/// <summary>The GDD city project kinds (projects.yaml) this game's ruleset has (R-ARMS-004: a row's `rulesets`), in file
diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.cs
index 8ec25121e..a08fad1b1 100644
--- a/sim/Statecraft.Sim/ContentLoader.cs
+++ b/sim/Statecraft.Sim/ContentLoader.cs
@@ -405,7 +405,8 @@ namespace Statecraft.Sim
// require itself and requirements cannot form a cycle (EventRules)
// options: [{ id, text, historical, recommended, effects: [{ target, delta }], set_rung, set_policy,
// grant_units: [{ type, n, at }], city_effects: [{ city, field, delta }],
- // unlock_projects: [<projects.yaml id of a locked kind>] }]
+ // unlock_projects: [<projects.yaml id of a locked kind>],
+ // unit_orders: [{ unit, q, r }] (R-ENEMY-005) }]
// sources: [{ url, checked }], status
// objective the objective (objectives.yaml) whose completion card this is: it fires only once
// that objective is recorded, and has exactly one option
diff --git a/sim/Statecraft.Sim/EventRules.cs b/sim/Statecraft.Sim/EventRules.cs
index cf95518f2..35f712e89 100644
--- a/sim/Statecraft.Sim/EventRules.cs
+++ b/sim/Statecraft.Sim/EventRules.cs
@@ -122,7 +122,32 @@ namespace Statecraft.Sim
{
foreach (var e in c.Events)
foreach (var o in e.Options)
+ {
CheckStructured(c, e, o, e.Tags.Any(SensitiveTags.Contains), field => $"events[{e.Id}].{field}");
+ CheckOrders(c, e, o, field => $"events[{e.Id}].{field}");
+ }
+ }
+
+ /// <summary>R-ENEMY-005 (Q-ENEMY-5): an option's go-to orders name a map/units_1948.yaml row and one of that row's own
+ /// anchor or order target hexes, so a card never sends a unit to a position no source gives it (owner, 31 October 2026,
+ /// #749: sourced anchors only; 2 November 2026, #2087: order targets, option 1). They are checked under gdd-0.3 too, where EventSystem does not apply them. The legacy loop reads the
+ /// same real cards but no units file, so it has nothing to check them against and no unit to order.</summary>
+ static void CheckOrders(Content c, GameEvent e, EventOption o, Func<string, string> F)
+ {
+ if (!c.IsGdd) return;
+ for (int i = 0; i < o.UnitOrders.Count; i++)
+ {
+ var x = o.UnitOrders[i];
+ var at = F(FormattableString.Invariant($"options[{o.Id}].unit_orders[{i}]"));
+ if (!c.UnitAnchorHexes.Keys.Any(k => k.Row == x.Unit))
+ throw new ContentException(e.File, at + ".unit", $"unknown unit row '{x.Unit}' ({StartingForces.FileName})");
+ if (!c.UnitAnchorHexes.Any(k => k.Key.Row == x.Unit && k.Value == (x.Q, x.R))
+ && !c.UnitOrderTargets.Any(k => k.Key.Row == x.Unit && (k.Value.Q, k.Value.R) == (x.Q, x.R)))
+ throw new ContentException(e.File, at, FormattableString.Invariant($"hex q={x.Q} r={x.R} is not an anchor or an order target of '{x.Unit}' in {StartingForces.HexesFileName}"));
+ // The order ends with its anchor's window (the owner's answer 1 on #2087), so the anchor needs an end.
+ if (EventSystem.OrderEnds(c, x) == null)
+ throw new ContentException(e.File, at, FormattableString.Invariant($"the anchor of '{x.Unit}' on hex q={x.Q} r={x.R} has no 'to' date in {StartingForces.FileName}"));
+ }
}
static void CheckStructured(Content c, GameEvent e, EventOption o, bool sensitive, Func<string, string> F)
diff --git a/sim/Statecraft.Sim/EventSystem.cs b/sim/Statecraft.Sim/EventSystem.cs
index b70c673e7..4b301a8fc 100644
--- a/sim/Statecraft.Sim/EventSystem.cs
+++ b/sim/Statecraft.Sim/EventSystem.cs
@@ -65,19 +65,34 @@ namespace Statecraft.Sim
/// once the window has ended (load-time coverage guarantees a holder there).</summary>
public static DateTime FillDate(GameEvent e, DateTime date) => e.To.HasValue && date >= e.To.Value ? e.To.Value.AddDays(-1) : date;
- /// <summary>Returns null on success, or the reason the choice was rejected.</summary>
- public static string? Choose(Content c, GameState s, string eventId, string optionId, List<Cause> why)
+ /// <summary>R-ENEMY-005 (the owner's answer 1 on #2087, "Orders expire with the operation"): the day a card's order to a
+ /// row's anchor hex ends, the `to` of that anchor's window in map/units_1948.yaml (the latest, should two anchors share
+ /// the hex), or null when it has none. The anchor's dates, not the card's: a card's from/to is when the decision is open
+ /// (Horev's closes on 23 December 1948; the operation ran to 7 January 1949), while the anchor's are the sourced span of
+ /// the position the operation sends the unit to: Carmeli facing the bridgehead to 19 July 1948, the end of Brosh, and
+ /// Golani at the Julis camp to 24 February 1949, the Egypt armistice. An order target's `to` counts as an anchor's
+ /// (owner, 2 November 2026, #2087, option 1).</summary>
+ internal static DateTime? OrderEnds(Content c, UnitOrderEffect x) =>
+ c.UnitAnchorHexes.Where(k => k.Key.Row == x.Unit && k.Value == (x.Q, x.R) && c.UnitAnchorEnds.ContainsKey(k.Key))
+ .Select(k => (DateTime?)c.UnitAnchorEnds[k.Key])
+ .Concat(c.UnitOrderTargets.Where(k => k.Key.Row == x.Unit && (k.Value.Q, k.Value.R) == (x.Q, x.R)).Select(k => (DateTime?)k.Value.To))
+ .Max();
+
+ /// <summary>Returns null on success, or the reason the choice was rejected. <paramref name="spent"/> is the movement
+ /// points the turn's orders have spent so far, which an option's unit orders share (R-ENEMY-005).
+ /// A refused unit order goes into <paramref name="rejected"/>, as the player's refused orders do.</summary>
+ public static string? Choose(Content c, GameState s, string eventId, string optionId, List<Cause> why, Dictionary<int, int>? spent = null, List<Rejection>? rejected = null)
{
PopulationLedger.RefuseAggregate(s);
if (!s.PendingEvents.Contains(eventId)) return "That event is not waiting for a decision";
var option = Get(c, eventId).Options.FirstOrDefault(o => o.Id == optionId);
if (option == null) return "That event has no such option";
- Resolve(c, s, eventId, option, "chosen", why);
+ Resolve(c, s, eventId, option, "chosen", why, spent: spent, rejected: rejected);
return null;
}
/// <param name="share">The share of each numeric effect that applies: 1, except for a disloyal minister's delegation (R-EVT-003).</param>
- static void Resolve(Content c, GameState s, string eventId, EventOption o, string how, List<Cause> why, double share = 1.0, bool delegated = false, Person? minister = null)
+ static void Resolve(Content c, GameState s, string eventId, EventOption o, string how, List<Cause> why, double share = 1.0, bool delegated = false, Person? minister = null, Dictionary<int, int>? spent = null, List<Rejection>? rejected = null)
{
s.PendingEvents.Remove(eventId);
s.ChosenOptions[eventId] = o.Id;
@@ -162,6 +177,23 @@ namespace Statecraft.Sim
// R-EFX-008: after the city effects. A kind already unlocked stays so, with no second cause.
foreach (var kind in o.UnlockProjects)
if (s.UnlockedProjects.Add(kind)) why.Add(new Cause("events", kind, 1, $"{Unlocked(c, kind)} ({title})", key: CauseKeys.EventUnlock, args: Context(title, localizedTitle)));
+ // R-ENEMY-005 (Q-ENEMY-5): the option's go-to orders, through the player's own go-to and its checks, in list order.
+ // A refused order changes nothing, as the player's does, and is reported as the player's are (Rejected); a row with
+ // no unit on the board orders nobody. gdd-0.1 only: under gdd-0.3 the operation cards stay effect-free for units
+ // (owner, 31 October 2026, #749). The owner's answer 1 on #2087: the order ends with the operation (OrderEnds), and
+ // its march goes round every enemy-held place but the one it was sent to (Movement.Search). The owner's ruling of
+ // 2 November 2026 on #2087 ("Keep a garrison in Nazareth (Recommended)"): the order never takes the last Israeli unit
+ // off an occupied place (R-CTRL-013), so it is not given to that unit, and the refusal says why.
+ if (c.Ruleset != SaveGame.Gdd03Ruleset)
+ foreach (var x in o.UnitOrders)
+ {
+ int id = c.StartingForces.FindIndex(f => f.Row == x.Unit); // the unit with id i is the i-th force (R-UNIT-006)
+ if (id < 0 || !s.Units.TryGetValue(id, out var u) || u.Side != c.StartingForces[id].Side || u.Type != c.StartingForces[id].Type) continue;
+ var refused = SettlementControl.LastGarrison(c, s, u) ? Orders.RefusedLastGarrison
+ : Movement.GiveGoTo(c, s, id, x.Q, x.R, spent ?? new Dictionary<int, int>(), why, OrderEnds(c, x)) != null ? Orders.RefusedCardOrder
+ : null;
+ if (refused != null) rejected?.Add(new Rejection(new UnitOrder(id, Movement.GoTo, x.Q, x.R), refused));
+ }
foreach (var kv in o.SetPolicy.Where(k => s.Policies.ContainsKey(k.Key)).OrderBy(k => k.Key, StringComparer.Ordinal))
{
s.Policies[kv.Key] = kv.Value;
@@ -310,7 +342,7 @@ namespace Statecraft.Sim
/// In the GDD loop a drawn option of a minister whose loyalty is below the floor applies only disloyal_effect_share of
/// each numeric effect (R-EVT-003; #107, owner, 18 October 2026). Why: loyalty decides how hard a minister works for a
/// decision he was left to make, competence which decision he makes; anchors and objective cards stay whole.</summary>
- public static void Delegate(Content c, GameState s, List<Cause> why)
+ public static void Delegate(Content c, GameState s, List<Cause> why, Dictionary<int, int>? spent = null, List<Rejection>? rejected = null)
{
PopulationLedger.RefuseAggregate(s);
var rng = new Rng(s.RngState);
@@ -321,7 +353,7 @@ namespace Statecraft.Sim
var minister = DelegatedTo(c, s, e);
if (e.Objective != "" || e.Prisoners != "" || e.Deported != "") // R-POW-004, R-EVT-007: an exchange card or a Deport card, like an objective's, has one option and draws nothing
{
- Resolve(c, s, id, e.Options[0], $"delegated to {minister?.Name ?? "the cabinet"}", why, delegated: true, minister: minister);
+ Resolve(c, s, id, e.Options[0], $"delegated to {minister?.Name ?? "the cabinet"}", why, delegated: true, minister: minister, spent: spent, rejected: rejected);
continue;
}
var competence = (minister?.Competence ?? 5) / 10.0;
@@ -332,7 +364,7 @@ namespace Statecraft.Sim
var share = anchored == null && mvp != null && minister != null && minister.Loyalty < mvp.DelegationLoyaltyFloor
? mvp.DisloyalEffectShare!.Value : 1.0;
var how = $"delegated to {minister?.Name ?? "the cabinet"}" + (share < 1 ? ", carried out half-heartedly" : "");
- Resolve(c, s, id, option, how, why, share, delegated: true, minister: minister);
+ Resolve(c, s, id, option, how, why, share, delegated: true, minister: minister, spent: spent, rejected: rejected);
}
s.RngState = rng.State;
}
diff --git a/sim/Statecraft.Sim/GameState.cs b/sim/Statecraft.Sim/GameState.cs
index 03e23aa8f..90554946f 100644
--- a/sim/Statecraft.Sim/GameState.cs
+++ b/sim/Statecraft.Sim/GameState.cs
@@ -107,6 +107,9 @@ namespace Statecraft.Sim
public SortedDictionary<string, CorridorWork> Corridors = new SortedDictionary<string, CorridorWork>(StringComparer.Ordinal);
/// <summary>The locked projects.yaml kinds an event option has unlocked (R-EFX-008), by id (ordinal).</summary>
public SortedSet<string> UnlockedProjects = new SortedSet<string>(StringComparer.Ordinal);
+ /// <summary>The units whose go-to an operation card gave (R-ENEMY-005), by unit id, each with the day the order ends: the
+ /// end of the window of the anchor it goes to (the owner's answer 1 on #2087, "Orders expire with the operation").</summary>
+ public SortedDictionary<int, DateTime> CardOrders = new SortedDictionary<int, DateTime>();
/// <summary>The next id a new unit, training cohort or city project takes (they share it). Ids are never reused.</summary>
public int NextId;
/// <summary>The date each completed objective was completed, by objective id (ordinal).</summary>
@@ -174,6 +177,7 @@ namespace Statecraft.Sim
c.Workshops = new SortedList<int, Workshop>(Workshops);
c.Corridors = new SortedDictionary<string, CorridorWork>(Corridors, StringComparer.Ordinal);
c.UnlockedProjects = new SortedSet<string>(UnlockedProjects, StringComparer.Ordinal);
+ c.CardOrders = new SortedDictionary<int, DateTime>(CardOrders);
c.Objectives = new SortedDictionary<string, DateTime>(Objectives, StringComparer.Ordinal);
c.Settlements = new SortedDictionary<string, SettlementControl>(Settlements, StringComparer.Ordinal);
c.PrisonersHeld = new SortedDictionary<string, int>(PrisonersHeld, StringComparer.Ordinal);
@@ -272,6 +276,8 @@ namespace Statecraft.Sim
if (Workshops.Count > 0) Section("wshop", '[', ']', Workshops.Values.Select(x => x.Canonical())); // R-ARMS-005, gdd-0.3 only
if (Corridors.Count > 0) Section("corr", '{', '}', Corridors.Values.Select(x => x.Canonical()));
if (UnlockedProjects.Count > 0) Section("unlocked", '[', ']', UnlockedProjects);
+ if (CardOrders.Count > 0) // R-ENEMY-005: only while a card's order stands, so a game with none hashes as before
+ Section("cardorders", '{', '}', CardOrders.Select(kv => kv.Key.ToString(CultureInfo.InvariantCulture) + "=" + kv.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)));
if (NextId != 0) { Sep(); Nl(); sb.Append("next=").Append(NextId.ToString(CultureInfo.InvariantCulture)); }
if (Objectives.Count > 0)
Section("obj", '{', '}', Objectives.Select(kv => kv.Key + "=" + kv.Value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)));
diff --git a/sim/Statecraft.Sim/GoldenRun.cs b/sim/Statecraft.Sim/GoldenRun.cs
index 7c64ed701..8f6d5a7ef 100644
--- a/sim/Statecraft.Sim/GoldenRun.cs
+++ b/sim/Statecraft.Sim/GoldenRun.cs
@@ -16,13 +16,13 @@ namespace Statecraft.Sim
/// <summary>Final hash of Play(content, Until1950). Changing it is a deliberate rules or content change: the value
/// is pinned in sim/Statecraft.Sim.Tests/golden/manifest.txt, and STATECRAFT_UPDATE_GOLDEN=1 dotnet test rewrites
/// both (docs/determinism.md). Say why in the commit message.</summary>
- public const string Hash1950 = "74fbe989d84a987728ba983a263714dcbe05abc2768033c15c3aed212cf34b63";
+ public const string Hash1950 = "ac38d6c76c3e0e397365370e63cd23ed00b1b12928cecc4b6aea418440b76d2c";
public static readonly DateTime Until1950 = new DateTime(1950, 1, 1);
/// <summary>Final hash of Play(content, Until1952): the M3 content range (to 31 December 1951). The GDD game ends on
/// 15 January 1952 (R-LOOP-004), the first turn on or after Until1952, so this is also the mvp-end run.</summary>
- public const string Hash1952 = "d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66";
+ public const string Hash1952 = "22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78";
public static readonly DateTime Until1952 = new DateTime(1952, 1, 1);
diff --git a/sim/Statecraft.Sim/Movement.cs b/sim/Statecraft.Sim/Movement.cs
index 169c4f1c0..2fac1d353 100644
--- a/sim/Statecraft.Sim/Movement.cs
+++ b/sim/Statecraft.Sim/Movement.cs
@@ -88,14 +88,15 @@ namespace Statecraft.Sim
/// <summary>R-MOVE-002, R-MOVE-008: the cheapest path to (q, r) with no points limit, each hex with the turn it is
/// reached on (turn 1 spends the points left after <paramref name="spent"/>, later turns all of them; a step that costs
/// more than the full points takes a whole turn, R-MOVE-001). Empty for an unknown or enemy unit, one that cannot
- /// move, its own hex, or a hex no path reaches.</summary>
- public static IReadOnlyList<(int Q, int R, int Turn)> Route(Content c, GameState s, int unitId, int q, int r, IReadOnlyDictionary<int, int> spent)
+ /// move, its own hex, or a hex no path reaches. With <paramref name="card"/> the route is an operation card's (R-ENEMY-005)
+ /// and goes round every enemy-held locality but (q, r) (<see cref="Search"/>).</summary>
+ public static IReadOnlyList<(int Q, int R, int Turn)> Route(Content c, GameState s, int unitId, int q, int r, IReadOnlyDictionary<int, int> spent, bool card = false)
{
var result = new List<(int Q, int R, int Turn)>();
if (!s.Units.TryGetValue(unitId, out var u) || IsEnemy(u) || (u.Q, u.R) == (q, r)) return result;
var full = Points(c, u);
if (full == 0) return result;
- var (dist, prev) = Search(c, s, u, int.MaxValue);
+ var (dist, prev) = Search(c, s, u, int.MaxValue, card: card ? (q, r) : ((int, int)?)null);
if (!dist.ContainsKey((q, r))) return result;
var hexes = new List<(int Q, int R)>();
for (var h = (q, r); h != (u.Q, u.R); h = prev[h]) hexes.Add(h);
@@ -122,14 +123,23 @@ namespace Statecraft.Sim
static void Stop(GameState s, Unit u, string key, string line, string hex, List<Cause> why)
{
- s.Units[u.Id] = new Unit(u.Id, u.Type, u.Q, u.R, u.Service, u.Side, u.Strength, "", "", u.HomeCity, u.Full, u.CombatXp);
+ Clear(s, u);
why.Add(UnitLines.Line(key, line, new[] { u }, hex));
}
+ /// <summary>Takes the unit's go-to away where it stands.</summary>
+ static void Clear(GameState s, Unit u)
+ {
+ s.Units[u.Id] = new Unit(u.Id, u.Type, u.Q, u.R, u.Service, u.Side, u.Strength, "", "", u.HomeCity, u.Full, u.CombatXp);
+ s.CardOrders.Remove(u.Id); // a stopped go-to is no operation card's order any more (R-ENEMY-005)
+ }
+
/// <summary>R-MOVE-008: gives the player's unit the go-to order and moves it at once as far as its points left reach.
/// Refused, the state untouched, for no hex, an unknown or enemy unit, one that cannot move or is there, water or off
- /// the board, an enemy unit's hex, a closed locality (R-MOVE-005) or a hex no route reaches.</summary>
- internal static string? GiveGoTo(Content c, GameState s, int unitId, int? q, int? r, Dictionary<int, int> spent, List<Cause> why)
+ /// the board, an enemy unit's hex, a closed locality (R-MOVE-005) or a hex no route reaches. With <paramref name="cardUntil"/>
+ /// the order is an operation card's (R-ENEMY-005): its route goes round every enemy-held locality but the hex, and it
+ /// ends on that day (<see cref="ContinueRoutes"/>). The player's own go-to replaces a card's.</summary>
+ internal static string? GiveGoTo(Content c, GameState s, int unitId, int? q, int? r, Dictionary<int, int> spent, List<Cause> why, DateTime? cardUntil = null)
{
if (q == null || r == null) return "A route names a hex";
if (!s.Units.TryGetValue(unitId, out var u)) return "There is no such unit";
@@ -139,35 +149,53 @@ namespace Statecraft.Sim
if (!(c.HexAt(q.Value, r.Value) is MapHex hex) || !hex.Land) return "Units cannot enter water or leave the map";
if (s.Units.Values.Any(x => x.Q == q && x.R == r && IsEnemy(x))) return "An enemy unit holds that hex";
if (Closed(c, s, false).Contains((q.Value, r.Value))) return "Units may not enter an enemy-held locality before its capture is possible";
- if (Route(c, s, unitId, q.Value, r.Value, spent).Count == 0) return "No route reaches that hex";
+ if (Route(c, s, unitId, q.Value, r.Value, spent, cardUntil != null).Count == 0) return "No route reaches that hex";
var target = HexText(q.Value, r.Value);
var given = new Unit(u.Id, u.Type, u.Q, u.R, u.Service, u.Side, u.Strength, GoTo, target, u.HomeCity, u.Full, u.CombatXp);
s.Units[unitId] = given;
+ if (cardUntil is DateTime until) s.CardOrders[unitId] = until; else s.CardOrders.Remove(unitId);
why.Add(UnitLines.Line(WhyKeys.OnItsWay, $"Unit {unitId} is on its way to hex {target}", new[] { given }, target));
if (u.Order == "fortify")
why.Add(UnitLines.Line(WhyKeys.FortifyLost, $"Unit {unitId} left hex {u.OrderTarget} and is no longer fortified", new[] { u }, u.OrderTarget));
- Advance(c, s, given, q.Value, r.Value, spent, why);
+ Advance(c, s, given, q.Value, r.Value, spent, why, cardUntil != null);
return null;
}
/// <summary>R-MOVE-009, the route step: at the start of the player's turn, in ascending id, each unit with a go-to moves
- /// on (<see cref="Advance"/>). An enemy unit next to it does not stop it (Q-MOVE-4: no zone of control).</summary>
- internal static void ContinueRoutes(Content c, GameState s, Dictionary<int, int> spent, List<Cause> why)
+ /// on (<see cref="Advance"/>). An enemy unit next to it does not stop it (Q-MOVE-4: no zone of control). An operation
+ /// card's go-to (R-ENEMY-005) whose day has come stops instead, where the unit stands: the order ends with the operation.
+ /// A card's go-to whose unit is now the last Israeli unit on an occupied place (SettlementControl.LastGarrison; owner,
+ /// 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)") is taken away too, the unit stays, and
+ /// <paramref name="rejected"/> lists it with <see cref="Orders.RefusedLastGarrison"/>, as the card's order would be at
+ /// the start. The player's own go-to is never held back.</summary>
+ internal static void ContinueRoutes(Content c, GameState s, Dictionary<int, int> spent, List<Cause> why, List<Rejection>? rejected = null)
{
+ // A card's order the player replaced (fortify, hold, attack, send home) or whose unit is gone is no card's order.
+ foreach (var id in s.CardOrders.Keys.ToList())
+ if (!s.Units.TryGetValue(id, out var x) || x.Order != GoTo) s.CardOrders.Remove(id);
foreach (var id in s.Units.Keys.OrderBy(x => x).ToList())
{
if (!s.Units.TryGetValue(id, out var u) || u.Order != GoTo) continue;
var (q, r) = Target(u);
- Advance(c, s, u, q, r, spent, why);
+ var card = s.CardOrders.TryGetValue(id, out var until);
+ if (card && s.Date >= until)
+ Stop(s, u, WhyKeys.CardOrderEnded, $"Unit {id} stopped: the operation's order to hex {HexText(q, r)} has ended", HexText(q, r), why);
+ else if (card && SettlementControl.LastGarrison(c, s, u))
+ {
+ Clear(s, u);
+ rejected?.Add(new Rejection(new UnitOrder(id, GoTo, q, r), Orders.RefusedLastGarrison));
+ }
+ else Advance(c, s, u, q, r, spent, why, card);
}
}
/// <summary>R-MOVE-008, R-MOVE-009: moves the unit along a fresh route to (q, r) as far as this turn's points reach,
/// stopping short of a full hex; stops it (order cleared) when no route reaches the hex or the hex is full on arrival,
- /// and clears the order on arrival. With no hex of this turn free, it waits, keeping the order.</summary>
- static void Advance(Content c, GameState s, Unit u, int q, int r, Dictionary<int, int> spent, List<Cause> why)
+ /// and clears the order on arrival. With no hex of this turn free, it waits, keeping the order. A <paramref name="card"/>
+ /// order's route and moves go round every enemy-held locality but (q, r) (R-ENEMY-005).</summary>
+ static void Advance(Content c, GameState s, Unit u, int q, int r, Dictionary<int, int> spent, List<Cause> why, bool card = false)
{
- var route = Route(c, s, u.Id, q, r, spent);
+ var route = Route(c, s, u.Id, q, r, spent, card);
if (route.Count == 0) { Stop(s, u, WhyKeys.StoppedNoRoute, $"Unit {u.Id} stopped: no route reaches hex {HexText(q, r)}", HexText(q, r), why); return; }
var today = route.TakeWhile(h => h.Turn == 1).ToList();
for (int i = today.Count - 1; i >= 0; i--)
@@ -178,7 +206,7 @@ namespace Statecraft.Sim
if ((h.Q, h.R) == (q, r)) { Stop(s, u, WhyKeys.StoppedFull, $"Unit {u.Id} stopped: hex {HexText(q, r)} is full", HexText(q, r), why); return; }
continue;
}
- if (Move(c, s, u.Id, h.Q, h.R, spent, why) is string refused) { Stop(s, u, WhyKeys.StoppedNoRoute, $"Unit {u.Id} stopped: {refused}", HexText(q, r), why); return; }
+ if (Move(c, s, u.Id, h.Q, h.R, spent, why, card: card ? (q, r) : ((int, int)?)null) is string refused) { Stop(s, u, WhyKeys.StoppedNoRoute, $"Unit {u.Id} stopped: {refused}", HexText(q, r), why); return; }
if ((h.Q, h.R) == (q, r)) Stop(s, s.Units[u.Id], WhyKeys.Arrived, $"Unit {u.Id} arrived at hex {HexText(q, r)}", HexText(q, r), why);
return;
}
@@ -204,8 +232,9 @@ namespace Statecraft.Sim
/// turn (R-MOVE-001). Refused, state untouched, for an unknown or enemy unit, one that cannot move or is already there,
/// water or a hex off the map, an enemy unit's hex (entering it is an attack, Q-MOVE-3), an enemy-held locality that
/// is not a target (R-MOVE-005), a hex full of the unit's side (R-MOVE-003), or a hex out of reach this turn. With <paramref name="enemy"/>
- /// the enemy AI orders its own unit through the same checks, the sides swapped (R-ENEMY-001).</summary>
- internal static string? Move(Content c, GameState s, int unitId, int q, int r, Dictionary<int, int> spent, List<Cause> why, bool enemy = false)
+ /// the enemy AI orders its own unit through the same checks, the sides swapped (R-ENEMY-001). With <paramref name="card"/>
+ /// the move is a step of an operation card's go-to to that hex, and its cost is that of the way round (<see cref="Search"/>).</summary>
+ internal static string? Move(Content c, GameState s, int unitId, int q, int r, Dictionary<int, int> spent, List<Cause> why, bool enemy = false, (int Q, int R)? card = null)
{
if (!s.Units.TryGetValue(unitId, out var u)) return "There is no such unit";
if (IsEnemy(u) != enemy) return "That unit is not yours";
@@ -217,7 +246,7 @@ namespace Statecraft.Sim
if (Closed(c, s, enemy).Contains((q, r))) return "Units may not enter an enemy-held locality before its capture is possible";
if (Full(c, s, u, q, r) is string full) return full;
spent.TryGetValue(unitId, out var used);
- var (dist, _) = Search(c, s, u, points - used, fresh: used == 0);
+ var (dist, _) = Search(c, s, u, points - used, fresh: used == 0, card: card);
if (!dist.TryGetValue((q, r), out var cost)) return "That hex is out of reach this turn";
// Moving clears fortify at once (Q-HOLD-1, "lost on move"; the standing orders' "fortify", or "fortifying" the turn it
// is given, with the hex it names), so a unit that goes out and comes back the same turn is not fortified; hold moves with
@@ -318,12 +347,16 @@ namespace Statecraft.Sim
/// control, Q-MOVE-4). Hexes leave the frontier in (cost, q, r) order and neighbours are tried in the fixed
/// <see cref="Neighbours"/> order, so a hex reached at the same cost twice keeps the first, and the path is the same
/// every run. With <paramref name="fresh"/>, one neighbouring hex whose cost exceeds the budget costs the whole budget
- /// (R-MOVE-001, OQ-3). Stacking limits only where a move ends, so it is not checked here.</summary>
+ /// (R-MOVE-001, OQ-3). Stacking limits only where a move ends, so it is not checked here. With <paramref name="card"/>, an
+ /// operation card's go-to to that hex (R-ENEMY-005; the owner's answer 1 on #2087, 31 October 2026), every enemy-held
+ /// locality (<see cref="NoEntry"/>) but that hex is closed too, open target or not: the march never ends on, and so
+ /// never captures, a place it was not sent to.</summary>
static (Dictionary<(int Q, int R), int> Dist, Dictionary<(int Q, int R), (int Q, int R)> Prev) Search(
- Content c, GameState s, Unit u, int budget, bool fresh = false)
+ Content c, GameState s, Unit u, int budget, bool fresh = false, (int Q, int R)? card = null)
{
var costs = c.RulesAt(s.Date).Mvp!.MoveCost; // the loader requires a cost for every land biome in the GDD loop
var blocked = Closed(c, s, IsEnemy(u));
+ if (card is (int, int) sent) blocked.UnionWith(NoEntry(c, s).Where(h => h != sent));
var built = BuiltSegments(c, s);
foreach (var x in s.Units.Values) if (IsEnemy(x) != IsEnemy(u)) blocked.Add((x.Q, x.R));
var dist = new Dictionary<(int Q, int R), int> { [(u.Q, u.R)] = 0 };
diff --git a/sim/Statecraft.Sim/Orders.cs b/sim/Statecraft.Sim/Orders.cs
index df9454b6d..7bbf76756 100644
--- a/sim/Statecraft.Sim/Orders.cs
+++ b/sim/Statecraft.Sim/Orders.cs
@@ -25,6 +25,13 @@ namespace Statecraft.Sim
public const string RefusedNotYours = "That unit is not yours";
public const string RefusedArtilleryHold = "Artillery does not hold ground";
public const string RefusedAlready = "That unit already has that order";
+ /// <summary>R-ENEMY-005 (the owner's answer 1 on #2087): an operation card's go-to that Movement.GiveGoTo refused. The
+ /// turn's Rejected list carries it with the order, as it carries the player's refused orders (EventSystem).</summary>
+ public const string RefusedCardOrder = "The unit could not take the operation's order";
+ /// <summary>R-ENEMY-005, R-CTRL-013 (owner, 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)"): an
+ /// operation card's go-to not carried out because the unit is the last Israeli unit on an occupied place
+ /// (SettlementControl.LastGarrison), at the order or on a later turn of its march. Listed like <see cref="RefusedCardOrder"/>.</summary>
+ public const string RefusedLastGarrison = "The unit stays: it is the last Israeli unit holding an occupied place";
/// <summary>The player's side (units_1948.yaml's id). Only the player's military units take orders.</summary>
const string PlayerSide = "israel";
diff --git a/sim/Statecraft.Sim/Scenario.cs b/sim/Statecraft.Sim/Scenario.cs
index 4f2afeffc..b7afd8441 100644
--- a/sim/Statecraft.Sim/Scenario.cs
+++ b/sim/Statecraft.Sim/Scenario.cs
@@ -125,7 +125,13 @@ namespace Statecraft.Sim
return (int)v;
}
- /// <summary>Plays the scenario and returns the final state. Fails with the date, the order and the sim's reason when a command is rejected.</summary>
+ /// <summary>An operation card's unit order the sim refused (R-ENEMY-005), not a command of the scenario's.</summary>
+ static bool CardRefusal(Rejection j) => j.Reason == Orders.RefusedCardOrder || j.Reason == Orders.RefusedLastGarrison;
+
+ /// <summary>Plays the scenario and returns the final state. Fails with the date, the order and the sim's reason when a command is rejected.
+ /// An operation card's refused unit order (R-ENEMY-005, <see cref="Orders.RefusedCardOrder"/>) is not one of the scenario's
+ /// commands: the 7th Brigade's Hiram order is refused in every run while the ALA holds al-Malikiyya (#2087). Nor is one
+ /// held back to keep the last unit on an occupied place (<see cref="Orders.RefusedLastGarrison"/>).</summary>
public GameState Play(Content c)
{
var s = Simulation.NewGame(c, Seed ?? GoldenRun.Seed, Mode.Historical);
@@ -135,9 +141,9 @@ namespace Statecraft.Sim
var now = new List<Command>();
while (pending.Count > 0 && pending[0].OnDate <= s.Date) { now.AddRange(pending[0].Built); pending.RemoveAt(0); }
var r = Simulation.Step(c, s, now);
- if (r.Rejected.Count > 0)
+ if (r.Rejected.Any(j => !CardRefusal(j)))
{
- var x = r.Rejected[0];
+ var x = r.Rejected.First(j => !CardRefusal(j));
throw new InvalidOperationException($"scenario '{Name}': on {s.Date:yyyy-MM-dd} the sim rejected {x.Command.Kind} ({Describe(x.Command)}): {x.Reason}");
}
s = r.State;
diff --git a/sim/Statecraft.Sim/SettlementControl.cs b/sim/Statecraft.Sim/SettlementControl.cs
index d25f61911..4e237a34e 100644
--- a/sim/Statecraft.Sim/SettlementControl.cs
+++ b/sim/Statecraft.Sim/SettlementControl.cs
@@ -324,6 +324,16 @@ namespace Statecraft.Sim
/// <summary>Whether an Israeli military unit is on <paramref name="t"/>'s hex (a halutz has no side, R-UNIT-001).</summary>
static bool Garrisoned(GameState s, SettlementTarget t) => s.Units.Values.Any(u => u.Q == t.Q && u.R == t.R && u.Side == Movement.PlayerSide);
+ /// <summary>R-CTRL-013, R-ENEMY-005 (owner, 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)"): whether
+ /// <paramref name="u"/> is the only Israeli military unit on an occupied place (occupied or awaiting its end, the two
+ /// states step 10 ends as a Raid when no unit is left, <see cref="Tick"/>). An operation card's order never takes that
+ /// unit out. Changes nothing and draws nothing; Any is order-free, so the answer does not depend on iteration order.</summary>
+ internal static bool LastGarrison(Content c, GameState s, Unit u) =>
+ u.Side == Movement.PlayerSide
+ && s.Settlements.Any(kv => (kv.Value.State == Occupied || kv.Value.State == AwaitingEnd)
+ && c.SettlementTargets.Any(t => t.Id == kv.Key && t.Q == u.Q && t.R == u.R))
+ && !s.Units.Values.Any(x => x.Id != u.Id && x.Q == u.Q && x.R == u.R && x.Side == Movement.PlayerSide);
+
static bool IsEnemy(Unit u) => u.Side != "" && u.Side != Movement.PlayerSide;
static bool Free(Content c, GameState s, Unit u, int q, int r) =>
diff --git a/sim/Statecraft.Sim/Simulation.cs b/sim/Statecraft.Sim/Simulation.cs
index 2ad243b38..8469baa65 100644
--- a/sim/Statecraft.Sim/Simulation.cs
+++ b/sim/Statecraft.Sim/Simulation.cs
@@ -47,8 +47,9 @@ namespace Statecraft.Sim
return new StepResult(s, why, rejected);
}
- RunOrders(c, s, commands, new Dictionary<int, int>(), new Dictionary<int, (int Q, int R)>(), why, rejected);
- EventSystem.Delegate(c, s, why);
+ var spent = new Dictionary<int, int>();
+ RunOrders(c, s, commands, spent, new Dictionary<int, (int Q, int R)>(), why, rejected);
+ EventSystem.Delegate(c, s, why, spent, rejected); // a delegated card's unit orders share the turn's movement (R-ENEMY-005)
var len = SecuritySystem.TurnLengthFor(c, s.Date, s.Rung);
// The next era's start, or the game's end (the last era's end, or mvp.end in the GDD loop, R-LOOP-004), is a
@@ -139,7 +140,7 @@ namespace Statecraft.Sim
static void RunOrders(Content c, GameState s, IReadOnlyList<Command> commands, Dictionary<int, int> spent,
Dictionary<int, (int Q, int R)> attacked, List<Cause> why, List<Rejection> rejected)
{
- if (c.IsGdd) Movement.ContinueRoutes(c, s, spent, why); // R-MOVE-009: the route step, before the turn's orders
+ if (c.IsGdd) Movement.ContinueRoutes(c, s, spent, why, rejected); // R-MOVE-009: the route step, before the turn's orders
if (c.IsGdd) SettlementControl.CaptureHeld(c, s, why);
var priceRung = s.Rung; // every command this turn is priced at the rung the turn started at (R-MONEY-004's war is that rung too)
var dollarsAtStart = s.DollarsConverted; // R-MONEY-004: the turn's limit counts every conversion order in it
@@ -155,10 +156,10 @@ namespace Statecraft.Sim
if (c.UsesAttention)
{
var before = s.Attention;
- error = AttentionSystem.TrySpend(c, s, cmd.Kind, priceRung) ?? Execute(c, s, cmd, spent, attacked, why, priceRung, dollarsAtStart);
+ error = AttentionSystem.TrySpend(c, s, cmd.Kind, priceRung) ?? Execute(c, s, cmd, spent, attacked, why, priceRung, dollarsAtStart, rejected);
if (error != null) s.Attention = before;
}
- else error = Execute(c, s, cmd, spent, attacked, why, priceRung, dollarsAtStart);
+ else error = Execute(c, s, cmd, spent, attacked, why, priceRung, dollarsAtStart, rejected);
if (error != null) rejected.Add(new Rejection(cmd, error));
if (c.IsGdd) SettlementControl.CaptureHeld(c, s, why); // R-CTRL-004: only where an order ends
}
@@ -181,7 +182,8 @@ namespace Statecraft.Sim
/// reported as a politics cause), or the reason it failed validation. A command that fails validation leaves
/// the state as it found it (attention is refunded by the caller).</summary>
static string? Execute(Content c, GameState s, Command cmd, Dictionary<int, int> spent,
- Dictionary<int, (int Q, int R)> attacked, List<Cause> why, int startRung, int dollarsAtStart)
+ Dictionary<int, (int Q, int R)> attacked, List<Cause> why, int startRung, int dollarsAtStart,
+ List<Rejection> rejected)
{
switch (cmd)
{
@@ -223,7 +225,7 @@ namespace Statecraft.Sim
return null;
}
case ChooseEventOption e:
- return EventSystem.Choose(c, s, e.EventId, e.OptionId, why);
+ return EventSystem.Choose(c, s, e.EventId, e.OptionId, why, spent, rejected); // a refused unit order is rejected on its own (R-ENEMY-005)
case SetMobilization m:
return SecuritySystem.SetMobilization(c, s, m.Level, why);
case Appoint a:
diff --git a/sim/Statecraft.Sim/StartingForces.cs b/sim/Statecraft.Sim/StartingForces.cs
index ebd1f361c..aa7cf0cd6 100644
--- a/sim/Statecraft.Sim/StartingForces.cs
+++ b/sim/Statecraft.Sim/StartingForces.cs
@@ -52,7 +52,14 @@ namespace Statecraft.Sim
internal static List<StartingForce> Read(Func<string, string?> readFile, Content c)
{
var rows = Rows(readFile, FileName, "units");
- var hexes = Hexes(readFile, rows);
+ var hexes = Hexes(readFile, rows, "anchors", "anchor");
+ c.UnitAnchorHexes = hexes; // R-ENEMY-005: the operation cards' orders name these
+ foreach (var row in rows) // and end with their windows; EventRules refuses an order to an anchor with no end
+ if (row != null && row.TryGetValue("anchors", out var ao) && ao is List<object> windows)
+ for (int k = 0; k < windows.Count; k++)
+ if (windows[k] is Dictionary<object, object> a && DateTime.TryParseExact(Text(a, "to"), "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var to))
+ c.UnitAnchorEnds[(Text(row, "id"), k)] = to;
+ OrderTargets(c, rows, Hexes(readFile, rows, "order_targets", "target"));
var start = c.Rules.Start.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
var ppu = c.RulesAt(c.Rules.Start).Mvp!.PeoplePerUnit; // the start day's rules, as Cities.Init reads them
var list = new List<StartingForce>();
@@ -166,8 +173,35 @@ namespace Statecraft.Sim
return types[0].Id;
}
- /// <summary>A file's list under <paramref name="key"/>, read untyped (only the keys the start needs are read).</summary>
- static List<Dictionary<object, object>> Rows(Func<string, string?> readFile, string fileName, string key)
+ /// <summary>R-ENEMY-005 (owner, 2 November 2026, #2087, option 1): each row's `order_targets`, where an operation card may
+ /// send its unit, with the hex tools/unit_anchor_hexes.py gives it and the `to` that ends the card's order. Never a
+ /// start and never drawn, but sourced and dated as an anchor: one with no sources or no from/to date is a load error.</summary>
+ static void OrderTargets(Content c, List<Dictionary<object, object>> rows, Dictionary<(string id, int anchor), (int q, int r)> hexes)
+ {
+ foreach (var row in rows)
+ {
+ if (row == null || !(row.TryGetValue("order_targets", out var to) && to is List<object> targets)) continue;
+ var id = Text(row, "id");
+ for (int k = 0; k < targets.Count; k++)
+ {
+ var at = FormattableString.Invariant($"units[{id}].order_targets[{k}]");
+ if (!(targets[k] is Dictionary<object, object> t)) throw new ContentException(FileName, at, "empty order target");
+ if (!(t.TryGetValue("sources", out var so) && so is List<object> sources && sources.Count > 0))
+ throw new ContentException(FileName, at + ".sources", "required, at least one source");
+ if (!DateTime.TryParseExact(Text(t, "from"), "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out _))
+ throw new ContentException(FileName, at + ".from", "required, a date 'YYYY-MM-DD'");
+ if (!DateTime.TryParseExact(Text(t, "to"), "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var until))
+ throw new ContentException(FileName, at + ".to", "required, a date 'YYYY-MM-DD'");
+ if (!hexes.TryGetValue((id, k), out var qr))
+ throw new ContentException(HexesFileName, "order_targets", $"no hex for {at} ({FileName}); rerun tools/unit_anchor_hexes.py");
+ c.UnitOrderTargets[(id, k)] = (qr.q, qr.r, until);
+ }
+ }
+ }
+
+ /// <summary>A file's list under <paramref name="key"/>, read untyped (only the keys the start needs are read). An
+ /// <paramref name="optional"/> key that is absent reads as an empty list.</summary>
+ static List<Dictionary<object, object>> Rows(Func<string, string?> readFile, string fileName, string key, bool optional = false)
{
string? text;
try { text = readFile(fileName); }
@@ -177,29 +211,31 @@ namespace Statecraft.Sim
Dictionary<string, List<Dictionary<object, object>>>? file;
try { file = new DeserializerBuilder().Build().Deserialize<Dictionary<string, List<Dictionary<object, object>>>>(text); }
catch (YamlException e) { throw new ContentException(fileName, $"line {e.Start.Line}", e.InnerException?.Message ?? e.Message); }
- if (file == null || !file.TryGetValue(key, out var rows) || rows == null) throw new ContentException(fileName, key, "required");
- return rows;
+ if (file != null && file.TryGetValue(key, out var rows) && rows != null) return rows;
+ if (optional && (file == null || !file.ContainsKey(key))) return new List<Dictionary<object, object>>();
+ throw new ContentException(fileName, key, "required");
}
- /// <summary>unit_anchor_hexes.yaml by (row id, anchor index). Every row must name an anchor of <paramref name="units"/>,
- /// once: a row that does not means the file is stale (the tool was not rerun after units_1948.yaml changed).</summary>
- static Dictionary<(string id, int anchor), (int q, int r)> Hexes(Func<string, string?> readFile, List<Dictionary<object, object>> units)
+ /// <summary>unit_anchor_hexes.yaml's <paramref name="key"/> list (anchors, or order_targets, R-ENEMY-005) by (row id,
+ /// index). Every row must name one entry of <paramref name="units"/>' list under the same key, once: a row that does
+ /// not means the file is stale (the tool was not rerun after units_1948.yaml changed).</summary>
+ static Dictionary<(string id, int anchor), (int q, int r)> Hexes(Func<string, string?> readFile, List<Dictionary<object, object>> units, string key, string index)
{
var anchors = new Dictionary<string, int>(StringComparer.Ordinal);
foreach (var u in units)
- if (u != null) anchors[Text(u, "id")] = u.TryGetValue("anchors", out var ao) && ao is List<object> list ? list.Count : 0;
+ if (u != null) anchors[Text(u, "id")] = u.TryGetValue(key, out var ao) && ao is List<object> list ? list.Count : 0;
var hexes = new Dictionary<(string, int), (int, int)>();
- var rows = Rows(readFile, HexesFileName, "anchors");
+ var rows = Rows(readFile, HexesFileName, key, optional: key != "anchors");
for (int i = 0; i < rows.Count; i++)
{
- var row = rows[i] ?? throw new ContentException(HexesFileName, $"anchors[{i}]", "empty row");
+ var row = rows[i] ?? throw new ContentException(HexesFileName, $"{key}[{i}]", "empty row");
var id = Text(row, "id");
- var at = id == "" ? $"anchors[{i}]" : $"anchors[{id}]";
- int k = Int(row, "anchor", at), q = Int(row, "q", at), r = Int(row, "r", at);
+ var at = id == "" ? $"{key}[{i}]" : $"{key}[{id}]";
+ int k = Int(row, index, at), q = Int(row, "q", at), r = Int(row, "r", at);
if (!anchors.TryGetValue(id, out var n) || k < 0 || k >= n)
- throw new ContentException(HexesFileName, at, FormattableString.Invariant($"no anchor {k} of a row '{id}' in {FileName}; rerun tools/unit_anchor_hexes.py"));
+ throw new ContentException(HexesFileName, at, FormattableString.Invariant($"no {index} {k} of a row '{id}' in {FileName}; rerun tools/unit_anchor_hexes.py"));
if (!hexes.TryAdd((id, k), (q, r)))
- throw new ContentException(HexesFileName, at, FormattableString.Invariant($"anchor {k} is listed twice"));
+ throw new ContentException(HexesFileName, at, FormattableString.Invariant($"{index} {k} is listed twice"));
}
return hexes;
}
diff --git a/sim/Statecraft.Sim/UnitLines.cs b/sim/Statecraft.Sim/UnitLines.cs
index 17169b28c..0d986902e 100644
--- a/sim/Statecraft.Sim/UnitLines.cs
+++ b/sim/Statecraft.Sim/UnitLines.cs
@@ -41,13 +41,14 @@ namespace Statecraft.Sim
HoldsFire = "holds_fire", AttackCalledOff = "attack_called_off", Engagement = "engagement", Destroyed = "destroyed",
Retreated = "retreated", SurrenderedPrisoners = "surrendered_prisoners", SurrenderedHeld = "surrendered_held",
SentHome = "sent_home", Withdrew = "withdrew", OnItsWay = "on_its_way",
- StoppedNoRoute = "stopped_no_route", StoppedFull = "stopped_full", Arrived = "arrived";
+ StoppedNoRoute = "stopped_no_route", StoppedFull = "stopped_full", Arrived = "arrived",
+ CardOrderEnded = "card_order_ended";
public static readonly IReadOnlyList<string> All = new[]
{
UnitMoved, FortifyLost, Fortifying, Holds, AttackEndedTruce, AttackOrdered, AttackEnded, HoldsFire,
AttackCalledOff, Engagement, Destroyed, Retreated, SurrenderedPrisoners, SurrenderedHeld, SentHome,
- Withdrew, OnItsWay, StoppedNoRoute, StoppedFull, Arrived,
+ Withdrew, OnItsWay, StoppedNoRoute, StoppedFull, Arrived, CardOrderEnded,
};
}
diff --git a/tools/tests/test_unit_anchor_hexes.py b/tools/tests/test_unit_anchor_hexes.py
index 8d2e5c994..0ba9e57aa 100644
--- a/tools/tests/test_unit_anchor_hexes.py
+++ b/tools/tests/test_unit_anchor_hexes.py
@@ -59,3 +59,11 @@ def test_a_hex_shared_by_a_player_locality_and_an_enemy_held_one_is_the_players_
monkeypatch.setattr(uah.yaml12, "load", reversed_rows)
assert (-4, 24) in uah.player_locality_hexes()
+
+
+def test_order_targets_get_their_own_rows():
+ # R-ENEMY-005 (owner, 2 November 2026, #2087, option 1): an order target is not an anchor, so it has no anchor row.
+ hexes = yaml12.load((MAP / "unit_anchor_hexes.yaml").read_text())
+ targets = {(r["id"], r["target"]): (r["q"], r["r"]) for r in hexes["order_targets"]}
+ assert targets[("kiryati", 0)] == (-3, 24) # Ramle, the ten_days card's order: Ramla's capture target, not its shared (-4, 24) (owner, 2 Nov 2026)
+ assert not any(r["id"] == "kiryati" and r["anchor"] == 1 for r in hexes["anchors"])
diff --git a/tools/tests/test_units_1948.py b/tools/tests/test_units_1948.py
index 843ecde32..9f9385948 100644
--- a/tools/tests/test_units_1948.py
+++ b/tools/tests/test_units_1948.py
@@ -25,6 +25,9 @@ def sources(u):
for a in u['anchors']:
out += a['sources']
out += (a.get('toward') or {}).get('sources') or []
+ # An order target (owner, 2 November 2026, #2087, option 1) keeps the anchor rules, so its sources count here too.
+ for t in u.get('order_targets') or []:
+ out += t['sources']
for t in u.get('aircraft') or []:
out += t['sources']
out += u.get('headgear_sources') or []
@@ -42,7 +45,7 @@ def wiki(s):
def test_every_window_ends_for_a_stated_reason():
for u in UNITS:
- for a in u['anchors']:
+ for a in u['anchors'] + (u.get('order_targets') or []): # an order target ends by the anchor rules (#2087)
where = f"{u['id']} {a['place']}"
assert a['sources'], where
assert a.get('end_basis') in ('source', 'front_armistice'), where
diff --git a/tools/unit_anchor_hexes.py b/tools/unit_anchor_hexes.py
index 555895f6b..39ba0144c 100644
--- a/tools/unit_anchor_hexes.py
+++ b/tools/unit_anchor_hexes.py
@@ -27,7 +27,8 @@ ROOT = Path(__file__).resolve().parents[1]
MAP = ROOT / "content" / "map"
OUT = MAP / "unit_anchor_hexes.yaml"
HEADER = ("# Generated by tools/unit_anchor_hexes.py from units_1948.yaml and hexes.json (hexgrid.settlement_hex).\n"
- "# Do not edit by hand: rerun the tool after changing either input. anchor is the index in the row's anchors list.\n")
+ "# Do not edit by hand: rerun the tool after changing either input. anchor is the index in the row's anchors list,\n"
+ "# target the index in its order_targets list (R-ENEMY-005: where an operation card may send the unit).\n")
def settlement_hexes() -> dict[tuple[int, int], str]:
@@ -45,8 +46,22 @@ def player_locality_hexes() -> set[tuple[int, int]]:
return {(s["q"], s["r"]) for s in rows if s["id"] not in held}
+# An order target sent to a settlement whose capture target is not its own hex goes to that capture target, or the order
+# could never take the place (owner, 2 November 2026, #2087: "Send it to Ramla's target (Recommended)"): at 4.4 km Ramle's
+# point lies in (-4, 24), which Ramla shares with Rehovot, and Ramla's capture target is its neighbour (-3, 24) in
+# settlement_targets.yaml (owner on #1796, 26 October 2026, "Contested + move target"). Keyed by (row id, target index).
+ORDER_TARGET_ON_CAPTURE_HEX = {("kiryati", 0): "ramla"}
+
+
+def capture_hex(settlement: str) -> tuple[int, int]:
+ """The capture target hex settlement_targets.yaml gives a settlement."""
+ rows = yaml12.load((ROOT / "content" / "settlement_targets.yaml").read_text(encoding="utf-8"))["targets"]
+ row = next(t for t in rows if t["id"] == settlement)
+ return row["q"], row["r"]
+
+
def render(hexes: dict, units: list[dict]) -> str:
- """The file text: one flow mapping per anchor, in units_1948.yaml order."""
+ """The file text: one flow mapping per anchor, then per order target, in units_1948.yaml order."""
placed = [(u, k, a, hg.settlement_hex(a["lon"], a["lat"], hexes))
for u in units for k, a in enumerate(u.get("anchors") or [])]
player, taken = player_locality_hexes(), set(settlement_hexes()) | {h for *_, h in placed}
@@ -61,6 +76,14 @@ def render(hexes: dict, units: list[dict]) -> str:
q, r = min(free, key=lambda c: math.dist(hg.hex_center_km(*c, hexes["hex_size_km"]), p))
taken.add((q, r))
lines.append(f" - {{ id: {u['id']}, anchor: {k}, q: {q}, r: {r} }}\n")
+ # An order target is where a card sends the player's own unit, so it takes the anchors' placement rule
+ # (settlement_hex) and never the enemy's free-neighbour rule; it is not added to taken, so no anchor moves for it.
+ lines.append("order_targets:\n")
+ for u in units:
+ for k, a in enumerate(u.get("order_targets") or []):
+ place = ORDER_TARGET_ON_CAPTURE_HEX.get((u["id"], k))
+ q, r = capture_hex(place) if place else hg.settlement_hex(a["lon"], a["lat"], hexes)
+ lines.append(f" - {{ id: {u['id']}, target: {k}, q: {q}, r: {r} }}\n")
return "".join(lines)
diff --git a/tools/web_check.py b/tools/web_check.py
index 9085e95e4..dfda9832b 100644
--- a/tools/web_check.py
+++ b/tools/web_check.py
@@ -8,7 +8,7 @@ fail on a failure line or a timeout. Uses Chrome for Testing from the Playwright
--enable-logging=stderr --v=1 as INFO:CONSOLE... "text", source: ...
Usage (from the repo root):
- uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK hash1950 74fbe989d84a987728ba983a263714dcbe05abc2768033c15c3aed212cf34b63" --expect "GOLDEN OK hash1952 d74296940a6a6c8346b38679d80ed25ef0b537d2e709048eb4989ad46a259a66"
+ uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK hash1950 ac38d6c76c3e0e397365370e63cd23ed00b1b12928cecc4b6aea418440b76d2c" --expect "GOLDEN OK hash1952 22f2c8da8222e1e87859ef9aae359aa37a04eab34880f65242c4f4d79d5b5c78"
uv run tools/web_check.py unity/Builds/Web-disabled --query "smoke-orders" --expect "SMOKE ORDERS OK 1948-06-15 08d9800eda4462ef165cc7ea6285fad059c030c0f87ad563e35c9789cc352d78"
(the smoke-orders golden: one Move given through the unit card, docs/determinism.md)
Options: --query Q (page URL query, without '?'), --expect TEXT (repeatable), --fail REGEX (default: GOLDEN FAIL|SMOKE FAIL|BOOT FAIL),
diff --git a/unity/Assets/Scripts/Map/Units/UnitData.cs b/unity/Assets/Scripts/Map/Units/UnitData.cs
index d1fa917e5..6b2cab2fc 100644
--- a/unity/Assets/Scripts/Map/Units/UnitData.cs
+++ b/unity/Assets/Scripts/Map/Units/UnitData.cs
@@ -185,6 +185,10 @@ namespace Statecraft.Game.Map.Units
public List<UnitVehicle>? Vehicles { get; set; }
public UnitDisbanded? Disbanded { get; set; }
public List<UnitAnchor> Anchors { get; set; } = new List<UnitAnchor>();
+ /// <summary>Where an operation card sends the unit (R-ENEMY-005; owner, 2 November 2026, #2087, option 1). Read only so
+ /// the file parses: the map never draws them and the card never shows them (the sim and tools/unit_anchor_hexes.py
+ /// read them).</summary>
+ public List<UnitAnchor>? OrderTargets { get; set; }
public List<UnitAircraft>? Aircraft { get; set; }
public List<UnitSource>? Sources { get; set; }
diff --git a/unity/Assets/Scripts/UI/InfoPanelPresenter.cs b/unity/Assets/Scripts/UI/InfoPanelPresenter.cs
index 7115c896f..f5fc3e81a 100644
--- a/unity/Assets/Scripts/UI/InfoPanelPresenter.cs
+++ b/unity/Assets/Scripts/UI/InfoPanelPresenter.cs
@@ -651,7 +651,8 @@ namespace Statecraft.Game.UI
var parts = u.OrderTarget.Split(',');
if (parts.Length != 2 || !int.TryParse(parts[0], NumberStyles.Integer, CultureInfo.InvariantCulture, out var q)
|| !int.TryParse(parts[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var r)) return "";
- var route = Movement.Route(bridge.Content, now.State, unit, q, r, now.Spent);
+ // An operation card's go-to marches round enemy-held places it was not sent to (R-ENEMY-005): count that route.
+ var route = Movement.Route(bridge.Content, now.State, unit, q, r, now.Spent, card: now.State.CardOrders.ContainsKey(unit));
return route.Count == 0 ? "" : text.Format("unit.go_to_given", System.Math.Max(0, route[route.Count - 1].Turn - 1));
}
diff --git a/unity/Assets/Scripts/UI/SimBridge.cs b/unity/Assets/Scripts/UI/SimBridge.cs
index 0f2e4f9fb..20464d97f 100644
--- a/unity/Assets/Scripts/UI/SimBridge.cs
+++ b/unity/Assets/Scripts/UI/SimBridge.cs
@@ -245,6 +245,8 @@ namespace Statecraft.Game.UI
[Training.RefusedNoTraining] = "unit.reinforce_refused.no_training",
[Training.RefusedCount] = "unit.reinforce_refused.count",
[Pools.RefusedDebtCeiling] = "arms.refused_debt_ceiling",
+ [Orders.RefusedCardOrder] = "unit.order_refused.card_order", // R-ENEMY-005: an operation card's refused go-to
+ [Orders.RefusedLastGarrison] = "unit.order_refused.last_garrison", // R-CTRL-013: a card's go-to held back
};
/// <summary>The sim's refusals that carry values (#2072: Combat.Check's Arms, Training.Reinforce's unit, settlement,
diff --git a/unity/Assets/Scripts/UI/ToastPresenter.cs b/unity/Assets/Scripts/UI/ToastPresenter.cs
index e03e4c0a3..312a35c3d 100644
--- a/unity/Assets/Scripts/UI/ToastPresenter.cs
+++ b/unity/Assets/Scripts/UI/ToastPresenter.cs
@@ -32,7 +32,7 @@ namespace Statecraft.Game.UI
onRouteStep = _ =>
{
var lines = bridge.Session.Now.Why
- .Where(x => x.Key == WhyKeys.Arrived || x.Key == WhyKeys.StoppedNoRoute || x.Key == WhyKeys.StoppedFull)
+ .Where(x => x.Key == WhyKeys.Arrived || x.Key == WhyKeys.StoppedNoRoute || x.Key == WhyKeys.StoppedFull || x.Key == WhyKeys.CardOrderEnded)
.Select(x => UnitNames.Line(x, bridge.Content, units, text, TownNamesHe)).ToList();
if (lines.Count > 0) Append(string.Join("\n", lines));
};
diff --git a/unity/Assets/Tests/EditMode/CityPanelTests.cs b/unity/Assets/Tests/EditMode/CityPanelTests.cs
index 88a913742..2a1a01c1c 100644
--- a/unity/Assets/Tests/EditMode/CityPanelTests.cs
+++ b/unity/Assets/Tests/EditMode/CityPanelTests.cs
@@ -46,6 +46,14 @@ public class CityPanelTests
return id;
}
+ /// <summary>The one refusal an untouched real game makes on its own (R-ENEMY-005; owner, 1 November 2026, #2087): on the
+ /// 15 November 1948 turn the unanswered Operation Hiram card is delegated, and its order sending the 7th Brigade to
+ /// al-Malikiyya (14,4) is refused while the ALA holds that hex, as the player's own go-to would be. The sim pins it in
+ /// WarEvents1948Tests (NoTurnBeforeTheArmisticeRefusesAnOrder, AnUntouchedGameRefusesOnlyHiramsOrderToTheSeventhBrigade);
+ /// the site tests below play through that turn and must still see every other refusal.</summary>
+ static bool IsTheMalkiyaRefusal(Rejection x) =>
+ x.Reason == Orders.RefusedCardOrder && x.Command is UnitOrder { Q: 14, R: 4 } o && o.Unit == C.StartingForces.FindIndex(f => f.Row == "brigade_7");
+
/// <summary>Tel Aviv with <paramref name="civilians"/> civilians, <paramref name="employed"/> of them in jobs.</summary>
static Action<GameState> Counts(int civilians, int employed) =>
s => s.Cities[City] = s.Cities[City].WithCounts(civilians, employed, s.Cities[City].Refugees);
@@ -421,7 +429,7 @@ public class CityPanelTests
do
{
var result = Simulation.Step(C, played, elapsed == 0 ? new Command[] { new PioneerWork(a, Projects.BuildYishuv, Site) } : new Command[0]);
- Assert.IsEmpty(result.Rejected);
+ Assert.IsEmpty(result.Rejected.Where(j => !IsTheMalkiyaRefusal(j)));
played = result.State; elapsed++;
} while (played.Sites[Site].BuiltOn == null && elapsed < 12);
Assert.IsNotNull(played.Sites[Site].BuiltOn, "real resolver finishes the fixture");
@@ -746,7 +754,7 @@ public class CityPanelTests
do
{
var result = Simulation.Step(C, played, new Command[0]);
- Assert.IsEmpty(result.Rejected);
+ Assert.IsEmpty(result.Rejected.Where(j => !IsTheMalkiyaRefusal(j)));
played = result.State; elapsed++;
} while (played.Sites[Site].BuiltOn == null && elapsed < 12);
Assert.IsNotNull(played.Sites[Site].BuiltOn, "real resolver finishes the fixture");
diff --git a/unity/Assets/Tests/EditMode/EventCardTests.cs b/unity/Assets/Tests/EditMode/EventCardTests.cs
index 01ad63455..d4e5efebb 100644
--- a/unity/Assets/Tests/EditMode/EventCardTests.cs
+++ b/unity/Assets/Tests/EditMode/EventCardTests.cs
@@ -226,6 +226,8 @@ public class EventCardTests
while (!g.State.PendingEvents.Contains("elections_1949")) g.Step(new Command[0]);
// On monthly turns elections_1949 comes on 15 January 1949 with sinai_withdrawal and rhodes_talks; this test is about the one-option card.
g.State.PendingEvents.RemoveAll(id => id != "elections_1949");
+ // Golani is on Operation Horev's go-to then (R-ENEMY-005), so the bridge shows the turn's preview, a copy: trim it too.
+ g.Now.State.PendingEvents.RemoveAll(id => id != "elections_1949");
var bridge = new SimBridge(g, Text);
var card = new EventCardPresenter(ui.Root, bridge, Text, null);
Assert.AreEqual("elections_1949", card.Shown!.Id);
diff --git a/unity/Assets/Tests/EditMode/UnitOrdersTests.cs b/unity/Assets/Tests/EditMode/UnitOrdersTests.cs
index d5d6b891d..e6973c2de 100644
--- a/unity/Assets/Tests/EditMode/UnitOrdersTests.cs
+++ b/unity/Assets/Tests/EditMode/UnitOrdersTests.cs
@@ -731,6 +731,47 @@ public class UnitOrdersTests
finally { Object.DestroyImmediate(map.gameObject); }
}
+ /// <summary>R-ENEMY-005 on screen (the owner's ruling on #2087, 1 November 2026): the card of a unit on an operation
+ /// card's go-to counts the turns of the card's march, which goes round an enemy-held place it was not sent to, not those
+ /// of the player's own route through it. Golani stands at 3,12, sent by a card to 10,5 beyond enemy-held Acre (8,7): on the
+ /// 4.4 km grid (#1796) no start and target within 7 hexes of Nazareth (8,11) make the way round cost a turn, so it is Acre.</summary>
+ [Test]
+ public void ACardOrderedUnitsCardCountsTheWayRound()
+ {
+ var map = BuildMap();
+ using var ui = new UiTestKit();
+ try
+ {
+ var session = GameSession.New(C, GoldenRun.Seed, Mode.Historical);
+ var id = UnitCard.SimUnit(C, session.State, Units.Single(e => e.Id == "golani"))!.Value;
+ var u = session.State.Units[id];
+ session.State.Units[id] = new Unit(u.Id, u.Type, 3, 12, u.Service, u.Side, u.Strength, Movement.GoTo, "10,5", u.HomeCity, u.Full);
+ session.State.CardOrders[id] = new System.DateTime(1949, 2, 24);
+ var bridge = new SimBridge(session, Text);
+ // Any committed order re-runs the turn's preview, in which the march takes this turn's step (RunOrders).
+ var other = UnitCard.SimUnit(C, session.State, Units.Single(e => e.Id == "carmeli"))!.Value;
+ Assert.IsNull(bridge.Queue(new UnitOrder(other, Orders.Hold)));
+ var now = bridge.Session.Now;
+ var plain = Movement.Route(C, now.State, id, 10, 5, now.Spent);
+ var card = Movement.Route(C, now.State, id, 10, 5, now.Spent, card: true);
+ Assert.IsTrue(now.State.CardOrders.ContainsKey(id), "the card's order still stands");
+ Assert.IsTrue(plain.Any(h => (h.Q, h.R) == (8, 7)) && !card.Any(h => (h.Q, h.R) == (8, 7)), "the player's route crosses Acre, the card's goes round");
+ Assert.AreNotEqual(plain[plain.Count - 1].Turn, card[card.Count - 1].Turn, "the way round costs a turn, so the card shows which route it counts");
+ var layer = UnitLayer.Create(map, Units, C.Hexes, still: true);
+ layer.Show(bridge.Content, bridge.State);
+ var info = new InfoPanelPresenter(ui.Root, bridge, Text, new Dictionary<string, string>(),
+ selectedUnit: () => layer.Selected is string sel ? layer.Tokens.First(p => p.Token.Unit.Id == sel) : (PlacedToken?)null,
+ showReachable: map.ShowReachable, showRoute: map.ShowRoute);
+ var golani = layer.Tokens.Single(p => p.Token.Unit.Id == "golani");
+ GameRoot.OnHexClicked(map, layer, info, golani.Q, golani.R);
+ var shown = ui.Q<Label>("info-settlements").text;
+ StringAssert.Contains(Text.Format("unit.go_to_given", card[card.Count - 1].Turn - 1), shown);
+ StringAssert.DoesNotContain(Text.Format("unit.go_to_given", plain[plain.Count - 1].Turn - 1), shown);
+ info.Dispose();
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
/// <summary>Spec 8.1: on touch, the first tap on an unlit reachable route previews it and the second gives the go-to.</summary>
[Test]
public void AGoToNeedsASecondTapOnTouch()
diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yaml
index 8f0ad8ac9..7f488ef90 100644
--- a/unity/Assets/UI/strings.en.yaml
+++ b/unity/Assets/UI/strings.en.yaml
@@ -408,6 +408,8 @@ why.line.on_its_way: "{0} is on its way to {1}"
why.line.stopped_no_route: "{0} stopped: no route reaches {1}"
why.line.stopped_full: "{0} stopped: {1} is full"
why.line.arrived: "{0} arrived at {1}"
+# An operation card's order ended with its operation (R-ENEMY-005; the owner's answer 1 on #2087).
+why.line.card_order_ended: "{0} stopped: the operation's order to {1} has ended"
# B1: the economy, population, effect and security Why lines (CauseKeys, CauseText). English is the sim's own Message,
# word for word: a test compares them, so change the sim and this together. {0} a name below, {1} the change in its unit;
# money and percentages arrive formatted by PlayerText. Lines without a key stay the sim's English (not yet localized).
@@ -1046,6 +1048,11 @@ unit.order_refused.not_military: "Only a military unit takes that order"
unit.order_refused.not_yours: "That unit is not yours"
unit.order_refused.artillery_hold: "Artillery does not hold ground"
unit.order_refused.already: "That unit already has that order"
+# An operation card's refused go-to (R-ENEMY-005; the owner's answer 1 on #2087).
+unit.order_refused.card_order: "The unit could not take the operation's order"
+# An operation card's go-to held back from the last Israeli unit on an occupied place (R-ENEMY-005, R-CTRL-013; owner,
+# 2 November 2026, #2087: "Keep a garrison in Nazareth (Recommended)").
+unit.order_refused.last_garrison: "The unit stays: it is the last Israeli unit holding an occupied place"
# #2072 Attack and Reinforce refusals (Combat.Check, Training.Reinforce), shown on the unit card and in the toast. Each
# English line is the sim's own text; {0}, {1}... are the values it fills in.
diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yaml
index d34bbcae9..7dbcfe5e2 100644
--- a/unity/Assets/UI/strings.he.yaml
+++ b/unity/Assets/UI/strings.he.yaml
@@ -460,6 +460,9 @@ why.line.on_its_way: "{0} בדרך למשבצת {1}"
why.line.stopped_no_route: "{0}: עצירה, כי אין מסלול שמגיע למשבצת {1}"
why.line.stopped_full: "{0}: עצירה, כי משבצת {1} מלאה"
why.line.arrived: "{0}: הגעה למשבצת {1}"
+# An operation card's order ended with its operation (R-ENEMY-005; the owner's answer 1 on #2087). Agent-drafted Hebrew;
+# native review pending (#564).
+why.line.card_order_ended: "{0}: עצירה, כי פקודת המבצע לנוע למשבצת {1} הסתיימה"
# B1: the economy, population, effect and security Why lines (CauseKeys, CauseText). A change reads "{0}: שינוי {1}", as
# event.effect.amount does, so the pattern has Hebrew and UiText marks the amount (#543). Counts as "Label: N" (HE-04);
# no verb agrees with a placeholder (HE-15). Native review: owner, 25 Oct 2026 (recommendations page), for every
@@ -1242,6 +1245,12 @@ unit.order_refused.not_military: "רק יחידה צבאית מקבלת פקוד
unit.order_refused.not_yours: "היחידה אינה שלך"
unit.order_refused.artillery_hold: "ארטילריה אינה מחזיקה בשטח"
unit.order_refused.already: "היחידה כבר קיבלה פקודה זו"
+# An operation card's refused go-to (R-ENEMY-005; the owner's answer 1 on #2087). Agent-drafted Hebrew; native review
+# pending (#564).
+unit.order_refused.card_order: "לא ניתן היה לבצע את פקודת המבצע ליחידה"
+# An operation card's go-to held back from the last Israeli unit on an occupied place (R-ENEMY-005, R-CTRL-013; #2087).
+# Agent-drafted Hebrew; native review pending (#564).
+unit.order_refused.last_garrison: "היחידה נשארת במקום: היא היחידה הישראלית האחרונה המחזיקה בו"
# #2072 Attack and Reinforce refusals (Combat.Check, Training.Reinforce), shown on the unit card and in the toast. A
# settlement in {0}/{1} opens the line as its label or follows a prefix, so no verb agrees with its gender (HE-15).