A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Operations need their units in place: a card's order resolves only with its brigades in the operation's regions (Fixes #2543) (#2621)
Eyal Golan30e1b1cefcd8
diff --git a/changelog.d/2543-operations-need-units-in-place.md b/changelog.d/2543-operations-need-units-in-place.mdnew file mode 100644index 000000000..cbe8bae43--- /dev/null+++ b/changelog.d/2543-operations-need-units-in-place.md@@ -0,0 +1,18 @@+### Changed++- Require the units named by an operation decision to be in one of that operation's regions before it can begin. A+ delegated operation whose units are elsewhere is postponed, keeps its option, and waits for its units for up to 6 turns+ (`mvp.operation_wait_turns`); it lapses earlier when a unit it needs is gone or its front's armistice is signed, and a+ lapse costs 0.01 Security (`mvp.operation_lapse_security`). While that armistice is undecided the operation waits for+ it. A late launch's unit orders end later by the time it waited, and one launched inside a truce the player accepted+ costs 0.10 International Support unless its own effects already do. Rhodes Talks, Sinai Withdrawal and Rafah follow a+ late Horev, and drop once Egypt signs.+ Operation cards' unit orders now also apply under gdd-0.3, and an objective, prisoner-exchange or Deport card can no+ longer give unit orders (the content loader refuses it). The escalations (Yoav's push to Hebron, Hiram's advance into+ Lebanon) and Ten Days' southern front give orders too; Givati gains a Bayt Jibrin order target.+ A card shown after its own window has closed reads its late text (`late_text`, with `late_text_he`); five cards+ have one, and the translators' page (`tools/translate.py`) lists it.+- The decision card lists each required unit once, shows an operation waiting for its front's armistice after that+ armistice and a waiting operation after the turn's other cards, takes a queued operation back when its unit is moved+ away, and moves the toast below a short photograph band. The turn report has a row for postponed and lapsed operations.+- The automated players no longer stage an operation's units onto an enemy-held place.diff --git a/content/events/latrun_proposal.yaml b/content/events/latrun_proposal.yamlindex 4e1fa53e8..d200bbaf9 100644--- a/content/events/latrun_proposal.yaml+++ b/content/events/latrun_proposal.yaml@@ -7,6 +7,7 @@ text: '{prime_minister} proposes to the cabinet that the IDF break the truce totitle_he: לטרוןtext_he: 'הצעת {prime_minister} לממשלה היא שצה״ל יפר את ההפוגה כדי לתקוף ולכבוש את לטרון. רוב השרים, ובהם {finance_minister}, {justice_minister} ו־{immigration_minister}, מתנגדים.'anchor: hard+armistice_front: jordan # R-ENEMY-007 (owner, 7 November 2026, "Jordan signing (Recommended)"): a pending card lapses once this armistice is signedtags: [security]office: prime_minister# Ben-Gurion's diary, 26 September 1948 (Ben-Gurion Archive, primary): the cabinet rejected the proposal. Vote [C]: 7-5 in@@ -51,6 +52,9 @@ options:# 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.+ # R-ENEMY-007 operation-start regions (#2543 table): central_plain contains the fort target and+ # R-ENEMY-007: jerusalem_hills covers the sourced Jerusalem-road objective (this card's sources; war-1948.md:137).+ requires_unit_regions: [central_plain, jerusalem_hills]unit_orders:- { unit: harel, q: -3, r: 25 }sources:diff --git a/content/events/operation_hiram.yaml b/content/events/operation_hiram.yamlindex 962f61c56..581d539bf 100644--- a/content/events/operation_hiram.yaml+++ b/content/events/operation_hiram.yaml@@ -6,7 +6,12 @@ text: 'In breach of the truce, the Arab Liberation Army attacked the Sheikh Abd# follow he.wiki "מבצע חירם" ("משלטי שייח' עבד"): https://he.wikipedia.org/wiki/מבצע_חירםtitle_he: מבצע חירםtext_he: 'בהפרת ההפוגה תקף צבא ההצלה את משלט שייח׳ עבד שמעל קיבוץ מנרה ב־22 באוקטובר. בין 29 ל־31 באוקטובר הדפו כוחותיו של משה כרמל את צבא ההצלה מן הגליל העליון במבצע חירם, והפסקת אש נכנסה לתוקף ב־31 באוקטובר. ההחלטה אם הכוחות יעצרו עם הפסקת האש או יתקדמו הלאה לתוך לבנון בידי {defense_minister}.'+# R-ENEMY-007 (owner, 7 November 2026, "Dateless variants (Recommended)", then "All approved (Recommended)" for these exact+# words): the text when the card is shown after its own window has closed.+late_text: 'In breach of the truce, the Arab Liberation Army attacked the Sheikh Abd position above Kibbutz Manara. Moshe Carmel''s forces are to drive it out of the Upper Galilee once they are in place. {defense_minister} must decide whether the forces stop at the cease-fire or advance further into Lebanon.'+late_text_he: 'בהפרת ההפוגה תקף צבא ההצלה את משלט שייח׳ עבד שמעל קיבוץ מנרה. כוחותיו של משה כרמל יהדפו אותו מן הגליל העליון כשיגיעו למקומם. ההחלטה אם הכוחות יעצרו עם הפסקת האש או יתקדמו הלאה לתוך לבנון בידי {defense_minister}.'anchor: soft+armistice_front: lebanon # R-ENEMY-007 (owner, 7 November 2026, "Signing wins (Recommended)"; Hiram on Lebanon): a pending card lapses once this armistice is signedtags: [security, war-casualties]office: defense_minister# Trigger: the attack on 22 October 1948 and sniping at Manara on 24-25 October (en.wiki "Operation Hiram"; the Acting@@ -40,6 +45,9 @@ options:# 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.+ # R-ENEMY-007 operation-start region (#2543 table): galilee is the sourced Upper/whole Galilee objective+ # R-ENEMY-007: (this card's sources; research_notes/M4 war mode/war-1948.md:145); both border target hexes are unassigned.+ requires_unit_regions: [galilee]unit_orders:- { unit: carmeli, q: 15, r: 3 }- { unit: brigade_7, q: 14, r: 4 }@@ -51,7 +59,12 @@ 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.+ # R-ENEMY-007 (owner, 7 November 2026: "Add real orders", "Stop at al-Malikiyya (Recommended)"): the same units and sourced border+ # R-ENEMY-007: targets as stop_at_ceasefire; the crossing into Lebanon is the card's text, with no village named.+ requires_unit_regions: [galilee]+ unit_orders: # R-ENEMY-007+ - { unit: carmeli, q: 15, r: 3 } # R-ENEMY-007: Manara, carmeli's order target+ - { unit: brigade_7, q: 14, r: 4 } # R-ENEMY-007: al-Malikiyya, brigade_7's order targetsources:- { 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.yamlindex 784a1caeb..edabfefe7 100644--- a/content/events/operation_horev.yaml+++ b/content/events/operation_horev.yaml@@ -2,14 +2,16 @@id: operation_horevtitle: Operation Horev# 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.'+# verbatim: "Add the line (Recommended)". Reworded for R-ENEMY-007 (Golani must first be in Horev's regions), owner,+# 7 November 2026, #2621: "Reword it (Recommended)", then "All approved (Recommended)" for these exact English and+# Hebrew words, 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. Golani must reach the south first; while it alone holds an occupied 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+armistice_front: egypt # R-ENEMY-007 (owner, 7 November 2026, "Signing wins (Recommended)"): a pending card lapses once this armistice is signedtags: [security, war-casualties]office: defense_minister# Start [C]: 22 December 1948 (the IDF Archives; Security Council resolution 66 dates the hostilities from 22 December;@@ -37,6 +39,9 @@ options:# "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).+ # R-ENEMY-007 operation-start regions (#2543 table): southern_coast covers Julis/Gaza and negev the sourced+ # R-ENEMY-007: Beersheba-Auja/Sinai axis (war-1948.md:149; research_notes/GDD phase 4/corridors-1948-51.md:311-323).+ requires_unit_regions: [southern_coast, negev]unit_orders:- { unit: golani, q: -8, r: 28 }- id: holddiff --git a/content/events/operation_yoav.yaml b/content/events/operation_yoav.yamlindex a4ff58288..03b8778e5 100644--- a/content/events/operation_yoav.yaml+++ b/content/events/operation_yoav.yaml@@ -7,7 +7,12 @@ text: 'An Israeli supply convoy was fired on as it passed the Egyptian positions# https://he.wikipedia.org/wiki/הר_חברון; https://he.wikipedia.org/wiki/בקעת_יריחו).title_he: מבצע יואבtext_he: 'שיירת אספקה ישראלית נורתה כשעברה ליד העמדות המצריות ב־15 באוקטובר, והמתקפה שהממשלה אישרה ב־6 באוקטובר מתנהלת בפיקוד יגאל אלון. ההחלטה עד היכן תתקדם בידי {defense_minister}.'+# R-ENEMY-007 (owner, 7 November 2026, "Dateless variants (Recommended)", then "All approved (Recommended)" for these exact+# words): the text when the card is shown after its own window has closed.+late_text: 'An Israeli supply convoy was fired on as it passed the Egyptian positions, and the offensive the cabinet approved is waiting for its brigades, under Yigal Allon. {defense_minister} must decide how far it goes.'+late_text_he: 'שיירת אספקה ישראלית נורתה כשעברה ליד העמדות המצריות, והמתקפה שהממשלה אישרה ממתינה לחטיבותיה, בפיקוד יגאל אלון. ההחלטה עד היכן תתקדם בידי {defense_minister}.'anchor: hard+armistice_front: egypt # R-ENEMY-007 (owner, 7 November 2026, "Signing wins (Recommended)"): a pending card lapses once this armistice is signedtags: [security, war-casualties]office: defense_minister# Approved at the cabinet session of 6 October 1948; launched after a supply convoy was fired on as it passed Egyptian@@ -33,6 +38,9 @@ options:# "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).+ # R-ENEMY-007 operation-start regions (#2543 table): southern_coast and negev cover the sourced coastal-force,+ # R-ENEMY-007: Beersheba and Negev objectives (this card's sources; research_notes/M4 war mode/war-1948.md:143).+ requires_unit_regions: [southern_coast, negev]unit_orders:- { unit: negev, q: -10, r: 35 }- { unit: givati, q: -9, r: 29 }@@ -41,6 +49,12 @@ options:text_he: לאפשר לאלון להתקדם לתוך הר חברון ובקעת יריחו# No day on record for the Southern Front command's disagreement, so `design`: owner ruling of 18 October 2026 (#949).alternative: { basis: design }+ # R-ENEMY-007 (owner, 7 November 2026: "Add real orders", "Same units (Recommended)"): stop_at_ceasefire's units and regions;+ # R-ENEMY-007: Givati to Bayt Jibrin (its order target, 27 October 1948) and Negev to Beersheba.+ requires_unit_regions: [southern_coast, negev]+ unit_orders: # R-ENEMY-007+ - { unit: givati, q: -6, r: 29 } # R-ENEMY-007: Bayt Jibrin, givati's order target+ - { unit: negev, q: -10, r: 35 } # R-ENEMY-007: Beersheba, negev's order targetset_rung: 5effects:- { target: security, delta: 0.03 }diff --git a/content/events/rafah_force_pressure.yaml b/content/events/rafah_force_pressure.yamlindex 9b0ffcd92..93f250938 100644--- a/content/events/rafah_force_pressure.yaml+++ b/content/events/rafah_force_pressure.yaml@@ -14,6 +14,8 @@ tags: [security]from: 1949-01-17to: 1949-03-17requires: [{ event: sinai_withdrawal, option: hold_el_arish }]+follows: true # R-ENEMY-007 (owner, 7 November 2026, "Shift with Sinai (Recommended)"; "They drop (Recommended)"): a late launch still brings this card, on the turn after+armistice_front: egypt # R-ENEMY-007: once the armistice with Egypt is signed this card no longer comestitle: >-The force west of Rafahtitle_he: >-@@ -22,6 +24,10 @@ text: >-In the record, Israel's Prime Minister told the US representative on 1 January 1949 that Britain had threatened action under its 1936 treaty with Egypt. On 5 January, the US Acting Secretary of State linked American pressure over the incursion into Egypt to the danger of a wider conflict outside Palestine. On this branch, {prime_minister} must decide whether to keep the force west of Rafah or complete its pullback.text_he: >-בתיעוד ההיסטורי, ראש ממשלת ישראל מסר לנציג ארצות הברית ב־1 בינואר 1949 שבריטניה איימה לפעול מכוח ההסכם שלה עם מצרים משנת 1936. ב־5 בינואר קשר ממלא מקום מזכיר המדינה האמריקני את הלחץ האמריקני בעניין החדירה למצרים לסכנה של עימות רחב יותר מחוץ לארץ ישראל. במסלול הזה, על {prime_minister} להחליט אם להשאיר את הכוח ממערב לרפיח או להשלים את נסיגתו.+# R-ENEMY-007 (owner, 7 November 2026, "Dateless variants (Recommended)", then "All approved (Recommended)" for these exact+# words): the text when the card is shown after its own window has closed.+late_text: 'In the record, Israel''s Prime Minister told the US representative that Britain had threatened action under its 1936 treaty with Egypt, and the US Acting Secretary of State linked American pressure over the incursion into Egypt to the danger of a wider conflict outside Palestine. On this branch, {prime_minister} must decide whether to keep the force west of Rafah or complete its pullback.'+late_text_he: 'בתיעוד ההיסטורי, ראש ממשלת ישראל מסר לנציג ארצות הברית שבריטניה איימה לפעול מכוח ההסכם שלה עם מצרים משנת 1936, וממלא מקום מזכיר המדינה האמריקני קשר את הלחץ האמריקני בעניין החדירה למצרים לסכנה של עימות רחב יותר מחוץ לארץ ישראל. במסלול הזה, על {prime_minister} להחליט אם להשאיר את הכוח ממערב לרפיח או להשלים את נסיגתו.'options:- id: keep_rafah_forcetext: "Keep the force west of Rafah"@@ -45,4 +51,4 @@ sources:- { url: "https://www.idf.il/media/emxjtczk/%D7%A7%D7%95%D7%91%D7%A5-%D7%9E%D7%91%D7%A6%D7%A2-%D7%97%D7%95%D7%A8%D7%91.pdf", checked: 2026-10-24 }status: draftreviewed_by: eyalgolan-reviewed_on: 2026-10-30+reviewed_on: 2026-11-07diff --git a/content/events/rhodes_talks.yaml b/content/events/rhodes_talks.yamlindex 7187e5f95..f2899def8 100644--- a/content/events/rhodes_talks.yaml+++ b/content/events/rhodes_talks.yaml@@ -6,6 +6,10 @@ text: 'By 6 January Egypt and Israel had both accepted a cease-fire followed by# (https://he.wikipedia.org/wiki/הסכמי_שביתת_הנשק_בתום_מלחמת_העצמאות).title_he: השיחות ברודוסtext_he: 'עד 6 בינואר קיבלו מצרים וישראל הפסקת אש שלאחריה שיחות ישירות בראשות האו״ם, והפסקת האש נכנסה לתוקף ב־7 בינואר. השיחות עומדות להיפתח ברודוס. ההחלטה אם ישראל תשלח משלחת בידי {foreign_minister}.'+# R-ENEMY-007 (owner, 7 November 2026, "Dateless variants (Recommended)", then "All approved (Recommended)" for these exact+# words): the text when the card is shown after its own window has closed.+late_text: 'Egypt and Israel have accepted a cease-fire followed by direct talks under UN chairmanship. The talks are to open at Rhodes. {foreign_minister} must decide whether Israel sends a delegation.'+late_text_he: 'מצרים וישראל קיבלו הפסקת אש שלאחריה שיחות ישירות בראשות האו״ם. השיחות עומדות להיפתח ברודוס. ההחלטה אם ישראל תשלח משלחת בידי {foreign_minister}.'anchor: hardtags: [security]office: foreign_minister@@ -21,6 +25,8 @@ office: foreign_ministerfrom: 1949-01-09to: 1949-01-13requires: [{ event: operation_horev, option: launch }]+follows: true # R-ENEMY-007 (owner, 7 November 2026, "Follow the launch (Recommended)"; "They drop (Recommended)"): a late launch still brings this card, on the turn after+armistice_front: egypt # R-ENEMY-007: once the armistice with Egypt is signed this card no longer comesoptions:- id: send_delegationtext: Send a delegation to Rhodesdiff --git a/content/events/sinai_withdrawal.yaml b/content/events/sinai_withdrawal.yamlindex 07cf6a88c..a7ebac351 100644--- a/content/events/sinai_withdrawal.yaml+++ b/content/events/sinai_withdrawal.yaml@@ -6,6 +6,10 @@ text: 'Israeli forces crossed into Sinai and reached the outskirts of El-Arish a# (https://he.wikipedia.org/wiki/מבצע_חורב).title_he: האולטימטום הבריטיtext_he: 'כוחות ישראליים חצו לסיני והגיעו לפאתי שדה התעופה של אל־עריש. מועצת הביטחון קראה להפסקת אש, ארצות הברית הוסיפה את לחצה, ובריטניה איימה לפעול נגד ישראל מכוח ההסכם שלה עם מצרים משנת 1936. עד 2 בינואר נסוגו רוב הכוחות לגבול הנגב, אך כוח נשאר ממערב לרפיח וחסם את כביש רפיח–אל־עריש. ההחלטה אם להשלים את הנסיגה בידי {prime_minister}.'+# R-ENEMY-007 (owner, 7 November 2026, "Dateless variants (Recommended)", then "All approved (Recommended)" for these exact+# words): the text when the card is shown after its own window has closed.+late_text: 'Israeli forces crossed into Sinai and reached the outskirts of El-Arish airfield. The Security Council called for a cease-fire, the United States added its pressure, and Britain threatened to act against Israel under its 1936 treaty with Egypt. Most forces have pulled back to the Negev frontier, but a force remains west of Rafah, blocking the Rafah-El-Arish road. {prime_minister} must decide whether to complete the pullback.'+late_text_he: 'כוחות ישראליים חצו לסיני והגיעו לפאתי שדה התעופה של אל־עריש. מועצת הביטחון קראה להפסקת אש, ארצות הברית הוסיפה את לחצה, ובריטניה איימה לפעול נגד ישראל מכוח ההסכם שלה עם מצרים משנת 1936. רוב הכוחות נסוגו לגבול הנגב, אך כוח נשאר ממערב לרפיח וחוסם את כביש רפיח–אל־עריש. ההחלטה אם להשלים את הנסיגה בידי {prime_minister}.'anchor: hardtags: [security]office: prime_minister@@ -28,6 +32,8 @@ office: prime_ministerfrom: 1949-01-02to: 1949-01-16requires: [{ event: operation_horev, option: launch }]+follows: true # R-ENEMY-007 (owner, 7 November 2026, "Follow the launch (Recommended)"; "They drop (Recommended)"): a late launch still brings this card, on the turn after+armistice_front: egypt # R-ENEMY-007: once the armistice with Egypt is signed this card no longer comesoptions:- id: withdrawtext: Keep the forces behind the Negev frontierdiff --git a/content/events/ten_days.yaml b/content/events/ten_days.yamlindex 62cd8a3dd..7ca7d8842 100644--- a/content/events/ten_days.yaml+++ b/content/events/ten_days.yaml@@ -8,6 +8,7 @@ text: 'The first truce has ended and the fighting has resumed, with Egypt attacktitle_he: קרבות עשרת הימיםtext_he: 'ההפוגה הראשונה הסתיימה והלחימה התחדשה, כשמצרים תוקפת בדרום. במרכז, מבצע דני בפיקוד יגאל אלון כבש את שדה התעופה בלוד וממשיך לפעול לאבטחת הדרך לירושלים. ההחלטה לאן יופנה המאמץ העיקרי בהמשך הלחימה בידי {defense_minister}.'anchor: hard+armistice_front: jordan # R-ENEMY-007 (owner, 7 November 2026, "Jordan signing (Recommended)"): a pending card lapses once this armistice is signedtags: [security, war-casualties]office: defense_minister# The truce was due to expire on 9 July (the Mediator's report S/888); Egypt renewed fighting on 8 July, one day early@@ -44,6 +45,9 @@ options:# 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).+ # R-ENEMY-007 operation-start regions (#2543 table): central_plain and jerusalem_hills cover Dani's sourced+ # R-ENEMY-007: Lydda/Ramle and Jerusalem-road objectives; galilee covers Brosh's Mishmar HaYarden front (war-1948.md:139,141).+ requires_unit_regions: [central_plain, jerusalem_hills, galilee]unit_orders:- { unit: kiryati, q: -3, r: 24 }- { unit: carmeli, q: 14, r: 6 }@@ -59,6 +63,12 @@ options:date: 1948-07-11sources:- { url: "https://bengurionarchive.bgu.ac.il/en/node/9706", checked: 2026-10-17 }+ # R-ENEMY-007 (owner, 7 November 2026: "Same units as Central (Recommended)", "Keep the same targets (Recommended)"): central_front's+ # R-ENEMY-007: units, regions and sourced targets, so these orders go to Ramle and the north, not to a southern target.+ requires_unit_regions: [central_plain, jerusalem_hills, galilee]+ unit_orders: # R-ENEMY-007+ - { unit: kiryati, q: -3, r: 24 } # R-ENEMY-007: as central_front+ - { unit: carmeli, q: 14, r: 6 } # R-ENEMY-007: as central_frontset_rung: 5effects:- { target: security, delta: 0.015 }diff --git a/content/map/unit_anchor_hexes.yaml b/content/map/unit_anchor_hexes.yamlindex 684d0f80c..4de4708c0 100644--- a/content/map/unit_anchor_hexes.yaml+++ b/content/map/unit_anchor_hexes.yaml@@ -36,6 +36,7 @@ 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: givati, target: 1, q: -6, 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.yamlindex 282f2df4a..ec7846506 100644--- a/content/map/units_1948.yaml+++ b/content/map/units_1948.yaml@@ -428,9 +428,10 @@ units:sector_he_review: agent-checkedsector_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%92%D7%93%D7%A8%D7%94', checked: '2026-10-22'}, {url: 'https://he.wikipedia.org/wiki/%D7%92%D7%9F_%D7%99%D7%91%D7%A0%D7%94', checked: '2026-10-22'}, {url: 'https://he.wikipedia.org/wiki/%D7%91%D7%90%D7%A8_%D7%98%D7%95%D7%91%D7%99%D7%94', checked: '2026-10-22'}]wikipedia_only: false+ # The owner person-checked this row on 7 November 2026 (#2621, the Bayt Jibrin stint): https://github.com/eyalgolan/statecraft-israel/pull/2621#issuecomment-6711002336# The owner person-checked this row on 6 November 2026 (#2757, the fields sourced since the earlier check on 21 October 2026 (#1240: https://github.com/eyalgolan/statecraft-israel/issues/1240#issuecomment-6323448250)): "all approved". https://github.com/eyalgolan/statecraft-israel/issues/2757status: fact-checked- checked_on: '2026-11-06'+ checked_on: '2026-11-07'strength:value: 3229as_of: '1948-05-15'@@ -490,6 +491,25 @@ units:- {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'}+ - place: Bayt Jibrin+ place_he: "בית ג'יברין"+ place_he_review: agent-checked+ place_he_sources: [{url: 'https://he.wikipedia.org/wiki/%D7%91%D7%99%D7%AA_%D7%92%27%D7%99%D7%91%D7%A8%D7%99%D7%9F', checked: '2026-11-07'}]+ lon: 34.89833+ lat: 31.60528+ from: '1948-10-27'+ since: 27 October 1948+ to: '1949-02-24'+ end_basis: front_armistice+ front: egypt+ note: "Operation Yoav, push_to_hebron (owner, 7 November 2026: \"Add real orders\"; the date, \"Second read, then later date (Recommended)\"; the end, \"24 Feb 1949 (Recommended)\"). Zochrot and en.wiki Bayt Jibrin have Givati occupy it on 27 October 1948; en.wiki Operation Yoav gives 23 October in its text and 24 October in its table, so the later, village-level date is used; he.wiki בית ג'יברין has Brigade 8 take the police fort on 27 October. The end is the Egyptian armistice, though the Huleiqat target above ends on 1 November 1948, when the lexicon has Givati moved to the centre. An order target: the token stays at Gedera."+ sources:+ # Zochrot, Bayt Jibrin: "Occupation date: 27/10/1948", "Occupying unit: Giva'ati"; "Benny Morris writes that an initial attack took place during the night of 24 October 1948, and later occupied on the 27" (agent read 2026-11-07).+ - {url: 'https://www.zochrot.org/villages/village_details/49055/en', checked: '2026-11-07'}+ # en.wiki Bayt Jibrin: "Israeli troops from the Giv'ati Brigade then occupied Bayt Jibrin and its police fort on October 27"; coordinates 31.60528, 34.89833 (agent read 2026-11-07).+ - {url: 'https://en.wikipedia.org/wiki/Bayt_Jibrin', checked: '2026-11-07'}+ # en.wiki Operation Yoav: "Beit Jibrin was captured by the 52 Battalion of Givati and the 8th Brigade on October 23"; its table gives 24 October (agent read 2026-11-07).+ - {url: 'https://en.wikipedia.org/wiki/Operation_Yoav', checked: '2026-11-07'}- id: etzioniname: Etzioni Brigadename_he: "חטיבת עציוני"diff --git a/content/rules.yaml b/content/rules.yamlindex 37a71ba45..25e6390d1 100644--- a/content/rules.yaml+++ b/content/rules.yaml@@ -164,6 +164,9 @@ mvp:# decision out half-heartedly: only the share of each numeric effect lands. The floor is 5 because people.yaml rates# the deputies 5 as a neutral rating, so neutral is not disloyal. Agent-proposed; the owner may override them.delegation_loyalty_floor: 5 # DESIGN VALUE: owner-set balance, not a historical figure (D-H1, #107: loyalty below which a delegated decision is half-done)+ operation_lapse_security: -0.01 # DESIGN VALUE: owner-set balance, not a historical figure (D-H1, R-ENEMY-007, #2543: the Security a lapsed operation costs, Horev's Hold; the owner chose it on 7 November 2026, quoted in docs/rules/mvp.md)+ operation_truce_break_standing: -0.10 # DESIGN VALUE: owner-set balance, not a historical figure (D-H1, R-ENEMY-007, #2543: the International Support a late operation launched inside an accepted truce costs, as Latrun's offensive; the owner chose it on 7 November 2026, quoted in docs/rules/mvp.md)+ operation_wait_turns: 6 # DESIGN VALUE: owner-set balance, not a historical figure (D-H1, R-ENEMY-007, #2543: turns a postponed operation waits for its units; the owner chose 6 on 7 November 2026, quoted in docs/rules/mvp.md)disloyal_effect_share: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-H1, #107: share of each numeric effect a disloyal minister delivers)# Movement (R-MOVE-001, R-MOVE-003; Q-MOVE-1, Q-MOVE-3, owner, 15 October 2026, #375: "Take all recommendations").# The numbers below were proposed in PR #1073 (#744) and accepted by the owner as design values on 19 October 2026:diff --git a/content/schema/event.schema.json b/content/schema/event.schema.jsonindex 04614c7da..1e3fb0dba 100644--- a/content/schema/event.schema.json+++ b/content/schema/event.schema.json@@ -111,6 +111,10 @@"prisoners": { "enum": ["egypt", "jordan", "lebanon", "syria"], "description": "The front whose prisoners this exchange card returns (R-POW-004). It fires only while that front holds prisoners or the player's soldiers, and has exactly one option. Jordan's card also returns the Iraqi prisoners." },"deported": { "$ref": "#/definitions/id", "description": "A settlement target (settlement_targets.yaml) whose residents stayed. This Deport follow-up card fires only once the player's Deport has depopulated that place, carries the displacement tag and has exactly one option (R-EVT-007)." },"front_quiet": { "enum": ["egypt", "jordan", "lebanon", "syria"], "description": "The front of this armistice_<front> card, on that card only. Under gdd-0.3 the card may also come before its from, and again after a refusal, once that front is quiet (Armistice.MayOfferEarly), and then it takes the first soft slot (R-WAR-008, R-EVT-002)." },+ "armistice_front": { "enum": ["egypt", "jordan", "lebanon", "syria"], "description": "On an operation card or a following card only: the front whose signed armistice ends the card. A pending operation lapses once it is signed, and the card never first fires after it (R-ENEMY-007)." },+ "follows": { "type": "boolean", "description": "Under the GDD loop: the card follows the decision its requires waits for, and fires on the turn after that decision even when its own window has closed, so a late operation still brings it (R-ENEMY-007). Needs requires." },+ "late_text": { "type": "string", "description": "On a following card or an operation card only: the text shown when the card is shown after its own window has closed (a late follow-up, or an operation shown again while it waits), with no dates that would mislead (R-ENEMY-007)." },+ "late_text_he": { "type": "string", "description": "late_text in Hebrew; required exactly when the card has Hebrew text (R-ENEMY-007)." },"order": { "type": "integer", "description": "Default 0. Among the cards that fire on the same turn with the same from, a lower order comes first, then the id (R-EVT-006). Set it only to put one card after another on purpose." },"from": { "$ref": "#/definitions/date", "description": "First day of the window." },"to": { "$ref": "#/definitions/date", "description": "End of the window (exclusive). Leave out for an open window." },@@ -190,7 +194,7 @@},"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.",+ "description": "R-ENEMY-005 (GDD loop, both gdd-0.1 and gdd-0.3): 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,@@ -202,6 +206,13 @@}}},+ "requires_unit_regions": {+ "type": "array",+ "minItems": 1,+ "uniqueItems": true,+ "description": "R-ENEMY-007: player-region ids. Every unit_orders row's starting unit must be in any one listed region before this military-operation option can resolve.",+ "items": { "type": "string", "minLength": 1 }+ },"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/GDD.md b/docs/GDD.mdindex d533db90e..0d6730540 100644--- a/docs/GDD.md+++ b/docs/GDD.md@@ -388,7 +388,7 @@ Later on 1 November 2026 the owner answered the questions the approved answers l| Housing repair price | "Fixed price 0.5 Money + 1 work" | A repair costs 0.5 Money and 1 work and raises the city's housing condition by 10 percentage points. The price is a labelled design value ([#1700](https://github.com/eyalgolan/statecraft-israel/issues/1700#issuecomment-6554004118), [#1703](https://github.com/eyalgolan/statecraft-israel/issues/1703#issuecomment-6554005317)). || Historical starting farmer tiers | "Amir's 1:2:1 ratio per city (Recommended)"; the rounding rule: "all approved"; 7 November 2026, "Per host, 1/18/1 (Recommended)" | Each host's starting farmers are a quarter novice, half trained and a quarter veteran, a labelled design value. The split runs per host, not per census city, which gives 1 / 18 / 1 nationally across the 20 opening fields' hosts ([#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704985642)). When a host's count is not a multiple of 4, the split uses the largest remainder with ties to trained (5 farmers: 1 / 3 / 1); at 2 more than a multiple of 4 the leftover unit ties between novice and veteran, and it goes to trained (6 farmers: 1 / 4 / 1; owner, 6 November 2026, "Trained: 1/4/1 (Recommended)", [#2465](https://github.com/eyalgolan/statecraft-israel/issues/2465#issuecomment-6676926351)), and every host's total stays exact ([#1717](https://github.com/eyalgolan/statecraft-israel/issues/1717#issuecomment-6554155751), [rounding](https://github.com/eyalgolan/statecraft-israel/issues/1717#issuecomment-6555212806)). Amir's 5 / 10 / 5 stays for Open mode (D2). || D5 places | Southern Coast: "Nir Am (Recommended)"; Negev: "Nirim, add it to the map (Recommended)"; for Nirim: "Optional (Recommended)", "Israeli at the start (Recommended)" and "Agent checks are enough" | Nir Am is the Southern Coast's opening housing place and Nirim, at its 1948 site at Dangur (today's Nir Yitzhak), is the Negev's. Nirim is an optional location, Israeli-held at the start. Agent checks of the sources replace D5's person's check for these places ([#2113](https://github.com/eyalgolan/statecraft-israel/issues/2113#issuecomment-6554685727), [#2136](https://github.com/eyalgolan/statecraft-israel/pull/2136)). |-| Operation-card orders | "military openrations must have unit orders"; Latrun: "Harel at Sha'ar HaGai (Recommended)"; Dani: "Kiryati to Ramle (Recommended)" | Every military-operation card gives unit orders, each from a sourced, dated anchor (owner, 31 October 2026, #749): `ten_days`, `operation_yoav`, `operation_hiram`, `operation_horev` and the attack option of `latrun_proposal`. Latrun orders Harel from its Sha'ar HaGai anchor to Latrun; Dani orders Kiryati to Ramle ([#2087](https://github.com/eyalgolan/statecraft-israel/pull/2087#issuecomment-6555753104), [Latrun and Dani](https://github.com/eyalgolan/statecraft-israel/pull/2087#issuecomment-6555857468)). |+| Operation-card orders and start placement | 1 November: "military openrations must have unit orders"; Latrun: "Harel at Sha'ar HaGai (Recommended)"; Dani: "Kiryati to Ramle (Recommended)". #2543 (owner, 4 November 2026): "A military operation can only get underway if you have the required units in place (you cant fight in latrun in you dont have military units there)." For #2543 the owner chose the options labelled "In the same region", "Both rulesets (Recommended)" and, later, "Player must move them"; on a delegated card: "Postpone and explain to the user which units need to move where. Postpone until they are in the right area and if the operation is still relevant" (as recorded on #2543, 4 November 2026). | Every military-operation option has sourced unit orders and an authored set of existing regions. The agent-recorded #2543 scope says its ordered starting units must each be on a hex in one of those regions, with no pre-positioning or credit for starting regions. An unmet direct choice is refused unchanged. An unmet delegated choice is postponed with the required moves explained, consumes no draw, and is redrawn later; it lapses without a choice or effects when its window closes. Orders apply under `gdd-0.1` and `gdd-0.3` (R-ENEMY-005, R-ENEMY-007; [#2087](https://github.com/eyalgolan/statecraft-israel/pull/2087), #2543). || Movement preview | "I am talking about an arrow showing which tiles the unit is going to move to. this needs to be for israeli units only" | Choosing where an Israeli unit moves shows an animated arrow over the tiles it will move through. Enemy units get no arrow ([#2134](https://github.com/eyalgolan/statecraft-israel/issues/2134)). || The 1949 armistice-lines overlay | "On by default (Recommended)" | The 1949 armistice-lines overlay shows in every run, with no URL flag; a release build draws only the lines the owner signed off ([#2195](https://github.com/eyalgolan/statecraft-israel/pull/2195#issuecomment-6565077805)). || The desktop Quit button | Hebrew label: "יציאה is right (Recommended)"; Settings placement: "Own row at the bottom (Recommended)" | Desktop builds show Quit on the start screen and in its own last row in Settings, labelled "יציאה" in Hebrew; the browser build hides it ([#2188](https://github.com/eyalgolan/statecraft-israel/pull/2188#issuecomment-6564490828)). |diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 2c17e99f5..1972f6dfc 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -28,10 +28,10 @@ macOS IL2CPP parity check is not an MVP release gate.uv run tools/machine_lock.py --shared --wait-unity -- "$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.assetgolden_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 d53edcd56e05f661e3617d680814913e2c42f05f18c6b4317875ea08213c1fa8"- # and "GOLDEN OK hash1952 25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7"+ # one GOLDEN OK line per manifest golden (#394), e.g. "GOLDEN OK hash1950 832e8ccc38e3fb36228826816b452477fbbd6ab667ee30cdaef40e5b1b2fe869"+ # and "GOLDEN OK hash1952 841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e"uv run tools/web_check.py unity/Builds/Web-gzip --query "golden&smoke=5" "${golden_expect[@]}" \- --expect "SMOKE OK 5 turns 1948-10-15 b93ad5503dad3981b7a0de4c078b6d4323794be991a8d8343e5fe90271dc006c"+ --expect "SMOKE OK 5 turns 1948-10-15 12f088f62bd0694ae59b5f6472751579ad96c2198308d0869a8cf795f1aad051"uv run tools/web_check.py unity/Builds/Web-gzip --startscreen new --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-gzip --startscreen recording --timeout 300 --stall 90uv 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.uv run tools/machine_lock.py --shared --wait-unity -- "$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.assetuv run tools/web_check.py unity/Builds/Web-pages --query "golden&smoke=5" "${golden_expect[@]}" \- --expect "SMOKE OK 5 turns 1948-10-15 b93ad5503dad3981b7a0de4c078b6d4323794be991a8d8343e5fe90271dc006c"+ --expect "SMOKE OK 5 turns 1948-10-15 12f088f62bd0694ae59b5f6472751579ad96c2198308d0869a8cf795f1aad051"uv run tools/web_check.py unity/Builds/Web-pages --startscreen new --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-pages --startscreen recording --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-pages --startscreen new --query lang=he --timeout 300 --stall 90diff --git a/docs/WRITING_EVENTS.md b/docs/WRITING_EVENTS.mdindex b5ef4352c..482bb7178 100644--- a/docs/WRITING_EVENTS.md+++ b/docs/WRITING_EVENTS.md@@ -48,6 +48,10 @@ schema too, or that test fails. Keep the comment when you copy a file.| `prisoners` | no | Makes the event a front's prisoner-exchange card: `egypt`, `jordan` (which also returns the Iraqi prisoners), `lebanon` or `syria`. It fires only while that front holds prisoners or the player's soldiers (GDD loop only), has exactly one option, and returns them and scores when it resolves (R-POW-004). || `deported` | no | Makes the event Deport's follow-up card for a settlement target whose residents stayed: it fires only once the player's Deport has depopulated that place, carries the `displacement` tag and has exactly one option (R-EVT-007). See "deported". || `front_quiet` | no | On a front's armistice card only (`armistice_<front>`, one of `egypt`, `jordan`, `lebanon`, `syria`). Under `gdd-0.3` the card may also come before its `from`, and again after a refusal, once that front has been quiet long enough; it then takes the first soft slot (R-WAR-008, R-EVT-002). |+| `armistice_front` | no | On an operation card or a `follows` card only: a front (`egypt`, `jordan`, `lebanon`, `syria`) whose signed armistice ends the card. A pending operation lapses once it is signed, and waits while that front's armistice card is pending; the card never first fires after the signature (R-ENEMY-007). |+| `follows` | no | `true` on a card with `requires`, under the GDD loop: once its `requires` are met it fires on the turn after, even when its own window has closed, so a late operation still brings it (R-ENEMY-007). |+| `late_text` | no | On a following card or an operation card only, with a `to`: the card's text when it is shown after its own window has closed (a late follow-up, or an operation shown again while it waits), with no dates that would mislead (R-ENEMY-007). |+| `late_text_he` | with `late_text`, when the card has Hebrew | `late_text` in Hebrew, required exactly when the card's text is in Hebrew. || `options` | yes | One or more options. See below. || `sources` | no by the loader, yes by the rules | A list of `{ url, checked }`. See below. || `status` | no (default `draft`) | The review status. See below. |@@ -244,7 +248,8 @@ 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". |+| `unit_orders` | no | GDD loop, both GDD identities. A list of `{ unit, q, r }`: see "unit_orders". |+| `requires_unit_regions` | with `unit_orders` | A non-empty list of existing `regions.yaml` ids in any one of which every ordered unit must stand: see "unit_orders". || `debt_dollars` | no | Applied under gdd-0.3 only. US$ millions, more than 0, that the option also adds to Debt, in IL at the `mvp.il_per_dollar` rate in force on the event's date (R-EFX-009). || `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". |@@ -323,8 +328,12 @@ An event with a sensitive tag may carry no grant, no positive `city_effects` dela comment. The order goes through the player's own go-to: one the player could not give changes nothing, and theplayer is told so. The order ends on the `to` date of the anchor, or of the order target (the loader refuses a hex with none), and its marchgoes 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.+- Every option with `unit_orders` also has `requires_unit_regions`. The required units are exactly the distinct rows in+ `unit_orders`; before the option resolves, each row's starting unit must be on the board and on a hex in any listed+ region (R-ENEMY-007). Cite the operation objective or target supporting every region in the option's comment.+- A direct choice with a missing unit is refused unchanged. Delegation postpones an unmet drawn operation, explains the+ required moves, rolls back that draw and redraws on later consideration; a still-pending card lapses when its event+ window closes. The orders and placement rule apply under gdd-0.1 and gdd-0.3; legacy ignores them.### sourcesdiff --git a/docs/determinism.md b/docs/determinism.mdindex 707d11ad8..f713d6c28 100644--- a/docs/determinism.md+++ b/docs/determinism.md@@ -63,9 +63,9 @@ final `GameState.Hash()` is pinned:| Run | Ends | Hash ||---|---|---|-| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `d53edcd56e05f661e3617d680814913e2c42f05f18c6b4317875ea08213c1fa8` |-| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7` |-| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7` |+| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `832e8ccc38e3fb36228826816b452477fbbd6ab667ee30cdaef40e5b1b2fe869` |+| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e` |+| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e` |`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@@ -73,8 +73,9 @@ later end date moves only `mvp-end`. `mvp-end` is pinned in the manifest and itsplayer check enumerate the manifest, so it and every scenario are checked without another hand-written list.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 b93ad5503dad3981b7a0de4c078b6d4323794be991a8d8343e5fe90271dc006c`.+buttons, answering each event with its first option while the turn's Attention pays for it and that option's operation+units are in place in the state the card shows: the turn's start after its standing go-to routes have moved, the+no-orders preview (R-ENEMY-007, `GoldenRun.SmokeOrders`; the smoke gives no unit orders), the rest left to their ministers): `SMOKE OK 5 turns 1948-10-15 12f088f62bd0694ae59b5f6472751579ad96c2198308d0869a8cf795f1aad051`.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:@@ -85,7 +86,7 @@ while read -r name hash; dogolden_expect+=(--expect "GOLDEN OK $name $hash")done < sim/Statecraft.Sim.Tests/golden/manifest.txtuv run tools/web_check.py unity/Builds/Web-<compression> --query "golden&smoke=5" "${golden_expect[@]}" \- --expect "SMOKE OK 5 turns 1948-10-15 b93ad5503dad3981b7a0de4c078b6d4323794be991a8d8343e5fe90271dc006c"+ --expect "SMOKE OK 5 turns 1948-10-15 12f088f62bd0694ae59b5f6472751579ad96c2198308d0869a8cf795f1aad051"````smoke-orders` (GDD Phase 5 PR 15, #754) is the same kind of browser run for the unit orders (`?smoke-orders`, desktop@@ -531,3 +532,26 @@ The hash reads the state keys, so it never sees a record outside its window. An| #2551, #2833: as above | scenario-mvp-absorb-first | `cf73bb07` | as hash1950 (was `16c8a869`) || #2551, #2833: as above | scenario-mvp-defeat | `8096c41e` | its answers to `austerity_1949` and `reparations_claim` move with the cards (15 April 1949, 15 February 1951); the debt is IL 3.75m lower and the run still ends in defeat; as in hash1952, #2833's two cards move `morale`, `homes_lift_morale`, both `housing` lines (rounding only) and part of `stab` (`16ef2d5b` with their `from` lines reverted) (was `572f71ab`) || #2551, #2833: as above | scenario-mvp-annex-nazareth | `dec2cad5` | the run ends on 15 February 1949, the turn `armistice_egypt` now comes, so the card is fired and pending at the end (was `3cab078b`). smoke5, smoke-orders and scenario-mvp-occupy-cost end before 15 February 1949 and do not move |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | hash1950 | `b2dd7387` | the reference player stages Kiryati, Carmeli, the 7th Brigade and Golani before their operation cards; all four operations still take their historical options and Rhodes and Sinai still fire; Ramla falls a month earlier (15 August), and one Golani-Egypt engagement replaces an old Legion one (same draw count) (was `d53edcd5`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | hash1952 | `488d99fe` | carries hash1950's staged-operation state forward: same choices and follow-up cards, earlier Ramla capture, IL 0.1m less debt (was `25fbfb8f`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | smoke5 | `3803636f` | the five-turn first-option run gives no unit orders and stops at a first option whose operation units are not in place in the no-orders preview (the card shows that state), so Ten Days goes to its minister; with #2620's annexed residents on main (was `b93ad550`, main after #2551 and #2833; #2551 and #2833 do not move it, so the value is the same as before them; no snapshot is kept for this run) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | mvp-end | `488d99fe` | the same 44-turn run as hash1952 (was `25fbfb8f`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | scenario-reckless | `2217be01` | Hiram, Yoav and Horev still resolve historically; staging leaves Golani in the south and the 7th Brigade alive; one engagement instead of two (one draw fewer) (was `ac5fbdd3`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | scenario-cautious | `d421ba64` | as scenario-reckless: one engagement instead of two; Carmeli reaches its Hiram target, the 7th Brigade survives, Ramla falls a turn earlier (was `46655872`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | scenario-mvp-absorb-first | `5cded37c` | operations still historical; staging sends Golani to the Egyptian front (three engagements instead of two, one draw more) and the 7th Brigade survives (was `cf73bb07`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | scenario-mvp-defeat | `7fc8c624` | as above, Ramla a turn earlier; one draw more, so the delegated iraqi_exodus card now takes pace instead of airlift (was `8096c41e`, main after #2551 and #2833; the same lines change as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | scenario-mvp-occupy-cost | `90494f81` | Ramla a turn earlier and Acre taken, the 7th Brigade survives, no combat draw; Golani stays Nazareth's last garrison (was `eb3ae67b`, main after #2551 and #2833; #2551 and #2833 do not move it, so the value is the same as before them) |+| #2543 operations need units in place (owner: "Player must move them"); the automated players stage the units like a player | scenario-mvp-annex-nazareth | `adafb60f` | Golani is Nazareth's last garrison, so it is not staged and Horev postpones and lapses (the owner's rule): Rhodes Talks and Sinai Withdrawal never fire, and no combat draw (was `dec2cad5`, main after #2551 and #2833; the same lines change as before them) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack) | hash1950 | `832e8ccc` | Carmeli (unit 1) was staged for Ten Days onto Acre (8, 7), a Galilee member place, and captured it on 15 June 1948. It is now staged to another Galilee hex, so Acre is not taken and Carmeli ends a hex west, on (14, 3); nothing else differs (was `b2dd7387`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | hash1952 | `841f0553` | the same: no Acre capture, Carmeli on (14, 3) (was `488d99fe`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | mvp-end | `841f0553` | the same run as hash1952 (was `488d99fe`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | scenario-reckless | `8bf27728` | Acre is no longer captured and awaiting a choice at the end; nothing else differs (was `2217be01`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | scenario-cautious | `024fa528` | no Acre capture; Carmeli is on (14, 3) at the end, still on its card's go-to toward (15, 3), so the run keeps `cardorders{ 1=1949-03-23 }` (was `d421ba64`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | scenario-mvp-absorb-first | `96f62541` | no Acre capture; Carmeli on (14, 3) (was `5cded37c`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | scenario-mvp-defeat | `2c98e244` | no Acre capture; Carmeli on (14, 3); the defeat is unchanged (was `7fc8c624`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | scenario-mvp-occupy-cost | `f9df2061` | no Acre capture; Carmeli a hex west on its march, (10, 6) (was `90494f81`) |+| #2543 review: the automated players' staging never targets an enemy-held place (`Movement.NoEntry`; R-ENEMY-007: staging is a move, not an attack): as above | scenario-mvp-annex-nazareth | `cf8d2bdf` | no Acre capture; Carmeli a hex west on its march, (12, 4) (was `adafb60f`). smoke5 and smoke-orders do not move: the smoke runs stage nothing |+| #2543, the owner's 7 November 2026 rulings ("Wait, with a limit", "6 turns", "Keep the option"): a postponed operation waits for its units, up to `mvp.operation_wait_turns` turns, keeping its option, and the state records it (`postponed{}`, written only when set) | smoke5 | `14066f39` | the smoke gives no unit orders, so Ten Days, postponed on the 15 July 1948 turn, no longer lapses at its window's end: it is still pending and postponed on 15 October 1948, and the first-option run stops at it each turn, so Bernadotte and Yoav are pending behind it. No snapshot is kept for this run; the end state was read from a probe run (was `3803636f`) |+| #2543, the owner's 7 November 2026 rulings ("Wait, with a limit", "6 turns", "Keep the option"): a postponed operation waits for its units, up to `mvp.operation_wait_turns` turns, keeping its option, and the state records it (`postponed{}`, written only when set): as above | scenario-mvp-annex-nazareth | `4d4a35d7` | Golani is Nazareth's last garrison on 15 December 1948, so Horev is postponed rather than lapsing; once Nazareth is annexed the automated player stages Golani toward Horev's regions (read from HistoricalAI, which skips a last garrison), and on 15 February 1949, the run's end, Horev is still pending, postponed since turn 7, with Golani on (6, 12) on its go-to toward (-7, 26) (was `cf8d2bdf`). No other golden moves: in the other runs every operation is decided in its own window |+| #2543, the owner's Q4 of 7 November 2026 ("Shift by the delay"): `postponed{}` also records the date of the first postponement, from which a late launch's orders are shifted | smoke5 | `12f088f6` | format only: Ten Days' entry gains the date of its first postponement, turn 2, 15 July 1948 on monthly turns from 15 May; no snapshot is kept for this run (was `14066f39`) |+| #2543, the owner's Q4 of 7 November 2026 ("Shift by the delay"): `postponed{}` also records the date of the first postponement, from which a late launch's orders are shifted: as above | scenario-mvp-annex-nazareth | `c2aafd13` | format only: `operation_horev=launch@7` becomes `operation_horev=launch@7@1948-12-15`; nothing else differs (was `4d4a35d7`) |diff --git a/docs/gdd/military-combat.md b/docs/gdd/military-combat.mdindex 4ac8149f8..30d6e718e 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 (`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).+- 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 operation options on `ten_days`, `operation_yoav`, `operation_hiram`, `operation_horev` and `latrun_proposal` give their sourced orders under both GDD identities (R-ENEMY-005). Each may start only when every ordered starting unit is on the board and in one of its sourced authored regions. A direct unmet choice is refused unchanged; an unmet delegated draw is rolled back and the card is postponed with the needed moves explained, then lapses without resolving when its window closes (R-ENEMY-007, #2543).- 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/gdd03-event-inventory.md b/docs/gdd03-event-inventory.mdindex 52374d681..49663ac02 100644--- a/docs/gdd03-event-inventory.md+++ b/docs/gdd03-event-inventory.md@@ -15,17 +15,19 @@ and review the diff. Do not edit the table by hand.- **Old target** and **old delta**: the field as authored, which `legacy` and `gdd-0.1` apply (R-EFX-001). Theexception is `debt_dollars`: those rulesets read it but only `gdd-0.3` applies it (R-EFX-009, #2457). A`set_policy` or `set_rung` field sets a level instead of adding a delta. A `unit_orders` field gives a go-to order- under `gdd-0.1` only (R-ENEMY-005), and a `rejoin` field returns a road not taken to the recorded course (R-ALT-009).+ (R-ENEMY-005), and a `rejoin` field returns a road not taken to the recorded course (R-ALT-009).- **gdd-0.3 target**: "same" when the card is in the `gdd-0.3` catalogue. The loader has then validated the field- under `gdd-0.3` (R-EFX-001, R-EFX-002) and it applies with the same delta. A `unit_orders` field is the exception:- the loader still checks it, but `gdd-0.3` gives no order (R-ENEMY-005; owner, 31 October 2026, #749). "Legacy+ under `gdd-0.3` (R-EFX-001, R-EFX-002) and it applies with the same delta. A `unit_orders` field applies under+ both GDD rulesets, once the option's operation units are in place (R-ENEMY-007, #2543). "Legacyrulesets only" when `content/gdd03-events.yaml` excludes the whole card: none of its options is in play under`gdd-0.3`.-- **Not in the table**: `requires_unit_regions` (added by #2621, not on main yet) is an option gate, not an effect+- **Not in the table**: `requires_unit_regions` (R-ENEMY-007, #2543) is an option gate, not an effectfield, so it is out of this inventory.-- **Review reset**: "no" on every row. Only `israel_bonds` changes its source bytes: its `launch` option gains- `debt_dollars: 52` and a comment (#2457), with its text, Hebrew, sources and review status unchanged. Every card's- bytes are pinned (`AllFortyOneSourceRecordsIncludingReviewsAndHebrewAreUnchanged`), and the test checks that a kept card keeps its status and human sign-off under `gdd-0.3`. An excluded card keeps+- **Review reset**: "no" on every row. Of this inventory's own changes, only `israel_bonds`' source bytes move: its+ `launch` option gains `debt_dollars: 52` and a comment (#2457), with its text, Hebrew, sources and review status+ unchanged. Every card's bytes are pinned (`AllFortyOneSourceRecordsIncludingReviewsAndHebrewAreUnchanged`), and a+ later edit re-pins a card with its reason. The five operation cards' `requires_unit_regions` lines and their+ `# R-ENEMY-007` comments (#2543) are left out of the pin, so those cards keep theirs. The test also checks that a kept card keeps its status and human sign-off under `gdd-0.3`. An excluded card keepsits record and review for the legacy rulesets.**What decides it.** Decision D1 and answers Q1 to Q4 (owner, 1 November 2026, "Approve all six (Recommended)" for D1@@ -123,7 +125,7 @@ first-slice availability") describes; this file changes no exclusion.| `latrun_proposal` | `press_offensive` | `effects[0].security` | 0.025 | `effects[0].security` (same) | 0.025 | no || `latrun_proposal` | `press_offensive` | `effects[1].intl_standing` | -0.1 | `effects[1].intl_standing` (same) | -0.1 | no || `latrun_proposal` | `press_offensive` | `effects[2].morale` | -0.02 | `effects[2].morale` (same) | -0.02 | no |-| `latrun_proposal` | `press_offensive` | `unit_orders[0].harel` | go to (-3, 25) | `unit_orders[0].harel` (loaded, not run under gdd-0.3) | none (no order given) | no |+| `latrun_proposal` | `press_offensive` | `unit_orders[0].harel` | go to (-3, 25) | `unit_orders[0].harel` (same, once its units are in place: R-ENEMY-007) | go to (-3, 25) | no || `law_of_return` | `enact` | `effects[0].morale` | 0.03 | `effects[0].morale` (same) | 0.03 | no || `law_of_return` | `enact` | `effects[1].intl_standing` | 0.01 | `effects[1].intl_standing` (same) | 0.01 | no || `law_of_return` | `quota` | `effects[0].morale` | -0.06 | `effects[0].morale` (same) | -0.06 | no |@@ -137,22 +139,26 @@ first-slice availability") describes; this file changes no exclusion.| `ministry_supply_crisis` | `keep_ministry` | `effects[0].morale` | -0.03 | `effects[0].morale` (same) | -0.03 | no || `operation_hiram` | `stop_at_ceasefire` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `operation_hiram` | `stop_at_ceasefire` | `effects[0].security` | 0.02 | `effects[0].security` (same) | 0.02 | no |-| `operation_hiram` | `stop_at_ceasefire` | `unit_orders[0].carmeli` | go to (15, 3) | `unit_orders[0].carmeli` (loaded, not run under gdd-0.3) | none (no order given) | no |-| `operation_hiram` | `stop_at_ceasefire` | `unit_orders[1].brigade_7` | go to (14, 4) | `unit_orders[1].brigade_7` (loaded, not run under gdd-0.3) | none (no order given) | no |+| `operation_hiram` | `stop_at_ceasefire` | `unit_orders[0].carmeli` | go to (15, 3) | `unit_orders[0].carmeli` (same, once its units are in place: R-ENEMY-007) | go to (15, 3) | no |+| `operation_hiram` | `stop_at_ceasefire` | `unit_orders[1].brigade_7` | go to (14, 4) | `unit_orders[1].brigade_7` (same, once its units are in place: R-ENEMY-007) | go to (14, 4) | no || `operation_hiram` | `advance_into_lebanon` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `operation_hiram` | `advance_into_lebanon` | `effects[0].security` | 0.025 | `effects[0].security` (same) | 0.025 | no || `operation_hiram` | `advance_into_lebanon` | `effects[1].intl_standing` | -0.08 | `effects[1].intl_standing` (same) | -0.08 | no |+| `operation_hiram` | `advance_into_lebanon` | `unit_orders[0].carmeli` | go to (15, 3) | `unit_orders[0].carmeli` (same, once its units are in place: R-ENEMY-007) | go to (15, 3) | no |+| `operation_hiram` | `advance_into_lebanon` | `unit_orders[1].brigade_7` | go to (14, 4) | `unit_orders[1].brigade_7` (same, once its units are in place: R-ENEMY-007) | go to (14, 4) | no || `operation_horev` | `launch` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `operation_horev` | `launch` | `effects[0].security` | 0.02 | `effects[0].security` (same) | 0.02 | no |-| `operation_horev` | `launch` | `unit_orders[0].golani` | go to (-8, 28) | `unit_orders[0].golani` (loaded, not run under gdd-0.3) | none (no order given) | no |+| `operation_horev` | `launch` | `unit_orders[0].golani` | go to (-8, 28) | `unit_orders[0].golani` (same, once its units are in place: R-ENEMY-007) | go to (-8, 28) | no || `operation_horev` | `hold` | `effects[0].security` | -0.01 | `effects[0].security` (same) | -0.01 | no || `operation_yoav` | `stop_at_ceasefire` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `operation_yoav` | `stop_at_ceasefire` | `effects[0].security` | 0.025 | `effects[0].security` (same) | 0.025 | no |-| `operation_yoav` | `stop_at_ceasefire` | `unit_orders[0].negev` | go to (-10, 35) | `unit_orders[0].negev` (loaded, not run under gdd-0.3) | none (no order given) | no |-| `operation_yoav` | `stop_at_ceasefire` | `unit_orders[1].givati` | go to (-9, 29) | `unit_orders[1].givati` (loaded, not run under gdd-0.3) | none (no order given) | no |+| `operation_yoav` | `stop_at_ceasefire` | `unit_orders[0].negev` | go to (-10, 35) | `unit_orders[0].negev` (same, once its units are in place: R-ENEMY-007) | go to (-10, 35) | no |+| `operation_yoav` | `stop_at_ceasefire` | `unit_orders[1].givati` | go to (-9, 29) | `unit_orders[1].givati` (same, once its units are in place: R-ENEMY-007) | go to (-9, 29) | no || `operation_yoav` | `push_to_hebron` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `operation_yoav` | `push_to_hebron` | `effects[0].security` | 0.03 | `effects[0].security` (same) | 0.03 | no || `operation_yoav` | `push_to_hebron` | `effects[1].intl_standing` | -0.08 | `effects[1].intl_standing` (same) | -0.08 | no |+| `operation_yoav` | `push_to_hebron` | `unit_orders[0].givati` | go to (-6, 29) | `unit_orders[0].givati` (same, once its units are in place: R-ENEMY-007) | go to (-6, 29) | no |+| `operation_yoav` | `push_to_hebron` | `unit_orders[1].negev` | go to (-10, 35) | `unit_orders[1].negev` (same, once its units are in place: R-ENEMY-007) | go to (-10, 35) | no || `rafah_force_pressure` | `complete_pullback` | `rejoin` | rejoins `sinai_withdrawal` | `rejoin` (same) | rejoins `sinai_withdrawal` | no || `reparations_claim` | `claim` | `effects[0].intl_standing` | 0 | `effects[0].intl_standing` (same) | 0 | no || `reparations_claim` | `claim` | `effects[1].treasury` | -1 | `effects[1].treasury` (same) | -1 | no |@@ -173,12 +179,14 @@ first-slice availability") describes; this file changes no exclusion.| `sinai_withdrawal` | `hold_el_arish` | `effects[1].security` | 0.025 | `effects[1].security` (same) | 0.025 | no || `ten_days` | `central_front` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `ten_days` | `central_front` | `effects[0].security` | 0.025 | `effects[0].security` (same) | 0.025 | no |-| `ten_days` | `central_front` | `unit_orders[0].kiryati` | go to (-3, 24) | `unit_orders[0].kiryati` (loaded, not run under gdd-0.3) | none (no order given) | no |-| `ten_days` | `central_front` | `unit_orders[1].carmeli` | go to (14, 6) | `unit_orders[1].carmeli` (loaded, not run under gdd-0.3) | none (no order given) | no |+| `ten_days` | `central_front` | `unit_orders[0].kiryati` | go to (-3, 24) | `unit_orders[0].kiryati` (same, once its units are in place: R-ENEMY-007) | go to (-3, 24) | no |+| `ten_days` | `central_front` | `unit_orders[1].carmeli` | go to (14, 6) | `unit_orders[1].carmeli` (same, once its units are in place: R-ENEMY-007) | go to (14, 6) | no || `ten_days` | `southern_front` | `set_rung` | set 5 | `set_rung` (same) | set 5 | no || `ten_days` | `southern_front` | `effects[0].security` | 0.015 | `effects[0].security` (same) | 0.015 | no |+| `ten_days` | `southern_front` | `unit_orders[0].kiryati` | go to (-3, 24) | `unit_orders[0].kiryati` (same, once its units are in place: R-ENEMY-007) | go to (-3, 24) | no |+| `ten_days` | `southern_front` | `unit_orders[1].carmeli` | go to (14, 6) | `unit_orders[1].carmeli` (same, once its units are in place: R-ENEMY-007) | go to (14, 6) | no |-132 rows: 41 cards under gdd-0.1, 41 under gdd-0.3.+138 rows: 41 cards under gdd-0.1, 41 under gdd-0.3.| Excluded card | gdd-0.3 loader with only this exclusion removed ||---|---|diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex c58ca65fd..2e5756471 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -122,7 +122,7 @@ R-CITY-005: The cities' employed share (employed over civilians and craftsmen, sR-CITY-006: The cities are the `city` and `town` rows of `map/settlements_1948.yaml`, in that file's order, and their start values are `cities.yaml`'s. The loader refuses a `cities.yaml` whose ids are not exactly those rows in that order (#2732). Each of a city's values (`people`, `employed_share`, `housing_capacity`, `job_slots`) is required and has a status: `sourced` (read from the source named), `derived` (computed from sourced values), `wikipedia-only` (an owner-accepted Wikipedia figure) or `design` (a labelled design value, R-LOOP-005). A `sourced`, `derived` or `wikipedia-only` value has at least one source, each with a url and a checked date, and the day (YYYY-MM-DD) or month (YYYY-MM) it describes; the loader refuses a value without them, naming the file and field (GDD Phase 3 plan, review focus 3).-The regional foundation under exact `gdd-0.3` identity reads optional `regions.yaml` (`schema/regions.schema.json`), separate from aliyah origins. Each explicit region has a stable id, one label place (`capital_location`), land member hexes and member place ids. A member place is a settlement, a named map location, a designated site (`sites.yaml`) or a locality, whose hex is `map/locality_hexes.yaml`'s (written by `tools/locality_hexes.py` from `map/localities_1948.yaml` and `map/region_places_1948.yaml`; read only under exact `gdd-0.3` and only with `regions.yaml`, so no older identity reads or hashes it). Owner, 2 November 2026: Q1 "Accept localities", and "Fix all, then ship (Recommended)", whose option read "Accept site ids too; author records for the 4 (sourced); for the 14, the member's hex joins its region where it's unclaimed, and where another region holds the hex the member moves to that region. All listed for Amir to review." The label place must be a member; it is a label only (Q3, owner, 2 November 2026: "All nine drafts as labels"), not the regional-capital model the owner declined on 30 October 2026 ([GDD](../GDD.md), "Regional-capital model"), and nothing gives it capital mechanics. All nine shipped labels are `APPROVED` as labels (owner, 2 November 2026: "Approve all nine as labels (Recommended)"); that changes no rule. A region may list optional `field_hexes`, the opening field hexes (#1691 Q4, owner, 2 November 2026: "Approve as drafted (Recommended)", the 20 by the 27 October 2026 split): each must be a land hex of the region's own member hexes, listed once; a hex is in at most one region, so no field hex is in two. They are data only: no rule reads them yet, and the four checks of the shipped list (land, a coastal plain, lowland or valley biome, Israeli-held on 15 May 1948 in `map/control_hexes_1948_49.yaml`, in its region) are in `tools/tests/test_region_field_hexes.py`; a person's check of each row is pending. Validation uses effective placements after overrides; a place id with different hexes in two place files, repeated members and overlapping ownership are errors. Different place ids may share one hex within a region. No contiguity or complete-map coverage is required: a land hex may be in no region. Unknown opening control stays null and never grants access. Geography approval is separate from evidence status and human historical review. The shipped file has the nine regions of #1691; no new game initializes them yet (#1689).+Both GDD identities read optional `regions.yaml` (`schema/regions.schema.json`), separate from aliyah origins, as immutable lookup data (R-ENEMY-007); the regional foundation's population and control state is exact `gdd-0.3` only. Each explicit region has a stable id, one label place (`capital_location`), land member hexes and member place ids. A member place is a settlement, a named map location, a designated site (`sites.yaml`) or a locality, whose hex is `map/locality_hexes.yaml`'s (written by `tools/locality_hexes.py` from `map/localities_1948.yaml` and `map/region_places_1948.yaml`; read only with `regions.yaml`, under both GDD identities, so it is part of their content hash; the state hash carries regional state only under exact `gdd-0.3`). Owner, 2 November 2026: Q1 "Accept localities", and "Fix all, then ship (Recommended)", whose option read "Accept site ids too; author records for the 4 (sourced); for the 14, the member's hex joins its region where it's unclaimed, and where another region holds the hex the member moves to that region. All listed for Amir to review." The label place must be a member; it is a label only (Q3, owner, 2 November 2026: "All nine drafts as labels"), not the regional-capital model the owner declined on 30 October 2026 ([GDD](../GDD.md), "Regional-capital model"), and nothing gives it capital mechanics. All nine shipped labels are `APPROVED` as labels (owner, 2 November 2026: "Approve all nine as labels (Recommended)"); that changes no rule. A region may list optional `field_hexes`, the opening field hexes (#1691 Q4, owner, 2 November 2026: "Approve as drafted (Recommended)", the 20 by the 27 October 2026 split): each must be a land hex of the region's own member hexes, listed once; a hex is in at most one region, so no field hex is in two. They are data only: no rule reads them yet, and the four checks of the shipped list (land, a coastal plain, lowland or valley biome, Israeli-held on 15 May 1948 in `map/control_hexes_1948_49.yaml`, in its region) are in `tools/tests/test_region_field_hexes.py`; a person's check of each row is pending. Validation uses effective placements after overrides; a place id with different hexes in two place files, repeated members and overlapping ownership are errors. Different place ids may share one hex within a region. No contiguity or complete-map coverage is required: a land hex may be in no region. Unknown opening control stays null and never grants access. Geography approval is separate from evidence status and human historical review. The shipped file has the nine regions of #1691; no new game initializes them yet (#1689).The approved region associations and capital choices are recorded in `research_notes/gdd03-regions-capitals-fields.md` and its evidence ledger. The shipped extents are the sub-district design draft (owner, 30 October 2026: "C: sub-district, then Amir adjusts") with the 2 November 2026 fixes above, listed for Amir to review; they are design regions, not settled historical extents, and regional activation stays off (#1689). The inactive schema input `research_notes/gdd03-regions.schema-input.yaml` stays as evidence and retains every member id; the shared strict loader refuses seven of its nine rows, each on a member place that the 2 November fixes resolved. Named-place acceptance projections do not stand in for complete regions. Reception-camp design association does not establish its footprint, operation or control; historical rows still require a person's check.@@ -366,10 +366,12 @@ R-ENEMY-003: An enemy unit off its script attacks the first neighbouring hex, inR-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-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. Once R-ENEMY-007 permits the operation to start, 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 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 both `gdd-0.1` and `gdd-0.3`; 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).+R-ENEMY-007: The owner, 4 November 2026 (#2543): "A military operation can only get underway if you have the required units in place (you cant fight in latrun in you dont have military units there)." For #2543 the owner chose the options labelled "In the same region", "Both rulesets (Recommended)" and, later, "Player must move them"; for a delegated card the owner's words, as recorded on #2543 on 4 November 2026, are "Postpone and explain to the user which units need to move where. Postpone until they are in the right area and if the operation is still relevant". Under the agent-recorded scope, every option with `unit_orders` has a non-empty `requires_unit_regions` list. Its required units are exactly the distinct starting-force rows in its `unit_orders`; each must still be on the board and stand on a hex in any one listed region when the option is decided. No starting position receives special credit and the sim does not pre-position a unit. The five requirements recorded in #2543 are: `ten_days.central_front`, Kiryati and Carmeli in `central_plain`, `jerusalem_hills` or `galilee`; `operation_yoav.stop_at_ceasefire`, Negev and Givati in `southern_coast` or `negev`; `operation_hiram.stop_at_ceasefire`, Carmeli and 7th Brigade in `galilee`; `operation_horev.launch`, Golani in `southern_coast` or `negev`; `latrun_proposal.press_offensive`, Harel in `central_plain` or `jerusalem_hills`. The owner's rulings of 7 November 2026 ("Add real orders", "Same units (Recommended)", "Same units as Central (Recommended)", "Keep the same targets (Recommended)", "Stop at al-Malikiyya (Recommended)") add three more, each with its units' sourced targets: `operation_yoav.push_to_hebron`, Givati to Bayt Jibrin (from 27 October 1948, the later of the sources' dates, "Second read, then later date (Recommended)") and Negev to Beersheba, in `southern_coast` or `negev`; `operation_hiram.advance_into_lebanon`, Carmeli to Manara and 7th Brigade to al-Malikiyya, in `galilee`, the crossing into Lebanon told by the card only; `ten_days.southern_front`, Kiryati and Carmeli, in `central_front`'s regions and to its targets, Ramle and the north, not a southern target. A direct unmet choice is refused before any state changes. If delegation draws an unmet operation option, the card remains pending, the turn report (its operations row) and the Why screen say which units must move to which regions, and the draw is rolled back. Since the owner's rulings of 7 November 2026 ("All five cards", "Wait, with a limit (Recommended)", "6 turns (Recommended)", "Keep the option (Recommended)"), the postponed card keeps that option and later delegations draw nothing (the state's `postponed{}` records the option and the turn and date of the first postponement); it is shown again on 6 turns (`mvp.operation_wait_turns`) and lapses at the end of the 6th, without a chosen option, effects or orders. A card never postponed lapses when its window closes, as before. A postponed card whose historical option needs no units takes that option at its next delegation, and its wait ends (Latrun: "Takes the vote, wait ends (Recommended)"). A postponed card lapses at once when a unit its option needs is no longer on the board ("Lapse at once (Recommended)"; a dated row is waited for until its day), and any pending operation lapses when its front's armistice is signed ("Signing wins (Recommended)"; `armistice_front`: Yoav and Horev egypt, Hiram lebanon, "Keep Lebanon (Recommended)", Ten Days and Latrun jordan, "Jordan signing (Recommended)"). While that front's armistice card is pending, the operation cannot be chosen and its delegation postpones it ("Decide armistice first (Recommended)"). Every lapse costs `mvp.operation_lapse_security` (-0.01) in Security, Horev's Hold ("All five -0.01 (Recommended)"). An operation that waited and launches while a truce the player accepted is in force costs `mvp.operation_truce_break_standing` (-0.10) in International Support, unless its own effects already cost it, as Latrun's offensive does ("Same as Latrun, -0.10 (Recommended)", the owner's follow-up on a late Ten Days). Its card orders end later by the time it waited ("Shift by the delay (Recommended)"; the coordinator's reading, from the first postponement to the launch). Unlike an ordinary card under R-EVT-001, an operation card never first appears once its window has closed, and the wait for a soft slot does not keep it past its window. A card with `follows` (Rhodes Talks, Sinai Withdrawal, Rafah Force Pressure) fires on the turn after its `requires` are met even when its own window has closed ("Follow the launch (Recommended)", "Shift with Sinai (Recommended)"), and a card with `armistice_front` never first fires after that front's armistice is signed, so these three drop if Egypt signs before they are shown ("They drop (Recommended)"). A card shown after its own window has closed (a late follow-up, or an operation shown again while it waits) shows its `late_text`, and in Hebrew its `late_text_he`: Rhodes Talks, Sinai Withdrawal, Rafah Force Pressure, Operation Yoav and Operation Hiram have one ("Dateless variants (Recommended)"; the texts, "All approved (Recommended)", 7 November 2026). Operation Horev's text now says Golani must reach the south first ("Reword it (Recommended)"). This applies under both GDD identities. All requirement and missing-row iteration is ordinal; immutable region geography is loaded under both identities, while regional population/control state remains `gdd-0.3` only. Under `gdd-0.1` the loader reads `regions.yaml`'s geography for this rule but no field host: the host rows (R-POP-004, #1717) and their checks stay exact `gdd-0.3`, as the opening field hosts' section says.+## The war statePhase 5 PR 11, first slice (#750; Q-WAR-1, Q-WAR-2 and Q-WAR-4, owner, 15 October 2026, #375: "Take all recommendations"; D-C4): the security rung stops being a player lever in the GDD loop and stays the value the war events set. The player's attacks in a truce (Q-WAR-3) are a later slice of #750.@@ -550,7 +552,7 @@ R-EFX-009: Under gdd-0.3 only, an option's `debt_dollars` (US$ millions) also adD-H1 in the GDD loop (GDD Phase 7 PR 1, #805). The owner took the plan's recommendations for Q-EVT-1 to Q-EVT-4 on 17 October 2026 (#784). As the plan's Decided rows record them (`docs/superpowers/plans/2026-10-15-gdd-phase-7.md`), that keeps windows, hard anchors and the cap of 3 soft events a turn, keeps delegation, adds no delayed effects in the MVP, and shows every effect of every option from the sim's preview. These rules state what the code already does; no behaviour changed. On 18 October 2026 the owner added loyalty to delegation (#107: "Yes: minister loyalty changes a delegated event's outcome, with labelled values in the PR"); R-EVT-003 states it, with two design values (`delegation_loyalty_floor`, `disloyal_effect_share`).-R-EVT-001: An event fires on the first turn whose span overlaps its window `[from, to)` (or at the new game, when the start date is in it), once its `requires` is met and its conditions hold; an objective's card also waits for its objective (R-OBJ-003). Every eligible hard anchor fires. At most 3 soft events fire a turn (`EventSystem.MaxSoftEventsPerTurn`), apart from the cards R-OBJ-003 and R-EVT-007 say take no slot; ordinary soft events take the slots the hard anchors leave, `max(0, 3 - hard anchors)`, and the rest wait for the first later turn with a free slot, even after their window has ended (Q-CUT-6; owner, 4 November 2026, #2605: "Show it late (Recommended)"). A waiting event's normal eligibility gates, including its conditions, are evaluated again when it can fire.+R-EVT-001: An event fires on the first turn whose span overlaps its window `[from, to)` (or at the new game, when the start date is in it), once its `requires` is met and its conditions hold; an objective's card also waits for its objective (R-OBJ-003). Every eligible hard anchor fires. At most 3 soft events fire a turn (`EventSystem.MaxSoftEventsPerTurn`), apart from the cards R-OBJ-003 and R-EVT-007 say take no slot; ordinary soft events take the slots the hard anchors leave, `max(0, 3 - hard anchors)`, and the rest wait for the first later turn with a free slot, even after their window has ended (Q-CUT-6; owner, 4 November 2026, #2605: "Show it late (Recommended)"). A waiting event's normal eligibility gates, including its conditions, are evaluated again when it can fire. R-ENEMY-007's cards are the exceptions: an operation card never first fires after its window has closed, and the wait for a slot does not keep it past its window; a card with `follows` may fire after its window, on the turn after its `requires` are met; and a card with `armistice_front` never first fires after that front's armistice is signed.R-EVT-002: The soft events take the free slots in order: an early armistice first (`front_quiet`, R-WAR-008; Q-EVT-1, Q-OBJ-1), then consequence cards (R-ALT-008), then the rest; within each group by `from` (an objective's card after the others of its `from`, R-OBJ-007), then `order` (R-EVT-006), then id (ordinal). So two fronts that turn quiet on the same turn come in a stable order, and the cap of 3 still holds. With no early armistice eligible the order is unchanged.diff --git a/docs/translations.md b/docs/translations.mdindex 9f1caabd5..c391154da 100644--- a/docs/translations.md+++ b/docs/translations.md@@ -22,7 +22,7 @@ language is checked with `CheckDeclaredLanguage`, which refuses one whose `ui.ya| File | Key | Entry ||---|---|---|| `ui.yaml` | the key in `strings.en.yaml` (`hud.turn`) | the text |-| `events.yaml` | the event id (`altalena`) | `title`, `text`, `options` (option id: text, in the event's order), and `review` |+| `events.yaml` | the event id (`altalena`) | `title`, `text`, `late_text` (only for a card with one, R-ENEMY-007), `options` (option id: text, in the event's order), and `review` || `content.yaml` | a content key (below) | `text`, `review`, and for a language other than Hebrew `sources` |```yamldiff --git a/sim/Statecraft.Sim.Tests/CauseKeysTests.cs b/sim/Statecraft.Sim.Tests/CauseKeysTests.csindex ecf892bb6..3088d9403 100644--- a/sim/Statecraft.Sim.Tests/CauseKeysTests.cs+++ b/sim/Statecraft.Sim.Tests/CauseKeysTests.cs@@ -217,6 +217,19 @@ public class CauseKeysTestsforeach (var option in Real.Events.Single(e => e.Id == id).Options){var chosen = s.Clone();+ if (option.RequiresUnitRegions.Count != 0)+ {+ var at = Real.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var unitOrder in option.UnitOrders)+ {+ int unitId = Real.StartingForces.FindIndex(f => f.Row == unitOrder.Unit);+ var force = Real.StartingForces[unitId];+ var unit = chosen.Units.TryGetValue(unitId, out var present) ? present+ : new Unit(unitId, force.Type, force.Q, force.R, side: force.Side, strength: force.Strength);+ chosen.Units[unitId] = new Unit(unit.Id, unit.Type, at.Q, at.R, unit.Service, unit.Side, unit.Strength,+ unit.Order, unit.OrderTarget, unit.HomeCity, unit.Full, unit.CombatXp);+ }+ }Assert.Null(EventSystem.Choose(Real, chosen, id, option.Id, eventLines));foreach (var row in EventSystem.OptionEffects(Real, s, option)){diff --git a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs b/sim/Statecraft.Sim.Tests/DesignValuesTests.csindex 3f2ce4edd..8aabcec35 100644--- a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs+++ b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs@@ -67,6 +67,9 @@ public partial class DesignValuesTests("rules.yaml", "mvp.hold_defence_percent"), // R-ORDER-003, #746 (Q-HOLD-2)("rules.yaml", "attention_cost.unit_order"), // R-ORDER-001, #746 (D-A6)("rules.yaml", "mvp.delegation_loyalty_floor"), // R-EVT-003, #107+ ("rules.yaml", "mvp.operation_wait_turns"), // R-ENEMY-007, #2543+ ("rules.yaml", "mvp.operation_lapse_security"), // R-ENEMY-007, #2543 (Q8)+ ("rules.yaml", "mvp.operation_truce_break_standing"), // R-ENEMY-007, #2543 (late Ten Days in the truce)("rules.yaml", "mvp.disloyal_effect_share"),("rules.yaml", "mvp.enemy_attack_ratio_percent"), // R-ENEMY-003, #749 (Q-ENEMY-2)// Q-START-1 (owner, 15 October 2026, #375): no city has a sourced housing stock or job count, so every city'sdiff --git a/sim/Statecraft.Sim.Tests/DollarsTests.cs b/sim/Statecraft.Sim.Tests/DollarsTests.csindex 74c2b3ed1..8a826f540 100644--- a/sim/Statecraft.Sim.Tests/DollarsTests.cs+++ b/sim/Statecraft.Sim.Tests/DollarsTests.cs@@ -540,18 +540,21 @@ sources: [{ url: https://example.org/event, checked: 2026-10-18 }]// war has 10 turns at rung 4 or 5, not 11. One war turn less costs IL 3.75m less debt (IL 36.79m on 15 April 1949 and// IL 174.99m at the end); the conversion is $40m, IL 13.32m less debt (IL 23.47m and IL 161.67m), and with $4m more// foreign currency kept the converting run's crisis comes on 15 April 1951. The no-lever crisis is unchanged.+ // R-ENEMY-007 (#2543) changes it deliberately again: this no-orders run leaves required formations out of place, so its+ // operations postpone and lapse. With both changes the run ends at IL 28.94m on 15 April 1949 and IL 168.79m, the+ // conversion at IL 15.62m and IL 155.47m (still $40m, IL 13.32m less debt); both crisis dates are as with #2551 alone.[Fact]public void TheWarOnlyRunReproducesThePrototypeAtTheSourcedRate(){var none = Prototype(0);- Assert.Equal((36.79, 174.99), (Math.Round(none.April1949, 2), Math.Round(none.End.Debt, 2)));+ Assert.Equal((28.94, 168.79), (Math.Round(none.April1949, 2), Math.Round(none.End.Debt, 2)));Assert.Equal(new DateTime(1951, 12, 15), none.Crisis);var sold = Prototype(4);Assert.Equal(40, sold.Converted);var saved = 40 * 0.333;Assert.Equal(none.April1949 - saved, sold.April1949, 9);Assert.Equal(none.End.Debt - saved, sold.End.Debt, 9);- Assert.Equal((23.47, 161.67), (Math.Round(sold.April1949, 2), Math.Round(sold.End.Debt, 2)));+ Assert.Equal((15.62, 155.47), (Math.Round(sold.April1949, 2), Math.Round(sold.End.Debt, 2)));Assert.Equal(new DateTime(1951, 4, 15), sold.Crisis);}}diff --git a/sim/Statecraft.Sim.Tests/EnemyAITests.cs b/sim/Statecraft.Sim.Tests/EnemyAITests.csindex 4ef5f14ec..192bca534 100644--- a/sim/Statecraft.Sim.Tests/EnemyAITests.cs+++ b/sim/Statecraft.Sim.Tests/EnemyAITests.cs@@ -1,5 +1,6 @@using System;using System.Collections.Generic;+using System.Globalization;using System.Linq;using Statecraft.Sim;@@ -13,6 +14,11 @@ public class EnemyAITestsconst string Types = Fixture.GddUnitTypes+ " - { id: soldier, kind: unit, side: israel, class: infantry, movement_points: 3 }\n"+ " - { id: enemy, kind: unit, side: egypt, class: infantry, movement_points: 3 }\n";+ const string OperationRegions = "player_regions:\n"+ + " - id: fixture_region\n capital_location: town_a\n member_hexes: [{ q: 0, r: 0 }, { q: 1, r: 0 }]\n"+ + " member_locations: [town_a]\n design_note: 'Operation requirement test region'\n"+ + " sources: ['test fixture: no historical claim']\n capital_approval: NEEDS-RESEARCH\n"+ + " binding_status: NEEDS-RESEARCH\n opening_control: { status: NEEDS-RESEARCH, value: null }\n";static Content Load() => ContentLoader.Load(Fixture.Write(Fixture.Gdd(new Dictionary<string, string>{@@ -521,15 +527,9 @@ public class EnemyAITestsforeach (var u in s.Units.Values.Where(IsEnemy))if ((u.Q, u.R) != start[u.Id]) Assert.DoesNotContain((u.Q, u.R), players);}- // 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-007: with no player moves, the delegated operations postpone before their card orders can capture+ // Beersheba or Ramla. This test's enemy-movement assertion therefore leaves the player's settlement ledger empty.+ Assert.Empty(s.Settlements);}// R-ENEMY-001: what the enemy does is named on its cause (Cause.EnemyOrder), for the turn report (#1293): a scripted@@ -602,18 +602,30 @@ public class EnemyAITests+ " - { 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"+ + " - id: ok\n text: Accept\n historical: true\n requires_unit_regions: [fixture_region]\n unit_orders: [" + order + "]\n"+ "sources: [{ url: \"https://example.org/event\", checked: 2026-10-18 }]\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,+ ["regions.yaml"] = OperationRegions, ["map/locality_hexes.yaml"] = "localities: []\n",});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));+ // R-ENEMY-007 (#2621): an objective, exchange or Deport card skips the placement check when it is delegated, so it+ // cannot carry unit orders at all; the refusal names the option's unit_orders.+ foreach (var single in new[] { "prisoners: egypt", "objective: fixture_goal", "deported: fixture_place" })+ {+ var special = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(Files(), new()+ {+ ["probe.yaml"] = Card("{ unit: brig, q: 4, r: 0 }").Replace("from: 1948-05-15\n", "from: 1948-05-15\n" + single + "\n")+ })));+ Assert.Equal(("events/probe.yaml", "events[probe].options[ok].unit_orders"), (special.File, special.Field));+ Assert.Contains("cannot give unit_orders", special.Message);+ }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);@@ -631,6 +643,16 @@ public class EnemyAITestsvar legacyMissingUnit = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(null, new() { ["probe.yaml"] = Card("{ q: 4, r: 0 }") })));Assert.Equal("events[probe].options[ok].unit_orders[0].unit", legacyMissingUnit.Field);+ var missing = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(Files(), new()+ {+ ["probe.yaml"] = Card("{ unit: brig, q: 4, r: 0 }").Replace(" requires_unit_regions: [fixture_region]\n", "")+ })));+ Assert.Equal(("events/probe.yaml", "events[probe].options[ok].requires_unit_regions"), (missing.File, missing.Field));+ var unknownRegion = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(Files(), new()+ {+ ["probe.yaml"] = Card("{ unit: brig, q: 4, r: 0 }").Replace("fixture_region]", "missing_region]")+ })));+ Assert.Equal("events[probe].options[ok].requires_unit_regions[0]", unknownRegion.Field);// 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);@@ -692,6 +714,9 @@ public class EnemyAITests// 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.+ // The owner's 7 November 2026 rulings on #2621 ("Add real orders", "Stop at al-Malikiyya (Recommended)", "Same units as+ // Central (Recommended)", "Keep the same targets (Recommended)", "Second read, then later date (Recommended)"): the+ // escalations and Ten Days' southern front give orders too, to their units' sourced targets; Bayt Jibrin is new.[Fact]public void OnlyTheSourcedAnchorsReceiveCardOrders(){@@ -701,14 +726,346 @@ public class EnemyAITests("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_hiram", "advance_into_lebanon", false, "carmeli", 15, 3), // the same: Manara+ ("operation_hiram", "advance_into_lebanon", false, "brigade_7", 14, 4),// the same: al-Malikiyya("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]+ ("operation_yoav", "push_to_hebron", false, "givati", -6, 29), // Bayt Jibrin, givati order_targets[1]+ ("operation_yoav", "push_to_hebron", false, "negev", -10, 35), // the same Beersheba("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]+ ("ten_days", "southern_front", false, "kiryati", -3, 24), // the same: Ramle+ ("ten_days", "southern_front", false, "carmeli", 14, 6), // the same: the north}, orders.OrderBy(x => x.Item1, StringComparer.Ordinal));}+ // R-ENEMY-007: the automated players stage an operation's units as a player's ordinary go-to, onto a hex of an allowed+ // region, but never onto an enemy-held place (Movement.NoEntry): staging is not an attack, and Acre (8, 7), a Galilee+ // member place, must not be captured as a side effect of putting Carmeli in Galilee. Played over the historical run to+ // the end of 1948. Red without the filter in HistoricalAI.OperationMoves: a go-to targets an enemy-held place.+ [Fact]+ public void StagingNeverTargetsAnEnemyHeldPlace()+ {+ var c = Real;+ var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);+ var staged = 0;+ while (s.Date < new DateTime(1949, 1, 1) && s.GameOver == null)+ {+ var closed = Movement.NoEntry(c, s);+ foreach (var o in HistoricalAI.OperationMoves(c, s, e => e.Options.FirstOrDefault(x => x.Historical) ?? e.Options[0]).OfType<UnitOrder>())+ {+ staged++;+ Assert.True(o.Q.HasValue && o.R.HasValue, "a staging order is a go-to to a hex");+ Assert.False(closed.Contains((o.Q!.Value, o.R!.Value)), FormattableString.Invariant($"{s.Date:yyyy-MM-dd}: unit {o.Unit} staged onto the enemy-held hex ({o.Q}, {o.R})"));+ }+ s = Simulation.Step(c, s, HistoricalAI.Commands(c, s)).State;+ }+ Assert.True(staged > 0, "the run stages at least one unit");+ }++ // R-ENEMY-007: every region an operation names has an English name in the sim's cause text (EventSystem's+ // OperationRegionName), so a region added to an operation but not to the names shows as its raw id and fails here.+ // Unity's operation.region.* strings are checked in EventCardTests.+ [Fact]+ public void EveryRequiredOperationRegionHasAnEnglishName()+ {+ var ids = Real.Events.SelectMany(e => e.Options).SelectMany(o => o.RequiresUnitRegions).Distinct(StringComparer.Ordinal)+ .OrderBy(x => x, StringComparer.Ordinal).ToList();+ Assert.NotEmpty(ids);+ Assert.All(ids, id => Assert.True(Real.PlayerRegions.Regions.ContainsKey(id), id + " is a regions.yaml region"));+ Assert.All(ids, id => Assert.NotEqual(id, EventSystem.OperationRegionName(id)));+ }++ [Fact]+ public void EveryMilitaryOperationOptionHasTheRecordedRegionRequirement()+ {+ var requirements = Real.Events.SelectMany(e => e.Options.Where(o => o.RequiresUnitRegions.Count != 0)+ .Select(o => (Event: e.Id, Option: o.Id, Units: string.Join(",", o.UnitOrders.Select(x => x.Unit)), Regions: string.Join(",", o.RequiresUnitRegions))));+ Assert.Equal(new[]+ {+ ("latrun_proposal", "press_offensive", "harel", "central_plain,jerusalem_hills"),+ ("operation_hiram", "stop_at_ceasefire", "carmeli,brigade_7", "galilee"),+ ("operation_hiram", "advance_into_lebanon", "carmeli,brigade_7", "galilee"), // "Same units (Recommended)"+ ("operation_horev", "launch", "golani", "southern_coast,negev"),+ ("operation_yoav", "stop_at_ceasefire", "negev,givati", "southern_coast,negev"),+ ("operation_yoav", "push_to_hebron", "givati,negev", "southern_coast,negev"), // "Same units (Recommended)"+ ("ten_days", "central_front", "kiryati,carmeli", "central_plain,jerusalem_hills,galilee"),+ ("ten_days", "southern_front", "kiryati,carmeli", "central_plain,jerusalem_hills,galilee"), // "Same units as Central"+ }, requirements.OrderBy(x => x.Event, StringComparer.Ordinal));+ }++ static Unit At(Unit u, int q, int r) => new Unit(u.Id, u.Type, q, r, u.Service, u.Side, u.Strength,+ u.Order, u.OrderTarget, u.HomeCity, u.Full, u.CombatXp);++ static void PutOperationInPlace(Content c, GameState s, EventOption option)+ {+ var at = c.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var row in option.UnitOrders.Select(x => x.Unit).Distinct(StringComparer.Ordinal))+ {+ int id = c.StartingForces.FindIndex(x => x.Row == row);+ var force = c.StartingForces[id];+ var unit = s.Units.TryGetValue(id, out var existing) ? existing+ : new Unit(id, force.Type, force.Q, force.R, side: force.Side, strength: force.Strength);+ s.Units[id] = At(unit, at.Q, at.R);+ }+ }++ // R-ENEMY-007: every one of the five operation options refuses before mutation if one ordered unit is outside every+ // allowed region, and resolves once all ordered units are in any allowed region.+ [Theory]+ [InlineData("ten_days", "central_front")]+ [InlineData("operation_yoav", "stop_at_ceasefire")]+ [InlineData("operation_hiram", "stop_at_ceasefire")]+ [InlineData("operation_horev", "launch")]+ [InlineData("latrun_proposal", "press_offensive")]+ public void AnOperationRefusesOutOfPlaceAndAcceptsAllInPlace(string card, string choice)+ {+ foreach (var c in new[] { Real, Gdd03EventRulesTests.Real(true) })+ {+ var e = c.Events.First(x => x.Id == card); var option = e.Options.First(x => x.Id == choice);+ var s = Simulation.NewGame(c, 17, Mode.Historical);+ s.PendingEvents.Clear(); s.PendingEvents.Add(card); PutOperationInPlace(c, s, option);+ var outside = c.PlayerRegions.Regions.Values.SelectMany(x => x.MemberHexes)+ .First(h => !option.RequiresUnitRegions.Contains(c.PlayerRegions.AtHex(h.Q, h.R)!.Id, StringComparer.Ordinal));+ int first = c.StartingForces.FindIndex(x => x.Row == option.UnitOrders[0].Unit);+ s.Units[first] = At(s.Units[first], outside.Q, outside.R);+ var before = s.Hash(); var why = new List<Cause>();+ Assert.Equal(EventSystem.RefusedOperationUnitsNotInPlace, EventSystem.Choose(c, s, card, choice, why));+ Assert.Equal(before, s.Hash()); Assert.Empty(why); Assert.Contains(card, s.PendingEvents); Assert.False(s.ChosenOptions.ContainsKey(card));++ PutOperationInPlace(c, s, option);+ Assert.Null(EventSystem.Choose(c, s, card, choice, why));+ Assert.Equal(choice, s.ChosenOptions[card]); Assert.DoesNotContain(card, s.PendingEvents);+ }+ }++ [Theory]+ [InlineData(false)]+ [InlineData(true)]+ public void ADelegatedOperationWithNoPlayerMovesPostponesThenLapsesWithoutAChoice(bool modern)+ {+ var c = modern ? Gdd03EventRulesTests.Real(true) : Real;+ var e = c.Events.First(x => x.Id == "operation_horev");+ var s = Simulation.NewGame(c, 23, Mode.Historical);+ s.Date = e.From; s.PendingEvents.Clear(); s.PendingEvents.Add(e.Id);+ var before = s.Hash(); var rng = s.RngState; var why = new List<Cause>();+ EventSystem.Delegate(c, s, why);+ Assert.Contains(e.Id, s.PendingEvents); Assert.False(s.ChosenOptions.ContainsKey(e.Id)); Assert.Equal(rng, s.RngState);+ // R-ENEMY-007 (owner, 7 November 2026: "Keep the option (Recommended)"): the postponement records only the kept option+ // and the turn its wait counts from; nothing else in the state changes.+ var kept = Assert.Single(s.PostponedOperations);+ Assert.Equal((e.Id, "launch", s.Turn), (kept.Key, kept.Value.Option, kept.Value.Turn));+ var unrecorded = s.Clone(); unrecorded.PostponedOperations.Clear();+ Assert.Equal(before, unrecorded.Hash());+ var postponed = Assert.Single(why, x => x.Key == CauseKeys.OperationPostponed);+ Assert.Equal(new[] { "golani", "negev|southern_coast" }, postponed.Args.Skip(2));+ Assert.Contains("Golani Brigade", postponed.Message); Assert.Contains("Negev", postponed.Message);+ Assert.DoesNotContain("golani", postponed.Message); Assert.DoesNotContain("southern_coast", postponed.Message);++ // "Wait, with a limit (Recommended)", "6 turns (Recommended)": the window's end no longer ends a postponed card; it is+ // shown again on mvp.operation_wait_turns turns after the first postponement, and lapses at the end of the last.+ var wait = c.Rules.Mvp!.OperationWaitTurns!.Value;+ Assert.Equal(6, wait);+ s.Date = e.To!.Value; s.Turn = kept.Value.Turn + wait; why.Clear(); EventSystem.LapseExpiredOperations(c, s, why);+ Assert.Contains(e.Id, s.PendingEvents); Assert.Empty(why);+ s.Turn++; EventSystem.LapseExpiredOperations(c, s, why);+ Assert.DoesNotContain(e.Id, s.PendingEvents); Assert.False(s.ChosenOptions.ContainsKey(e.Id)); Assert.Empty(s.PostponedOperations);+ var lapsed = Assert.Single(why, x => x.Key.StartsWith("operation_lapsed", StringComparison.Ordinal));+ Assert.Equal(CauseKeys.OperationLapsed, lapsed.Key);+ Assert.Contains("Golani Brigade", lapsed.Message); Assert.Contains("Southern Coast", lapsed.Message);+ // Q8: the lapse's Security cost is the turn's only other line (ALapseCostsTheNamedSecurity checks its amount).+ Assert.Equal(new[] { CauseKeys.OperationLapsed, CauseKeys.EventAmount }, why.Select(x => x.Key).ToArray());+ }++ // R-ENEMY-007 (the owner's words as recorded on #2543, 4 November 2026: "Postpone until they are in the right area and+ // if the operation is still relevant"): an ordinary card whose window lies wholly inside the turn just played still+ // late-fires at the turn's end, but an operation card does not first appear once its window has closed. Fixture dates:+ // the turn runs 15 May to 15 June 1948, and both windows run from 20 May to 1 June. With the operation's window still+ // open at the turn's end (to 20 June), it comes as usual.+ [Theory]+ [InlineData("1948-06-01", false)]+ [InlineData("1948-06-20", true)]+ public void AnOperationWhoseWindowClosedInsideTheTurnDoesNotFirstAppear(string to, bool fires)+ {+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());+ var probe = c.Events.Single(e => e.Id == "probe");+ probe.From = new DateTime(1948, 5, 20); probe.To = DateTime.ParseExact(to, "yyyy-MM-dd", CultureInfo.InvariantCulture);+ c.Events.Add(new GameEvent { Id = "ordinary", Title = "Ordinary", Text = "Ordinary.", From = probe.From, To = new DateTime(1948, 6, 1),+ Options = { new EventOption { Id = "ok", Text = "Ok" } } });+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ s.PendingEvents.Clear(); s.FiredEvents.Clear();+ s.Date = new DateTime(1948, 6, 15);+ EventSystem.Trigger(c, s, new List<Cause>(), new DateTime(1948, 5, 15));+ Assert.Contains("ordinary", s.PendingEvents);+ Assert.Equal(fires, s.PendingEvents.Contains("probe"));+ }++ // R-ENEMY-007, the owner's rulings of 7 November 2026 ("Wait, with a limit (Recommended)", "6 turns (Recommended)",+ // "Keep the option (Recommended)", "Lapse at once (Recommended)", "Signing wins (Recommended)"). The probe card's window is+ // the game's first day only, so it closes inside the first turn, as a real operation's does, and the brigade starts out of+ // its region on (2, 0). Fixture values, not history.+ static (Content C, GameState S) Waiting(string cardLines = "")+ {+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board(), cardLines: cardLines);+ var probe = c.Events.Single(x => x.Id == "probe");+ probe.From = c.Rules.Start; probe.To = c.Rules.Start.AddDays(1);+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ Assert.Contains("probe", s.PendingEvents);+ s.Units[0] = At(s.Units[0], 2, 0); // outside fixture_region+ return (c, s);+ }++ // Postponed on its first turn, the card no longer lapses at its window's end: it waits, and launches on the turn its+ // brigade is back in the region. Red with the old lapse (at the window's end): the card is gone after the first turn.+ [Fact]+ public void APostponedOperationWaitsPastItsWindowAndLaunchesWhenItsUnitArrives()+ {+ var (c, s) = Waiting();+ var r = Simulation.Step(c, s, Array.Empty<Command>());+ Assert.Contains(r.Why, x => x.Key == CauseKeys.OperationPostponed);+ Assert.DoesNotContain(r.Why, x => x.Key == CauseKeys.OperationLapsed);+ Assert.Contains("probe", r.State.PendingEvents);+ Assert.True(r.State.Date >= c.Events.Single(x => x.Id == "probe").To, "the window has closed");+ var back = r.State.Clone();+ back.Units[0] = At(back.Units[0], 0, 0); // in fixture_region, as a player's move would have put it+ var next = Simulation.Step(c, back, Array.Empty<Command>());+ Assert.Equal("ok", next.State.ChosenOptions["probe"]);+ Assert.Empty(next.State.PostponedOperations);+ }++ // The wait's limit (R-ENEMY-007): the card is shown again on 6 turns (mvp.operation_wait_turns) and lapses at the end of+ // the 6th. Both edges: postponed at the end of turn 1, it is pending after steps 1 to 6, so it is shown again on turns+ // 2 to 7, and it lapses at step 7, the end of turn 7, the 6th turn it was shown again.+ // Red with the old lapse: it is gone after the first turn.+ [Fact]+ public void APostponedOperationLapsesAfterItsWaitTurns()+ {+ var (c, s) = Waiting();+ var wait = c.Rules.Mvp!.OperationWaitTurns!.Value;+ for (int turn = 1; turn <= wait + 1; turn++)+ {+ var r = Simulation.Step(c, s, Array.Empty<Command>());+ s = r.State;+ if (turn <= wait) Assert.Contains("probe", s.PendingEvents);+ else Assert.Contains(r.Why, x => x.Key == CauseKeys.OperationLapsed && x.Target == "probe");+ }+ Assert.DoesNotContain("probe", s.PendingEvents);+ Assert.False(s.ChosenOptions.ContainsKey("probe"));+ Assert.Empty(s.PostponedOperations);+ }++ // Q8, "All five -0.01 (Recommended)" (owner, 7 November 2026): every lapse costs mvp.operation_lapse_security, Horev's+ // Hold, as an event amount named after the card, whatever ended the wait. The real content, which has Security: Horev+ // postponed on the 15 December 1948 turn with Golani back on its start hex, then ended by its wait, by Golani's loss, or+ // by Egypt's signature. Red without the cost: no Security line names Horev.+ [Theory]+ [InlineData("wait")]+ [InlineData("lost")]+ [InlineData("signed")]+ public void ALapseCostsTheNamedSecurity(string why)+ {+ var c = Real;+ var cost = c.Rules.Mvp!.OperationLapseSecurity!.Value;+ Assert.Equal(-0.01, cost);+ var s = GoldenRun.Play(c, new DateTime(1948, 12, 15));+ var golani = c.StartingForces.FindIndex(f => f.Row == "golani");+ s.Units[golani] = At(s.Units[golani], 11, 11);+ s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.True(s.PostponedOperations.ContainsKey("operation_horev"));+ if (why == "lost") s.Units.Remove(golani);+ if (why == "signed") s.ChosenOptions["armistice_egypt"] = "sign";+ if (why == "wait") s.Turn += c.Rules.Mvp!.OperationWaitTurns!.Value;+ var r = Simulation.Step(c, s, Array.Empty<Command>());+ Assert.Contains(r.Why, x => x.Target == "operation_horev" && x.Key.StartsWith("operation_lapsed", StringComparison.Ordinal));+ var line = Assert.Single(r.Why, x => x.System == "events" && x.Target == "security" && x.Key == CauseKeys.EventAmount+ && x.Message.Contains("Operation Horev"));+ Assert.Equal(cost, line.Delta, 9);+ }++ // "Lapse at once (Recommended)": a postponed card whose required unit is no longer on the board lapses on its next+ // consideration with its own reason, instead of waiting out its turns.+ [Fact]+ public void APostponedOperationLapsesAtOnceWhenItsUnitIsGone()+ {+ var (c, s) = Waiting();+ s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.Contains("probe", s.PendingEvents);+ s.Units.Remove(0); // the brigade is destroyed+ var r = Simulation.Step(c, s, Array.Empty<Command>());+ var lapsed = Assert.Single(r.Why, x => x.Target == "probe" && x.Key.StartsWith("operation_lapsed", StringComparison.Ordinal));+ Assert.Equal(CauseKeys.OperationLapsedUnitLost, lapsed.Key);+ Assert.DoesNotContain("probe", r.State.PendingEvents);+ }++ // "Signing wins (Recommended)": a pending operation whose armistice_front has signed lapses with its own reason.+ [Fact]+ public void AnOperationLapsesOnceItsFrontsArmisticeIsSigned()+ {+ var (c, s) = Waiting("armistice_front: egypt\n");+ s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.Contains("probe", s.PendingEvents);+ s.ChosenOptions["armistice_egypt"] = "sign";+ var r = Simulation.Step(c, s, Array.Empty<Command>());+ var lapsed = Assert.Single(r.Why, x => x.Target == "probe" && x.Key.StartsWith("operation_lapsed", StringComparison.Ordinal));+ Assert.Equal(CauseKeys.OperationLapsedSigned, lapsed.Key);+ Assert.Contains("Egypt", lapsed.Message);+ Assert.DoesNotContain("probe", r.State.PendingEvents);+ }++ // "Keep the option (Recommended)": a postponed card keeps the option it was postponed with. Open mode, with a free option the+ // minister would usually draw (recommended): over many seeds the card stays postponed with "ok" and is never resolved+ // with "free". Red without the kept option (a fresh draw on each consideration): some seeds resolve it with "free".+ [Fact]+ public void APostponedOperationKeepsItsOptionInsteadOfDrawingAgain()+ {+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());+ c.Events.Single(x => x.Id == "probe").Options.Add(new EventOption { Id = "free", Text = "Free", Recommended = true });+ for (ulong seed = 1; seed <= 40; seed++)+ {+ var s = Simulation.NewGame(c, seed, Mode.Historical); s.Mode = Mode.Open;+ s.Units[0] = At(s.Units[0], 2, 0);+ s.PostponedOperations["probe"] = new PostponedOperation("ok", s.Turn, s.Date);+ var why = new List<Cause>();+ EventSystem.Delegate(c, s, why);+ Assert.False(s.ChosenOptions.ContainsKey("probe"), $"seed {seed}: resolved with {(s.ChosenOptions.TryGetValue("probe", out var o) ? o : "")}");+ Assert.Equal("ok", s.PostponedOperations["probe"].Option);+ }+ }++ // Latrun's ruling ("Takes the vote, wait ends (Recommended)"): a postponed card whose historical option needs no units is+ // decided by its minister with that option. Red without that rule: the kept operation keeps it waiting.+ [Fact]+ public void APostponedCardWhoseHistoricalOptionNeedsNoUnitsTakesIt()+ {+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());+ var probe = c.Events.Single(x => x.Id == "probe");+ probe.Options[0].Historical = false;+ probe.Options.Add(new EventOption { Id = "vote", Text = "Vote", Historical = true });+ var s = Simulation.NewGame(c, 1, Mode.Historical); s.Mode = Mode.Open;+ s.Units[0] = At(s.Units[0], 2, 0);+ s.PostponedOperations["probe"] = new PostponedOperation("ok", s.Turn, s.Date);+ EventSystem.Delegate(c, s, new List<Cause>());+ Assert.Equal("vote", s.ChosenOptions["probe"]);+ Assert.Empty(s.PostponedOperations);+ }++ [Fact]+ public void APostponedDelegationRollsBackItsDrawBeforeLaterCards()+ {+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());+ c.Events.Add(new GameEvent { Id = "later", Title = "Later", Text = "Later.", From = c.Rules.Start,+ Options = { new EventOption { Id = "a", Text = "A" }, new EventOption { Id = "b", Text = "B" } } });+ var postponed = Simulation.NewGame(c, 91, Mode.Historical); postponed.Mode = Mode.Open;+ postponed.Units[0] = At(postponed.Units[0], 2, 0); // outside fixture_region+ postponed.PendingEvents.Clear(); postponed.PendingEvents.Add("probe"); postponed.PendingEvents.Add("later");+ var control = postponed.Clone(); control.PendingEvents.Remove("probe");+ EventSystem.Delegate(c, postponed, new List<Cause>()); EventSystem.Delegate(c, control, new List<Cause>());+ Assert.Contains("probe", postponed.PendingEvents);+ Assert.Equal(control.ChosenOptions["later"], postponed.ChosenOptions["later"]);+ Assert.Equal(control.RngState, postponed.RngState);+ }+// 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@@ -727,6 +1084,7 @@ public class EnemyAITestsAssert.Equal(Day(turn), s.Date);int id = Real.StartingForces.FindIndex(f => f.Row == row);Assert.True(s.Units.ContainsKey(id), row);+ PutOperationInPlace(Real, s, Real.Events.First(e => e.Id == card).Options.First(o => o.Id == option));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);@@ -749,20 +1107,21 @@ public class EnemyAITests// 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)+ static Content CardGame(int q, int r, string to, string board, bool held = false, string cardLines = ""){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 card = "id: probe\ntitle: Fixture\ntext: Fixture.\nfrom: 1948-05-15\n" + cardLines + "options:\n"+ + FormattableString.Invariant($" - id: ok\n text: Accept\n historical: true\n requires_unit_regions: [fixture_region]\n unit_orders: [{{ unit: brig, q: {q}, r: {r} }}]\n")+ "sources: [{ url: \"https://example.org/event\", checked: 2026-10-18 }]\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,+ ["regions.yaml"] = OperationRegions, ["map/locality_hexes.yaml"] = "localities: []\n",});if (held){@@ -777,6 +1136,25 @@ public class EnemyAITestsreturn ContentLoader.Load(Fixture.Write(files, new() { ["probe.yaml"] = card }));}+ // R-ENEMY-007: HistoricalAI previews the ordinary staging go-to before deciding whether to answer the open operation.+ // Red first: OperationStatus reads the turn-start hex (2,0), omits the choice, and end-turn delegation resolves it instead.+ [Fact]+ public void HistoricalAIAnswersAnOperationWhenThisTurnsStagingMovePlacesItsLastUnit()+ {+ var c = CardGame(4, 0, "1949-01-01", MovementTests.Board());+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ s.Units[0] = At(s.Units[0], 2, 0); // outside fixture_region; this turn's staging reaches its (1,0) member++ var commands = HistoricalAI.Commands(c, s);++ Assert.Contains(commands, x => x is UnitOrder { Unit: 0, Order: Movement.GoTo });+ Assert.Contains(commands, x => x is ChooseEventOption { EventId: "probe", OptionId: "ok" });+ var r = Simulation.Step(c, s, commands);+ Assert.Empty(r.Rejected);+ Assert.Contains(r.Why, x => x.Key == CauseKeys.EventChosen && x.Target == "probe");+ Assert.DoesNotContain(r.Why, x => x.Key == CauseKeys.EventDelegated && x.Target == "probe");+ }+// (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]@@ -811,12 +1189,13 @@ public class EnemyAITests+ " 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"+ + " - id: ok\n text: Accept\n historical: true\n requires_unit_regions: [fixture_region]\n unit_orders: [{ unit: brig, q: 4, r: 0 }]\n"+ "sources: [{ url: \"https://example.org/event\", checked: 2026-10-18 }]\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,+ ["regions.yaml"] = OperationRegions, ["map/locality_hexes.yaml"] = "localities: []\n",});return ContentLoader.Load(Fixture.Write(files, new() { ["probe.yaml"] = Card }));}@@ -912,13 +1291,16 @@ public class EnemyAITestsconst string Hexes = "anchors:\n - { id: brig_a, anchor: 0, q: 0, r: 0 }\n - { id: brig_a, anchor: 1, q: 2, r: 0 }\n"+ " - { id: brig_b, anchor: 0, q: 0, r: 1 }\n - { id: brig_b, anchor: 1, q: 2, r: 0 }\n";var card = "id: probe\ntitle: Fixture\ntext: Fixture.\nfrom: 1948-05-15\noptions:\n"- + " - id: ok\n text: Accept\n historical: true\n"+ + " - id: ok\n text: Accept\n historical: true\n requires_unit_regions: [fixture_region]\n"+ " unit_orders: [{ unit: " + first + ", q: 2, r: 0 }, { unit: " + second + ", q: 2, r: 0 }]\n"+ "sources: [{ url: \"https://example.org/event\", checked: 2026-10-18 }]\n";var c = ContentLoader.Load(Fixture.Write(Fixture.Gdd(new Dictionary<string, string>{["unit_types.yaml"] = Types, ["map/hexes.json"] = MovementTests.Board(), ["corridors.yaml"] = "corridors: []\n",["map/units_1948.yaml"] = "units:\n" + Row("brig_a") + Row("brig_b"), ["map/unit_anchor_hexes.yaml"] = Hexes,+ // R-ENEMY-007 (#2543): both rows start in the card's region, so the operation is met at once.+ ["regions.yaml"] = OperationRegions.Replace("{ q: 0, r: 0 }, { q: 1, r: 0 }]", "{ q: 0, r: 0 }, { q: 0, r: 1 }, { q: 1, r: 0 }]"),+ ["map/locality_hexes.yaml"] = "localities: []\n",}), new() { ["probe.yaml"] = card }));int a = c.StartingForces.FindIndex(f => f.Row == first), b = c.StartingForces.FindIndex(f => f.Row == second);var s = Simulation.NewGame(c, 1, Mode.Historical);@@ -933,45 +1315,37 @@ public class EnemyAITestsAssert.Equal(new[] { a, 9 }, r.State.Units.Values.Where(u => (u.Q, u.R) == (2, 0)).Select(u => u.Id).OrderBy(x => x));}- // 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).+ // R-ENEMY-007 changed this interaction: Golani at Nazareth is outside Horev's allowed southern regions, so delegation+ // postpones before R-ENEMY-005 can issue an order. The occupation and its last-garrison state remain untouched.[Fact]- public void HorevsOrderNeverTakesTheLastUnitOffNazareth()+ public void HorevPostponesWhileGolaniIsTheLastUnitAtNazareth(){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];+ var why = new List<Cause>(); var rejected = new List<Rejection>();+ EventSystem.Delegate(Real, s, why, rejected: rejected);+ Assert.Empty(rejected);+ Assert.Contains(why, x => x.Key == CauseKeys.OperationPostponed && x.Message.Contains("Golani Brigade"));+ Assert.Contains("operation_horev", s.PendingEvents);+ var golani = s.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);+ Assert.False(s.CardOrders.ContainsKey(0));+ Assert.Equal(SettlementControl.AwaitingEnd, s.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.+ // A second garrison does not satisfy R-ENEMY-007 either: the required Golani row itself must be in an allowed region.[Fact]- public void HorevsOrderGoesAheadWhenAnotherUnitHoldsNazareth()+ public void ASecondNazarethGarrisonDoesNotBypassHorevsPlacementRequirement(){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.Empty(r.Rejected);+ Assert.Contains(r.Why, x => x.Key == CauseKeys.OperationPostponed);+ Assert.Equal((Nazareth.Q, Nazareth.R, ""), (r.State.Units[0].Q, r.State.Units[0].R, r.State.Units[0].Order));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);}@@ -1033,11 +1407,255 @@ public class EnemyAITestsAssert.False(s.CardOrders.ContainsKey(second));}+ // R-ENEMY-007, the owner's rulings of 7 November 2026 ("Follow the launch (Recommended)", "Shift with Sinai+ // (Recommended)", "Wait, with a limit (Recommended)"), through the real content: the historical run to 15 December 1948,+ // with Golani taken back to its start hex (11, 11), outside Horev's regions. Horev is postponed on the 15 December and+ // 15 January turns. On 15 February the player refuses the Egyptian armistice and Golani stands in the southern coast, so+ // Horev launches two turns late; Rhodes and Sinai still come, on the turn after, though their windows closed in January;+ // holding El Arish then brings the Rafah card the turn after that, past its 17 March end.+ // Red without `follows` (the cards' own windows): neither Rhodes nor Sinai comes after a late launch.+ [Fact]+ public void ALateHorevStillBringsRhodesSinaiAndThenRafah()+ {+ var c = Real;+ var s = GoldenRun.Play(c, new DateTime(1948, 12, 15));+ Assert.Equal(new DateTime(1948, 12, 15), s.Date);+ Assert.Contains("operation_horev", s.PendingEvents);+ var golani = c.StartingForces.FindIndex(f => f.Row == "golani");+ s.Units[golani] = At(s.Units[golani], 11, 11);+ var horev = c.Events.Single(e => e.Id == "operation_horev").Options.Single(o => o.Id == "launch");+ Assert.False(EventSystem.OperationStatus(c, s, horev).Met);++ for (int turn = 0; turn < 2; turn++)+ {+ s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.Contains("operation_horev", s.PendingEvents);+ Assert.True(s.PostponedOperations.ContainsKey("operation_horev"));+ Assert.DoesNotContain("rhodes_talks", s.FiredEvents);+ Assert.DoesNotContain("sinai_withdrawal", s.FiredEvents);+ }+ Assert.Equal(new DateTime(1949, 2, 15), s.Date);+ Assert.Contains("armistice_egypt", s.PendingEvents);++ var south = c.PlayerRegions.Regions[horev.RequiresUnitRegions[0]].MemberHexes[0];+ s.Units[golani] = At(s.Units[golani], south.Q, south.R); // as the player's go-to would have brought it+ var r = Simulation.Step(c, s, new Command[] { new ChooseEventOption("armistice_egypt", "hold_out") });+ Assert.Empty(r.Rejected);+ s = r.State;+ Assert.Equal("launch", s.ChosenOptions["operation_horev"]);+ Assert.Equal(new DateTime(1949, 3, 15), s.Date);+ Assert.Contains("rhodes_talks", s.PendingEvents);+ Assert.Contains("sinai_withdrawal", s.PendingEvents);++ r = Simulation.Step(c, s, new Command[] { new ChooseEventOption("sinai_withdrawal", "hold_el_arish") });+ Assert.Empty(r.Rejected);+ Assert.Equal("hold_el_arish", r.State.ChosenOptions["sinai_withdrawal"]);+ Assert.Equal(new DateTime(1949, 4, 15), r.State.Date);+ Assert.Contains("rafah_force_pressure", r.State.PendingEvents);+ }++ // "Signing wins (Recommended)", "They drop (Recommended)": the same postponed Horev; on 15 February the armistice with+ // Egypt is signed and Golani is still away, so Horev lapses with its own reason, and Rhodes, Sinai and Rafah never come.+ [Fact]+ public void SigningTheEgyptianArmisticeLapsesAPendingHorevAndDropsItsFollowers()+ {+ var c = Real;+ var s = GoldenRun.Play(c, new DateTime(1948, 12, 15));+ var golani = c.StartingForces.FindIndex(f => f.Row == "golani");+ s.Units[golani] = At(s.Units[golani], 11, 11);+ for (int turn = 0; turn < 2; turn++) s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.Contains("armistice_egypt", s.PendingEvents);+ var r = Simulation.Step(c, s, new Command[] { new ChooseEventOption("armistice_egypt", "sign") });+ Assert.Empty(r.Rejected);+ Assert.Contains(r.Why, x => x.Key == CauseKeys.OperationLapsedSigned && x.Target == "operation_horev");+ s = r.State;+ Assert.DoesNotContain("operation_horev", s.PendingEvents);+ for (int turn = 0; turn < 3; turn++) s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ foreach (var id in new[] { "rhodes_talks", "sinai_withdrawal", "rafah_force_pressure" }) Assert.DoesNotContain(id, s.FiredEvents);+ }++ // "They drop (Recommended)": a following card not yet shown never comes once Egypt's armistice is signed. Sinai decided+ // with hold_el_arish on 15 April 1949, after its window: Rafah comes at that turn's end, unless Egypt has signed.+ // Red without the armistice_front filter in Trigger: Rafah comes after the signature too.+ [Theory]+ [InlineData(false, true)]+ [InlineData(true, false)]+ public void AFollowerNotYetShownDropsOnceItsFrontSigns(bool signed, bool comes)+ {+ var c = Real;+ var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);+ s.Date = new DateTime(1949, 4, 15);+ s.PendingEvents.Clear();+ foreach (var e in c.Events.Where(e => e.From <= s.Date)) s.FiredEvents.Add(e.Id); // everything earlier has had its turn+ s.FiredEvents.Remove("rafah_force_pressure");+ s.ChosenOptions["operation_horev"] = "launch";+ s.ChosenOptions["sinai_withdrawal"] = "hold_el_arish";+ if (signed) s.ChosenOptions["armistice_egypt"] = "sign";+ EventSystem.Trigger(c, s, new List<Cause>(), new DateTime(1949, 3, 15));+ Assert.Equal(comes, s.PendingEvents.Contains("rafah_force_pressure"));+ }++ // Q3, "Decide armistice first (Recommended)" (owner, 7 November 2026): while the operation's front has its armistice card+ // pending, the operation cannot be chosen, and its delegation postpones it with that reason; once the armistice is signed+ // it cannot be chosen either, and it lapses at the turn's end. Real content: Horev and Egypt's card on 15 February 1949,+ // Golani in place. Red without the check: Horev launches beside a pending armistice.+ [Fact]+ public void AnOperationWaitsForItsFrontsPendingArmistice()+ {+ var c = Real;+ var s = GoldenRun.Play(c, new DateTime(1948, 12, 15));+ var golani = c.StartingForces.FindIndex(f => f.Row == "golani");+ s.Units[golani] = At(s.Units[golani], 11, 11);+ for (int turn = 0; turn < 2; turn++) s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.Contains("armistice_egypt", s.PendingEvents);+ var launch = c.Events.Single(e => e.Id == "operation_horev").Options.Single(o => o.Id == "launch");+ var south = c.PlayerRegions.Regions[launch.RequiresUnitRegions[0]].MemberHexes[0];+ s.Units[golani] = At(s.Units[golani], south.Q, south.R);+ Assert.True(EventSystem.OperationStatus(c, s, launch).Met, "Golani stands in place");++ var chosen = s.Clone();+ Assert.Equal(EventSystem.RefusedOperationArmisticeFirst, EventSystem.Choose(c, chosen, "operation_horev", "launch", new List<Cause>()));+ Assert.Contains("operation_horev", chosen.PendingEvents);++ var delegated = s.Clone(); delegated.PendingEvents.Remove("armistice_egypt"); delegated.PendingEvents.Add("armistice_egypt"); // Horev first+ var why = new List<Cause>();+ EventSystem.Delegate(c, delegated, why);+ Assert.Contains(why, x => x.Key == CauseKeys.OperationWaitsForArmistice && x.Target == "operation_horev");+ Assert.False(delegated.ChosenOptions.ContainsKey("operation_horev"));++ var signed = s.Clone();+ Assert.Null(EventSystem.Choose(c, signed, "armistice_egypt", "sign", new List<Cause>()));+ Assert.Equal(EventSystem.RefusedOperationArmisticeSigned, EventSystem.Choose(c, signed, "operation_horev", "launch", new List<Cause>()));+ var refused = s.Clone();+ Assert.Null(EventSystem.Choose(c, refused, "armistice_egypt", "hold_out", new List<Cause>()));+ Assert.Null(EventSystem.Choose(c, refused, "operation_horev", "launch", new List<Cause>())); // decided first: Horev may go+ }++ // Q4, "Shift by the delay (Recommended)" (owner, 7 November 2026): a late launch's card orders end later by the time the+ // card waited, from its first postponement to the launch, instead of on the #2087 date. Real content: Horev postponed on+ // 15 December 1948 and launched on 15 February 1949, 62 days late; Golani's Julis anchor ends 24 February 1949, so its+ // order now ends 62 days later, on 27 April 1949. Red without the shift: the order ends on 24 February 1949.+ [Fact]+ public void ALateLaunchsOrdersEndLaterByItsDelay()+ {+ var c = Real;+ var s = GoldenRun.Play(c, new DateTime(1948, 12, 15));+ var golani = c.StartingForces.FindIndex(f => f.Row == "golani");+ s.Units[golani] = At(s.Units[golani], 11, 11);+ for (int turn = 0; turn < 2; turn++) s = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.Equal(new DateTime(1948, 12, 15), s.PostponedOperations["operation_horev"].Date);+ Assert.Null(EventSystem.Choose(c, s, "armistice_egypt", "hold_out", new List<Cause>()));+ var launch = c.Events.Single(e => e.Id == "operation_horev").Options.Single(o => o.Id == "launch");+ var south = c.PlayerRegions.Regions[launch.RequiresUnitRegions[0]].MemberHexes[0];+ s.Units[golani] = At(s.Units[golani], south.Q, south.R);+ Assert.Equal(new DateTime(1949, 2, 15), s.Date);+ Assert.Null(EventSystem.Choose(c, s, "operation_horev", "launch", new List<Cause>()));+ var normal = EventSystem.OrderEnds(c, launch.UnitOrders.Single(x => x.Unit == "golani"));+ Assert.Equal(new DateTime(1949, 2, 24), normal);+ Assert.Equal(normal!.Value.AddDays(62), s.CardOrders[golani]);+ Assert.Equal(new DateTime(1949, 4, 27), s.CardOrders[golani]);+ }++ // The owner's follow-up of 7 November 2026 on a late Ten Days during the truce: "Same as Latrun, -0.10 (Recommended)". A+ // late operation launched while a truce the player accepted is in force costs International Support+ // mvp.operation_truce_break_standing, as Latrun's offensive does. Real content: Ten Days on 15 July 1948 with Kiryati and+ // Carmeli out of its regions, the second truce complied with; both brigades back on the 15 August turn, so Ten Days+ // launches inside the truce. Red without the rule: no International Support line names Ten Days.+ [Fact]+ public void ALateOperationLaunchedInsideAnAcceptedTruceCostsInternationalSupport()+ {+ var c = Real;+ var cost = c.Rules.Mvp!.OperationTruceBreakStanding!.Value;+ Assert.Equal(-0.10, cost);+ var s = GoldenRun.Play(c, new DateTime(1948, 7, 15));+ Assert.Contains("ten_days", s.PendingEvents);+ Assert.Contains("second_truce", s.PendingEvents);+ var central = c.Events.Single(e => e.Id == "ten_days").Options.Single(o => o.Id == "central_front");+ var rows = central.UnitOrders.Select(x => x.Unit).Distinct().Select(row => c.StartingForces.FindIndex(f => f.Row == row)).ToList();+ var away = c.PlayerRegions.Regions["negev"].MemberHexes[0]; // not one of Ten Days' regions+ var home = rows.ToDictionary(id => id, id => (s.Units[id].Q, s.Units[id].R));+ foreach (var id in rows) s.Units[id] = At(s.Units[id], away.Q, away.R);+ var r = Simulation.Step(c, s, new Command[] { new ChooseEventOption("second_truce", "comply") });+ Assert.Empty(r.Rejected);+ s = r.State;+ Assert.True(s.PostponedOperations.ContainsKey("ten_days"));+ var place = c.PlayerRegions.Regions[central.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var id in rows) s.Units[id] = At(s.Units[id], place.Q, place.R);+ Assert.True(Combat.TruceInForce(s), "the second truce binds the player on 15 August 1948");+ r = Simulation.Step(c, s, Array.Empty<Command>());+ Assert.Equal("central_front", r.State.ChosenOptions["ten_days"]);+ var line = Assert.Single(r.Why, x => x.System == "events" && x.Target == "intl_standing" && x.Key == CauseKeys.EventAmount+ && x.Message.Contains("Ten Days"));+ Assert.Equal(cost, line.Delta, 9);+ }++ // The same rule never charges twice: Latrun's offensive already costs International Support for breaking the truce (its+ // own -0.10 effect), so chosen late inside the second truce it has that one line and no other. Red without the guard: two.+ [Fact]+ public void LatrunsOffensiveIsNotChargedTwiceForBreakingTheTruce()+ {+ var c = Real;+ var s = GoldenRun.Play(c, new DateTime(1948, 9, 15));+ Assert.True(Combat.TruceInForce(s), "the second truce binds the player on 15 September 1948");+ var e = c.Events.Single(x => x.Id == "latrun_proposal");+ var press = e.Options.Single(o => o.Id == "press_offensive");+ Assert.Contains(press.Effects, fx => fx.Target == "intl_standing" && fx.Delta < 0);+ s.PendingEvents.Remove(e.Id); s.PendingEvents.Add(e.Id); s.FiredEvents.Add(e.Id);+ s.PostponedOperations[e.Id] = new PostponedOperation(press.Id, s.Turn - 1, new DateTime(1948, 8, 15)); // waited a turn+ var place = c.PlayerRegions.Regions[press.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var row in press.UnitOrders.Select(x => x.Unit).Distinct())+ {+ var id = c.StartingForces.FindIndex(f => f.Row == row);+ s.Units[id] = At(s.Units[id], place.Q, place.R);+ }+ var why = new List<Cause>();+ Assert.Null(EventSystem.Choose(c, s, e.Id, press.Id, why));+ Assert.Single(why, x => x.Target == "intl_standing" && x.Key == CauseKeys.EventAmount);+ }++ // R-ENEMY-007 (owner, 7 November 2026: "Dateless variants (Recommended)", then "All approved (Recommended)"): a following+ // card that comes late, or an operation shown again while it waits, shows its late text once its own window has closed,+ // and its own text inside the window. Real content, the five cards with late text. Red without it: the dated text shows.+ [Theory]+ [InlineData("rhodes_talks")]+ [InlineData("sinai_withdrawal")]+ [InlineData("rafah_force_pressure")]+ [InlineData("operation_yoav")]+ [InlineData("operation_hiram")]+ public void ACardShownAfterItsWindowShowsItsLateText(string id)+ {+ var c = Real;+ var e = c.Events.Single(x => x.Id == id);+ Assert.NotEqual("", e.LateText); Assert.NotEqual("", e.LateTextHe);+ var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);+ s.Date = e.From;+ Assert.False(EventSystem.ShowsLate(e, s.Date));+ Assert.Equal(Cabinet.Fill(c, s, e.Text, EventSystem.FillDate(e, s.Date)), EventSystem.Render(c, s, e));+ s.Date = e.To!.Value;+ Assert.True(EventSystem.ShowsLate(e, s.Date));+ Assert.Equal(Cabinet.Fill(c, s, e.LateText, EventSystem.FillDate(e, s.Date)), EventSystem.Render(c, s, e));+ }++ // Late text belongs only on a card that can be shown after its window: a following card or an operation. On any other+ // card the loader refuses it, naming the field.+ [Fact]+ public void LateTextOnAnOrdinaryCardIsRefused()+ {+ var card = "id: plain\ntitle: Plain\ntext: Plain.\nlate_text: Later.\nfrom: 1948-05-15\nto: 1948-06-01\noptions:\n - id: ok\n text: Ok\n"+ + "sources: [{ url: \"https://example.org/event\", checked: 2026-10-18 }]\n";+ var e = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(Fixture.Gdd(new Dictionary<string, string>+ {+ ["unit_types.yaml"] = Types, ["map/hexes.json"] = MovementTests.Board(), ["corridors.yaml"] = "corridors: []\n",+ }), new() { ["plain.yaml"] = card })));+ Assert.Equal("events[plain].late_text", e.Field);+ Assert.Contains("only a following card or an operation card", e.Message);+ }+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>+ /// the first starting force) alone on Nazareth, which awaits the end of its occupation. The scenario uses the real+ /// gdd-0.1 content; operation placement and card-order handling are shared by both GDD ruleset identities.</summary>static GameState AloneInNazareth(string until){Assert.NotEqual(SaveGame.Gdd03Ruleset, Real.Ruleset);diff --git a/sim/Statecraft.Sim.Tests/Fixture.cs b/sim/Statecraft.Sim.Tests/Fixture.csindex 3333d76e7..de0c9fc5d 100644--- a/sim/Statecraft.Sim.Tests/Fixture.cs+++ b/sim/Statecraft.Sim.Tests/Fixture.cs@@ -298,6 +298,9 @@ mvp:fortify_defence_percent: 150hold_defence_percent: 120delegation_loyalty_floor: 5+ operation_wait_turns: 6+ operation_lapse_security: -0.01+ operation_truce_break_standing: -0.10disloyal_effect_share: 0.5move_cost: { coastal_plain: 1, hills: 2, desert: 3 }stack_limit: 2diff --git a/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.cs b/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.csindex dca9f97a1..9835e6e4d 100644--- a/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.cs@@ -39,7 +39,7 @@ public class Gdd03AssignmentFixtureTestsnew PopulationUnit(0, PopulationStatus.FreeCivilian, c.RequirePopulationInteger("reception.turns"), place,PopulationAssignment.Unassigned, CivilianProfession.None, CivilianTier.None, 0, "", 0, PopulationEquipment.None)));var state = PlayerRegions.CreateFixture(c,- new[] { new PlayerRegionPool(region, 3, 1m, 2, 2, Array.Empty<PlayerRegionFacility>()) }, people,+ PlayerRegionsContentTests.CompletePools(c, new PlayerRegionPool(region, 3, 1m, 2, 2, Array.Empty<PlayerRegionFacility>())), people,slots.Select(x => new PopulationTarget(x.Id, PopulationAssignmentKind.Work, region)), Array.Empty<string>(), Array.Empty<string>());var fixture = new Gdd03AssignmentFixture(c, state, slots);fixture.Assign(0, slots[0].Id); fixture.Assign(1, slots[1].Id);@@ -251,9 +251,9 @@ public class Gdd03AssignmentFixtureTestsvar rows = Enumerable.Range(0, people).Select(i => new PopulationInventoryRow("synthetic", i,new PopulationUnit(0, PopulationStatus.FreeCivilian, ticks, at, PopulationAssignment.Unassigned,CivilianProfession.None, CivilianTier.None, 0, "", 0, PopulationEquipment.None)));- var s = PlayerRegions.CreateFixture(c, new[] {+ var s = PlayerRegions.CreateFixture(c, PlayerRegionsContentTests.CompletePools(c,new PlayerRegionPool(RegionA, 0, 0m, industry, workshop, Array.Empty<PlayerRegionFacility>()),- new PlayerRegionPool(RegionB, 0, 0m, 0, 0, Array.Empty<PlayerRegionFacility>()) },+ new PlayerRegionPool(RegionB, 0, 0m, 0, 0, Array.Empty<PlayerRegionFacility>())),rows, slots.Select(x => new PopulationTarget(x.Id, PopulationAssignmentKind.Work, RegionA)),Array.Empty<string>(), Array.Empty<string>());return (s, new Gdd03AssignmentFixture(c, s, slots));@@ -315,9 +315,9 @@ public class Gdd03AssignmentFixtureTestsvar rows = Enumerable.Range(0, 4).Select(i => new PopulationInventoryRow("synthetic", i,new PopulationUnit(0, PopulationStatus.FreeCivilian, content.RequirePopulationInteger("reception.turns"), locations[i / 2],PopulationAssignment.Unassigned, CivilianProfession.None, CivilianTier.None, 0, "", 0, PopulationEquipment.None)));- var state = PlayerRegions.CreateFixture(content, new[] {+ var state = PlayerRegions.CreateFixture(content, PlayerRegionsContentTests.CompletePools(content,new PlayerRegionPool(RegionA, 2, 0m, 0, 0, new[] { new PlayerRegionFacility("synthetic-a-facility", "ramla", facilityKind, 1) }),- new PlayerRegionPool(RegionB, 2, 0m, 0, 0, new[] { new PlayerRegionFacility("synthetic-b-facility", "rishon_lezion", facilityKind, 1) }) },+ new PlayerRegionPool(RegionB, 2, 0m, 0, 0, new[] { new PlayerRegionFacility("synthetic-b-facility", "rishon_lezion", facilityKind, 1) })),rows, slots.Select((slot, i) => new PopulationTarget(slot.Id, PopulationAssignmentKind.Work, i < 2 ? RegionA : RegionB)),Array.Empty<string>(), Array.Empty<string>());var fixture = new Gdd03AssignmentFixture(content, state, slots);diff --git a/sim/Statecraft.Sim.Tests/Gdd03EventInventoryTests.cs b/sim/Statecraft.Sim.Tests/Gdd03EventInventoryTests.csindex 357d328bc..18e483b46 100644--- a/sim/Statecraft.Sim.Tests/Gdd03EventInventoryTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03EventInventoryTests.cs@@ -18,8 +18,8 @@ public class Gdd03EventInventoryTestsstatic string Num(double v) => v.ToString("G", CultureInfo.InvariantCulture);/// <summary>Every effect field of every option, in the card's own order: set_policy (by key), set_rung, effects, then- /// the structured grant_units, city_effects and unlock_projects, then unit_orders (R-ENEMY-005, not run under- /// gdd-0.3), debt_dollars (R-EFX-009, applied under gdd-0.3 only) and rejoin (R-ALT-009). Same-target effects keep+ /// the structured grant_units, city_effects and unlock_projects, then unit_orders (R-ENEMY-005; under gdd-0.3 too since+ /// R-ENEMY-007, #2543), debt_dollars (R-EFX-009, applied under gdd-0.3 only) and rejoin (R-ALT-009). Same-target effects keep/// their list index.</summary>static IEnumerable<(string Field, string Change)> Fields(EventOption o){@@ -68,11 +68,12 @@ public class Gdd03EventInventoryTestsforeach (var (field, change) in oldFields){rows++;- // R-ENEMY-005: a card's unit orders run under gdd-0.1 only; gdd-0.3 checks them and gives none (owner, #749).+ // R-ENEMY-005, R-ENEMY-007 (#2543): a card's unit orders run under both GDD rulesets, once the option's+ // operation units are in place (requires_unit_regions); the order itself is the same.var (target, delta) = m == null? ("legacy rulesets only (card excluded)", "none (not in play)"): field.StartsWith("unit_orders[", StringComparison.Ordinal)- ? ($"`{field}` (loaded, not run under gdd-0.3)", "none (no order given)")+ ? ($"`{field}` (same, once its units are in place: R-ENEMY-007)", change): ($"`{field}` (same)", change);sb.Append($"| `{e.Id}` | `{o.Id}` | `{field}` | {change} | {target} | {delta} | no |\n");}diff --git a/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs b/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.csindex f44a9b001..49a01262a 100644--- a/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03EventRulesTests.cs@@ -571,46 +571,42 @@ public class Gdd03EventRulesTests"law_of_return:d5d7f352eaa63e8f57a0f3fcdcbba82791e4ea3cd267afd8adee9d6b01a2f052", // re-pinned for #1065 (Beri's native Hebrew read), then for #2551 (R-TURN-002: `from` a turn earlier and its comment)"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: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)+ "operation_hiram:1c377312e7a71cd88e8ad943789259f8b0a6b146a2fa75843ac43a5fd4a0ea57", // 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), then for #2621 (the owner's "Add real orders", 7 November 2026: advance_into_lebanon's comment "No unit orders" goes, its new R-ENEMY-007 lines are left out of the pin), then for #2621 (the owner's "Dateless variants (Recommended)" and "All approved (Recommended)", 7 November 2026: late_text and late_text_he)+ "operation_horev:c1849834d9b34509fb96e22cc77c5a8c60167d5bf91b630ef96577621866e130", // 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), then for #2621 (the owner's "Reword it (Recommended)" and "All approved (Recommended)", 7 November 2026: the Nazareth sentence reworded for R-ENEMY-007, EN and HE)+ "operation_yoav:068b82fc97ed355e96225fd03bb5eec98e198e3a47c9bedf2a02f7f3f3d019e7", // 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), then for #2621 (the owner's "Dateless variants (Recommended)" and "All approved (Recommended)", 7 November 2026: late_text and late_text_he)+ "rafah_force_pressure:7375565a957129cb27c12d464806207e3b00196cde2759748f5692f4cc917036", // re-pinned for #1065 (owner's native read; flag removed in 05b5777d9), then for the stale reviewer comment (comment-only), then for #2621 (the owner's "Dateless variants (Recommended)" and "All approved (Recommended)", 7 November 2026: late_text and late_text_he), then for the owner's own re-sign after it (9665aac34: reviewed_on 2026-11-07)"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:0aa053313d9385bc8746fa1d7318883aab3d1d6706318ad978fc4cd97d98d898", // re-pinned for #1065 (Beri's native Hebrew read), then for #2551 (R-TURN-002: `from` a turn earlier and its comment)"reparations_vote:a79521d61ec59aa72a581b6598ecfade18e8d1e52dc25cef083078b0665a13b3",- "rhodes_talks:c5c9cdf906f75e2672e5eedaeadab7f224df96f666a3097813903b81ec06f4f6", // re-pinned for #1065 (Beri's native Hebrew read)+ "rhodes_talks:7692663150c6348e1ad889e38af30440948c54e5414a270eb35e25fbe111ee45", // re-pinned for #1065 (Beri's native Hebrew read), then for #2621 (the owner's "Dateless variants (Recommended)" and "All approved (Recommended)", 7 November 2026: late_text and late_text_he)"second_truce:22eeb171849bac248d58cec944c03bac6aee56c96a192aabf0aba2b7e02b19f6", // re-pinned for #1065 (Beri's native Hebrew read)- "sinai_withdrawal:4abcd39e509c3d404523f7a5609bdb8e1e5180c19524367790ba7adf0af9e06b", // re-pinned for #1065 (Beri's native Hebrew read)+ "sinai_withdrawal:f62d48c5e16f2c4805805e769b956bbe5e4f9037c3fa8fafa74758bbe870fc6a", // re-pinned for #1065 (Beri's native Hebrew read), then for #2621 (the owner's "Dateless variants (Recommended)" and "All approved (Recommended)", 7 November 2026: late_text and late_text_he)"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).+ // R-ENEMY-005, R-ENEMY-007: operation orders apply under both GDD identities once the required unit is in place.[Theory][InlineData(false)][InlineData(true)]- public void OperationCardOrdersApplyUnderGdd01Only(bool modern)+ public void OperationCardOrdersApplyUnderBothRulesetsWhenUnitsAreInPlace(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];+ var before = s.Units[0]; var option = c.Events.First(e => e.Id == "operation_horev").Options.First(o => o.Id == "launch");+ var at = c.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ s.Units[0] = new Unit(before.Id, before.Type, at.Q, at.R, before.Service, before.Side, before.Strength,+ before.Order, before.OrderTarget, before.HomeCity, before.Full, before.CombatXp);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.+ Assert.Equal((Movement.GoTo, "-8,28"), (after.Order, after.OrderTarget));+ }+ // R-ENEMY-005, R-CTRL-013: once the placement precondition is isolated, Golani alone on occupied Nazareth is held back+ // with RefusedLastGarrison under both GDD identities and the occupation continues.[Theory][InlineData(false)][InlineData(true)]- public void TheLastGarrisonRuleHoldsForAnOccupiedPlaceUnderGdd01Only(bool modern)+ public void TheLastGarrisonRuleHoldsForAnOccupiedPlaceUnderBothRulesets(bool modern){var c = Real(modern);Assert.Equal(modern, c.Ruleset == SaveGame.Gdd03Ruleset);@@ -621,16 +617,47 @@ public class Gdd03EventRulesTestss.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);+ var option = c.Events.First(e => e.Id == "operation_horev").Options.First(o => o.Id == "launch");+ var nazarethRegion = c.PlayerRegions.AtHex(nazareth.Q, nazareth.R)!.Id;+ if (!option.RequiresUnitRegions.Contains(nazarethRegion)) option.RequiresUnitRegions.Add(nazarethRegion); // isolate R-CTRL-013s.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 },+ Assert.Equal(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);}+ // R-ENEMY-005, R-CTRL-013, R-CTRL-016: the last-garrison rule guards only an occupied place. Once Nazareth is annexed it+ // is held for good with no garrison (R-CTRL-016), so Horev's order takes Golani away from it under both GDD identities.+ // mvp-annex-nazareth covered this before R-ENEMY-007; there Golani is now outside Horev's regions, so the placement+ // precondition is isolated as in the test above. Red without the Occupied/AwaitingEnd condition in+ // SettlementControl.LastGarrison: the order is refused with RefusedLastGarrison and Golani stays.+ [Theory]+ [InlineData(false)]+ [InlineData(true)]+ public void HorevsOrderTakesGolaniFromAnAnnexedNazarethUnderBothRulesets(bool modern)+ {+ var c = Real(modern);+ 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.Annexed, s.Date, turns: 3);+ var option = c.Events.First(e => e.Id == "operation_horev").Options.First(o => o.Id == "launch");+ var nazarethRegion = c.PlayerRegions.AtHex(nazareth.Q, nazareth.R)!.Id;+ if (!option.RequiresUnitRegions.Contains(nazarethRegion)) option.RequiresUnitRegions.Add(nazarethRegion); // isolate R-CTRL-013+ 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.DoesNotContain(rejected, j => j.Command is UnitOrder { Unit: 0 });+ Assert.Equal((Movement.GoTo, "-8,28"), (s.Units[0].Order, s.Units[0].OrderTarget));+ Assert.True(s.CardOrders.ContainsKey(0));+ Assert.Equal(SettlementControl.Annexed, 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]@@ -655,7 +682,11 @@ public class Gdd03EventRulesTestsAssert.Equal(SourceBytes.Select(x => x.Split(':')[0]), files.Select(Path.GetFileNameWithoutExtension));for (int i = 0; i < files.Length; i++){- var bytes = System.Text.Encoding.UTF8.GetBytes(File.ReadAllText(files[i]).Replace("\r\n", "\n"));+ // #2543 adds sourced operation-region metadata without changing the historical prose or its review record.+ // Preserve this byte pin over the pre-existing record by stripping only those rule-tagged lines.+ var sourceRecord = string.Join("\n", File.ReadAllText(files[i]).Replace("\r\n", "\n").Split('\n')+ .Where(line => !line.Contains("# R-ENEMY-007") && !line.TrimStart().StartsWith("requires_unit_regions:", StringComparison.Ordinal)));+ var bytes = System.Text.Encoding.UTF8.GetBytes(sourceRecord);Assert.Equal(SourceBytes[i].Split(':')[1], Convert.ToHexString(SHA256.HashData(bytes)).ToLowerInvariant());}}diff --git a/sim/Statecraft.Sim.Tests/Gdd03FieldHostTests.cs b/sim/Statecraft.Sim.Tests/Gdd03FieldHostTests.csindex a7ca1ea61..de80602d1 100644--- a/sim/Statecraft.Sim.Tests/Gdd03FieldHostTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03FieldHostTests.cs@@ -73,7 +73,10 @@ public class Gdd03FieldHostTestsAssert.Equal(10, negev.MemberLocations.Count);}- // Data only, under exact gdd-0.3 only: a new game initializes nothing, and the old identities never read the file.+ // Data only, under exact gdd-0.3 only: a new game initializes nothing, and the old identities read no host. Since+ // R-ENEMY-007 (#2543, the owner's "Both rulesets (Recommended)") gdd-0.1 reads regions.yaml for its geography (the+ // operations' regions), so the file is read, but no region carries a host there (mvp.md: "the legacy and gdd-0.1+ // identities read none of this").[Fact]public void HostsAreDataOnlyAndOldIdentitiesNeverReadThem(){@@ -81,11 +84,25 @@ public class Gdd03FieldHostTestsvar state = Simulation.NewGame(c, 1, Mode.Historical);Assert.Empty(state.PlayerRegions);Assert.False(state.PopulationLedger.IsInitialized);+ Assert.Contains(c.PlayerRegions.Regions.Values, r => r.FieldHosts.Count > 0);var reads = new List<string>();var old = PlayerRegionsContentTests.Load(Real, modern: false, onRead: reads.Add);Assert.Equal(SaveGame.GddRuleset, old.Ruleset);- Assert.DoesNotContain(PlayerRegionCatalogue.FileName, reads);- Assert.Empty(old.PlayerRegions.Regions);+ Assert.Contains(PlayerRegionCatalogue.FileName, reads);+ Assert.NotEmpty(old.PlayerRegions.Regions);+ Assert.All(old.PlayerRegions.Regions.Values, r => Assert.Empty(r.FieldHosts));+ }++ // The host checks are gdd-0.3's too: a host the loader refuses under exact gdd-0.3 is not read, so not refused, under+ // gdd-0.1. Red without the gate: gdd-0.1 refuses it.+ [Fact]+ public void OnlyExactGdd03ChecksTheHosts()+ {+ var row = Real.Split('\n').First(l => l.Contains("field: F01,", StringComparison.Ordinal));+ var bad = Real.Replace(row, row.Replace("host: rosh_pinna", "host: hanita"));+ Assert.Throws<ContentException>(() => PlayerRegionsContentTests.Load(bad));+ var old = PlayerRegionsContentTests.Load(bad, modern: false);+ Assert.All(old.PlayerRegions.Regions.Values, r => Assert.Empty(r.FieldHosts));}[Theory]@@ -128,6 +145,6 @@ public class Gdd03FieldHostTests{var c = PlayerRegionsContentTests.Load("player_regions:\n" + PlayerRegionsContentTests.RamlaRehovot.Replace(" member_locations:", " field_hexes: [{ q: -4, r: 24 }]\n member_locations:"));- Assert.Empty(Assert.Single(c.PlayerRegions.Regions).Value.FieldHosts);+ Assert.Empty(c.PlayerRegions.Regions["ramla_rehovot"].FieldHosts); // the synthetic row; the fixture adds the operation cards' regions (#2543)}}diff --git a/sim/Statecraft.Sim.Tests/Gdd03RegionAuthoringTests.cs b/sim/Statecraft.Sim.Tests/Gdd03RegionAuthoringTests.csindex 3eeedcd12..4feef866e 100644--- a/sim/Statecraft.Sim.Tests/Gdd03RegionAuthoringTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03RegionAuthoringTests.cs@@ -333,7 +333,7 @@ public class Gdd03RegionAuthoringTestswhile (true){ContentException? error = null;- try { Assert.Single(PlayerRegionsContentTests.Load(SingleRow(row)).PlayerRegions.Regions); }+ try { Assert.Contains(id, PlayerRegionsContentTests.Load(SingleRow(row)).PlayerRegions.Regions.Keys); }catch (ContentException e) { error = e; }if (error == null) break;Assert.Equal("regions.yaml", error.File);@@ -357,9 +357,10 @@ public class Gdd03RegionAuthoringTestspublic void ApprovedNamedPlaceProjectionsLoadWithoutClaimingFullExtents(){var c = PlayerRegionsContentTests.Load(Projections);- Assert.Equal(3, c.PlayerRegions.Regions.Count);+ var projectionIds = Rows(Parse(Projections), "player_regions").Select(r => Text(r, "id")!).ToArray();+ Assert.Equal(3, projectionIds.Length);var evidence = Rows(Parse(Evidence), "regions");- foreach (var region in c.PlayerRegions.Regions.Values)+ foreach (var region in projectionIds.Select(id => c.PlayerRegions.Regions[id])){var original = evidence.Single(r => Text(r, "id") == region.Id);Assert.Equal(Text(original, "capital_place_id"), region.CapitalLocation);@@ -505,25 +506,15 @@ public class Gdd03RegionAuthoringTests}[Fact]- public void OlderIdentityIgnoresAuthoredAndInvalidRegionContentAndKeepsManifestGoldens()+ public void Gdd01ConsumesAuthoredRegionsWhileLegacyStillIgnoresThem(){var reads = new List<string>();var authored = File.ReadAllText(Path.Combine(RealContentTests.ContentRoot(), "regions.yaml"));var old = LoadShipped(authored, reads.Add);- Assert.DoesNotContain("regions.yaml", reads);- Assert.DoesNotContain("map/locality_hexes.yaml", reads);- var absent = LoadShipped(null);- var incomplete = LoadShipped(Staged);- Assert.Equal(absent.Hash, old.Hash);- Assert.Equal(absent.Hash, incomplete.Hash);- Assert.Equal(Simulation.NewGame(absent, 1, Mode.Historical).Describe(),- Simulation.NewGame(old, 1, Mode.Historical).Describe());- var run1950 = GoldenRun.Play(old, GoldenRun.Until1950);- var run1952 = GoldenRun.Play(old, GoldenRun.Until1952);- Assert.Equal(GoldenManifest.Expected("hash1950"), run1950.Hash());- Assert.Equal(GoldenManifest.Expected("hash1952"), run1952.Hash());- Assert.Equal(GoldenSnapshot.Read("hash1950"), run1950.Describe());- Assert.Equal(GoldenSnapshot.Read("hash1952"), run1952.Describe());+ Assert.Contains("regions.yaml", reads);+ Assert.Contains("map/locality_hexes.yaml", reads);+ Assert.NotEmpty(old.PlayerRegions.Regions);+ Assert.Throws<ContentException>(() => LoadShipped(null));var files = new Dictionary<string, string>(Fixture.Files) { ["regions.yaml"] = Staged };Content Legacy() => ContentLoader.Load(rel => files.TryGetValue(rel, out var text) ? text : null, Array.Empty<string>());var legacy = Legacy();diff --git a/sim/Statecraft.Sim.Tests/Gdd03RegionalIsolationTests.cs b/sim/Statecraft.Sim.Tests/Gdd03RegionalIsolationTests.csindex 3b3acfc3b..344a67a21 100644--- a/sim/Statecraft.Sim.Tests/Gdd03RegionalIsolationTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03RegionalIsolationTests.cs@@ -43,7 +43,7 @@ public class Gdd03RegionalIsolationTests{var path = Path.Combine(root, rel);var text = File.Exists(path) ? File.ReadAllText(path) : null;- if (rel == PlayerRegionCatalogue.FileName && regions != null) return regions;+ if (rel == PlayerRegionCatalogue.FileName && regions != null) return PlayerRegionsContentTests.CompleteOperationRegions(regions);if (rel == "eras.yaml") return text!.Replace("loop: gdd", "loop: gdd, ruleset: gdd-0.3");if (marker && rel == "map/locations_1948.yaml") return text!.TrimEnd() + "\n" + RuralMarker;return text;@@ -53,7 +53,7 @@ public class Gdd03RegionalIsolationTestsstatic PlayerRegionPool Pool() => new PlayerRegionPool(A, 7, .4m, 3, 2,new[] { new PlayerRegionFacility("fixture-workshop", "rehovot", PlayerRegionFacilityKind.Workshop, 11) });- static GameState Fixture(Content c) => PlayerRegions.CreateFixture(c, new[] { Pool() },+ static GameState Fixture(Content c) => PlayerRegions.CreateFixture(c, PlayerRegionsContentTests.CompletePools(c, Pool()),new[] { new PopulationInventoryRow("fixture", 0, new PopulationUnit(0, PopulationStatus.FreeCivilian, 0,new PopulationLocation(A, -4, 24), PopulationAssignment.Unassigned, CivilianProfession.None, CivilianTier.None,0, "", 0, PopulationEquipment.None)) },diff --git a/sim/Statecraft.Sim.Tests/PlayerRegionsContentTests.cs b/sim/Statecraft.Sim.Tests/PlayerRegionsContentTests.csindex 201700ce3..dd5f1f94f 100644--- a/sim/Statecraft.Sim.Tests/PlayerRegionsContentTests.cs+++ b/sim/Statecraft.Sim.Tests/PlayerRegionsContentTests.cs@@ -28,27 +28,120 @@ public class PlayerRegionsContentTestsbinding_status: NEEDS-RESEARCHopening_control: { status: NEEDS-RESEARCH, value: null }";+ // The real operation cards are part of these loader fixtures. Keep their referenced region ids present so a test+ // aimed at one synthetic row reaches that row's own validation instead of failing first on unrelated event content.+ const string OperationRegions = @"+ - id: central_plain+ capital_location: rishon_lezion+ member_hexes: [{ q: -4, r: 23 }]+ member_locations: [rishon_lezion]+ design_note: 'Operation-card loader fixture; not a historical boundary'+ sources: ['test fixture: required by operation cards']+ capital_approval: NEEDS-RESEARCH+ binding_status: NEEDS-RESEARCH+ opening_control: { status: NEEDS-RESEARCH, value: null }+ - id: jerusalem_hills+ capital_location: jerusalem+ member_hexes: [{ q: 0, r: 26 }]+ member_locations: [jerusalem]+ design_note: 'Operation-card loader fixture; not a historical boundary'+ sources: ['test fixture: required by operation cards']+ capital_approval: NEEDS-RESEARCH+ binding_status: NEEDS-RESEARCH+ opening_control: { status: NEEDS-RESEARCH, value: null }+ - id: galilee+ capital_location: safed+ member_hexes: [{ q: 13, r: 6 }]+ member_locations: [safed]+ design_note: 'Operation-card loader fixture; not a historical boundary'+ sources: ['test fixture: required by operation cards']+ capital_approval: NEEDS-RESEARCH+ binding_status: NEEDS-RESEARCH+ opening_control: { status: NEEDS-RESEARCH, value: null }+ - id: southern_coast+ capital_location: gaza+ member_hexes: [{ q: -12, r: 31 }]+ member_locations: [gaza]+ design_note: 'Operation-card loader fixture; not a historical boundary'+ sources: ['test fixture: required by operation cards']+ capital_approval: NEEDS-RESEARCH+ binding_status: NEEDS-RESEARCH+ opening_control: { status: NEEDS-RESEARCH, value: null }+ - id: negev+ capital_location: beersheba+ member_hexes: [{ q: -10, r: 35 }]+ member_locations: [beersheba]+ design_note: 'Operation-card loader fixture; not a historical boundary'+ sources: ['test fixture: required by operation cards']+ capital_approval: NEEDS-RESEARCH+ binding_status: NEEDS-RESEARCH+ opening_control: { status: NEEDS-RESEARCH, value: null }+";+ internal static string? CompleteOperationRegions(string? regions)+ {+ if (regions == null || !System.Text.RegularExpressions.Regex.IsMatch(regions, @"(?m)^player_regions:\s*$")) return regions;+ var indentless = System.Text.RegularExpressions.Regex.IsMatch(regions, @"(?m)^- id:");+ var extra = string.Join("", OperationRegions.Split(new[] { "\n - id: " }, StringSplitOptions.None).Skip(1)+ .Select(row => "\n - id: " + row).Where(row =>+ {+ var id = row.Substring("\n - id: ".Length).Split('\n')[0];+ return !System.Text.RegularExpressions.Regex.IsMatch(regions, @"(?m)^\s*- id:\s*" + System.Text.RegularExpressions.Regex.Escape(id) + @"\s*$");+ }).Select(row => indentless ? System.Text.RegularExpressions.Regex.Replace(row, @"(?m)^ ", "") : row));+ // YamlStream.Save writes an explicit document end marker. Fixture rows must stay in that document, not be+ // appended after it as a second, marker-less document.+ var end = System.Text.RegularExpressions.Regex.Match(regions, @"(?m)^\.\.\.\s*$");+ if (!end.Success) return regions + extra;+ var before = regions.Substring(0, end.Index).TrimEnd();+ return before + "\n" + extra.Trim('\n') + "\n" + regions.Substring(end.Index);+ }++ internal static IEnumerable<PlayerRegionPool> CompletePools(Content c, params PlayerRegionPool[] pools)+ {+ var byId = pools.ToDictionary(x => x.Id, StringComparer.Ordinal);+ return c.PlayerRegions.Regions.Keys.Select(id => byId.TryGetValue(id, out var pool) ? pool+ : new PlayerRegionPool(id, 0, 0m, 0, 0, Array.Empty<PlayerRegionFacility>()));+ }internal static Content Load(string? regions = "player_regions:\n" + RamlaRehovot, bool modern = true,string? overrideText = null, Action<string>? onRead = null, bool localities = true, string? localityText = null){var root = RealContentTests.ContentRoot();+ // A no-geography fixture cannot load operation cards, whose requirements need geography. Every event that requires+ // one of them, directly or through another left-out event, leaves too, so the event graph stays valid; every other+ // real event stays (each event's id is its file name).+ var texts = Directory.GetFiles(Path.Combine(root, "events"), "*.yaml")+ .ToDictionary(p => Path.GetFileNameWithoutExtension(p), File.ReadAllText, StringComparer.Ordinal);+ var left = new HashSet<string>(StringComparer.Ordinal);+ if (regions == null)+ {+ foreach (var kv in texts) if (kv.Value.Contains("requires_unit_regions:", StringComparison.Ordinal)) left.Add(kv.Key);+ for (bool grew = true; grew;)+ {+ grew = false;+ foreach (var kv in texts)+ if (!left.Contains(kv.Key) && left.Any(id => kv.Value.Contains("event: " + id + ",", StringComparison.Ordinal)+ || kv.Value.Contains("event: " + id + " ", StringComparison.Ordinal)+ || kv.Value.Contains("event: " + id + "}", StringComparison.Ordinal)))+ { left.Add(kv.Key); grew = true; }+ }+ }+ var eventFiles = texts.Keys.Where(id => !left.Contains(id)).OrderBy(id => id, StringComparer.Ordinal).Select(id => "events/" + id + ".yaml");return ContentLoader.Load(rel =>{onRead?.Invoke(rel);- if (rel == PlayerRegionCatalogue.FileName) return regions;+ if (rel == PlayerRegionCatalogue.FileName) return CompleteOperationRegions(regions);if (rel == MapOverrides.FileName) return overrideText;if (!localities && rel == PlayerRegionCatalogue.LocalityHexesFileName) return null;if (localityText != null && rel == PlayerRegionCatalogue.LocalityHexesFileName) return localityText;var path = Path.Combine(root, rel);var text = File.Exists(path) ? File.ReadAllText(path) : null;return modern && rel == "eras.yaml" ? text!.Replace("loop: gdd", "loop: gdd, ruleset: gdd-0.3") : text;- }, Directory.GetFiles(Path.Combine(root, "events"), "*.yaml").Select(p => "events/" + Path.GetFileName(p)));+ }, eventFiles);}[Fact]public void SharedHexRetainsTwoPlaceIdentitiesAndOneCapital(){- var c = Load(); var r = Assert.Single(c.PlayerRegions.Regions).Value;+ var c = Load(); var r = c.PlayerRegions.Regions["ramla_rehovot"];Assert.Equal("ramla_rehovot", r.Id); Assert.Equal("NEEDS-RESEARCH", r.CapitalApproval);Assert.Equal("NEEDS-RESEARCH", r.BindingStatus); Assert.Null(r.OpeningController);Assert.Equal(new[] { "ramla", "rehovot" }, r.MemberLocations);@@ -190,7 +283,7 @@ public class PlayerRegionsContentTestspublic void LocalityAndSiteMembersAreAcceptedOnTheirOwnHexes(){var c = Load("player_regions:\n" + LocalityAndSite);- var r = Assert.Single(c.PlayerRegions.Regions).Value;+ var r = c.PlayerRegions.Regions["upper_galilee"];Assert.Equal(new[] { "kiryat_shmona", "tarshiha" }, r.MemberLocations);Assert.Same(r, c.PlayerRegions.AtLocation("tarshiha"));Assert.Same(r, c.PlayerRegions.AtLocation("kiryat_shmona"));@@ -219,9 +312,9 @@ public class PlayerRegionsContentTests[Fact]public void FieldHexesAreOptionalAndLoadOnTheRegionsOwnHexes(){- Assert.Empty(Assert.Single(Load().PlayerRegions.Regions).Value.FieldHexes); // absent: none+ Assert.Empty(Load().PlayerRegions.Regions["ramla_rehovot"].FieldHexes); // absent: nonevar c = Load("player_regions:\n" + RamlaRehovot.Replace(" member_locations:", " field_hexes: [{ q: -4, r: 24 }]\n member_locations:"));- Assert.Equal(new[] { (-4, 24) }, Assert.Single(c.PlayerRegions.Regions).Value.FieldHexes);+ Assert.Equal(new[] { (-4, 24) }, c.PlayerRegions.Regions["ramla_rehovot"].FieldHexes);}[Theory]@@ -289,23 +382,22 @@ public class PlayerRegionsContentTests{var real = File.ReadAllText(Path.Combine(RealContentTests.ContentRoot(), PlayerRegionCatalogue.LocalityHexesFileName));Assert.EndsWith("\n", real);- if (field == null) { Assert.Single(Load("player_regions:\n" + region, localityText: real + locality).PlayerRegions.Regions); return; }+ if (field == null) { Assert.Contains("ramla_rehovot", Load("player_regions:\n" + region, localityText: real + locality).PlayerRegions.Regions.Keys); return; }var e = Assert.Throws<ContentException>(() => Load("player_regions:\n" + region, localityText: real + locality));Assert.Equal("regions.yaml: player_regions[0]." + field + ": one place id has inconsistent placements across the place files", e.Message);}[Fact]- public void OnlyExactNewIdentityConsumesAndHashesGeography()+ public void BothGddIdentitiesConsumeAndHashGeographyButLegacyDoesNot(){var reads = new List<string>();var old = Load(modern: false, onRead: reads.Add);- Assert.DoesNotContain("regions.yaml", reads); Assert.Empty(old.PlayerRegions.Regions);- Assert.DoesNotContain(PlayerRegionCatalogue.LocalityHexesFileName, reads);- Assert.Equal(old.Hash, Load("malformed: [", modern: false, localities: false).Hash);+ Assert.Contains("regions.yaml", reads); Assert.NotEmpty(old.PlayerRegions.Regions);+ Assert.Contains(PlayerRegionCatalogue.LocalityHexesFileName, reads);+ Assert.NotEqual(old.Hash, Load("player_regions:\n" + RamlaRehovot + "\n# consumed by gdd-0.1 operations\n", modern: false).Hash);reads.Clear();Load(onRead: reads.Add);Assert.Contains(PlayerRegionCatalogue.LocalityHexesFileName, reads);- Assert.Equal(old.Hash, Load("malformed: [", modern: false).Hash);Assert.NotEqual(Load().Hash, Load("player_regions:\n" + RamlaRehovot + "\n# consumed provenance\n").Hash);// Under gdd-0.3 the locality hexes are a hash input: one locality off the fixture's members moved by one hex.var localities = File.ReadAllText(Path.Combine(RealContentTests.ContentRoot(), PlayerRegionCatalogue.LocalityHexesFileName));diff --git a/sim/Statecraft.Sim.Tests/PlayerRegionsTests.cs b/sim/Statecraft.Sim.Tests/PlayerRegionsTests.csindex b57eba3eb..9f10e2202 100644--- a/sim/Statecraft.Sim.Tests/PlayerRegionsTests.cs+++ b/sim/Statecraft.Sim.Tests/PlayerRegionsTests.cs@@ -21,18 +21,18 @@ public class PlayerRegionsTestsstatic PopulationTarget[] Targets() => new[] { new PopulationTarget("fixture-a-job", PopulationAssignmentKind.Work, A),new PopulationTarget("fixture-b-job", PopulationAssignmentKind.Work, B) };static GameState State(Content c, IEnumerable<PlayerRegionPool>? pools = null, bool reverse = false) =>- PlayerRegions.CreateFixture(c, pools ?? new[] { Pool(A), Pool(B) }, People(reverse), Targets(), Array.Empty<string>(), Array.Empty<string>());+ PlayerRegions.CreateFixture(c, PlayerRegionsContentTests.CompletePools(c, (pools ?? new[] { Pool(A), Pool(B) }).ToArray()), People(reverse), Targets(), Array.Empty<string>(), Array.Empty<string>());[Fact]public void OneRegionBaselineAndTwoRegionPoolsDoNotUseTownAggregates(){var c = PlayerRegionsContentTests.Load();- var one = PlayerRegions.CreateFixture(c, new[] { Pool(A) }, People().Take(1), Targets().Take(1), Array.Empty<string>(), Array.Empty<string>());- Assert.Single(one.PlayerRegions); Assert.Empty(one.Cities);+ var one = PlayerRegions.CreateFixture(c, PlayerRegionsContentTests.CompletePools(c, Pool(A)), People().Take(1), Targets().Take(1), Array.Empty<string>(), Array.Empty<string>());+ Assert.Contains(A, one.PlayerRegions.Keys); Assert.Empty(one.Cities);Assert.Equal(1, PlayerRegions.PresentPopulation(one, A));Assert.Equal(7, one.PlayerRegions[A].OrdinaryHousing);var two = State(Content());- Assert.Equal(new[] { B, A }, two.PlayerRegions.Keys);+ Assert.Equal(new[] { B, A }, two.PlayerRegions.Keys.Where(id => id == A || id == B));Assert.Equal(1, PlayerRegions.PresentPopulation(two, A)); Assert.Equal(1, PlayerRegions.PresentPopulation(two, B));Assert.Equal(2, two.PopulationLedger.Units.Count); two.PopulationLedger.Reconcile();Assert.Throws<ArgumentException>(() => PlayerRegions.PresentPopulation(two, "rehovot"));@@ -115,7 +115,7 @@ public class PlayerRegionsTestsvar twin = new PlayerRegionFacility("fixture-facility", "rishon_lezion", PlayerRegionFacilityKind.Industry, 1);Assert.Equal("Facility must have one owning region and a member location.",Assert.Throws<ArgumentException>(() => State(c, new[] { Pool(A, facilities: new[] { f }), Pool(B, facilities: new[] { twin }) })).Message);- Assert.Throws<ArgumentException>(() => State(c, new[] { Pool(A) }));+ Assert.Throws<ArgumentException>(() => PlayerRegions.CreateFixture(c, new[] { Pool(A) }, People(), Targets(), Array.Empty<string>(), Array.Empty<string>()));Assert.Throws<ArgumentException>(() => State(c, new[] { Pool(A), Pool(B), Pool(B) }));var outside = new PlayerRegionFacility("fixture-facility", "tiberias", PlayerRegionFacilityKind.Industry, 1);Assert.Throws<ArgumentException>(() => State(c, new[] { Pool(A, facilities: new[] { outside }), Pool(B) }));diff --git a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs b/sim/Statecraft.Sim.Tests/PlayerTextTests.csindex a8f33be19..c9eecac8a 100644--- a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs+++ b/sim/Statecraft.Sim.Tests/PlayerTextTests.cs@@ -23,8 +23,7 @@ public class PlayerTextTestss = r.State;}return messages;- }-+}[Fact]public void NoCauseInTheHistoricalRunShowsAContentIdOrAnIsoDate(){@@ -151,6 +150,25 @@ public class PlayerTextTestsg.Date = e.From;ContentWindows.Update(c, g, start);g.PendingEvents.Clear(); g.PendingEvents.Add(e.Id);+ if (o.RequiresUnitRegions.Count != 0)+ {+ var at = c.PlayerRegions.Regions[o.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var unitOrder in o.UnitOrders)+ {+ int unitId = c.StartingForces.FindIndex(f => f.Row == unitOrder.Unit);+ var force = c.StartingForces[unitId];+ var unit = g.Units.TryGetValue(unitId, out var present) ? present+ : new Unit(unitId, force.Type, force.Q, force.R, side: force.Side, strength: force.Strength);+ g.Units[unitId] = new Unit(unit.Id, unit.Type, at.Q, at.R, unit.Service, unit.Side, unit.Strength,+ unit.Order, unit.OrderTarget, unit.HomeCity, unit.Full, unit.CombatXp);+ }+ // This fixture exercises each option's cause text, not the separate refused-card-order contract.+ // Give every staged operation a legal card order by clearing enemy holders from its authored targets.+ foreach (var target in o.UnitOrders)+ foreach (var held in g.Units.Values.Where(u => u.Side != Movement.PlayerSide+ && (u.Q, u.R) == (target.Q, target.R)).Select(u => u.Id).ToList())+ g.Units.Remove(held);+ }var r = Simulation.Step(c, g, new Command[] { new ChooseEventOption(e.Id, o.Id) });Assert.Empty(r.Rejected);causes.AddRange(r.Why);diff --git a/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs b/sim/Statecraft.Sim.Tests/ReferencePlayerTests.csindex 59d38f587..965b83dbd 100644--- a/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs+++ b/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs@@ -42,12 +42,13 @@ public class ReferencePlayerTestss.Cities["tel_aviv"] = s.Cities["tel_aviv"].WithCounts(248, 96, 0); // the start fills every job (Q-START-1): free 10var orders = ReferencePlayer.Commands(Mvp, s);var history = HistoricalAI.Commands(Mvp, s);- Assert.Equal(history.Select(x => x.Kind), orders.Take(history.Count).Select(x => x.Kind));- Assert.Equal(history.Count + 2, orders.Count);+ var carriedHistory = history.Where(x => x is not UnitOrder { Unit: 0, Order: Movement.GoTo }).ToList();+ Assert.Equal(carriedHistory.Select(x => x.Kind), orders.Take(carriedHistory.Count).Select(x => x.Kind));+ Assert.Equal(carriedHistory.Count + 2, orders.Count);Assert.DoesNotContain(orders, x => x is AssignWorkers);// The attack policy (#747): unit 0 (strength 5 here, on 11,11) meets the Iraqi unit next to it (3, on 11,12) at// 166 percent, past the policy's 150. At 4.4 km the Syrian start anchor is two hexes away (#1183).- var attack = Assert.IsType<UnitOrder>(orders[history.Count]);+ var attack = Assert.IsType<UnitOrder>(orders[carriedHistory.Count]);Assert.Equal((0, Combat.Attack, (int?)11, (int?)12), (attack.Unit, attack.Order, attack.Q, attack.R));var train = Assert.IsType<Train>(orders.Last());Assert.Equal(("tel_aviv", "halutz", 1), (train.City, train.Track, train.Count)); // 152 civilians without work@@ -57,19 +58,20 @@ public class ReferencePlayerTestsAssert.Equal((247, 106, true), (city.Civilians, city.Employed, city.JobsDefault)); // min(106 jobs, 247 civilians)}- /// <summary>The real start: the 15 May cards (degania_defence and idf_founding) are answered first, at full war's price.+ /// <summary>The real start: free operation-staging orders precede the 15 May cards (degania_defence and idf_founding),+ /// which are both answered at full war's price./// The cities start with every job filled (Q-START-1: job slots equal the start employed), so no AssignWorkers takes/// Attention. Answering both cards uses that turn's 4 Attention (Q-CUT-5), so the halutz group is not trained on the/// first turn; the player first trains on 15 August 1948. Before #1565 added degania_defence it trained on 15 May 1948;/// the owner accepted the shift on 24 October 2026 ("Accept the shift", #1568). Every order it sends is taken.</summary>[Fact]- public void OnTheRealStartItAnswersTheCardFirstAndTrainsWhenAttentionAllows()+ public void OnTheRealStartItStagesOperationsThenAnswersCardsAndTrainsWhenAttentionAllows(){var s = Simulation.NewGame(Mvp, GoldenRun.Seed, Mode.Historical);Assert.Contains("idf_founding", s.PendingEvents);Assert.Contains("degania_defence", s.PendingEvents);var first = ReferencePlayer.Commands(Mvp, s);- Assert.IsType<ChooseEventOption>(first[0]);+ Assert.Contains(first.TakeWhile(x => x is not ChooseEventOption), x => x is UnitOrder { Order: Movement.GoTo });Assert.Equal(new[] { "degania_defence", "idf_founding" }, first.OfType<ChooseEventOption>().Select(x => x.EventId).OrderBy(id => id, StringComparer.Ordinal));Assert.DoesNotContain(first, x => x is AssignWorkers);Assert.DoesNotContain(first, x => x is Train);@@ -220,9 +222,11 @@ public class ReferencePlayerTestsvar tired = s.Clone();tired.Attention = 0;Assert.NotEmpty(ReferencePlayer.Commands(Mvp, tired));- Assert.All(ReferencePlayer.Commands(Mvp, tired), x => Assert.Equal(Combat.Attack, Assert.IsType<UnitOrder>(x).Order)); // unit orders are free (D-A6)+ Assert.All(ReferencePlayer.Commands(Mvp, tired), x =>+ Assert.Contains(Assert.IsType<UnitOrder>(x).Order, new[] { Combat.Attack, Movement.GoTo })); // both unit orders are free (D-A6)tired.Arms = 0;- Assert.Empty(ReferencePlayer.Commands(Mvp, tired)); // and the attack needs the Arms+ Assert.NotEmpty(ReferencePlayer.Commands(Mvp, tired));+ Assert.All(ReferencePlayer.Commands(Mvp, tired), x => Assert.Equal(Movement.GoTo, Assert.IsType<UnitOrder>(x).Order)); // attacks need Arms; staging does not}/// <summary>With more jobs than civilians, the default (not the player) fills no more jobs than there are civilians.</summary>diff --git a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.csindex a66cc0372..aed46d8c2 100644--- a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs+++ b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs@@ -116,7 +116,7 @@ public class RemainingCauseKeysTestssites++;}}- Assert.Equal(126, sites); // 126 with #2558: EconomySystem.MoneyLine, the event Debt line worded for the Money row; 125 with #1711's CityHeld (R-CITY-010); 124 with #2534's enemy attack-order line (Combat.Give marks the order's own cause); 123 with #2471's gdd-0.3 field Food line (R-FIELD-002); 122 with #2527's FoodImported and the conversion's fx_reserves line; 120 with #2457's event Debt line (R-EFX-009); 119 with #1700 slice B's ProjectBuilderFreed; 118 with #1700's builders (R-CITY-011: two ProjectBuilder lines, ProjectWaiting, the build order's job-default line); 114 with #1703's gdd-0.3 housing surcharge and housing cohesion lines; 112 with the arms workshops' five (R-ARMS-005 with its job-default line, R-ARMS-006; #1701); 107 with R-MONEY-004's DollarsConverted (#813); 106 since #2212: EconomySystem.OtherMoney's line (105 since #2199: PayOrBorrow's Paid line)+ Assert.Equal(129, sites); // 129 with R-ENEMY-007's truce-break line (a late operation inside an accepted truce, #2543); 128 with R-ENEMY-007's lapse cost (Q8, the event-amount Security line of a lapsed operation, #2543); 127 with R-ENEMY-007's keyed postponed/lapsed operation producer (#2543); 126 with #2558: EconomySystem.MoneyLine, the event Debt line worded for the Money row; 125 with #1711's CityHeld (R-CITY-010); 124 with #2534's enemy attack-order line (Combat.Give marks the order's own cause); 123 with #2471's gdd-0.3 field Food line (R-FIELD-002); 122 with #2527's FoodImported and the conversion's fx_reserves line; 120 with #2457's event Debt line (R-EFX-009); 119 with #1700 slice B's ProjectBuilderFreed; 118 with #1700's builders (R-CITY-011: two ProjectBuilder lines, ProjectWaiting, the build order's job-default line); 114 with #1703's gdd-0.3 housing surcharge and housing cohesion lines; 112 with the arms workshops' five (R-ARMS-005 with its job-default line, R-ARMS-006; #1701); 107 with R-MONEY-004's DollarsConverted (#813); 106 since #2212: EconomySystem.OtherMoney's line (105 since #2199: PayOrBorrow's Paid line)}[Fact]diff --git a/sim/Statecraft.Sim.Tests/SchemaTests.cs b/sim/Statecraft.Sim.Tests/SchemaTests.csindex 3d3cd4646..48d8c7f7c 100644--- a/sim/Statecraft.Sim.Tests/SchemaTests.cs+++ b/sim/Statecraft.Sim.Tests/SchemaTests.cs@@ -29,7 +29,7 @@ public class SchemaTestsstatic readonly HashSet<string> Supported = new HashSet<string>{"$schema", "$ref", "title", "description", "definitions", "type", "properties", "additionalProperties", "required",- "items", "minItems", "minLength", "pattern", "minimum", "exclusiveMinimum", "maximum", "enum",+ "items", "minItems", "uniqueItems", "minLength", "pattern", "minimum", "exclusiveMinimum", "maximum", "enum","allOf", "oneOf", "not", "const",};@@ -90,6 +90,9 @@ public class SchemaTestselse if (value is JsonArray arr){if (schema.TryGetProperty("minItems", out var mi) && arr.Count < mi.GetInt32()) errors.Add($"{path}: needs at least {mi.GetInt32()} entries");+ if (schema.TryGetProperty("uniqueItems", out var ui) && ui.GetBoolean())+ for (int i = 0; i < arr.Count; i++)+ if (arr.Take(i).Any(x => JsonNode.DeepEquals(x, arr[i]))) { errors.Add($"{path}[{i}]: duplicate entry"); break; }if (schema.TryGetProperty("items", out var items))for (int i = 0; i < arr.Count; i++) Check(items, root, arr[i], $"{path}[{i}]", errors);}@@ -361,6 +364,16 @@ people:Assert.Contains(Errors("event.schema.json", good.Replace("https://", "http://")), e => e.Contains("does not match"));}+ [Fact]+ public void OperationRegionsRequireOneOrMoreUniqueNonemptyIds()+ {+ const string card = "id: e\ntitle: T\ntext: X\nfrom: 1950-01-01\noptions:\n - id: a\n text: A\n requires_unit_regions: REGIONS\nsources: [{ url: \"https://example.org\", checked: 2026-10-09 }]\n";+ Assert.Empty(Errors("event.schema.json", card.Replace("REGIONS", "[galilee]")));+ Assert.Contains(Errors("event.schema.json", card.Replace("REGIONS", "[]")), e => e.Contains("at least 1"));+ Assert.Contains(Errors("event.schema.json", card.Replace("REGIONS", "[galilee, galilee]")), e => e.Contains("duplicate entry"));+ Assert.Contains(Errors("event.schema.json", card.Replace("REGIONS", "['']")), e => e.Contains("must not be empty"));+ }+// R-EFX-009 (review on #2487): debt_dollars is "more than 0", as the loader checks.[Fact]public void DebtDollarsMustBeMoreThanZero()diff --git a/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs b/sim/Statecraft.Sim.Tests/SliceSmokeTests.csindex 39eea58f4..e0cad4cb9 100644--- a/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs+++ b/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs@@ -33,7 +33,8 @@ public class SliceSmokeTestsdelegate List<Command> Policy(Content c, GameState s, int turn);- /// <summary>What GameRoot.Smoke does (GoldenRun.SmokeOrders, shared with Unity's golden check).</summary>+ /// <summary>What GameRoot.Smoke does (GoldenRun.SmokeOrders, shared with Unity's golden check): first options only, while+ /// the Attention pays and their operation units are in place at the turn's start.</summary>static List<Command> FirstOption(Content c, GameState s, int turn) => GoldenRun.SmokeOrders(c, s);/// <summary>The golden runs' player (GoldenRun.Orders): HistoricalAI's orders, then the reference player's GDD orders.</summary>@@ -239,6 +240,74 @@ public class SliceSmokeTestsAssert.Equal(straight.Hashes, run.Hashes); // reloading every turn changes nothing}+ /// <summary>#2621 (R-ENEMY-007): the smoke plays what the WebGL ?smoke run's GameRoot.Smoke can press. The event card+ /// enables an option from the turn-start state (EventCardPresenter: OperationStatus on bridge.State), and the smoke gives+ /// no unit orders, so a first option whose units are not in place at the turn's start is not pressed: the smoke stops+ /// there, as it does when the Attention runs out, and the rest of the turn's cards go to their ministers.</summary>+ [Fact]+ public void TheSmokeAnswersOnlyFirstOptionsWhoseUnitsAreInPlaceAtTheTurnStart()+ {+ var s = Simulation.NewGame(Real, GoldenRun.Seed, Mode.Historical);+ int unmet = 0;+ for (int turn = 0; turn < 5; turn++)+ {+ var orders = GoldenRun.SmokeOrders(Real, s);+ Assert.All(orders, o => Assert.IsType<ChooseEventOption>(o)); // the smoke skips every unit: no Move, no go-to+ var shown = Simulation.Preview(Real, s, Array.Empty<Command>()).State; // what the card shows (SimBridge.State)+ var expected = new List<Command>();+ var left = s.Attention;+ foreach (var e in s.PendingEvents.Select(id => Real.Events.First(x => x.Id == id)))+ {+ var cmd = new ChooseEventOption(e.Id, e.Options[0].Id);+ var price = AttentionSystem.Cost(Real, s, cmd.Kind);+ if (price > left + 1e-9) break;+ if (!EventSystem.OperationStatus(Real, shown, e.Options[0]).Met) { unmet++; break; }+ left -= price;+ expected.Add(cmd);+ }+ Assert.Equal(expected.Cast<ChooseEventOption>().Select(x => (x.EventId, x.OptionId)),+ orders.Cast<ChooseEventOption>().Select(x => (x.EventId, x.OptionId)));+ s = Simulation.Step(Real, s, orders).State;+ }+ Assert.True(unmet > 0, "the five turns hold a first option whose units are not in place (ten_days' central_front)");+ }++ /// <summary>#2621 review: the card enables an option from what the screen shows (SimBridge.State), which with a unit+ /// on a standing go-to is the no-orders preview (the routes have moved). So the smoke judges a first option's units on+ /// that preview too, and the turn's resolution (EventSystem.Choose's re-check after the routes) takes the same answer.+ /// Here ten_days' central_front is unmet at the turn start, and each missing unit gets a standing go-to into its+ /// region that it reaches this turn.</summary>+ [Fact]+ public void TheSmokeJudgesAnOperationOnTheStateTheCardShows()+ {+ var s = Simulation.NewGame(Real, GoldenRun.Seed, Mode.Historical);+ var ten = Real.Events.First(e => e.Id == "ten_days");+ var central = ten.Options[0];+ Assert.Equal("central_front", central.Id);+ for (int turn = 0; turn < 12 && !(s.PendingEvents.Contains(ten.Id) && !EventSystem.OperationStatus(Real, s, central).Met); turn++)+ s = Simulation.Step(Real, s, GoldenRun.SmokeOrders(Real, s)).State;+ var status = EventSystem.OperationStatus(Real, s, central);+ Assert.True(s.PendingEvents.Contains(ten.Id) && !status.Met, "the smoke reaches a ten_days turn with central_front unmet");+ var staged = s.Clone();+ foreach (var need in status.Missing)+ {+ int id = Real.StartingForces.FindIndex(f => f.Row == need.Unit);+ var u = staged.Units[id];+ var to = Movement.Reachable(Real, staged, id).Keys.OrderBy(h => h.Q).ThenBy(h => h.R)+ .Where(h => Real.PlayerRegions.AtHex(h.Q, h.R) is PlayerRegionGeography g && need.Regions.Contains(g.Id, StringComparer.Ordinal))+ .Cast<(int Q, int R)?>().FirstOrDefault();+ Assert.True(to != null, $"{need.Unit} can reach its region this turn");+ staged.Units[id] = new Unit(u.Id, u.Type, u.Q, u.R, u.Service, u.Side, u.Strength, Movement.GoTo,+ FormattableString.Invariant($"{to!.Value.Q},{to.Value.R}"), u.HomeCity, u.Full, u.CombatXp);+ }+ var shown = Simulation.Preview(Real, staged, Array.Empty<Command>()).State;+ Assert.True(EventSystem.OperationStatus(Real, shown, central).Met, "the routes bring the units into place in the shown state");+ var orders = GoldenRun.SmokeOrders(Real, staged);+ Assert.Contains(orders, o => o is ChooseEventOption x && x.EventId == ten.Id && x.OptionId == central.Id);+ var after = Simulation.Step(Real, staged, orders).State;+ Assert.Equal(central.Id, after.ChosenOptions[ten.Id]); // the resolution's re-check after the routes takes it too+ }+[Fact]public void TheFirstOptionSmokeRunPlaysTheWholeSliceCleanly(){diff --git a/sim/Statecraft.Sim.Tests/StartingForcesTests.cs b/sim/Statecraft.Sim.Tests/StartingForcesTests.csindex caa700f6e..dbc8fb95d 100644--- a/sim/Statecraft.Sim.Tests/StartingForcesTests.cs+++ b/sim/Statecraft.Sim.Tests/StartingForcesTests.cs@@ -275,7 +275,8 @@ public class StartingForcesTests{Assert.Equal(14, Real.StartingForces.Count);// Every starting row is fact-checked with no field sourced after its checked_on: the owner checked the six order targets- // sourced on 1 November (#2757, 6 November 2026, "all approved").+ // sourced on 1 November (#2757, 6 November 2026, "all approved"), and Givati's Bayt Jibrin target on 7 November 2026+ // (#2621).Assert.Empty(ReleaseGate.StartingForcesUnchecked(Real));var c = Load(Row("b", "israel", 20), Row("a", "israel", 20, q: 2, status: "fact-checked", extra: " checked_on: '2026-10-21'\n"));Assert.Equal(new[] { "b" }, ReleaseGate.StartingForcesUnchecked(c));diff --git a/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs b/sim/Statecraft.Sim.Tests/WarEvents1948Tests.csindex c6345cea7..584588864 100644--- a/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs+++ b/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs@@ -132,6 +132,19 @@ public class WarEvents1948Testss.Date = e.From;SecuritySystem.SetRung(C, s, 3, new List<Cause>()); // a level no option sets, so any change is visibles.PendingEvents.Add(id);+ if (option.RequiresUnitRegions.Count != 0)+ {+ var at = C.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var order in option.UnitOrders)+ {+ int unitId = C.StartingForces.FindIndex(f => f.Row == order.Unit);+ var force = C.StartingForces[unitId];+ var unit = s.Units.TryGetValue(unitId, out var present) ? present+ : new Unit(unitId, force.Type, force.Q, force.R, side: force.Side, strength: force.Strength);+ s.Units[unitId] = new Unit(unit.Id, unit.Type, at.Q, at.R, unit.Service, unit.Side, unit.Strength,+ unit.Order, unit.OrderTarget, unit.HomeCity, unit.Full, unit.CombatXp);+ }+ }var before = C.Indicators.ToDictionary(i => i.Id, i => s.Indicators[i.Id]);Assert.Null(EventSystem.Choose(C, s, id, option.Id, new List<Cause>()));Assert.Equal(row.Rung ?? 3, s.Rung);@@ -214,23 +227,30 @@ public class WarEvents1948TestsAssert.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>+ /// <summary>A game played with no commands at all: under R-ENEMY-007 the untouched player never puts the operation+ /// brigades in place, so each delegated operation is postponed (keyed, naming the units to move) and, after its wait,+ /// lapses (keyed), none is launched, and no card order is ever given, so none is refused. Ten Days, postponed on the+ /// 15 July 1948 turn, waits mvp.operation_wait_turns turns and lapses inside these 12 turns.</summary>[Fact]- public void AnUntouchedGameRefusesOnlyHiramsOrderToTheSeventhBrigade()+ public void AnUntouchedGamePostponesOperationsWithoutIssuingTheirOrders(){var s = GameSession.New(C, GoldenRun.Seed, Mode.Historical).State;var refused = new List<(int Turn, DateTime Start, Rejection X)>();+ var why = new List<Cause>();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)));+ why.AddRange(r.Why);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);+ Assert.Empty(refused);+ foreach (var op in new[] { "ten_days", "operation_yoav", "operation_hiram" })+ {+ Assert.Contains(why, x => x.Key == CauseKeys.OperationPostponed && x.Target == op);+ Assert.DoesNotContain(op, s.ChosenOptions.Keys);+ }+ Assert.Contains(why, x => x.Key == CauseKeys.OperationLapsed && x.Target == "ten_days");}/// <summary>Operation Hiram's refused card order: the 7th Brigade (unit 13, R-UNIT-009) to al-Malikiyya (14,4).</summary>diff --git a/sim/Statecraft.Sim.Tests/golden/hash1950.txt b/sim/Statecraft.Sim.Tests/golden/hash1950.txtindex 184c04c68..7d11395be 100644--- a/sim/Statecraft.Sim.Tests/golden/hash1950.txt+++ b/sim/Statecraft.Sim.Tests/golden/hash1950.txt@@ -44,7 +44,7 @@ pop{sit[housing_crisistreasury=0 [0000000000000000]-debt=84.30032828298673 [40551338941E5F7A]+debt=84.20032828298673 [40550CD22DB7F914]fx=94.52989672613671 [4057A1E9D3F540F0]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -116,8 +116,8 @@ city{tiberias=6,2,8,2,1,c0.18928571428571433 [3FC83A83A83A83AA]zikhron_yaakov=2,1,2,1,1,c0.35 [3FD6666666666666]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@15,4|side=israel|strength=2+ 0:veteran_soldier@-7,28|side=israel|strength=2|full=4+ 1:veteran_soldier@14,3|side=israel|strength=22:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-2,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=3@@ -126,9 +126,9 @@ units[8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,279:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4- 13:veteran_soldier@-4,24|side=israel|strength=1|full=2+ 13:veteran_soldier@8,8|side=israel|strength=215:veteran_halutz@-3,21/6site{beit_kama=done,1949-08-15@@ -139,6 +139,6 @@ cproj[next=18ctrl{beersheba=since=1949-01-15,fled=1- ramla=since=1948-09-15,fled=1+ ramla=since=1948-08-15,fled=1food=3003,1001,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/hash1952.txt b/sim/Statecraft.Sim.Tests/golden/hash1952.txtindex fb6b00500..84e3201f4 100644--- a/sim/Statecraft.Sim.Tests/golden/hash1952.txt+++ b/sim/Statecraft.Sim.Tests/golden/hash1952.txt@@ -45,7 +45,7 @@ sit[fx_crisishousing_crisistreasury=0 [0000000000000000]-debt=220.29012071283807 [406B8948AB3BB104]+debt=220.19012071283805 [406B861578087DD0]fx=-12.990431328096534 [C029FB19D0A63788]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -139,8 +139,8 @@ city{tiberias=6,2,13,2,0,c0 [0000000000000000]zikhron_yaakov=2,1,4,1,0,c0 [0000000000000000]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@15,4|side=israel|strength=2+ 0:veteran_soldier@-7,28|side=israel|strength=2|full=4+ 1:veteran_soldier@14,3|side=israel|strength=22:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-2,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=3@@ -149,9 +149,9 @@ units[8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,279:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4- 13:veteran_soldier@-4,24|side=israel|strength=1|full=2+ 13:veteran_soldier@8,8|side=israel|strength=215:veteran_halutz@-3,21/6site{beit_kama=done,1949-08-15@@ -173,6 +173,6 @@ obj{yishuvim=1951-09-15ctrl{beersheba=since=1949-01-15,fled=1- ramla=since=1948-09-15,fled=1+ ramla=since=1948-08-15,fled=1food=2733,1390,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txtindex 118c351f8..583d1a136 100644--- a/sim/Statecraft.Sim.Tests/golden/manifest.txt+++ b/sim/Statecraft.Sim.Tests/golden/manifest.txt@@ -3,14 +3,14 @@# 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.# gdd-0.3 has no GoldenRun entries: its reference-player policy is not defined, so GoldenRun refuses that ruleset.-hash1950 d53edcd56e05f661e3617d680814913e2c42f05f18c6b4317875ea08213c1fa8-hash1952 25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7-smoke5 b93ad5503dad3981b7a0de4c078b6d4323794be991a8d8343e5fe90271dc006c+hash1950 832e8ccc38e3fb36228826816b452477fbbd6ab667ee30cdaef40e5b1b2fe869+hash1952 841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e+smoke5 12f088f62bd0694ae59b5f6472751579ad96c2198308d0869a8cf795f1aad051smoke-orders 08d9800eda4462ef165cc7ea6285fad059c030c0f87ad563e35c9789cc352d78-scenario-reckless ac5fbdd3ea4e1a7b08266b171897f9fdee8bd5487bc491b21c9778278fafe2dd-scenario-cautious 466558729704aa8952c343f9dc46bf74364e417b428a07333522dbea0c81a7b8-scenario-mvp-absorb-first cf73bb0727b5949442ed7b8c225643988d6317d55f1f10b6e7e89875f50b91a7-mvp-end 25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7-scenario-mvp-defeat 8096c41e01d0440b62a0c9cf4b10413e92e97614fe5a8d085b27ae1534ec3058-scenario-mvp-occupy-cost eb3ae67bd7c3c661e597336679b3ea9647b1a118c128392bd57a542ff0bd80d8-scenario-mvp-annex-nazareth dec2cad59a04ed1f577f110283cbc99950e3bb3f73320f28e9e9034071af3ba3+scenario-reckless 8bf2772804330a960263e8afb44696a24b6b2a2f3b3945cbbf02be9cc9304116+scenario-cautious 024fa528cf406ab0d10771da75e7029dd1d33892705ec9c19d6a239a8d3d77bd+scenario-mvp-absorb-first 96f625412b2739fd5d79f2d72a47da569cce5efbd24b8497e2479ed9d0e415f7+mvp-end 841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e+scenario-mvp-defeat 2c98e24499673978d50ee8cd31bdc6bd5b1647f607c14138b5cb67ab183fa269+scenario-mvp-occupy-cost f9df20613554a2d9b324f8b5b1b0c3082e10de89ad8d9a8db78f3604d97e0bc9+scenario-mvp-annex-nazareth c2aafd13e7e26b88655f2ce2cd580a8244550449f1c3492acc55d23ef392db9ddiff --git a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt b/sim/Statecraft.Sim.Tests/golden/mvp-end.txtindex fb6b00500..84e3201f4 100644--- a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt+++ b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt@@ -45,7 +45,7 @@ sit[fx_crisishousing_crisistreasury=0 [0000000000000000]-debt=220.29012071283807 [406B8948AB3BB104]+debt=220.19012071283805 [406B861578087DD0]fx=-12.990431328096534 [C029FB19D0A63788]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -139,8 +139,8 @@ city{tiberias=6,2,13,2,0,c0 [0000000000000000]zikhron_yaakov=2,1,4,1,0,c0 [0000000000000000]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@15,4|side=israel|strength=2+ 0:veteran_soldier@-7,28|side=israel|strength=2|full=4+ 1:veteran_soldier@14,3|side=israel|strength=22:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-2,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=3@@ -149,9 +149,9 @@ units[8:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,279:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4- 13:veteran_soldier@-4,24|side=israel|strength=1|full=2+ 13:veteran_soldier@8,8|side=israel|strength=215:veteran_halutz@-3,21/6site{beit_kama=done,1949-08-15@@ -173,6 +173,6 @@ obj{yishuvim=1951-09-15ctrl{beersheba=since=1949-01-15,fled=1- ramla=since=1948-09-15,fled=1+ ramla=since=1948-08-15,fled=1food=2733,1390,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txtindex 2b5d1b83d..ee4bfff61 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt@@ -1,4 +1,4 @@-1949-04-15;1663341875487339525;Historical;11;+1949-04-15;15755400384260045787;Historical;11;ind{food_supply=0.468 [3FDDF3B645A1CAC1]housing=0.38982590078831036 [3FD8F2E855C1400A]@@ -43,7 +43,7 @@ pop{veterans=659531.4296791082 [41242096DBFEE66B]sit[treasury=0 [0000000000000000]-debt=36.78793189372497 [404264DAF3C98316]+debt=36.837931893724964 [40426B415A2FE97B]fx=90.22947100954694 [40568EAFA72C5897]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -111,23 +111,24 @@ city{tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@15,4|side=israel|strength=2|order=go_to|target=15,3+ 0:veteran_soldier@-7,28|side=israel|strength=2|full=4+ 1:veteran_soldier@14,3|side=israel|strength=2|order=go_to|target=15,32:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-3,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=35:veteran_soldier@0,26|side=israel|strength=37:veteran_soldier@-10,35|side=israel|strength=18: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+ 9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4+ 13:veteran_soldier@8,8|side=israel|strength=2cardorders{1=1949-03-23next=14ctrl{beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1- ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1+ ramla=owner=israel,state=awaiting_choice,since=1948-08-15,fled=1food=2427,809,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txtindex 59f14a7ce..b243e2a74 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt@@ -1,4 +1,4 @@-1950-01-15;1663341875487339525;Historical;20;+1950-01-15;8709371129873692656;Historical;20;ind{food_supply=0.8893359375000001 [3FEC7570A3D70A3E]housing=0.4168186644627783 [3FDAAD28310EB8D1]@@ -43,7 +43,7 @@ pop{veterans=667938.2378207468 [4124624479C3A414]sit[treasury=0 [0000000000000000]-debt=276.87532828298686 [40714E01583ACB14]+debt=277.3753282829867 [40715601583ACB11]fx=94.52989672613671 [4057A1E9D3F540F0]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -117,18 +117,19 @@ city{tiberias=6,2,8,2,1,c0.18928571428571433 [3FC83A83A83A83AA]zikhron_yaakov=2,1,2,1,1,c0.35 [3FD6666666666666]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@15,4|side=israel|strength=2+ 0:veteran_soldier@-7,28|side=israel|strength=1|full=4+ 1:veteran_soldier@14,3|side=israel|strength=22:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-3,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=35:veteran_soldier@0,26|side=israel|strength=37: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+ 8:egyptian_army@-8,27|side=egypt|strength=9|order=fortify|target=-8,27+ 9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4+ 13:veteran_soldier@8,8|side=israel|strength=221:halutz@-3,2122:halutz@-3,2123:halutz@-3,21@@ -392,7 +393,7 @@ obj{absorb_immigrants=1950-01-15ctrl{beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1- ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1+ ramla=owner=israel,state=awaiting_choice,since=1948-08-15,fled=1score=100scoreparts=100,0,0food=3003,1001,0diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txtindex 2d0892771..49efdf348 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-annex-nazareth.txt@@ -1,10 +1,10 @@-1949-02-15;1663341875487339525;Historical;9;+1949-02-15;11400714819323200433;Historical;9;ind{food_supply=0.4 [3FD999999999999A]housing=0.4144342978298799 [3FDA86176EE148A1]- intl_standing=0.6100000000000001 [3FE3851EB851EB86]- morale=0.7026567681936653 [3FE67C2A0BF68E18]- security=0.5146288293457033 [3FE077D6E0F3CB40]+ intl_standing=0.53 [3FE0F5C28F5C28F6]+ morale=0.7016567681936653 [3FE673F8E50D1543]+ security=0.5046288293457033 [3FE025EB5BD512EE]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]@@ -14,14 +14,14 @@ eff{building_houses=0.07429382257461548 [3FB304EB8240B780]food_lifts_cohesion=0.03992187500000001 [3FA470A3D70A3D72]homes_lift_morale=0.06243079858799369 [3FAFF6EDFC65AE5C]- safety_lifts_morale=0.050239859619140646 [3FA9B909F40A287B]+ safety_lifts_morale=0.049239859619140645 [3FA935F785729B2B]work_lifts_cohesion=0.04006423498653092 [3FA4834CA6034814]shift{food_supply=0 [0000000000000000]housing=0 [0000000000000000]- intl_standing=0.1100000000000001 [3FBC28F5C28F5C30]+ intl_standing=0.030000000000000027 [3F9EB851EB851EC0]morale=-0.040000000000000036 [BFA47AE147AE1480]- security=0.18000000000000016 [3FC70A3D70A3D710]+ security=0.17000000000000015 [3FC5C28F5C28F5C8]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -41,11 +41,11 @@ pop{veterans=657677.6664788157 [4124121B553CB61A]sit[treasury=0 [0000000000000000]-debt=31.08147122191724 [403F14DB4C49B320]+debt=31.031471221917243 [403F080E7F7CE654]fx=83.68904673158221 [4054EC19577663EC]rung=5;cf=0;mob=0.8 [3FE999999999999A]-stab=0.626287693608005 [3FE40A8C7D3DE075]+stab=0.6253724158302272 [3FE4030D0339F67C]att=4 [4010000000000000]fired[altalena@@ -61,12 +61,13 @@ fired[operation_hiramoperation_horevoperation_yoav- rhodes_talkssecond_truce- sinai_withdrawalten_dayspending[+ operation_horevarmistice_egypt+postponed{+ operation_horev=launch@7@1948-12-15chosen{altalena=enforcebernadotte_assassination=outlaw@@ -78,11 +79,8 @@ chosen{jerusalem_military_government=military_governmentlatrun_proposal=accept_voteoperation_hiram=stop_at_ceasefire- operation_horev=launchoperation_yoav=stop_at_ceasefire- rhodes_talks=send_delegationsecond_truce=comply- sinai_withdrawal=withdrawten_days=central_frontappt{under=;@@ -104,25 +102,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@4,14|side=israel|strength=4|order=go_to|target=-8,28- 1:veteran_soldier@13,6|side=israel|strength=2|order=go_to|target=15,3+ 0:veteran_soldier@6,12|side=israel|strength=4|order=go_to|target=-7,26+ 1:veteran_soldier@12,4|side=israel|strength=2|order=go_to|target=15,32:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-3,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=35:veteran_soldier@0,26|side=israel|strength=37:veteran_soldier@-10,35|side=israel|strength=18: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=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,511:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4+ 13:veteran_soldier@8,8|side=israel|strength=2cardorders{- 0=1949-02-241=1949-03-23next=14ctrl{beersheba=owner=israel,state=awaiting_choice,since=1949-01-15,fled=1nazareth=owner=israel,state=annexed,since=1948-07-15- ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1+ ramla=owner=israel,state=awaiting_choice,since=1948-08-15,fled=1food=2355,785,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txtindex 46056645b..63967b818 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-defeat.txt@@ -1,9 +1,9 @@-1952-01-15;3326683750974677102;Historical;44;+1952-01-15;6018027440424184879;Historical;44;ind{food_supply=0 [0000000000000000]- housing=0.08527429756872117 [3FB5D4894F3F3D57]- intl_standing=0.8100000000000003 [3FE9EB851EB851EE]- morale=0.6761872908333285 [3FE5A35387833317]+ housing=0.12527429756872116 [3FC008FCF98B23CA]+ intl_standing=0.7900000000000003 [3FE947AE147AE14A]+ morale=0.6021843611458284 [3FE345182329166A]security=0.5211322526321603 [3FE0AD1D8BBE4521]pol{border_settlement=0.2 [3FC999999999999A]@@ -14,16 +14,16 @@ eff{border_villages_secure=0.04113225263216018 [3FA50F495FBB5C36]building_houses=0.08504947742483629 [3FB5C5CD7414E142]food_lifts_cohesion=0.012063175589332852 [3F88B49405230026]- homes_lift_morale=0.012819275597818983 [3F8A40FE0B9BBCA2]+ homes_lift_morale=0.018816345910318985 [3F93449799429ABC]rationing_feeds=0 [0000000000000000]rationing_grates=0 [0000000000000000]safety_lifts_morale=0.0520437005265136 [3FAAA578CF72C98B]work_lifts_cohesion=0.019261139119662984 [3F93B9312A691F60]shift{food_supply=-0.04999999999999999 [BFA9999999999998]- housing=-1.3877787807814457E-17 [BC70000000000000]- intl_standing=0.3100000000000003 [3FD3D70A3D70A3DC]- morale=0.030000000000000027 [3F9EB851EB851EC0]+ housing=0.039999999999999994 [3FA47AE147AE147A]+ intl_standing=0.29000000000000026 [3FD28F5C28F5C294]+ morale=-0.050000000000000044 [BFA99999999999A0]security=0.18000000000000016 [3FC70A3D70A3D710]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]@@ -46,11 +46,11 @@ sit[fx_crisishousing_crisistreasury=0 [0000000000000000]-debt=293.9901207128381 [40725FD788D10BB6]+debt=295.69012071283805 [40727B0ABC043EE8]fx=-74.99043132809652 [C052BF633A14C6F0]rung=2;cf=0;mob=0.05 [3FA999999999999A]-stab=0.4593297084326191 [3FDD65A86EF327F8]+stab=0.43907509119986515 [3FDC19CE694C43CD]att=4 [4010000000000000]fired[altalena@@ -102,7 +102,7 @@ chosen{forex_crisis_1951=request_aidfrumkin_commission=inquiryidf_founding=one_army- iraqi_exodus=airlift+ iraqi_exodus=paceisrael_bonds=donations_onlyjerusalem_ceasefire=keepjerusalem_military_government=military_government@@ -138,22 +138,23 @@ city{tiberias=6,2,13,2,0,c0 [0000000000000000]zikhron_yaakov=2,1,4,1,0,c0 [0000000000000000]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@15,4|side=israel|strength=2+ 0:veteran_soldier@-7,28|side=israel|strength=2|full=4+ 1:veteran_soldier@14,3|side=israel|strength=22:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-2,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=35:veteran_soldier@0,26|side=israel|strength=37:veteran_soldier@-9,35|side=israel|strength=18: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+ 9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4+ 13:veteran_soldier@8,8|side=israel|strength=2next=14ctrl{beersheba=since=1949-01-15,fled=1- ramla=since=1948-09-15,fled=1+ ramla=since=1948-08-15,fled=1food=0,1390,1390exhausted=3arms=132\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txtindex e46baa7b9..bf3bdc51c 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-occupy-cost.txt@@ -1,4 +1,4 @@-1948-12-15;15755400384260045787;Historical;7;+1948-12-15;11400714819323200433;Historical;7;ind{food_supply=0.4 [3FD999999999999A]housing=0.4196029067993164 [3FDADAC626809D49]@@ -40,7 +40,7 @@ pop{veterans=655829.1137019362 [412403AA3A3723E3]sit[treasury=0 [0000000000000000]-debt=17.996888251868295 [4031FF3411878A7B]+debt=17.896888251868297 [4031E59A77EDF0E2]fx=76.85902112083348 [405336FA33B92365]rung=5;cf=0;mob=0.8 [3FE999999999999A]@@ -95,25 +95,24 @@ city{zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]units[0:veteran_soldier@8,11|side=israel|strength=4- 1:veteran_soldier@11,8|side=israel|strength=2|order=go_to|target=15,3+ 1:veteran_soldier@10,6|side=israel|strength=2|order=go_to|target=15,32:veteran_soldier@0,17|side=israel|strength=43:veteran_soldier@-3,24|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=35:veteran_soldier@0,26|side=israel|strength=3- 6:veteran_soldier@-3,26|side=israel|strength=17:veteran_soldier@-11,35|side=israel|strength=1|order=go_to|target=-10,358:egyptian_army@-8,27|side=egypt|strength=10|order=fortify|target=-8,27- 9:arab_legion@-3,25|side=jordan|strength=3|order=attack|target=-4,25+ 9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,511:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,1412: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+ 13:veteran_soldier@8,8|side=israel|strength=2cardorders{1=1949-03-237=1949-02-24next=14ctrl{nazareth=owner=israel,state=awaiting_end,since=1948-07-15- ramla=owner=israel,state=awaiting_choice,since=1948-09-15,fled=1+ ramla=owner=israel,state=awaiting_choice,since=1948-08-15,fled=1food=2208,736,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txtindex d53b01ed2..7f7366fcf 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt@@ -1,4 +1,4 @@-1949-04-15;1663341875487339525;Historical;11;+1949-04-15;15755400384260045787;Historical;11;ind{food_supply=0.5700000000000001 [3FE23D70A3D70A3E]housing=0.38982590078831036 [3FD8F2E855C1400A]@@ -43,7 +43,7 @@ pop{veterans=659531.4296791082 [41242096DBFEE66B]sit[treasury=0 [0000000000000000]-debt=36.78793189372497 [404264DAF3C98316]+debt=36.837931893724964 [40426B415A2FE97B]fx=90.22947100954694 [40568EAFA72C5897]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -109,18 +109,19 @@ city{tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]units[- 0:veteran_soldier@4,14|side=israel|strength=4- 1:veteran_soldier@13,3|side=israel|strength=2|order=go_to|target=15,3+ 0:veteran_soldier@-7,28|side=israel|strength=2|full=4+ 1:veteran_soldier@14,3|side=israel|strength=2|order=go_to|target=15,32:veteran_soldier@0,17|side=israel|strength=4- 3:veteran_soldier@-3,21|side=israel|strength=3+ 3:veteran_soldier@-4,23|side=israel|strength=34:veteran_soldier@-9,29|side=israel|strength=35:veteran_soldier@0,26|side=israel|strength=37:veteran_soldier@-10,35|side=israel|strength=18: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+ 9:arab_legion@-3,25|side=jordan|strength=4|order=fortify|target=-3,2510:syrian_army@15,5|side=syria|strength=3|order=fortify|target=15,5- 11:iraqi_army@6,14|side=iraq|strength=3|order=fortify|target=6,14+ 11:iraqi_army@7,14|side=iraq|strength=3|order=fortify|target=7,1412:arab_liberation_army@14,4|side=ala|strength=4|order=fortify|target=14,4+ 13:veteran_soldier@8,8|side=israel|strength=2cardorders{1=1949-03-23next=14diff --git a/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml b/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yamlindex ae35f9589..6d39e1a43 100644--- a/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml+++ b/sim/Statecraft.Sim.Tests/scenarios/mvp-annex-nazareth.yaml@@ -2,9 +2,10 @@# (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 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+# scenario annexes Nazareth (R-CTRL-016), in the turn that delegates Operation Horev. Automated staging is planned from+# the turn-start state, where Golani is still Nazareth's last garrison, so it issues no move. The annexation then runs as+# a player order, but Golani remains outside Horev's required regions; delegation postpones the operation and it lapses+# after 23 December 1948 (R-ENEMY-007, 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 ordiff --git a/sim/Statecraft.Sim.Tests/translations_fixture/README.md b/sim/Statecraft.Sim.Tests/translations_fixture/README.mdindex 697e37048..0993caf2a 100644--- a/sim/Statecraft.Sim.Tests/translations_fixture/README.md+++ b/sim/Statecraft.Sim.Tests/translations_fixture/README.md@@ -7,7 +7,8 @@ exactly these bytes, and `tools/tests/test_translate.py` checks `tools/translatetool and the game stay one contract.The cases: events ordered by date, then id (`alpha` before `vote` on the same day; `quiet` has no Hebrew); a review flag-and none; text with `'`, `"` and `\`; an office's feminine title (`title_f`) beside its retained sources and date window;+and none; a late text (`late`, R-ENEMY-007) written between the body and the options;+text with `'`, `"` and `\`; an office's feminine title (`title_f`) beside its retained sources and date window;a person whose `name_he` source sits in `biography_sources` (a list, so not a field); a record keyed by a mapping key(`regions.north`); a list item with no id (keyed by its index); an English value that is not text (skipped); a Hebrewfield with no English (skipped); UI strings in strings.en.yaml's order with one only in Hebrew last, and a separatordiff --git a/sim/Statecraft.Sim.Tests/translations_fixture/content/events/a_late.yaml b/sim/Statecraft.Sim.Tests/translations_fixture/content/events/a_late.yamlindex 852da440c..0b76c322a 100644--- a/sim/Statecraft.Sim.Tests/translations_fixture/content/events/a_late.yaml+++ b/sim/Statecraft.Sim.Tests/translations_fixture/content/events/a_late.yaml@@ -3,6 +3,8 @@ title: Latetext: Later.title_he: מאוחרtext_he: מאוחר יותר.+late_text: Later still.+late_text_he: מאוחר עוד יותר.from: 1948-07-01options:- id: continuediff --git a/sim/Statecraft.Sim.Tests/translations_fixture/expected/he/events.yaml b/sim/Statecraft.Sim.Tests/translations_fixture/expected/he/events.yamlindex 4724887fa..eb2be7c75 100644--- a/sim/Statecraft.Sim.Tests/translations_fixture/expected/he/events.yaml+++ b/sim/Statecraft.Sim.Tests/translations_fixture/expected/he/events.yaml@@ -14,5 +14,6 @@ vote:late:title: "מאוחר"text: "מאוחר יותר."+ late_text: "מאוחר עוד יותר."options:continue: "להמשיך"diff --git a/sim/Statecraft.Sim/Cause.cs b/sim/Statecraft.Sim/Cause.csindex 8f7ee33d6..35535ead6 100644--- a/sim/Statecraft.Sim/Cause.cs+++ b/sim/Statecraft.Sim/Cause.cs@@ -80,7 +80,9 @@ namespace Statecraft.Sim// #1680: event context Args begin with the shown English and sourced Hebrew title (empty for a preview).public const string EventNew = "event_new", EventChosen = "event_chosen", EventDelegated = "event_delegated",- EventDelegatedPartial = "event_delegated_partial";+ EventDelegatedPartial = "event_delegated_partial", OperationPostponed = "operation_postponed",+ OperationLapsed = "operation_lapsed", OperationLapsedSigned = "operation_lapsed_signed",+ OperationLapsedUnitLost = "operation_lapsed_unit_lost", OperationWaitsForArmistice = "operation_waits_for_armistice";// Chosen/delegated Args: filled English option, filled Hebrew option, English minister, Hebrew minister (empty: cabinet).public const string EventAmount = "event_amount", EventStock = "event_stock", EventGrant = "event_grant",EventCity = "event_city", EventUnlock = "event_unlock", EventPolicy = "event_policy",@@ -277,7 +279,7 @@ namespace Statecraft.Sim{MoneyFlows, FxFlows, Borrowed, Paid, MoneyOther, CivilianUpkeep, FxCrisisBegan, FxCrisisEased, FxCrisisFood, Arrived, EffectChange,SituationBegan, SituationEnded, RungChanged, CallUpSet, CallUpRaised, CallUpLowered, Ceasefire,- EventNew, EventChosen, EventDelegated, EventDelegatedPartial, EventAmount, EventStock, EventGrant, EventCity,+ EventNew, EventChosen, EventDelegated, EventDelegatedPartial, OperationPostponed, OperationLapsed, OperationLapsedSigned, OperationLapsedUnitLost, OperationWaitsForArmistice, EventAmount, EventStock, EventGrant, EventCity,EventUnlock, EventPolicy, EventSetRung, EventRejoin, MilitaryUpkeep, HousingSurcharge, HousingCohesion,ObjectiveCompleted, PrisonersReturned, SoldiersReturned,WorkersAssigned, WagesPaid, ImmigrantsHoused, HousingShortage, ImmigrantsWaiting, RecruitsVeteran, CorridorStarted, CorridorCancelled, CorridorCompleted, PioneersVeteran, MapBorrowed, MapBuilt, LandWorkStarted, SiteStarted, SiteCancelled, SiteCompleted, ProjectStarted, ProjectCancelled, ProjectCompleted, ProjectBuilder, ProjectBuilderFreed, ProjectWaiting, ArmsBought, WorkshopWorkers, WorkshopArms, WorkshopPaused, DollarsConverted, DollarsConvertedFx, FoodHarvest, FieldFood, FoodShortage, FoodWithoutImports, FoodImported, PrisonerFood, PrisonerFoodShortage, CraftsmenReturned, CraftsmenReassigned, PioneerReturned, PioneersReassigned, TrainingStarted, TrainingArms, TrainingCancelled, TrainingArmsReturned, ReplacementsStopped, ReplacementsJoined, MilitaryTrained, PioneersTrained, CraftsmenTrained, Appointed, Reshuffle, AppointmentsEnded, ApprovalStability, CoalitionCollapsed, LegislatureConvened, GovernmentTookOffice, CoalitionChanged, EraEnded, AdvisoryPolicyRejected, PolicyRejected, PolicySet, AdvisoryBudgetRejected, BudgetRejected, PlaceCaptured, EnemyRegained, PlaceAnnexed, PlaceWithdrawn, PlaceDeported, DeportEffect, DeportCost, OccupationStarted, PendingBecameRaid, OccupationLostUnit, OccupationCountdown, DepopulationSupport, CityHeld,diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.csindex 37be51f88..e517d7ba8 100644--- a/sim/Statecraft.Sim/Content.cs+++ b/sim/Statecraft.Sim/Content.cs@@ -661,6 +661,18 @@ namespace Statecraft.Sim/// <summary>A minister whose loyalty is below this carries a delegated decision out half-heartedly (R-EVT-003; #107,/// owner, 18 October 2026). Required in the GDD loop, 0 to 10 (0: nobody is below it).</summary>public int? DelegationLoyaltyFloor { get; set; }+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Wait, with a limit (Recommended)", "6 turns (Recommended)"): how many+ /// turns after its first postponement a postponed operation card is shown again while it waits for its units; at the+ /// end of the last it lapses. Required in the GDD loop, at least 1.</summary>+ public int? OperationWaitTurns { get; set; }+ /// <summary>R-ENEMY-007 (owner, 7 November 2026, Q8: "All five -0.01 (Recommended)"): the Security change a lapsed+ /// operation card costs, whatever ended its wait: Horev's Hold. Required in the GDD loop, finite and at most 0.</summary>+ public double? OperationLapseSecurity { get; set; }+ /// <summary>R-ENEMY-007 (owner, 7 November 2026, on a late Ten Days during the truce: "Same as Latrun, -0.10+ /// (Recommended)"): the International Support a late operation costs when it launches while a truce the player accepted+ /// is in force (Combat.TruceInForce). Not charged on an option whose own effects already cost International Support+ /// (Latrun's offensive). Required in the GDD loop, finite and at most 0.</summary>+ public double? OperationTruceBreakStanding { get; set; }/// <summary>The movement points it costs to enter a hex of each land biome of map/hexes.json (R-MOVE-001; Q-MOVE-1)./// Lake and sea have none: they are impassable. The loader requires one for every land biome in the GDD loop.</summary>public Dictionary<string, int> MoveCost { get; set; } = new Dictionary<string, int>();@@ -1096,6 +1108,9 @@ namespace Statecraft.Simpublic 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>R-ENEMY-007: the authored player regions in any one of which every <see cref="UnitOrders"/> row's+ /// starting unit must stand before this military-operation option can resolve. Empty when this is not an operation.</summary>+ public List<string> RequiresUnitRegions { get; set; } = new List<string>();/// <summary>R-EFX-009 (#2457): US$ millions this option also adds to Debt, under gdd-0.3 only, in IL millions at the/// mvp.il_per_dollar rate in force on the event's date. Null when absent.</summary>public double? DebtDollars { get; set; }@@ -1224,6 +1239,19 @@ namespace Statecraft.Sim/// that front, before its hard-anchor date and again after a refusal, and then takes the first soft slot (R-EVT-002)./// Empty for every other event.</summary>public string FrontQuiet { get; set; } = "";+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Signing wins (Recommended)" and the front rulings): the front whose+ /// signed armistice ends this card. A pending operation lapses when it is signed; "" for none.</summary>+ public string ArmisticeFront { get; set; } = "";+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Follow the launch (Recommended)"; Rafah: "Shift by the delay+ /// (Recommended)" and "Shift with Sinai (Recommended)"): under the GDD loop the card follows the decision its `requires`+ /// waits for. Once that is met it fires at the next turn's end even when its own window has closed, so a late+ /// operation still brings it, on the turn after. False for every other card.</summary>+ public bool Follows { get; set; }+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Dateless variants (Recommended)", then "All approved (Recommended)"): the+ /// card's text, and its Hebrew, when it is shown after its own window has closed (a following card that came late, or+ /// an operation shown again while it waits), so its dates do not mislead. "" for none.</summary>+ public string LateText { get; set; } = "";+ public string LateTextHe { get; set; } = "";/// <summary>The place among the same turn's cards of the same `from` (R-EVT-006): a lower order comes first, before/// the id decides. Default 0; degania_defence has 1, so One Army opens the game (owner, 24 October 2026, #1568).</summary>public int Order { get; set; }diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.csindex 35acde139..c69d9b51e 100644--- a/sim/Statecraft.Sim/ContentLoader.cs+++ b/sim/Statecraft.Sim/ContentLoader.cs@@ -210,7 +210,7 @@ namespace Statecraft.Siminternal const string ObjectivesFileName = "objectives.yaml";/// <summary>R-CITY-006: the locality placements, with the settlement_hexes.yaml checks (unique ids, land hexes) and- /// q and r required. Only the exact gdd-0.3 regions path calls this.</summary>+ /// q and r required. Both GDD identities' immutable geography path calls this.</summary>static List<SettlementHex>? LocalityHexes(Content c, LocalityHexesFile file){const string f = PlayerRegionCatalogue.LocalityHexesFileName;@@ -458,6 +458,11 @@ namespace Statecraft.Sim// has exactly one option (R-EVT-007)// front_quiet the front (Prisoners.Fronts) of an armistice_<front> card: under gdd-0.3 it may also// come early, and again after a refusal, once that front is quiet (R-WAR-008)+ // armistice_front a front (Prisoners.Fronts) whose signed armistice ends the card: a pending+ // operation lapses once it is signed, and a card with it never first fires after+ // it (R-ENEMY-007); on an operation card or a following card only+ // follows true: under the GDD loop the card fires on the turn after its `requires` are met+ // even when its window has closed (R-ENEMY-007); needs a `requires`foreach (var rel in eventFiles.OrderBy(p => p, StringComparer.Ordinal)){var e = Read<GameEvent>(readFile, rel);@@ -501,9 +506,10 @@ namespace Statecraft.Simc.StartingForces = StartingForces.Read(readFile, c);if (formationXp != null) ApplyGdd03FormationCombatXp(formationXp, c);}- // R-CITY-006: no read or hash input in either old identity. Absence leaves the capability inactive. After the- // sites (a site id may be a member) and the effective map overrides; the locality hexes are read only with regions, and are required then (#2298).- if (c.Ruleset == SaveGame.Gdd03Ruleset)+ // R-CITY-006 and R-ENEMY-007: authored geography is immutable lookup data in both GDD identities. Only exact+ // gdd-0.3 initializes regional population/control state. After sites (a site id may be a member) and the effective+ // map overrides; locality hexes are read only with regions, and are required then (#2298).+ if (c.IsGdd){var regions = ReadOptional<PlayerRegionsFile>(readFile, PlayerRegionCatalogue.FileName);if (regions != null)@@ -1560,6 +1566,13 @@ namespace Statecraft.Sim// R-EVT-003 (#107): required, so a missing key is never read as 0 (no floor, or a disloyal minister who does nothing).if (m.DelegationLoyaltyFloor == null) throw new ContentException(file, "mvp.delegation_loyalty_floor", "required when eras.yaml systems.loop is gdd");if (m.DelegationLoyaltyFloor < 0 || m.DelegationLoyaltyFloor > 10) throw new ContentException(file, "mvp.delegation_loyalty_floor", "must be 0-10");+ // R-ENEMY-007 (owner, 7 November 2026: "6 turns (Recommended)"): required, so no wait is read as 0.+ if (m.OperationWaitTurns == null) throw new ContentException(file, "mvp.operation_wait_turns", "required when eras.yaml systems.loop is gdd");+ if (m.OperationWaitTurns < 1) throw new ContentException(file, "mvp.operation_wait_turns", "must be >= 1");+ if (m.OperationLapseSecurity == null) throw new ContentException(file, "mvp.operation_lapse_security", "required when eras.yaml systems.loop is gdd");+ if (!(m.OperationLapseSecurity <= 0 && IsFinite(m.OperationLapseSecurity.Value))) throw new ContentException(file, "mvp.operation_lapse_security", "must be a finite number <= 0");+ if (m.OperationTruceBreakStanding == null) throw new ContentException(file, "mvp.operation_truce_break_standing", "required when eras.yaml systems.loop is gdd");+ if (!(m.OperationTruceBreakStanding <= 0 && IsFinite(m.OperationTruceBreakStanding.Value))) throw new ContentException(file, "mvp.operation_truce_break_standing", "must be a finite number <= 0");if (m.DisloyalEffectShare == null) throw new ContentException(file, "mvp.disloyal_effect_share", "required when eras.yaml systems.loop is gdd");Unit(file, "mvp.disloyal_effect_share", m.DisloyalEffectShare.Value);// R-MOVE-001 (Q-MOVE-1): a cost for every land biome of the map, so no hex is read as free, and none for a water@@ -1659,6 +1672,7 @@ namespace Statecraft.SimValidateEventSites(c);ValidateEventPrisoners(c);ValidateEventFrontQuiet(c);+ ValidateEventArmisticeFront(c);ValidateEventDeported(c);ValidateProjects(c);ValidateCorridors(c);@@ -1689,6 +1703,21 @@ namespace Statecraft.Sim}}+ /// <summary>R-ENEMY-007: an operation card's armistice front is a known front, on a card with an operation option+ /// (one with requires_unit_regions), so that front's signed armistice can end it.</summary>+ static void ValidateEventArmisticeFront(Content c)+ {+ foreach (var e in c.Events.Where(e => e.ArmisticeFront != ""))+ {+ if (!Prisoners.Fronts.Contains(e.ArmisticeFront))+ throw new ContentException(e.File, $"events[{e.Id}].armistice_front", $"unknown front '{e.ArmisticeFront}' (one of {string.Join(", ", Prisoners.Fronts)})");+ if (!e.Follows && !e.Options.Any(o => o.RequiresUnitRegions.Count != 0))+ throw new ContentException(e.File, $"events[{e.Id}].armistice_front", "only an operation card (an option with requires_unit_regions) or a following card has an armistice front");+ }+ foreach (var e in c.Events.Where(e => e.Follows && e.Requires.Count == 0))+ throw new ContentException(e.File, $"events[{e.Id}].follows", "a following card follows its requires: it needs one");+ }+/// <summary>A Deport follow-up card (R-EVT-007; GDD Phase 6 PR 9, #801): a settlement target whose residents stayed,/// since Deport is refused where they fled (R-CTRL-018) and the card could never fire; the displacement tag, so the/// release gate holds it until the owner's review (R-GATE-001); one option, which Delegate resolves without a draw; no `to`,@@ -1717,7 +1746,7 @@ namespace Statecraft.Simthrow new ContentException(e.File, $"events[{e.Id}].from", FormattableString.Invariant($"a Deport card opens at the game's start ({c.Rules.Start:yyyy-MM-dd}), so a Deport on any turn fires it"));foreach (var (key, set) in new[] { ("conditions", e.Conditions.Count > 0), ("requires", e.Requires.Count > 0), ("site", e.Site != ""),("objective", e.Objective != ""), ("kind", e.Kind != EventKinds.Historical), ("variants", e.Variants.Count > 0),- ("front_quiet", e.FrontQuiet != "") })+ ("front_quiet", e.FrontQuiet != ""), ("armistice_front", e.ArmisticeFront != ""), ("follows", e.Follows) })if (set) throw new ContentException(e.File, $"events[{e.Id}].{key}", "a Deport card waits for nothing but its Deport");if (cardOf.TryGetValue(e.Deported, out var first))throw new ContentException(e.File, $"events[{e.Id}].deported", $"'{e.Deported}' already has a card, '{first}': one Deport raises one card");diff --git a/sim/Statecraft.Sim/EventRules.cs b/sim/Statecraft.Sim/EventRules.csindex b405aba7d..5a2b3d278 100644--- a/sim/Statecraft.Sim/EventRules.cs+++ b/sim/Statecraft.Sim/EventRules.cs@@ -40,9 +40,35 @@ namespace Statecraft.Simif (e.Office != "" && !offices.Contains(e.Office)) throw new ContentException(e.File, F("office"), $"unknown office '{e.Office}'");if (c.Offices.Any(o => o.Id == e.Office && o.HistoricalOnly))throw new ContentException(e.File, F("office"), "historical-only titles cannot be delegated events");+ // R-ENEMY-007 (#2621): an objective, exchange or Deport card is answered with its single option even when it is+ // delegated (EventSystem's delegation step resolves it at once), so R-ENEMY-007's placement check never runs for+ // it. Such a card cannot also give unit orders. GDD loop only, as the order checks (CheckOrders): legacy content+ // loads as before.+ var single = !c.IsGdd ? null+ : e.Objective != "" ? "objective" : e.Prisoners != "" ? "prisoners" : e.Deported != "" ? "deported" : null;+ if (single != null)+ foreach (var o in e.Options.Where(o => o.UnitOrders.Count != 0))+ throw new ContentException(e.File, F($"options[{o.Id}].unit_orders"), $"a card with {single} cannot give unit_orders (R-ENEMY-007)");CheckPlaceholders(c, e, F("title"), e.Title, offices);CheckPlaceholders(c, e, F("text"), e.Text, offices);CheckHebrew(c, e, offices);+ // R-ENEMY-007: late text, only on a card that can be shown after its window closes (a following card or an+ // operation), with a window to close, and in Hebrew exactly when the card's text is.+ if (e.LateText != "" || e.LateTextHe != "")+ {+ if (!e.Follows && !e.Options.Any(o => o.RequiresUnitRegions.Count != 0))+ throw new ContentException(e.File, F("late_text"), "only a following card or an operation card, which can be shown after its window, has late text");+ if (!e.To.HasValue) throw new ContentException(e.File, F("late_text"), "a card with late text has a `to`");+ if (e.LateText.Trim() == "") throw new ContentException(e.File, F("late_text"), "required: late_text_he is set but late_text is not");+ CheckPlaceholders(c, e, F("late_text"), e.LateText, offices);+ if (e.TextHe == "" && e.LateTextHe != "") throw new ContentException(e.File, F("late_text_he"), "only a card with Hebrew text has late_text_he");+ if (e.TextHe != "")+ {+ if (e.LateTextHe == "") throw new ContentException(e.File, F("late_text_he"), "required: the card's text is in Hebrew too");+ if (!e.LateTextHe.Any(ch => ch >= '\u05D0' && ch <= '\u05EA')) throw new ContentException(e.File, F("late_text_he"), "must be Hebrew, in Hebrew letters");+ CheckPlaceholders(c, e, F("late_text_he"), e.LateTextHe, offices);+ }+ }// Chapters design 3.2: an event may only name model records that are active for its whole window.void Active(string field, string id){@@ -136,7 +162,8 @@ namespace Statecraft.Sim/// <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+ /// #749: sourced anchors only; 2 November 2026, #2087: order targets, option 1). They are checked and applied under+ /// both GDD identities. R-ENEMY-007 also requires every operation option to author its allowed player regions. 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){@@ -149,10 +176,29 @@ namespace Statecraft.Simif (!x.RGiven) throw new ContentException(e.File, at + ".r", "required");}if (!c.IsGdd) return;+ var requirementField = F(FormattableString.Invariant($"options[{o.Id}].requires_unit_regions"));+ if (o.UnitOrders.Count == 0)+ {+ if (o.RequiresUnitRegions.Count != 0)+ throw new ContentException(e.File, requirementField, "requires unit_orders on the same option");+ return;+ }+ if (o.RequiresUnitRegions.Count == 0)+ throw new ContentException(e.File, requirementField, "required for an option with unit_orders (R-ENEMY-007)");+ var regions = new HashSet<string>(StringComparer.Ordinal);+ for (int i = 0; i < o.RequiresUnitRegions.Count; i++)+ {+ var id = o.RequiresUnitRegions[i];+ var at = requirementField + FormattableString.Invariant($"[{i}]");+ if (!regions.Add(id)) throw new ContentException(e.File, at, "duplicate region id");+ if (!c.PlayerRegions.Regions.ContainsKey(id)) throw new ContentException(e.File, at, $"unknown player region '{id}' ({PlayerRegionCatalogue.FileName})");+ }+ var rows = new HashSet<string>(StringComparer.Ordinal);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 (!rows.Add(x.Unit)) throw new ContentException(e.File, at + ".unit", "duplicate operation unit row");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))diff --git a/sim/Statecraft.Sim/EventSystem.cs b/sim/Statecraft.Sim/EventSystem.csindex e48cef027..47991303b 100644--- a/sim/Statecraft.Sim/EventSystem.cs+++ b/sim/Statecraft.Sim/EventSystem.cs@@ -4,9 +4,32 @@ using System.Linq;namespace Statecraft.Sim{+ /// <summary>One R-ENEMY-007 operation-start row: the starting-force row and the allowed player regions, in ordinal order.</summary>+ public sealed class OperationRequirementRow+ {+ public string Unit { get; }+ public IReadOnlyList<string> Regions { get; }+ internal OperationRequirementRow(string unit, IReadOnlyList<string> regions) { Unit = unit; Regions = regions; }+ }++ /// <summary>A pure snapshot of an operation option's authored requirements in the current state.</summary>+ public sealed class OperationRequirementStatus+ {+ public IReadOnlyList<OperationRequirementRow> Required { get; }+ public IReadOnlyList<OperationRequirementRow> Missing { get; }+ public bool Met => Missing.Count == 0;+ internal OperationRequirementStatus(IReadOnlyList<OperationRequirementRow> required, IReadOnlyList<OperationRequirementRow> missing)+ { Required = required; Missing = missing; }+ }+public static class EventSystem{public const int MaxSoftEventsPerTurn = 3;+ public const string RefusedOperationUnitsNotInPlace = "The operation's required units are not in place";+ /// <summary>Q3 (owner, 7 November 2026: "Decide armistice first (Recommended)"): an operation whose front's armistice card+ /// is pending waits for it; once that armistice is signed, the operation cannot be chosen (it lapses at the turn's end).</summary>+ public const string RefusedOperationArmisticeFirst = "The armistice on this operation's front must be decided first";+ public const string RefusedOperationArmisticeSigned = "The armistice on this operation's front is signed";/// <summary>The facility a grant with no `at` stands at (Q-HFX-2) and the city fields an option may change (R-EFX-004).</summary>public const string MilitaryCamp = "military_camp", HousingField = "housing_capacity", JobsField = "job_slots", ConditionField = "condition";@@ -35,8 +58,13 @@ namespace Statecraft.Sim// R-WAR-008 (#2813): a quiet armistice card has no end date, so its `to` (1950-01-01 on the real cards) does not end it.var eligible = c.Events.Where(e => (quiet.Contains(e.Id) || !s.FiredEvents.Contains(e.Id) && e.From <= s.Date)- && (quiet.Contains(e.Id) || s.CappedEvents.Contains(e.Id) || e.To == null || start < e.To.Value))+ && (quiet.Contains(e.Id) || s.CappedEvents.Contains(e.Id) || e.To == null || start < e.To.Value || c.IsGdd && e.Follows)).Where(e => !endingTurn || EndingCard(s, e))+ // R-ENEMY-007 (owner, 7 November 2026: "They drop (Recommended)", "Signing wins (Recommended)"): a card whose front's+ // armistice is signed never first fires after it. Only the GDD loop has such cards.+ .Where(e => e.ArmisticeFront == "" || !Demobilization.Signed(s, e.ArmisticeFront))+ // R-ENEMY-007: unlike an ordinary late-fired card, an operation cannot first appear after it is no longer relevant.+ .Where(e => !c.IsGdd || e.To == null || s.Date < e.To.Value || !e.Options.Any(o => o.RequiresUnitRegions.Count != 0)).Where(e => Timeline.AllMet(c, s, e))// R-OBJ-003: an objective's card waits for the objective. Only the GDD loop records one, so in the legacy loop it never fires..Where(e => e.Objective == "" || s.Objectives.ContainsKey(e.Objective))@@ -104,6 +132,27 @@ namespace Statecraft.Sim.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>R-ENEMY-007: every distinct unit_orders row must have its starting unit in any one of the option's+ /// authored regions. Missing, destroyed or replaced starting units are not in place. Pure: no state or RNG change.</summary>+ public static OperationRequirementStatus OperationStatus(Content c, GameState s, EventOption option)+ {+ if (!c.IsGdd)+ return new OperationRequirementStatus(Array.Empty<OperationRequirementRow>(), Array.Empty<OperationRequirementRow>());+ var regions = option.RequiresUnitRegions.OrderBy(x => x, StringComparer.Ordinal).ToArray();+ var required = option.UnitOrders.Select(x => x.Unit).Distinct(StringComparer.Ordinal)+ .OrderBy(x => x, StringComparer.Ordinal).Select(x => new OperationRequirementRow(x, regions)).ToArray();+ var missing = required.Where(row =>+ {+ int id = c.StartingForces.FindIndex(f => f.Row == row.Unit);+ if (id < 0 || !s.Units.TryGetValue(id, out var unit)) return true;+ var force = c.StartingForces[id];+ if (unit.Side != force.Side || unit.Type != force.Type) return true;+ var region = c.PlayerRegions.AtHex(unit.Q, unit.R);+ return region == null || !row.Regions.Contains(region.Id, StringComparer.Ordinal);+ }).ToArray();+ return new OperationRequirementStatus(required, missing);+ }+/// <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>@@ -113,6 +162,8 @@ namespace Statecraft.Simif (!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";+ if (ArmisticeBlock(c, s, Get(c, eventId), option) is string block) return block;+ if (!OperationStatus(c, s, option).Met) return RefusedOperationUnitsNotInPlace;Resolve(c, s, eventId, option, "chosen", why, spent: spent, rejected: rejected);return null;}@@ -121,6 +172,10 @@ namespace Statecraft.Simstatic 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);+ // R-ENEMY-007: a decided card waits no more. Q4 (owner, 7 November 2026: "Shift by the delay (Recommended)"): a card+ // that waited launches its orders to end later by the time it waited, from its first postponement to now.+ var delay = s.PostponedOperations.TryGetValue(eventId, out var waited) ? s.Date - waited.Date : TimeSpan.Zero;+ s.PostponedOperations.Remove(eventId);s.ChosenOptions[eventId] = o.Id;var fillDate = FillDate(Get(c, eventId), s.Date);var title = Title(c, s, Get(c, eventId));@@ -167,6 +222,16 @@ namespace Statecraft.Simwhy.Add(new Cause("events", fx.Target, change, $"{PlayerText.Change(c, fx.Target, change)} ({title})",key: fx.Target == Pools.FoodTarget || fx.Target == Pools.ArmsTarget ? CauseKeys.EventStock : CauseKeys.EventAmount, args: Context(title, localizedTitle)));}+ // R-ENEMY-007 (owner, 7 November 2026, on a late Ten Days during the truce: "Same as Latrun, -0.10 (Recommended)"): an+ // operation that waited and launches while a truce the player accepted is in force breaks it, and costs International+ // Support as Latrun's offensive does; an option whose own effects already cost it (that offensive) is not charged again.+ if (c.IsGdd && delay > TimeSpan.Zero && o.RequiresUnitRegions.Count != 0 && Combat.TruceInForce(s) && Reaches(s, "intl_standing")+ && !o.Effects.Any(fx => fx.Target == "intl_standing" && fx.Delta < 0))+ {+ var broke = EffectsSystem.Shift(c, s, "intl_standing", c.RulesAt(s.Date).Mvp!.OperationTruceBreakStanding!.Value);+ why.Add(new Cause("events", "intl_standing", broke, $"{PlayerText.Change(c, "intl_standing", broke)} ({title})",+ key: CauseKeys.EventAmount, args: Context(title, localizedTitle)));+ }// R-EFX-009 (#2457): the bond's dollars also go onto Debt, at the event's date's rate, scaled like the numeric effects.if (DebtFor(c, Get(c, eventId), o, s.Date) is double debt){@@ -216,21 +281,20 @@ namespace Statecraft.Simif (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+ // no unit on the board orders nobody. R-ENEMY-007 applies the orders under both GDD identities once every required+ // unit is in place. 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 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) + delay) != 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;@@ -401,25 +465,174 @@ namespace Statecraft.Simforeach (var id in s.PendingEvents.ToList()){var e = Get(c, id);+ if (LapseKey(c, s, e) is string lapse) { Lapse(c, s, e, why, lapse); continue; }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, spent: spent, rejected: rejected);continue;}+ var beforeDraw = rng.State;var competence = (minister?.Competence ?? 5) / 10.0;var anchored = s.Mode == Mode.Historical && e.Anchor == "hard" ? e.Options.FirstOrDefault(o => o.Historical) : null;- var option = anchored ?? (rng.NextDouble() < competence+ // R-ENEMY-007 (owner, 7 November 2026: "Keep the option (Recommended)"): a postponed card keeps the option it was+ // postponed with and draws nothing. Latrun's ruling ("Takes the vote, wait ends (Recommended)"): when the card's+ // historical option needs no units, its minister takes that one instead, and the wait ends.+ s.PostponedOperations.TryGetValue(id, out var postponed);+ var free = postponed == null ? null : e.Options.FirstOrDefault(o => o.Historical && o.RequiresUnitRegions.Count == 0);+ var kept = postponed == null ? null : e.Options.FirstOrDefault(o => o.Id == postponed.Option);+ var option = free ?? kept ?? anchored ?? (rng.NextDouble() < competence? e.Options.FirstOrDefault(o => o.Recommended) ?? e.Options[0]: e.Options[(int)(rng.NextDouble() * e.Options.Count)]);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" : "");+ // Q3 ("Decide armistice first (Recommended)"): an operation waits while its front's armistice card is pending,+ // whichever comes first in the pending list; a signature then lapses it at the turn's end ("Signing wins").+ if (ArmisticeBlock(c, s, e, option) == RefusedOperationArmisticeFirst)+ {+ rng.State = beforeDraw;+ if (postponed == null) s.PostponedOperations[id] = new PostponedOperation(option.Id, s.Turn, s.Date);+ why.Add(OperationCause(c, s, e, Array.Empty<OperationRequirementRow>(), CauseKeys.OperationWaitsForArmistice));+ continue;+ }+ var status = OperationStatus(c, s, option);+ if (!status.Met)+ {+ rng.State = beforeDraw; // Q2: postponement consumes no draw+ // R-ENEMY-007 (owner, 7 November 2026: "Lapse at once (Recommended)"): a required unit that is no longer on the+ // board can never arrive, so the card lapses now rather than waiting out its turns.+ if (Lost(c, s, option).Count > 0) { Lapse(c, s, e, why, CauseKeys.OperationLapsedUnitLost, option); continue; }+ if (postponed == null) s.PostponedOperations[id] = new PostponedOperation(option.Id, s.Turn, s.Date);+ why.Add(OperationCause(c, s, e, status.Missing, CauseKeys.OperationPostponed));+ continue;+ }Resolve(c, s, id, option, how, why, share, delegated: true, minister: minister, spent: spent, rejected: rejected);}s.RngState = rng.State;}+ /// <summary>R-ENEMY-007: at the turn's end, each pending operation card whose wait is over lapses without a choice or+ /// effects (<see cref="LapseKey"/>). Stable pending-list order; no RNG draw.</summary>+ public static void LapseExpiredOperations(Content c, GameState s, List<Cause> why)+ {+ foreach (var id in s.PendingEvents.ToList())+ {+ var e = Get(c, id);+ if (LapseKey(c, s, e) is string key) Lapse(c, s, e, why, key);+ }+ }++ /// <summary>R-ENEMY-007 (owner, 7 November 2026): why a pending operation card lapses now, or null while it may still+ /// come. Its front's signed armistice ends it ("Signing wins (Recommended)"); a postponed card lapses once a unit its+ /// kept option needs is no longer on the board ("Lapse at once (Recommended)"), or once it has been shown again on+ /// mvp.operation_wait_turns turns after its first postponement ("6 turns (Recommended)"); a card never postponed lapses+ /// at its window's end, as before. GDD only.</summary>+ internal static string? LapseKey(Content c, GameState s, GameEvent e)+ {+ if (!c.IsGdd || !e.Options.Any(o => o.RequiresUnitRegions.Count != 0)) return null;+ if (e.ArmisticeFront != "" && Demobilization.Signed(s, e.ArmisticeFront)) return CauseKeys.OperationLapsedSigned;+ if (s.PostponedOperations.TryGetValue(e.Id, out var p))+ {+ var kept = e.Options.FirstOrDefault(o => o.Id == p.Option);+ if (kept != null && Lost(c, s, kept).Count > 0) return CauseKeys.OperationLapsedUnitLost;+ return s.Turn - p.Turn > c.RulesAt(s.Date).Mvp!.OperationWaitTurns!.Value ? CauseKeys.OperationLapsed : null;+ }+ return e.To.HasValue && e.To.Value <= s.Date ? CauseKeys.OperationLapsed : null;+ }++ /// <summary>Q3 (owner, 7 November 2026: "Decide armistice first (Recommended)"): why the operation option <paramref name="o"/>+ /// of <paramref name="e"/> cannot go now because of its front's armistice (pending, or signed), or null. GDD only.</summary>+ public static string? ArmisticeBlock(Content c, GameState s, GameEvent e, EventOption o)+ {+ if (!c.IsGdd || o.RequiresUnitRegions.Count == 0 || e.ArmisticeFront == "") return null;+ if (Demobilization.Signed(s, e.ArmisticeFront)) return RefusedOperationArmisticeSigned;+ var card = "armistice_" + e.ArmisticeFront;+ return card != e.Id && s.PendingEvents.Contains(card) ? RefusedOperationArmisticeFirst : null;+ }++ /// <summary>R-ENEMY-007: the rows <paramref name="o"/> requires that are no longer on the board: their unit has arrived+ /// (a dated row is only waited for until its day, R-UNIT-009) and is gone, or its id now holds another unit.</summary>+ public static IReadOnlyList<string> Lost(Content c, GameState s, EventOption o) =>+ o.RequiresUnitRegions.Count == 0 ? Array.Empty<string>() : o.UnitOrders.Select(x => x.Unit).Distinct(StringComparer.Ordinal)+ .Where(row =>+ {+ int id = c.StartingForces.FindIndex(f => f.Row == row);+ if (id < 0) return false;+ var force = c.StartingForces[id];+ if (force.Arrives is DateTime day && s.Date < day) return false;+ return !s.Units.TryGetValue(id, out var u) || u.Side != force.Side || u.Type != force.Type;+ })+ .OrderBy(x => x, StringComparer.Ordinal).ToList();++ static void Lapse(Content c, GameState s, GameEvent e, List<Cause> why, string key, EventOption? option = null)+ {+ s.PostponedOperations.TryGetValue(e.Id, out var p);+ option ??= p == null ? null : e.Options.FirstOrDefault(o => o.Id == p.Option);+ var operations = option != null ? new[] { option } : e.Options.Where(o => o.RequiresUnitRegions.Count != 0).ToArray();+ var rows = key == CauseKeys.OperationLapsedSigned ? Array.Empty<OperationRequirementRow>()+ : operations.SelectMany(o => key == CauseKeys.OperationLapsedUnitLost+ ? OperationStatus(c, s, o).Required.Where(r => Lost(c, s, o).Contains(r.Unit))+ : OperationStatus(c, s, o).Missing)+ .GroupBy(x => x.Unit, StringComparer.Ordinal).Select(g => g.First()).OrderBy(x => x.Unit, StringComparer.Ordinal).ToArray();+ s.PendingEvents.Remove(e.Id);+ s.PostponedOperations.Remove(e.Id);+ why.Add(OperationCause(c, s, e, rows, key));+ // Q8 (owner, 7 November 2026: "All five -0.01 (Recommended)"): every lapse costs Horev's Hold in Security, where the+ // content has a Security indicator (as an event's effect reaches only indicators the state has).+ if (!Reaches(s, "security")) return;+ var title = Title(c, s, e);+ var change = EffectsSystem.Shift(c, s, "security", c.RulesAt(s.Date).Mvp!.OperationLapseSecurity!.Value);+ why.Add(new Cause("events", "security", change, $"{PlayerText.Change(c, "security", change)} ({title})",+ key: CauseKeys.EventAmount, args: Context(title, HebrewTitle(c, s, e))));+ }++ static Cause OperationCause(Content c, GameState s, GameEvent e, IReadOnlyList<OperationRequirementRow> rows, string key)+ {+ var title = Title(c, s, e); var titleHe = HebrewTitle(c, s, e);+ var args = new List<string> { title, titleHe };+ foreach (var row in rows.OrderBy(x => x.Unit, StringComparer.Ordinal))+ {+ args.Add(row.Unit);+ args.Add(string.Join("|", row.Regions.OrderBy(x => x, StringComparer.Ordinal)));+ }+ var moves = string.Join("; ", rows.OrderBy(x => x.Unit, StringComparer.Ordinal)+ .Select(x => OperationUnitName(c, x.Unit) + " to " + string.Join(" or ", x.Regions.OrderBy(r => r, StringComparer.Ordinal).Select(OperationRegionName))));+ var lost = string.Join(", ", rows.OrderBy(x => x.Unit, StringComparer.Ordinal).Select(x => OperationUnitName(c, x.Unit)));+ if (key == CauseKeys.OperationLapsedSigned || key == CauseKeys.OperationWaitsForArmistice) args.Add(e.ArmisticeFront);+ var message = key == CauseKeys.OperationLapsed+ ? $"{title} lapsed because the required units never reached the operation regions" + (moves == "" ? "" : $": {moves}")+ : key == CauseKeys.OperationLapsedSigned+ ? $"{title} lapsed because the armistice with {FrontName(e.ArmisticeFront)} was signed"+ : key == CauseKeys.OperationWaitsForArmistice+ ? $"{title} postponed until the armistice with {FrontName(e.ArmisticeFront)} is decided"+ : key == CauseKeys.OperationLapsedUnitLost+ ? $"{title} lapsed because a required unit is no longer on the board: {lost}"+ : $"{title} postponed; move {moves}";+ return new Cause("events", e.Id, 0, message, key: key, args: args);+ }++ static string OperationUnitName(Content c, string row)+ {+ var force = c.StartingForces.FirstOrDefault(x => x.Row == row);+ return force != null && force.Name != "" ? force.Name : row;+ }++ /// <summary>The sim's English name of a front (Prisoners.Fronts), as Unity's map.front_* strings give it.</summary>+ static string FrontName(string front) => front.Length == 0 ? front : char.ToUpperInvariant(front[0]) + front.Substring(1);++ /// <summary>English display names paired with Unity's operation.region.* catalogue. These five authored regions+ /// are the complete R-ENEMY-007 vocabulary; structured cause args retain the ids for EN/HE presentation lookup.</summary>+ internal static string OperationRegionName(string id) => id switch+ {+ "central_plain" => "Central Plain",+ "jerusalem_hills" => "Jerusalem Hills",+ "galilee" => "Galilee",+ "southern_coast" => "Southern Coast",+ "negev" => "Negev",+ _ => id,+ };+public static string Render(Content c, GameEvent e, DateTime date) => Offices.Fill(c, e.Text, FillDate(e, date));/// <summary>The card's title as the player sees it now: a matching variant's, else the event's (R-ALT-010).</summary>@@ -431,6 +644,10 @@ namespace Statecraft.Sim/// <summary>Event text as the player sees it now: a matching variant's, with names following the player's appointments.</summary>public static string Render(Content c, GameState s, GameEvent e) =>- Cabinet.Fill(c, s, Timeline.Variant(c, s, e)?.Text ?? e.Text, FillDate(e, s.Date));+ Cabinet.Fill(c, s, Timeline.Variant(c, s, e)?.Text ?? (ShowsLate(e, s.Date) ? e.LateText : e.Text), FillDate(e, s.Date));++ /// <summary>R-ENEMY-007 ("Dateless variants (Recommended)"): whether <paramref name="e"/>, shown on <paramref name="date"/>,+ /// shows its late text: it has one, and its own window has closed. A road variant (R-ALT-010) still comes first.</summary>+ public static bool ShowsLate(GameEvent e, DateTime date) => e.LateText != "" && e.To.HasValue && date >= e.To.Value;}}diff --git a/sim/Statecraft.Sim/GameState.cs b/sim/Statecraft.Sim/GameState.csindex dcf40d282..aab9618a8 100644--- a/sim/Statecraft.Sim/GameState.cs+++ b/sim/Statecraft.Sim/GameState.cs@@ -72,6 +72,10 @@ namespace Statecraft.Simpublic List<string> PendingEvents = new List<string>();/// <summary>Soft events that were eligible but found no slot, by id (R-EVT-001). They remain here until they fire.</summary>public SortedSet<string> CappedEvents = new SortedSet<string>(StringComparer.Ordinal);+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Keep the option (Recommended)", "Wait, with a limit (Recommended)"): each+ /// pending operation card a delegation postponed, by id: the option it was postponed with, which later delegations+ /// keep instead of drawing again, and the turn of its first postponement, from which its wait is counted.</summary>+ public SortedDictionary<string, PostponedOperation> PostponedOperations = new SortedDictionary<string, PostponedOperation>(StringComparer.Ordinal);/// <summary>The option each resolved event was resolved with (chosen or delegated), for events' `requires`.</summary>public Dictionary<string, string> ChosenOptions = new Dictionary<string, string>();/// <summary>Player appointments by office id; valid while the government in AppointedUnder is in office (Cabinet).</summary>@@ -175,6 +179,7 @@ namespace Statecraft.Simc.FiredEvents = new SortedSet<string>(FiredEvents, StringComparer.Ordinal);c.PendingEvents = new List<string>(PendingEvents);c.CappedEvents = new SortedSet<string>(CappedEvents, StringComparer.Ordinal);+ c.PostponedOperations = new SortedDictionary<string, PostponedOperation>(PostponedOperations, StringComparer.Ordinal);c.ChosenOptions = new Dictionary<string, string>(ChosenOptions);c.Appointments = new Dictionary<string, Appointment>(Appointments);c.Placements = new List<Placement>(Placements);@@ -253,6 +258,10 @@ namespace Statecraft.SimList("pending", PendingEvents);// R-EVT-001: absent when no event has waited for the cap, so all existing golden hashes stay byte-for-byte stable.if (CappedEvents.Count > 0) Section("capped", '[', ']', CappedEvents);+ // R-ENEMY-007: absent while no operation waits, as `capped`, so a run that postpones none hashes as before.+ if (PostponedOperations.Count > 0)+ Section("postponed", '{', '}', PostponedOperations.Select(kv => kv.Key + "=" + kv.Value.Option + "@" + kv.Value.Turn.ToString(CultureInfo.InvariantCulture)+ + "@" + kv.Value.Date.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture)));Nl(); sb.Append("chosen{");foreach (var kv in ChosenOptions.OrderBy(k => k.Key, StringComparer.Ordinal)) { Entry(); sb.Append(kv.Key).Append('=').Append(kv.Value); Sep(); }Close('}');@@ -331,4 +340,15 @@ namespace Statecraft.Simreturn sb.ToString();}}++ /// <summary>R-ENEMY-007: a postponed operation card's kept option, and the turn (GameState.Turn) and date of its first+ /// postponement: the wait is counted from the turn, and a late launch's orders end later by the time since the date (Q4).+ /// Immutable, so GameState.Clone can share it.</summary>+ public sealed class PostponedOperation+ {+ public string Option { get; }+ public int Turn { get; }+ public DateTime Date { get; }+ public PostponedOperation(string option, int turn, DateTime date) { Option = option; Turn = turn; Date = date; }+ }}diff --git a/sim/Statecraft.Sim/GoldenRun.cs b/sim/Statecraft.Sim/GoldenRun.csindex 1572f35b9..dd3d07889 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 = "d53edcd56e05f661e3617d680814913e2c42f05f18c6b4317875ea08213c1fa8";+ public const string Hash1950 = "832e8ccc38e3fb36228826816b452477fbbd6ab667ee30cdaef40e5b1b2fe869";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 = "25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7";+ public const string Hash1952 = "841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e";public static readonly DateTime Until1952 = new DateTime(1952, 1, 1);@@ -67,20 +67,25 @@ namespace Statecraft.Simreturn s;}- /// <summary>The smoke5 golden's orders for one turn, what the WebGL ?smoke run's GameRoot.Smoke does: each open event,- /// in the card's order, answered with its first option while the turn's Attention pays for an answer; the rest go- /// to their ministers at the turn's end (docs/determinism.md). SliceSmokeTests plays the same policy.</summary>+ /// <summary>The smoke5 golden's orders for one turn, what the WebGL ?smoke run's GameRoot.Smoke does: each open event is+ /// answered with its first option while the turn's Attention pays and while that option's operation units are in+ /// place (R-ENEMY-007), judged on the no-orders preview, the state the card enables its options from (SimBridge.State:+ /// the turn's start after its standing go-to routes have moved; the smoke itself gives no unit orders); at the first+ /// event that fails either, the rest go to their ministers at turn end. The Attention is the turn start's.+ /// SliceSmokeTests plays the same policy.</summary>public static List<Command> SmokeOrders(Content c, GameState s){if (c == null) throw new ArgumentNullException(nameof(c));if (!c.UsesAttention) throw new NotSupportedException("Golden policies are not defined for gdd-0.3.");var answers = new List<Command>();+ var shown = Simulation.Preview(c, s, Array.Empty<Command>()).State;var left = s.Attention;foreach (var e in s.PendingEvents.Select(id => c.Events.First(x => x.Id == id))){var cmd = new ChooseEventOption(e.Id, e.Options[0].Id);var price = AttentionSystem.Cost(c, s, cmd.Kind);if (price > left + 1e-9) break;+ if (!EventSystem.OperationStatus(c, shown, e.Options[0]).Met) break;left -= price;answers.Add(cmd);}diff --git a/sim/Statecraft.Sim/HebrewOverlay.cs b/sim/Statecraft.Sim/HebrewOverlay.csindex 3b6544006..1d2299c88 100644--- a/sim/Statecraft.Sim/HebrewOverlay.cs+++ b/sim/Statecraft.Sim/HebrewOverlay.cs@@ -58,6 +58,7 @@ namespace Statecraft.Simpublic static IEnumerable<(Type Type, string Property)> Covered =>Bindings.Select(b => (b.Value.DeclaringType!, b.Value.Name)).Concat(new[] { (typeof(GameEvent), nameof(GameEvent.TitleHe)), (typeof(GameEvent), nameof(GameEvent.TextHe)),+ (typeof(GameEvent), nameof(GameEvent.LateTextHe)),(typeof(EventOption), nameof(EventOption.TextHe)) });/// <summary>The Hebrew the typed records hold, as a translation set (no UI strings: those are not content).</summary>@@ -68,7 +69,7 @@ namespace Statecraft.Simif (e.TitleHe != "")set.Events.Add(new EventTranslation{- Id = e.Id, Title = e.TitleHe, Text = e.TextHe, Review = e.TextHeReview,+ Id = e.Id, Title = e.TitleHe, Text = e.TextHe, LateText = e.LateTextHe, Review = e.TextHeReview,Options = e.Options.Where(o => o.TextHe != "").Select(o => new KeyValuePair<string, string>(o.Id, o.TextHe)).ToList(),});foreach (var b in Bindings)@@ -90,7 +91,7 @@ namespace Statecraft.Sim{foreach (var e in c.Events){- e.TitleHe = ""; e.TextHe = ""; e.TextHeReview = "";+ e.TitleHe = ""; e.TextHe = ""; e.LateTextHe = ""; e.TextHeReview = "";foreach (var o in e.Options) o.TextHe = "";}foreach (var b in Bindings)@@ -111,7 +112,7 @@ namespace Statecraft.Sim{var e = c.Events.FirstOrDefault(x => x.Id == t.Id)?? throw new ContentException(file + Translations.EventsFile, t.Id, "no event has this id");- e.TitleHe = t.Title; e.TextHe = t.Text;+ e.TitleHe = t.Title; e.TextHe = t.Text; e.LateTextHe = t.LateText;if (t.Review != "") e.TextHeReview = t.Review;foreach (var o in t.Options)(e.Options.FirstOrDefault(x => x.Id == o.Key)diff --git a/sim/Statecraft.Sim/HistoricalAI.cs b/sim/Statecraft.Sim/HistoricalAI.csindex 007ebd911..d80e53c6f 100644--- a/sim/Statecraft.Sim/HistoricalAI.cs+++ b/sim/Statecraft.Sim/HistoricalAI.cs@@ -1,11 +1,13 @@using System;using System.Collections.Generic;+using System.Globalization;using System.Linq;namespace Statecraft.Sim{- /// <summary>Plays what really happened: picks each pending event's historical option (else its first), answers each- /// capture awaiting the choice, in ordinal id order, with Raid, never Deport (R-CTRL-009; Q-REF-1 (a), owner, 18+ /// <summary>Plays what really happened: stages every future historical operation with ordinary go-to orders, picks each+ /// pending event's historical option (else its first), and answers each capture awaiting the choice, in ordinal id order,+ /// with Raid, never Deport (R-CTRL-009; Q-REF-1 (a), owner, 18/// October 2026, #783 batch 3; impact plan section 4.1 item 1), then sends reserves home down to the current security/// level's minimum call-up (the army demobilised after the 1949 armistices). In the GDD loop the call-up order is retired/// and the sim itself sends the reserves home with the rung (R-WAR-002), so there it sends none. It sends no budget@@ -15,10 +17,18 @@ namespace Statecraft.Sim{public static IReadOnlyList<Command> Commands(Content c, GameState s){- var wanted = s.PendingEvents+ var wanted = OperationMoves(c, s, HistoricalOption).ToList();+ var staged = Simulation.Preview(c, s, wanted).State;+ wanted.AddRange(s.PendingEvents.Select(id => c.Events.First(e => e.Id == id))- .Select(e => (Command)new ChooseEventOption(e.Id, (e.Options.FirstOrDefault(o => o.Historical) ?? e.Options[0]).Id))- .ToList();+ .Select(e => (Event: e, Option: HistoricalOption(e)))+ // If a long route has not finished, leave the card pending. End-turn delegation sees this turn's movement+ // and either makes the same historical decision then or postpones without a refused player command.+ .Where(x => EventSystem.OperationStatus(c, staged, x.Option).Met)+ // Q3: an operation whose front's armistice is pending or signed is left to delegation, which waits or lapses it.+ .Where(x => EventSystem.ArmisticeBlock(c, staged, x.Event, x.Option) == null)+ .Select(x => (Command)new ChooseEventOption(x.Event.Id, x.Option.Id))+ .ToList());// Settlements is ordinal. Each Raid is tried on a copy after the ones before it, as Step will run them, and one the// sim would refuse (a unit with nowhere to go) is left out, so that capture waits.var probe = s.Clone();@@ -39,5 +49,92 @@ namespace Statecraft.Sim}return list;}++ /// <summary>The test-only reference player may replace one of this policy's staging go-to orders with an attack. Remove an+ /// operation answer if the ordinary commands that still precede it no longer put its required units in place.</summary>+ internal static void RemoveOperationChoicesWithoutStaging(Content c, GameState s, List<Command> commands)+ {+ for (int i = 0; i < commands.Count;)+ {+ if (commands[i] is ChooseEventOption choice)+ {+ var option = c.Events.First(e => e.Id == choice.EventId).Options.First(o => o.Id == choice.OptionId);+ if (option.RequiresUnitRegions.Count != 0+ && !EventSystem.OperationStatus(c, Simulation.Preview(c, s, commands.Take(i).ToList()).State, option).Met)+ {+ commands.RemoveAt(i);+ continue;+ }+ }+ i++;+ }+ }++ static EventOption HistoricalOption(GameEvent e) => e.Options.FirstOrDefault(o => o.Historical) ?? e.Options[0];++ /// <summary>R-ENEMY-007: ordinary player go-to orders that put every unit needed by the next operation this+ /// automated player will choose into one of that option's allowed regions. Planning begins before the card opens;+ /// the normal route step spreads a long journey over turns. A lapsed card is not planned again.</summary>+ public static IReadOnlyList<Command> OperationMoves(Content c, GameState s, Func<GameEvent, EventOption> choose)+ {+ if (!c.IsGdd) return Array.Empty<Command>();+ var nextByUnit = c.Events+ // A card past its window still counts while it waits, postponed, for its units (R-ENEMY-007).+ .Where(e => e.To == null || s.Date < e.To.Value || s.PostponedOperations.ContainsKey(e.Id))+ .Where(e => !s.FiredEvents.Contains(e.Id) || s.PendingEvents.Contains(e.Id))+ // A card one of whose requirements is already decided the other way can never fire, so nothing is staged+ // for it (an undecided requirement still allows staging, as the card may yet come).+ .Where(e => !e.Requires.Any(r => !r.Diverged && s.ChosenOptions.ContainsKey(r.Event) && !Timeline.Met(c, s, r)))+ .Select(e => (Event: e, Option: choose(e)))+ .Where(x => x.Option.RequiresUnitRegions.Count != 0)+ .SelectMany(x => x.Option.UnitOrders.Select(o => (x.Event, x.Option, Row: o.Unit)))+ .OrderBy(x => x.Event.From).ThenBy(x => x.Event.Id, StringComparer.Ordinal)+ .GroupBy(x => x.Row, StringComparer.Ordinal).Select(g => g.First())+ .OrderBy(x => x.Row, StringComparer.Ordinal);+ var commands = new List<Command>();+ var probe = s.Clone();+ var spent = new Dictionary<int, int>();+ // Step advances standing routes before it applies these returned commands. Plan against that same state and+ // movement budget, otherwise replacing a route could be valid in the probe but refused after Step advances it.+ Movement.ContinueRoutes(c, probe, spent, new List<Cause>());+ // Staging is a move, not an attack: an enemy-held place in an allowed region (Acre in Galilee) is never its target,+ // so putting a unit in place captures nothing (R-ENEMY-007).+ var closed = Movement.NoEntry(c, probe);+ foreach (var need in nextByUnit)+ {+ int id = c.StartingForces.FindIndex(f => f.Row == need.Row);+ if (id < 0 || !probe.Units.TryGetValue(id, out var unit)) continue; // a dated brigade is planned after it arrives+ var force = c.StartingForces[id];+ // The automated player can issue only the same ordinary go-to that a player can. A replacement in the+ // starting slot, an immobile force, or the last garrison of an occupied place is not available to stage.+ // probe includes earlier queued moves, so two units cannot both be planned away from one occupation.+ if (unit.Side != force.Side || unit.Type != force.Type || Movement.Allowance(c, unit) == 0+ || SettlementControl.LastGarrison(c, probe, unit)) continue;+ var here = c.PlayerRegions.AtHex(unit.Q, unit.R);+ if (here != null && need.Option.RequiresUnitRegions.Contains(here.Id, StringComparer.Ordinal)) continue;+ if (unit.Order == Movement.GoTo)+ {+ var target = unit.OrderTarget.Split(',');+ if (target.Length == 2+ && int.TryParse(target[0], NumberStyles.Integer, CultureInfo.InvariantCulture, out var q)+ && int.TryParse(target[1], NumberStyles.Integer, CultureInfo.InvariantCulture, out var r))+ {+ var destination = c.PlayerRegions.AtHex(q, r);+ if (destination != null && need.Option.RequiresUnitRegions.Contains(destination.Id, StringComparer.Ordinal)) continue;+ }+ }+ var targetHex = need.Option.RequiresUnitRegions+ .SelectMany(region => c.PlayerRegions.Regions[region].MemberHexes)+ .Distinct().Where(h => !closed.Contains((h.Q, h.R)))+ .Select(h => (Hex: h, Route: Movement.Route(c, probe, id, h.Q, h.R, spent)))+ .Where(x => x.Route.Count != 0 && Movement.Full(c, probe, unit, x.Hex.Q, x.Hex.R) == null)+ .OrderBy(x => x.Route[x.Route.Count - 1].Turn).ThenBy(x => x.Route.Count)+ .ThenBy(x => x.Hex.Q).ThenBy(x => x.Hex.R).FirstOrDefault();+ if (targetHex.Route != null+ && Movement.GiveGoTo(c, probe, id, targetHex.Hex.Q, targetHex.Hex.R, spent, new List<Cause>()) == null)+ commands.Add(new UnitOrder(id, Movement.GoTo, targetHex.Hex.Q, targetHex.Hex.R));+ }+ return commands;+ }}}diff --git a/sim/Statecraft.Sim/PlayerRegions.cs b/sim/Statecraft.Sim/PlayerRegions.csindex 5919b797e..f8d883e53 100644--- a/sim/Statecraft.Sim/PlayerRegions.cs+++ b/sim/Statecraft.Sim/PlayerRegions.cs@@ -75,7 +75,7 @@ namespace Statecraft.Simpublic string BindingStatus { get; }public string ControlStatus { get; }public string? OpeningController { get; }- internal PlayerRegionGeography(PlayerRegionDefinition row)+ internal PlayerRegionGeography(PlayerRegionDefinition row, bool hosts){Id = row.Id; CapitalLocation = row.CapitalLocation;MemberHexes = Array.AsReadOnly(row.MemberHexes.Select(h => (h.Q!.Value, h.R!.Value))@@ -83,7 +83,7 @@ namespace Statecraft.SimMemberLocations = Array.AsReadOnly(row.MemberLocations.OrderBy(x => x, StringComparer.Ordinal).ToArray());FieldHexes = Array.AsReadOnly(row.FieldHexes.Select(h => (h.Q!.Value, h.R!.Value)).OrderBy(h => h.Item1).ThenBy(h => h.Item2).ToArray());- FieldHosts = Array.AsReadOnly(row.FieldHexes.Where(h => h.Field.Length > 0).Select(h => new PlayerRegionFieldHost(h))+ FieldHosts = Array.AsReadOnly(row.FieldHexes.Where(h => hosts && h.Field.Length > 0).Select(h => new PlayerRegionFieldHost(h)).OrderBy(h => h.Field, StringComparer.Ordinal).ToArray());DesignNote = row.DesignNote; Sources = Array.AsReadOnly(row.Sources.OrderBy(x => x, StringComparer.Ordinal).ToArray());CapitalApproval = row.CapitalApproval; BindingStatus = row.BindingStatus;@@ -98,7 +98,7 @@ namespace Statecraft.Sim}}- /// <summary>R-CITY-006. One validator and one immutable exact-identity geography index for all consumers.+ /// <summary>R-CITY-006, R-ENEMY-007. One validator and one immutable GDD geography index for all consumers./// A member place is a settlement, a named map location, a designated site (sites.yaml) or a locality placed by/// <see cref="LocalityHexesFileName"/> (owner, 2 November 2026: Q1 "Accept localities"; "Fix all, then ship/// (Recommended)": "Accept site ids too"). capital_location is the region's label place (Q3 "All nine drafts as@@ -108,7 +108,7 @@ namespace Statecraft.Sim{public const string FileName = "regions.yaml";/// <summary>Each locality's hex, written by tools/locality_hexes.py with the map's projection and rounding, so the- /// sim needs no trigonometry (docs/determinism.md). Read only under exact gdd-0.3, with regions.yaml.</summary>+ /// sim needs no trigonometry (docs/determinism.md). Read under either GDD identity, with regions.yaml.</summary>public const string LocalityHexesFileName = "map/locality_hexes.yaml";/// <summary>Owner, 7 November 2026, #1689: "These two only (Recommended)". The only fields a settlement may host.</summary>static readonly string[] SettlementHostFields = { "F19", "F20" };@@ -197,9 +197,12 @@ namespace Statecraft.Simif (result.places.ContainsKey(id)) Fail(field, "location already belongs to another region");if (!ownHexes.Contains(hex)) Fail(field, "effective location lies outside member_hexes");}- // R-POP-004 (#1717): a field's host is data only. F01 to F20 are the fields' places in the file's order, so a- // typed label cannot move the permission below. A row with no host keys has no host (synthetic regions).- for (int i = 0; i < row.FieldHexes.Count; i++)+ // R-POP-004 (#1717): a field's host is data only, under exact gdd-0.3: since R-ENEMY-007 (#2543, "Both rulesets+ // (Recommended)") gdd-0.1 reads this file for its geography, but it reads no host (mvp.md: "the legacy and+ // gdd-0.1 identities read none of this"). F01 to F20 are the fields' places in the file's order, so a typed label+ // cannot move the permission below. A row with no host keys has no host (synthetic regions).+ var readsHosts = c.Ruleset == SaveGame.Gdd03Ruleset;+ for (int i = 0; i < row.FieldHexes.Count && readsHosts; i++){var h = row.FieldHexes[i]; var field = FormattableString.Invariant($"field_hexes[{i}]");var label = FormattableString.Invariant($"F{++fieldNumber:00}");@@ -215,7 +218,7 @@ namespace Statecraft.Simelse if (!ownPlaces.Contains(h.Host)) Fail(field + ".host", $"{label}: {h.Host} is not a member location of {row.Id}");}if (string.IsNullOrWhiteSpace(row.CapitalLocation) || !ownPlaces.Contains(row.CapitalLocation)) Fail("capital_location", "must name a member location on a member hex");- var frozen = new PlayerRegionGeography(row);+ var frozen = new PlayerRegionGeography(row, readsHosts);result.regions.Add(row.Id, frozen); result.capitals.Add(row.CapitalLocation, row.Id);foreach (var h in ownHexes) result.hexes.Add(h, row.Id);foreach (var p in ownPlaces) result.places.Add(p, row.Id);diff --git a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs b/sim/Statecraft.Sim/Reference/ReferencePlayer.csindex 5887f4b11..3ea277f8e 100644--- a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs+++ b/sim/Statecraft.Sim/Reference/ReferencePlayer.cs@@ -23,22 +23,29 @@ namespace Statecraft.Sim.Reference{if (!c.UsesAttention) throw new NotSupportedException("The reference policy is not defined for gdd-0.3.");var list = new List<Command>(HistoricalAI.Commands(c, s));+ IReadOnlyList<Command> Finish()+ {+ HistoricalAI.RemoveOperationChoicesWithoutStaging(c, s, list);+ return list;+ }var left = s.Attention - list.Sum(x => AttentionSystem.Cost(c, s, x.Kind));Attack(c, s, list, ref left);House(c, s, list, ref left);var halutz = c.UnitTypes.FirstOrDefault(t => t.Id == "halutz");- if (halutz == null) return list;+ if (halutz == null) return Finish();Build(c, s, list, ref left);- if (s.Units.Values.Any(u => Projects.IsPioneer(u.Type)) || s.Cohorts.Values.Any(k => k.Type == halutz.Id)) return list;+ if (s.Units.Values.Any(u => Projects.IsPioneer(u.Type)) || s.Cohorts.Values.Any(k => k.Type == halutz.Id)) return Finish();var trainCost = AttentionSystem.Cost(c, s, Training.TrainKind);- if (trainCost > left + 1e-9) return list; // training borrows, so the Treasury does not hold it back- foreach (var city in s.Cities.Values)+ if (trainCost <= left + 1e-9) // training borrows, so the Treasury does not hold it back{- if (Training.Idle(city) < 1 || !Training.HasFacility(c, s, city.Id, halutz.Facility)) continue;- list.Add(new Train(city.Id, halutz.Id, 1));- break;+ foreach (var city in s.Cities.Values)+ {+ if (Training.Idle(city) < 1 || !Training.HasFacility(c, s, city.Id, halutz.Facility)) continue;+ list.Add(new Train(city.Id, halutz.Id, 1));+ break;+ }}- return list;+ return Finish();}/// <summary>The attack policy in the class comment. Unit orders are free (D-A6), but the cost is still checked.</summary>@@ -55,6 +62,9 @@ namespace Statecraft.Sim.Reference{var preview = Combat.Preview(c, s, u.Id, u.Q + dq, u.R + dr);if (preview == null || preview.Value.RatioPercent < AttackRatioPercent) continue;+ // Keep the stated attack policy identical: a free operation-staging go-to waits for the next turn+ // rather than moving the unit before an attack this policy would already have ordered.+ list.RemoveAll(x => x is UnitOrder o && o.Unit == u.Id && o.Order == Movement.GoTo);list.Add(new UnitOrder(u.Id, Combat.Attack, u.Q + dq, u.R + dr));left -= cost;attacking++;diff --git a/sim/Statecraft.Sim/Scenario.cs b/sim/Statecraft.Sim/Scenario.csindex 7b9d7d8f9..35b6f0ccf 100644--- a/sim/Statecraft.Sim/Scenario.cs+++ b/sim/Statecraft.Sim/Scenario.cs@@ -137,11 +137,35 @@ namespace Statecraft.Sim{var s = Simulation.NewGame(c, Seed ?? GoldenRun.Seed, Mode.Historical);var pending = Steps.OrderBy(x => x.OnDate).ToList();+ var scriptedThrough = Steps.SelectMany(step => step.Built.Select(command => (step.OnDate, Unit: command is Move m+ ? (int?)m.Unit : command is UnitOrder o ? o.Unit : null)))+ .Where(x => x.Unit.HasValue).GroupBy(x => x.Unit!.Value)+ .ToDictionary(g => g.Key, g => g.Max(x => x.OnDate).AddMonths(1));for (int turn = 0; turn < 1000 && s.Date < UntilDate && s.GameOver == null; turn++){- var now = new List<Command>();+ // The scenario is the player: stage the historical/recommended operation choice with ordinary go-to orders.+ // Let an explicitly scripted movement and its following turn finish first, then return that unit to the+ // automated plan. After this turn's scripted commands are appended, preview the combined player queue so an+ // operation whose last unit arrives now is answered now rather than delegated.+ var now = HistoricalAI.OperationMoves(c, s, e => e.Options.FirstOrDefault(o => o.Historical)+ ?? e.Options.FirstOrDefault(o => o.Recommended) ?? e.Options[0])+ .Where(x => x is not UnitOrder o || !scriptedThrough.TryGetValue(o.Unit, out var through) || s.Date > through).ToList();while (pending.Count > 0 && pending[0].OnDate <= s.Date) { now.AddRange(pending[0].Built); pending.RemoveAt(0); }now = now.Where(Simulation.IsInstant).Concat(now.Where(x => !Simulation.IsInstant(x))).ToList();+ var staged = Simulation.Preview(c, s, now).State;+ var operationChoices = s.PendingEvents.Select(id => c.Events.First(e => e.Id == id))+ .Select(e => (Event: e, Option: e.Options.FirstOrDefault(o => o.Historical)+ ?? e.Options.FirstOrDefault(o => o.Recommended) ?? e.Options[0]))+ .Where(x => x.Option.RequiresUnitRegions.Count != 0 && EventSystem.OperationStatus(c, staged, x.Option).Met)+ .Select(x => (Command)new ChooseEventOption(x.Event.Id, x.Option.Id));+ var attention = c.UsesAttention ? staged.Attention : double.PositiveInfinity;+ foreach (var choice in operationChoices)+ {+ var cost = c.UsesAttention ? AttentionSystem.Cost(c, s, choice.Kind) : 0;+ if (cost > attention + 1e-9) continue;+ attention -= cost;+ now.Add(choice);+ }var r = Simulation.Step(c, s, now);if (r.Rejected.Any(j => !CardRefusal(j))){diff --git a/sim/Statecraft.Sim/Simulation.cs b/sim/Statecraft.Sim/Simulation.csindex 8a9c0528f..96d6ca080 100644--- a/sim/Statecraft.Sim/Simulation.cs+++ b/sim/Statecraft.Sim/Simulation.cs@@ -88,6 +88,7 @@ namespace Statecraft.Simwhy.Add(new Cause("era", s.GameOver, 0, PlayerText.GameOver(s.GameOver), key: CauseKeys.EraEnded));}ContentWindows.Update(c, s, turnStart);+ EventSystem.LapseExpiredOperations(c, s, why);Cabinet.ExpireOnGovernmentChange(c, s, why);if (c.UsesAttention) AttentionSystem.Refill(c, s);// A game that just ended raises no new events, but the unfired cards of recorded objectives (R-LOOP-004, R-OBJ-003;diff --git a/sim/Statecraft.Sim/StartingForces.cs b/sim/Statecraft.Sim/StartingForces.csindex 88c1b163c..9927e5ef0 100644--- a/sim/Statecraft.Sim/StartingForces.cs+++ b/sim/Statecraft.Sim/StartingForces.cs@@ -12,6 +12,8 @@ namespace Statecraft.Simpublic sealed class StartingForce{public string Row { get; set; } = "";+ /// <summary>Player-facing names from the same units_1948.yaml row, used when a sim report names a required brigade.</summary>+ public string Name { get; set; } = "";/// <summary>The anchor's place, as the row names it.</summary>public string Anchor { get; set; } = "";public string Type { get; set; } = "";@@ -104,7 +106,7 @@ namespace Statecraft.Simif (!hex.Land) throw new ContentException(FileName, $"{at}.anchors[{k}]", FormattableString.Invariant($"hex q={q} r={r} is not a land hex in {ContentLoader.HexesFile}"));var force = new StartingForce{- Row = id, Anchor = Text(anchor, "place"), Type = TypeFor(c, side, at), Side = side,+ Row = id, Name = Text(row, "name"), Anchor = Text(anchor, "place"), Type = TypeFor(c, side, at), Side = side,Strength = units, Q = q, R = r, Status = Text(row, "status"), Arrives = day == start ? (DateTime?)null : asOf,CheckedOn = Text(row, "checked_on"),};diff --git a/sim/Statecraft.Sim/Translations.cs b/sim/Statecraft.Sim/Translations.csindex f8b1a1d19..074d822c2 100644--- a/sim/Statecraft.Sim/Translations.cs+++ b/sim/Statecraft.Sim/Translations.cs@@ -49,6 +49,8 @@ namespace Statecraft.Simpublic string Id { get; set; } = "";public string Title { get; set; } = "";public string Text { get; set; } = "";+ /// <summary>The card's late text (R-ENEMY-007, the event's late_text_he), or "" for none.</summary>+ public string LateText { get; set; } = "";/// <summary>Option id and text, in the event file's order.</summary>public List<KeyValuePair<string, string>> Options { get; set; } = new List<KeyValuePair<string, string>>();/// <summary><see cref="HebrewReview.AgentChecked"/> until a native speaker, or an AI-assisted contributor who@@ -143,7 +145,7 @@ namespace Statecraft.Sim{if (!Id.IsMatch(id)) throw new ContentException(Where(EventsFile), id, "not an event id");var map = Mapping(node, Where(EventsFile), id);- Only(map, Where(EventsFile), id, "title", "text", "options", "review");+ Only(map, Where(EventsFile), id, "title", "text", "late_text", "options", "review");var e = new EventTranslation{Id = id,@@ -151,6 +153,7 @@ namespace Statecraft.SimText = Text(Get(map, "text", Where(EventsFile), id), Where(EventsFile), id + ".text"),Review = Review(map, Where(EventsFile), id),};+ if (map.Children.TryGetValue(new YamlScalarNode("late_text"), out var late)) e.LateText = Text(late, Where(EventsFile), id + ".late_text");foreach (var (oid, text) in Entries(Mapping(Get(map, "options", Where(EventsFile), id), Where(EventsFile), id + ".options"),Where(EventsFile))){@@ -302,6 +305,7 @@ namespace Statecraft.Simevents.Append(Key(e.Id)).Append(":\n");events.Append(" title: ").Append(Json(e.Title)).Append('\n');events.Append(" text: ").Append(Json(e.Text)).Append('\n');+ if (e.LateText != "") events.Append(" late_text: ").Append(Json(e.LateText)).Append('\n');events.Append(" options:\n");foreach (var o in e.Options) events.Append(" ").Append(Key(o.Key)).Append(": ").Append(Json(o.Value)).Append('\n');if (e.Review != "") events.Append(" review: ").Append(Json(e.Review)).Append('\n');@@ -410,6 +414,7 @@ namespace Statecraft.Simif (string.IsNullOrEmpty(StringOf(e, "title_he"))) continue;var t = new EventTranslation { Id = id, Title = StringOf(e, "title_he")!, Text = StringOf(e, "text_he") ?? "" };if (!string.IsNullOrEmpty(StringOf(e, "text_he_review"))) t.Review = StringOf(e, "text_he_review")!;+ if (!string.IsNullOrEmpty(StringOf(e, "late_text_he"))) t.LateText = StringOf(e, "late_text_he")!;if (Value(e, "options") is YamlSequenceNode options)foreach (var o in options.Children.OfType<YamlMappingNode>())if (StringOf(o, "id") is string oid && !string.IsNullOrEmpty(StringOf(o, "text_he")))diff --git a/tools/tests/test_translate.py b/tools/tests/test_translate.pyindex f18de16af..fc9ff6e75 100644--- a/tools/tests/test_translate.py+++ b/tools/tests/test_translate.py@@ -103,6 +103,26 @@ def test_refuses_a_stray_brace_in_an_event(value):translate.set_event(EVENT, changes(title_he=value))+LATE = EVENT.replace("anchor: soft\n", "anchor: soft\n# The late text's comment.\nlate_text: '{prime_minister} asks again: vote now?'\n")+++def test_a_late_text_gets_its_hebrew_after_it_and_is_part_of_the_event():+ """R-ENEMY-007: late_text_he sits under late_text, and EventRules wants it exactly when the event has Hebrew."""+ late_he = "{prime_minister} שואל שוב: להצביע עכשיו?"+ out, _ = translate.set_event(LATE, changes(late_text_he=late_he))+ lines = out.split("\n")+ assert lines[lines.index("late_text: '{prime_minister} asks again: vote now?'") + 1] == f"late_text_he: {translate._scalar(late_he)}"+ assert yaml12.load(out)["late_text_he"] == late_he+ assert [line for line in LATE.split("\n") if line not in lines] == []+ with pytest.raises(translate.Refused, match="all or none"):+ translate.set_event(LATE, changes())+ with pytest.raises(translate.Refused, match="late text"):+ translate.set_event(EVENT, changes(late_text_he=late_he))+ cleared, _ = translate.set_event(out, changes(title_he="", text_he="", late_text_he="",+ options={"yes_vote": "", "wait": ""}))+ assert cleared == LATE++UI_EN = 'a.one: "One {0}"\na.two: "Two"\nb.three: "Three"\n'UI_HE = '# Hebrew.\na.one: "אחד {0}"\nb.three: "שלוש"\n'@@ -202,6 +222,25 @@ def test_hebrew_saves_into_the_event_and_the_ui_file(tmp_path, monkeypatch):[line for line in before.split("\n") if line.startswith(("title_he:", "text_he_review:"))]++def test_a_late_text_has_its_row_in_every_language(langs):+ r = rows()+ assert r["event:rhodes_talks:late_text"]["en"].startswith("Egypt and Israel have accepted a cease-fire")+ assert r["event:rhodes_talks:late_text"]["unit"] == "event:rhodes_talks"+ texts, _ = translate.load("he")+ assert texts["event:rhodes_talks:late_text"].startswith("מצרים וישראל קיבלו הפסקת אש")+ edits = {"event:rhodes_talks:title": "Pourparlers à Rhodes", "event:rhodes_talks:text": "{foreign_minister} décide.",+ "event:rhodes_talks:option:send_delegation": "Envoyer", "event:rhodes_talks:option:decline": "Refuser"}+ assert "all or none" in translate.save("fr", edits, {})["errors"]["event:rhodes_talks"]+ late = {"event:rhodes_talks:late_text": "Plus tard, {foreign_minister} décide."}+ assert translate.save("fr", {**edits, **late}, {})["errors"] == {}+ events = yaml12.load((langs / "fr/events.yaml").read_text(encoding="utf-8"))+ assert events["rhodes_talks"] == {"title": "Pourparlers à Rhodes", "text": "{foreign_minister} décide.",+ "late_text": "Plus tard, {foreign_minister} décide.",+ "options": {"send_delegation": "Envoyer", "decline": "Refuser"},+ "review": "agent-checked"}+ assert translate.load("fr")[0]["event:rhodes_talks:late_text"] == "Plus tard, {foreign_minister} décide."+FR = {"event:altalena:title": "L'Altalena", "event:altalena:text": "{defense_minister} décide.","event:altalena:option:enforce": "Imposer", "event:altalena:option:compromise": "Céder"}diff --git a/tools/translate.py b/tools/translate.pyindex b9608d3b4..5ca460fbe 100644--- a/tools/translate.py+++ b/tools/translate.py@@ -8,7 +8,7 @@ the translation on the right.Usage: uv run tools/translate.py [--port 8765] [--no-open] (serves http://127.0.0.1:PORT; Ctrl+C stops it)-Hebrew is written where the game reads it: the events' title_he / text_he / options' text_he (#1064) and+Hebrew is written where the game reads it: the events' title_he / text_he / late_text_he / options' text_he (#1064) andunity/Assets/UI/strings.he.yaml (#12), changing only the edited lines so comments and layout stay. Hebrew content namesare shown but not edited here: they carry their own sources. Any other language is written totranslations/<lang>/{events,ui,content}.yaml, which the game does not read yet. Every language keeps the Hebrew rules@@ -162,13 +162,19 @@ def _put(lines: list[str], key: str, value: str, indent: int, after: int, lo: indef set_event(text: str, changes: dict) -> tuple[str, list[str]]:- """changes: title_he, text_he, options {id: text_he}, native_read. Returns the new file text and its warnings."""+ """changes: title_he, text_he, late_text_he (optional), options {id: text_he}, native_read. Returns the new file text+ and its warnings."""data = yaml12.load(text)options = {o["id"]: o for o in data.get("options") or []}if set(changes["options"]) - set(options):raise Refused(f"unknown option {sorted(set(changes['options']) - set(options))}")+ late_he = changes.get("late_text_he", "").strip()+ has_late = isinstance(data.get("late_text"), str)+ if late_he and not has_late:+ raise Refused("a late text in Hebrew needs the event's late_text (R-ENEMY-007)")fields = [("title", "title_he", changes["title_he"].strip(), data.get("title", "")),("text", "text_he", changes["text_he"].strip(), data.get("text", ""))]+ fields += [("late text", "late_text_he", late_he, data["late_text"])] if has_late else []fields += [(f"option {oid}", oid, changes["options"].get(oid, "").strip(), o.get("text", ""))for oid, o in options.items()]warnings = check_unit([(name, v, en) for name, _, v, en in fields], hebrew=True)@@ -178,8 +184,10 @@ def set_event(text: str, changes: dict) -> tuple[str, list[str]]:lines = text.split("\n")title_he, text_he = fields[0][2], fields[1][2]review = REVIEW if filled and not changes.get("native_read") else ""- for key, value in (("title_he", title_he), ("text_he", text_he), ("text_he_review", review)):- prev = {"title_he": "text", "text_he": "title_he", "text_he_review": "text_he"}[key]+ keys = (("title_he", title_he), ("text_he", text_he), ("text_he_review", review)) + \+ ((("late_text_he", late_he),) if has_late else ())+ for key, value in keys:+ prev = {"title_he": "text", "text_he": "title_he", "text_he_review": "text_he", "late_text_he": "late_text"}[key]after = _find(lines, prev, 0)_put(lines, key, value, 0, _find(lines, "text", 0) if after is None else after)expected.pop(key, None)@@ -225,7 +233,8 @@ def check_unit(fields: list[tuple[str, str, str]], hebrew: bool) -> list[str]:"""fields: (name, value, English) of one event. All or none, then each value's own checks; returns the warnings."""filled = [f for f in fields if f[1]]if filled and len(filled) != len(fields):- raise Refused("all or none: the title, the body and every option's text (docs/WRITING_EVENTS.md)")+ raise Refused("all or none: the title, the body, the late text when the event has one, and every option's text "+ "(docs/WRITING_EVENTS.md)")return [w for name, value, english in filled for w in _check(name, value, english, hebrew, event=True)]@@ -278,6 +287,8 @@ def catalog() -> list[dict]:group = {"group": unit, "group_label": d.get("title", eid), "unit": unit}rows.append({"key": f"{unit}:title", "label": "Title", "en": d.get("title", ""), **group})rows.append({"key": f"{unit}:text", "label": "Body", "en": d.get("text", ""), **group})+ if isinstance(d.get("late_text"), str):+ rows.append({"key": f"{unit}:late_text", "label": "Late text", "en": d["late_text"], **group})rows += [{"key": f"{unit}:option:{o['id']}", "label": f"Option · {o['id']}", "en": o.get("text", ""), **group}for o in d.get("options") or []]for k, v in _parse(UI_EN).items():@@ -324,6 +335,8 @@ def load(lang: str) -> tuple[dict[str, str], set[str]]:unit = f"event:{eid}"if d.get("title_he"):texts[f"{unit}:title"], texts[f"{unit}:text"] = d["title_he"], d.get("text_he", "")+ if d.get("late_text_he"):+ texts[f"{unit}:late_text"] = d["late_text_he"]texts.update({f"{unit}:option:{o['id']}": o["text_he"] for o in d.get("options") or [] if o.get("text_he")})if d.get("text_he_review"):flagged.add(unit)@@ -336,7 +349,7 @@ def load(lang: str) -> tuple[dict[str, str], set[str]]:return texts, flaggedfor eid, e in _lang_data(lang, "events").items():unit = f"event:{eid}"- texts.update({f"{unit}:{k}": e[k] for k in ("title", "text") if e.get(k)})+ texts.update({f"{unit}:{k}": e[k] for k in ("title", "text", "late_text") if e.get(k)})texts.update({f"{unit}:option:{oid}": t for oid, t in (e.get("options") or {}).items() if t})if e.get("review"):flagged.add(unit)@@ -385,9 +398,11 @@ def inline_hebrew(content: Path, ui_en: Path, ui_he: Path) -> tuple[str, str, stfor eid, (_, d) in _events(content / "events").items():if not isinstance(d.get("title_he"), str) or not d["title_he"]:continue- e = {"title": d["title_he"], "text": d.get("text_he") if isinstance(d.get("text_he"), str) else "",- "options": {o["id"]: o["text_he"] for o in d.get("options") or []- if isinstance(o, dict) and isinstance(o.get("id"), str) and isinstance(o.get("text_he"), str) and o["text_he"]}}+ e = {"title": d["title_he"], "text": d.get("text_he") if isinstance(d.get("text_he"), str) else ""}+ if isinstance(d.get("late_text_he"), str) and d["late_text_he"]:+ e["late_text"] = d["late_text_he"]+ e |= {"options": {o["id"]: o["text_he"] for o in d.get("options") or []+ if isinstance(o, dict) and isinstance(o.get("id"), str) and isinstance(o.get("text_he"), str) and o["text_he"]}}if isinstance(d.get("text_he_review"), str) and d["text_he_review"]:e["review"] = d["text_he_review"]events[eid] = e@@ -469,6 +484,7 @@ def save(lang: str, edits: dict[str, str], native: dict[str, bool], dry: bool =for unit in units:path, d = events[unit[6:]]changes = {"title_he": new.get(f"{unit}:title", ""), "text_he": new.get(f"{unit}:text", ""),+ "late_text_he": new.get(f"{unit}:late_text", ""),"native_read": read(unit),"options": {o["id"]: new.get(f"{unit}:option:{o['id']}", "") for o in d.get("options") or []}}try:@@ -485,10 +501,12 @@ def save(lang: str, edits: dict[str, str], native: dict[str, bool], dry: bool =events, ui, content = _lang_data(lang, "events"), _lang_data(lang, "ui"), _lang_data(lang, "content")for unit in units:eid, keys = unit[6:], [r["key"] for r in rows.values() if r["unit"] == unit]- entry = {k: v for k, v in events.get(eid, {}).items() if k not in ("title", "text", "options", "review")}- if new.get(keys[0]):- entry = {"title": new[keys[0]], "text": new[keys[1]],- "options": {k.split(":")[-1]: new[k] for k in keys[2:]}, **entry}+ entry = {k: v for k, v in events.get(eid, {}).items()+ if k not in ("title", "text", "late_text", "options", "review")}+ if new.get(f"{unit}:title"):+ late = {"late_text": new[f"{unit}:late_text"]} if f"{unit}:late_text" in keys else {}+ entry = {"title": new[f"{unit}:title"], "text": new[f"{unit}:text"], **late,+ "options": {k.split(":")[-1]: new[k] for k in keys if k.startswith(f"{unit}:option:")}, **entry}if not read(unit):entry["review"] = REVIEWevents[eid] = entrydiff --git a/tools/web_check.py b/tools/web_check.pyindex 7f63c5026..6c2757d78 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 d53edcd56e05f661e3617d680814913e2c42f05f18c6b4317875ea08213c1fa8" --expect "GOLDEN OK hash1952 25fbfb8fd3e5109d0e2e39f7d3af50322083e144ba137cf4304f4331b954dcc7"+ uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK hash1950 832e8ccc38e3fb36228826816b452477fbbd6ab667ee30cdaef40e5b1b2fe869" --expect "GOLDEN OK hash1952 841f05536a49b68cd10d3f1ca548e559098415119284d483620f14bb6a4bb44e"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)Every run needs a positive check: a nonblank --expect, --startscreen, --persistence or --first-save (#2690).diff --git a/unity/Assets/Scripts/UI/CauseText.cs b/unity/Assets/Scripts/UI/CauseText.csindex 9db71d170..a3df07b50 100644--- a/unity/Assets/Scripts/UI/CauseText.cs+++ b/unity/Assets/Scripts/UI/CauseText.cs@@ -72,6 +72,21 @@ namespace Statecraft.Game.UIcase CauseKeys.EventDelegatedPartial:return text.Format(key, cause.Args[2] == "" ? text["why.cause.cabinet"] : Local(cause.Args[2], cause.Args[3], text),Local(cause.Args[0], cause.Args[1], text));+ case CauseKeys.OperationPostponed:+ case CauseKeys.OperationLapsed:+ // CauseTextTests' sim-only English compatibility path has no presentation unit catalogue. The sim's+ // Message is still the exact pre-localization report in that case; GameRoot supplies rows and gets the+ // player-facing unit and region names below. Hebrew always uses the localized structured arguments.+ if (text["ui.lang"] == UiLanguage.English && rows.Count == 0) return cause.Message;+ return text.Format(key, Local(cause.Args[0], cause.Args[1], text), OperationMoves(cause, rows, text));+ case CauseKeys.OperationLapsedSigned:+ case CauseKeys.OperationWaitsForArmistice:+ // R-ENEMY-007: the front is the third argument, named from the map's front strings.+ if (text["ui.lang"] == UiLanguage.English && rows.Count == 0) return cause.Message;+ return text.Format(key, Local(cause.Args[0], cause.Args[1], text), text["map.front_" + cause.Args[2]]);+ case CauseKeys.OperationLapsedUnitLost:+ if (text["ui.lang"] == UiLanguage.English && rows.Count == 0) return cause.Message;+ return text.Format(key, Local(cause.Args[0], cause.Args[1], text), OperationUnits(cause, rows, text));case CauseKeys.EventAmount:case CauseKeys.EventStock:case CauseKeys.EventGrant:@@ -86,6 +101,32 @@ namespace Statecraft.Game.UI}}+ /// <summary>R-ENEMY-007: the units a lapsed operation lost, in the player's language, from the cause's unit arguments.</summary>+ static string OperationUnits(Cause cause, IReadOnlyList<UnitEntry> rows, UiText text)+ {+ var units = new List<string>();+ for (int i = 2; i + 1 < cause.Args.Count; i += 2)+ {+ var row = rows.FirstOrDefault(x => x.Id == cause.Args[i]);+ units.Add(row == null ? cause.Args[i] : text["ui.lang"] == UiLanguage.Hebrew && !string.IsNullOrEmpty(row.NameHe) ? row.NameHe : row.Name);+ }+ return string.Join(", ", units);+ }++ static string OperationMoves(Cause cause, IReadOnlyList<UnitEntry> rows, UiText text)+ {+ var moves = new List<string>();+ for (int i = 2; i + 1 < cause.Args.Count; i += 2)+ {+ var row = rows.FirstOrDefault(x => x.Id == cause.Args[i]);+ var unit = row == null ? cause.Args[i]+ : text["ui.lang"] == UiLanguage.Hebrew && !string.IsNullOrEmpty(row.NameHe) ? row.NameHe : row.Name;+ var regions = string.Join(" / ", cause.Args[i + 1].Split('|').Select(id => text["operation.region." + id]));+ moves.Add(text.Format("event.operation_move", unit, regions));+ }+ return string.Join("; ", moves);+ }+// #1682: these branches use captured ids, values and resident flags, never the live GameState.static readonly HashSet<string> RemainingKeys = new HashSet<string>{diff --git a/unity/Assets/Scripts/UI/EventCardPresenter.cs b/unity/Assets/Scripts/UI/EventCardPresenter.csindex af1f41725..00365e534 100644--- a/unity/Assets/Scripts/UI/EventCardPresenter.cs+++ b/unity/Assets/Scripts/UI/EventCardPresenter.cs@@ -1,5 +1,7 @@#nullable enableusing System.Linq;+using System.Collections.Generic;+using Statecraft.Game.Map.Units;using Statecraft.Sim;using UnityEngine.UIElements;@@ -34,6 +36,13 @@ namespace Statecraft.Game.UIpublic const string RejoinClass = "event-rejoin";/// <summary>One line under an option for one of its effects, from the sim's preview (#1125, R-EVT-005; Statecraft.uss).</summary>public const string EffectClass = "event-effect";+ public const string RequirementClass = "event-requirement";+ public const string MissingRequirementClass = "event-requirement-unmet";+ /// <summary>The red line under an operation option that waits for, or is ended by, its front's armistice (Q3).</summary>+ public const string ArmisticeClass = "event-requirement-armistice";++ /// <summary>The map's sourced unit rows, supplied by GameRoot after map parsing, for operation requirement names.</summary>+ public IReadOnlyList<UnitEntry> Units { get; set; } = System.Array.Empty<UnitEntry>();readonly VisualElement card; readonly SimBridge bridge; readonly UiText text; readonly PortraitCatalog? portraits;readonly EventImageCatalog? photos;@@ -47,6 +56,7 @@ namespace Statecraft.Game.UI/// <summary>Tests: the card is waiting for the start screen to close before it looks up its photograph.</summary>internal bool PhotoWaits => photoWaits;readonly VisualElement band, head, options, layer, hudRoot; readonly Label credit, delegateLine;+ readonly VisualElement? toast; float toastDefaultTop = float.NaN;/// <summary>The body: the text and the options with their effect lines, which scroll together only when they overflow/// the card (#1853); the head above it and the foot with Hide below it stay pinned.</summary>readonly ScrollView scroll;@@ -134,6 +144,9 @@ namespace Statecraft.Game.UIillustrationSwitch.clicked += onSwitch;foreach (var e in new[] { band, credit, head, scroll, options }) e.RegisterCallback<GeometryChangedEvent>(OnPhotoGeometry);layer.RegisterCallback<GeometryChangedEvent>(OnColumnGeometry);+ toast = hudRoot.Q("toast");+ toast?.RegisterCallback<GeometryChangedEvent>(OnToastGeometry);+ card.RegisterCallback<GeometryChangedEvent>(OnToastGeometry);card.RegisterCallback<GeometryChangedEvent>(OnCardGeometry);presses = new PressSource(options);bridge.Changed += Render;@@ -159,6 +172,8 @@ namespace Statecraft.Game.UIvideo?.Stop();foreach (var e in new[] { band, credit, head, scroll, options }) e.UnregisterCallback<GeometryChangedEvent>(OnPhotoGeometry);layer.UnregisterCallback<GeometryChangedEvent>(OnColumnGeometry);+ toast?.UnregisterCallback<GeometryChangedEvent>(OnToastGeometry);+ card.UnregisterCallback<GeometryChangedEvent>(OnToastGeometry);card.UnregisterCallback<GeometryChangedEvent>(OnCardGeometry);presses.Dispose();card.Q<VisualElement>("event-options")?.Clear(); card.style.display = DisplayStyle.None;@@ -227,7 +242,13 @@ namespace Statecraft.Game.UI{var c = bridge.Content; var s = bridge.State;var pending = s.PendingEvents.Select(id => c.Events.First(e => e.Id == id)).ToList();- var open = pending.Where(e => bridge.QueuedLike(new ChooseEventOption(e.Id, "")) == null && !bridge.EndingCardSeen(e.Id)).ToList();+ var open = pending.Where(e => bridge.QueuedLike(new ChooseEventOption(e.Id, "")) == null && !bridge.EndingCardSeen(e.Id))+ // R-ENEMY-007: an operation card that waits (postponed, for its units) is shown after the turn's other cards, and one+ // that waits for its front's pending armistice after that armistice (Q3, owner, 7 November 2026: "Decide armistice+ // first (Recommended)"), so the cards the player can decide now come first. A stable sort: otherwise as before.+ .OrderBy(e => s.PostponedOperations.ContainsKey(e.Id)+ || e.Options.Any(o => EventSystem.ArmisticeBlock(c, s, e, o) == EventSystem.RefusedOperationArmisticeFirst) ? 1 : 0)+ .ToList();Shown = open.FirstOrDefault();if (Shown == null) { collapsedFor = null; openedFor = null; scrolledFor = null; }if (bridge.Session != session) { session = bridge.Session; collapsedFor = null; focusedFor = null; openedFor = null; scrolledFor = null; }@@ -278,7 +299,8 @@ namespace Statecraft.Game.UIbanner.style.display = banner.text.Length == 0 ? DisplayStyle.None : DisplayStyle.Flex;var office = holder == null ? null : c.Offices.First(o => o.Id == e.Office);card.Q<Label>("event-office").text = holder == null ? "" : text.Format("event.office", ContentNames.Of(text, office!, holder, date), ContentNames.Of(text, holder));- card.Q<Label>("event-text").text = Local(EventSystem.Render(c, s, e), variant == null ? e.TextHe : "");+ // R-ENEMY-007: a card shown after its window closed shows its late text, in Hebrew its late_text_he.+ card.Q<Label>("event-text").text = Local(EventSystem.Render(c, s, e), variant == null ? (EventSystem.ShowsLate(e, s.Date) ? e.LateTextHe : e.TextHe) : "");var objective = card.Q<Label>("event-objective"); // an objective card's line (#380); none on any other cardobjective.text = ObjectiveLine(c, s, e, text);objective.style.display = objective.text.Length == 0 ? DisplayStyle.None : DisplayStyle.Flex;@@ -288,14 +310,43 @@ namespace Statecraft.Game.UIdelegateLine.style.display = unpaid ? DisplayStyle.Flex : DisplayStyle.None;var options = card.Q<VisualElement>("event-options");options.Clear();+ // R-ENEMY-007 (owner, 7 November 2026: "show each unit once on operation cards"): a unit two options need in the same+ // regions gets its line once, under the first of them.+ var shownRequirements = new HashSet<string>(System.StringComparer.Ordinal);foreach (var o in e.Options){var option = o;+ var requirement = EventSystem.OperationStatus(c, s, o);var label = Local(Cabinet.Fill(c, s, o.Text, date), o.TextHe);var b = new Button(() => Choose(e, option)) { name = "option-" + o.Id, text = price is double cost && cost > 0 ? text.Format("event.option_cost", label, cost) : label };b.AddToClassList(OptionClass);- b.SetEnabled(!unpaid);+ // Q3 (owner, 7 November 2026: "Decide armistice first (Recommended)"): while the front's armistice card is pending,+ // or once that armistice is signed, the operation option is disabled and a red line says why.+ var armistice = EventSystem.ArmisticeBlock(c, s, e, o);+ b.SetEnabled(!unpaid && requirement.Met && armistice == null);options.Add(b);+ if (armistice != null)+ {+ var front = text["map.front_" + e.ArmisticeFront];+ var why = new Label(text.Format(armistice == EventSystem.RefusedOperationArmisticeFirst ? "event.operation_armistice_first" : "event.operation_armistice_signed", front));+ why.AddToClassList(MissingRequirementClass); why.AddToClassList(ArmisticeClass); options.Add(why);+ }+ // R-ENEMY-007: one line per required unit, in the requirement's ordinal order. A unit in place gets the muted+ // "must be in" line; a unit elsewhere gets only the "Move ... before" line, which names the same regions.+ foreach (var need in requirement.Required)+ {+ if (!shownRequirements.Add(need.Unit + ":" + string.Join("|", need.Regions))) continue;+ var regions = string.Join(" / ", need.Regions.Select(id => text["operation.region." + id]));+ bool away = requirement.Missing.Any(x => x.Unit == need.Unit);+ // Review item 6: a required unit no longer on the board cannot be moved, so the card says that instead; the card+ // lapses at its next consideration ("Lapse at once (Recommended)").+ bool lost = away && EventSystem.Lost(c, s, o).Contains(need.Unit);+ var line = new Label(lost ? text.Format("event.operation_lost", OperationUnitName(need.Unit))+ : text.Format(away ? "event.operation_missing" : "event.operation_requirement", OperationUnitName(need.Unit), regions));+ if (away) line.AddToClassList(MissingRequirementClass);+ else { line.AddToClassList("muted"); line.AddToClassList(RequirementClass); }+ options.Add(line);+ }// What the option does, one line per effect, from the sim's preview (#1125, R-EVT-005): Unity only words it. Under// the option like the rejoin line, so a Label takes no Tab stop. The rejoin effect has that line already, below.foreach (var preview in EventSystem.OptionEffectPreviews(c, s, o))@@ -317,6 +368,13 @@ namespace Statecraft.Game.UIif (shown && focusedFor != e.Id) FocusCard(e.Id, force: false);}+ string OperationUnitName(string row)+ {+ var unit = Units.FirstOrDefault(x => x.Id == row);+ if (unit == null) return row;+ return text["ui.lang"] == UiLanguage.Hebrew && !string.IsNullOrEmpty(unit.NameHe) ? unit.NameHe : unit.Name;+ }+/// <summary>One option-effect row in the UI's language. An indicator, money or policy is named as the top bar and the Why/// panel name it (why.name.<id>, Hebrew in Hebrew), the sim's English name where the strings have none; a project/// unlock takes the kind's own Hebrew name (ContentNames).</summary>@@ -515,6 +573,35 @@ namespace Statecraft.Game.UIif (h < needs - 0.5f) SetPhotoShown(false);}+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Smaller lines, then toast moves (Recommended)"): over an open card the toast+ /// sits at the top middle, over the photograph and clear of its credit (Statecraft.uss, `.event-modal .toast`). When the+ /// photograph band is too short to hold it above the credit (a tall card on a short window), it moves below the band,+ /// under the office line, over the top of the body, still clear of the title and the options; when even that has no+ /// room, it stays put. Only a changed value is written, so its own geometry event settles at once.</summary>+ void OnToastGeometry(GeometryChangedEvent evt) => PlaceToast();++ void PlaceToast()+ {+ if (toast == null || toast.parent == null) return;+ // An inline top set by this method has keyword Undefined; unset (the stylesheet's place) is Null.+ var moved = toast.style.top.keyword == StyleKeyword.Undefined;+ if (!moved) toastDefaultTop = toast.worldBound.yMin;+ var open = Shown != null && !Collapsed && toast.resolvedStyle.display == DisplayStyle.Flex && PhotoAlt != null;+ float? want = null;+ if (open && !float.IsNaN(toastDefaultTop))+ {+ var height = toast.worldBound.height;+ if (toastDefaultTop + height > credit.worldBound.yMin - 2)+ {+ var below = card.Q<Label>("event-office").worldBound.yMax + 6;+ if (below + height < options.worldBound.yMin - 2)+ want = below - toast.parent.worldBound.yMin - toast.resolvedStyle.marginTop;+ }+ }+ if (want == null) { if (moved) toast.style.top = StyleKeyword.Null; }+ else if (!moved || System.Math.Abs(toast.style.top.value.value - want.Value) > 0.5f) toast.style.top = want.Value;+ }+void OnPhotoGeometry(GeometryChangedEvent evt){// A padding change can resize the header without changing the card's outer rectangle (#649).diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 282cc8d15..f3a87c3ef 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -465,6 +465,8 @@ namespace Statecraft.Game.UIDiagLog.BootPhase("screens wired"); // issue #321: the splits of the units layer// The map's own parse of the unit file when it read this text (issue #321: it was parsed twice at boot).var unitData = map.UnitEntriesFor(inputs.Map.UnitsYaml, Debug.LogWarning);+ card.Units = unitData;+ card.Render(); // a continued operation card replaces raw row ids with the sourced unit names immediatelywhy.Units = unitData;report.Units = unitData; // the turn report names the enemy's units by these rows (#1293)DiagLog.BootPhase("units layer data read");@@ -1311,7 +1313,7 @@ namespace Statecraft.Game.UI}/// <summary>Plays turns the way a player does: answers each open event by pressing the card's first option button- /// while the turn's Attention pays for an answer, then presses End Turn and closes the turn report it brings (#1037); a card left unanswered goes to its minister+ /// while the turn's Attention pays for an answer and that option's operation units are in place (R-ENEMY-007), then presses End Turn and closes the turn report it brings (#1037); a card left unanswered goes to its minister/// (since the GDD cutover, 15 July 1948 brings three cards at full war, where an answer costs 2 of the 4). Logs "SMOKE turn <n> <date> refused <k>" per turn through <paramref name="log"/>,/// then "SMOKE OK <n> turns <date> <hash>", or "SMOKE FAIL <reason>" when a press does not take effect./// Static, so an edit-mode test can drive it step by step.</summary>@@ -1326,6 +1328,9 @@ namespace Statecraft.Game.UI// Rulesets with Attention keep the smoke's own pool check unchanged; gdd-0.3 has no pool to run out of (#1688).if (bridge.Content.UsesAttention&& bridge.AttentionLeft!.Value + 1e-9 < AttentionSystem.Cost(bridge.Content, bridge.State, new ChooseEventOption(shown.Id, "").Kind)) break;+ // R-ENEMY-007 (#2621): a first option whose operation units are not in place is disabled, and the smoke gives no+ // unit orders, so the card goes to its minister as an unpaid one does (GoldenRun.SmokeOrders plays the same).+ if (!EventSystem.OperationStatus(bridge.Content, bridge.State, shown.Options[0]).Met) break;var option = root.Q<VisualElement>("event-options")?.Q<Button>();if (option == null || guard >= 50) { log(FormattableString.Invariant($"SMOKE FAIL event {shown.Id} has no option to press")); yield break; }if (!Press(option, log)) yield break;diff --git a/unity/Assets/Scripts/UI/SimBridge.cs b/unity/Assets/Scripts/UI/SimBridge.csindex f23b519ce..af7590074 100644--- a/unity/Assets/Scripts/UI/SimBridge.cs+++ b/unity/Assets/Scripts/UI/SimBridge.cs@@ -315,6 +315,10 @@ namespace Statecraft.Game.UI// that fits (capture.refusal.not_awaiting names the place, these do not), so they stay the sim's English.[SettlementControl.RefusedNoOneToDeport] = "capture.refusal.no_one_to_deport",[SettlementControl.RefusedUnknownOutcome] = "capture.refusal.unknown_outcome",+ // R-ENEMY-007 (#2543): an operation whose units are not in place, or whose front's armistice comes first or is signed.+ [EventSystem.RefusedOperationUnitsNotInPlace] = "event.operation_refused",+ [EventSystem.RefusedOperationArmisticeFirst] = "event.operation_refused_armistice_first",+ [EventSystem.RefusedOperationArmisticeSigned] = "event.operation_refused_armistice_signed",};/// <summary>The sim's refusals that carry values (#2072: Combat.Check's Arms, Training.Reinforce's unit, settlement,@@ -439,6 +443,7 @@ namespace Statecraft.Game.UIvar before = Session.Now.Why.Count;var refused = Session.Commit(c);if (refused != null) return Refuse(refused);+ WithdrawUnmetOperations();Notify(Changed);var added = Session.Now.Why.Skip(before).ToList();Notify(Committed, added);@@ -461,6 +466,20 @@ namespace Statecraft.Game.UIreturn null;}+ /// <summary>R-ENEMY-007 (owner, 7 November 2026: "Re-show the card (Recommended)"): after an instant order, a queued+ /// operation choice whose required units are no longer in place in the state the card shows (<see cref="State"/>) is+ /// withdrawn, which refunds its Attention, so its card shows again with the missing unit's "Move ... before" line+ /// instead of End Turn refusing the choice and handing the card to its minister. The caller notifies.</summary>+ void WithdrawUnmetOperations()+ {+ foreach (var q in deferred.OfType<ChooseEventOption>().ToList())+ {+ var option = Content.Events.FirstOrDefault(e => e.Id == q.EventId)?.Options.FirstOrDefault(o => o.Id == q.OptionId);+ if (option != null && option.RequiresUnitRegions.Count != 0 && !EventSystem.OperationStatus(Content, State, option).Met)+ deferred.Remove(q);+ }+ }+public void Withdraw(Command c){if (deferred.Remove(c)) Notify(Changed);diff --git a/unity/Assets/Scripts/UI/TurnReportPresenter.cs b/unity/Assets/Scripts/UI/TurnReportPresenter.csindex bcb72f448..2a4db4a98 100644--- a/unity/Assets/Scripts/UI/TurnReportPresenter.cs+++ b/unity/Assets/Scripts/UI/TurnReportPresenter.cs@@ -29,8 +29,10 @@ namespace Statecraft.Game.UIpublic const string EnemyRow = "enemy";/// <summary>The row after the stocks that lists the arms workshops' Arms and ceiling pauses this turn (#1701 A1).</summary>public const string WorkshopRow = "workshops";- /// <summary>The row after the workshops' that lists the cities the enemy holds this turn (R-CITY-010, #1711).</summary>+ /// <summary>The row after the workshops' and the operations' that lists the cities the enemy holds this turn (R-CITY-010, #1711).</summary>public const string HeldRow = "held";+ /// <summary>The row of the turn's postponed and lapsed operations (R-ENEMY-007, #2543).</summary>+ public const string OperationsRow = "operations";/// <summary>The units_1948.yaml rows, which name the enemy's units in that row (GameRoot sets them once the map has read/// them); without a row a unit is named by its id (report.unit).</summary>@@ -113,7 +115,8 @@ namespace Statecraft.Game.UI/// <summary>The report's lines for the session's last turn: each top-bar meter whose shown change is not empty, in/// the bar's order (the meters have different units, so no order by size is given without a rule); then national stocks; under- /// <see cref="WorkshopRow"/>, the arms workshops' lines (#1701); under <see cref="HeldRow"/>, the held cities (#1711); under+ /// <see cref="WorkshopRow"/>, the arms workshops' lines (#1701); under <see cref="OperationsRow"/>, the postponed and lapsed+ /// operations (R-ENEMY-007); under <see cref="HeldRow"/>, the held cities (#1711); under/// <see cref="EnemyRow"/>, the enemy's orders (#1293).</summary>public static IReadOnlyList<Line> Lines(SimBridge bridge, UiText text, IReadOnlyList<UnitEntry>? units = null,IReadOnlyDictionary<string, string>? townNamesHe = null)@@ -133,6 +136,12 @@ namespace Statecraft.Game.UIlines.AddRange(StockLines(bridge, text, units, townNamesHe));var workshops = WorkshopLines(bridge, text, townNamesHe);if (workshops.Count > 0) lines.Add(new Line(WorkshopRow, text["report.workshops"], workshops));+ // R-ENEMY-007 (#2543): a postponed or lapsed operation changes no number either, and the rule says the turn report+ // names the units and why, so its lines have their own row, in the sim's order.+ var operations = bridge.Session.Last?.Why.Where(w => w.Key == CauseKeys.OperationPostponed || w.Key == CauseKeys.OperationLapsed+ || w.Key == CauseKeys.OperationLapsedSigned || w.Key == CauseKeys.OperationLapsedUnitLost || w.Key == CauseKeys.OperationWaitsForArmistice)+ .Select(w => CauseText.Line(w, bridge.Content, units ?? Array.Empty<UnitEntry>(), text, townNamesHe)).ToList();+ if (operations != null && operations.Count > 0) lines.Add(new Line(OperationsRow, text["report.operations"], operations));// R-CITY-010 (#1711): a held city's line changes no number (Delta 0), so HudModel.Causes leaves it out and it has// its own row; the sim writes it under gdd-0.3 only, in s.Cities' order.var held = bridge.Session.Last?.Why.Where(w => w.Key == CauseKeys.CityHeld)diff --git a/unity/Assets/Tests/EditMode/BuildGateTests.cs b/unity/Assets/Tests/EditMode/BuildGateTests.csindex 6606035d8..07a1fc8c5 100644--- a/unity/Assets/Tests/EditMode/BuildGateTests.cs+++ b/unity/Assets/Tests/EditMode/BuildGateTests.cs@@ -158,7 +158,7 @@ public class BuildGateTests{var c = ContentLoader.Load(Paths.Content);CollectionAssert.IsEmpty(ReleaseGate.StartingForcesUnchecked(c).Select(x => x.Split(':')[0]),- "the owner person-checked the real rows (21 October 2026, #1240), and Etzioni and the 7th after them (#1241, https://github.com/eyalgolan/statecraft-israel/issues/793#issuecomment-6338280840); six got an order target sourced after that check (#2722), and the owner checked those on 6 November 2026 (#2757, \"all approved\")");+ "the owner person-checked the real rows (21 October 2026, #1240), and Etzioni and the 7th after them (#1241, https://github.com/eyalgolan/statecraft-israel/issues/793#issuecomment-6338280840); six got an order target sourced after that check (#2722), and the owner checked those on 6 November 2026 (#2757, \"all approved\"), and Givati's Bayt Jibrin target on 7 November 2026 (#2621)");foreach (var f in c.StartingForces) f.Status = "to_verify"; // in memory only: the rows as they were before that checkvar refusal = Refusal(c);Assert.IsNotNull(refusal, "a row that is not fact-checked blocks a shareable build");diff --git a/unity/Assets/Tests/EditMode/CauseTextTests.cs b/unity/Assets/Tests/EditMode/CauseTextTests.csindex 619b33ef7..0768d0f33 100644--- a/unity/Assets/Tests/EditMode/CauseTextTests.cs+++ b/unity/Assets/Tests/EditMode/CauseTextTests.cs@@ -88,6 +88,71 @@ public class CauseTextTestsAssert.IsFalse(Regex.IsMatch(unmarked, "[A-Za-z]"));}+ [Test]+ public void PostponedAndLapsedOperationsNameTheUnitAndRegionsInBothLanguages()+ {+ var e = C.Events.Single(x => x.Id == "operation_horev");+ var s = Simulation.NewGame(C, 23, Mode.Historical);+ s.Date = e.From; s.PendingEvents.Clear(); s.PendingEvents.Add(e.Id);+ var why = new List<Cause>(); EventSystem.Delegate(C, s, why);+ var postponed = why.Single(x => x.Key == CauseKeys.OperationPostponed);+ var rows = UnitData.Parse(System.IO.File.ReadAllText(System.IO.Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));+ var en = CauseText.Line(postponed, C, rows, En);+ StringAssert.Contains("Golani Brigade", en); StringAssert.Contains("Negev", en); StringAssert.Contains("Southern Coast", en);+ StringAssert.DoesNotContain("golani", en); StringAssert.DoesNotContain("southern_coast", en);+ var he = CauseText.Line(postponed, C, rows, He);+ StringAssert.Contains("חטיבת גולני", he); StringAssert.Contains("הנגב", he); StringAssert.Contains("מישור החוף הדרומי", he);+ // The owner's choice, 7 November 2026: "Neutral form (Recommended)": the decision is the subject, so the verb agrees+ // with any card title, a plural one such as "קרבות עשרת הימים" included.+ StringAssert.Contains("ההחלטה על", he); StringAssert.Contains("נדחתה", he);+ Assert.IsFalse(Regex.IsMatch(he, "golani|southern_coast|negev"), he);++ // R-ENEMY-007 (owner, 7 November 2026: "6 turns (Recommended)"): a postponed card lapses after its wait, not at its window's end.+ s.Date = e.To!.Value; s.Turn += C.Rules.Mvp!.OperationWaitTurns!.Value + 1; why.Clear(); EventSystem.LapseExpiredOperations(C, s, why);+ var lapsed = why.Single(x => x.Key == CauseKeys.OperationLapsed);+ StringAssert.Contains("Golani Brigade", CauseText.Line(lapsed, C, rows, En));+ var heLapsed = CauseText.Line(lapsed, C, rows, He);+ StringAssert.Contains("חטיבת גולני", heLapsed);+ StringAssert.Contains("ההחלטה על", heLapsed); StringAssert.Contains("ירדה מן הפרק", heLapsed);+ }++ /// <summary>R-ENEMY-007 (owner, 7 November 2026): the lapse on a signed front, the lapse on a lost unit and the wait for+ /// the front's armistice, from the sim's own causes, each in both languages, Hebrew in the neutral form ("ההחלטה על").+ /// Horev postponed with Golani out of place, then each ending made.</summary>+ [Test]+ public void TheArmisticeAndLostUnitLinesAreWordedInBothLanguages()+ {+ var e = C.Events.Single(x => x.Id == "operation_horev");+ var rows = UnitData.Parse(System.IO.File.ReadAllText(System.IO.Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));+ GameState Postponed()+ {+ var s = Simulation.NewGame(C, 23, Mode.Historical);+ s.Date = e.From; s.PendingEvents.Clear(); s.PendingEvents.Add(e.Id);+ EventSystem.Delegate(C, s, new List<Cause>());+ Assert.IsTrue(s.PostponedOperations.ContainsKey(e.Id));+ return s;+ }+ var signed = Postponed(); signed.ChosenOptions["armistice_egypt"] = "sign";+ var why = new List<Cause>(); EventSystem.LapseExpiredOperations(C, signed, why);+ var lapsedSigned = why.Single(x => x.Key == CauseKeys.OperationLapsedSigned);+ StringAssert.Contains("Egypt", CauseText.Line(lapsedSigned, C, rows, En));+ var he = CauseText.Line(lapsedSigned, C, rows, He);+ StringAssert.Contains("ההחלטה על", he); StringAssert.Contains("מצרים", he);++ var lost = Postponed(); lost.Units.Remove(C.StartingForces.FindIndex(f => f.Row == "golani"));+ why.Clear(); EventSystem.LapseExpiredOperations(C, lost, why);+ var lapsedLost = why.Single(x => x.Key == CauseKeys.OperationLapsedUnitLost);+ StringAssert.Contains("Golani Brigade", CauseText.Line(lapsedLost, C, rows, En));+ StringAssert.Contains("חטיבת גולני", CauseText.Line(lapsedLost, C, rows, He));++ var waiting = Postponed(); // Horev postponed in December, still waiting when Egypt's card comes on 15 February 1949+ waiting.Date = new System.DateTime(1949, 2, 15); waiting.PendingEvents.Add("armistice_egypt");+ why.Clear(); EventSystem.Delegate(C, waiting, why);+ var waits = why.Single(x => x.Key == CauseKeys.OperationWaitsForArmistice);+ StringAssert.Contains("Egypt", CauseText.Line(waits, C, rows, En));+ StringAssert.Contains("מצרים", CauseText.Line(waits, C, rows, He));+ }+/// <summary>The keyed lines the seeded game does not reach: a call-up order, a situation that ends, civilian upkeep and/// its borrowing, the currency crisis on both sides, and the legacy loop's food cut and UN ceasefire.</summary>[Test]@@ -575,6 +640,8 @@ public class CauseTextTestsCauseKeys.CallUpSet, CauseKeys.CallUpRaised, CauseKeys.CallUpLowered, CauseKeys.Ceasefire,CauseKeys.EventAmount, CauseKeys.EventChosen, CauseKeys.EventCity, CauseKeys.EventDelegated,CauseKeys.EventDelegatedPartial, CauseKeys.EventGrant, CauseKeys.EventNew, CauseKeys.EventPolicy,+ CauseKeys.OperationPostponed, CauseKeys.OperationLapsed, CauseKeys.OperationLapsedSigned, CauseKeys.OperationLapsedUnitLost,+ CauseKeys.OperationWaitsForArmistice,CauseKeys.EventRejoin, CauseKeys.EventSetRung, CauseKeys.EventStock, CauseKeys.EventUnlock,CauseKeys.MilitaryUpkeep, CauseKeys.HousingSurcharge, CauseKeys.HousingCohesion,CauseKeys.ObjectiveCompleted, CauseKeys.PrisonersReturned, CauseKeys.SoldiersReturned,diff --git a/unity/Assets/Tests/EditMode/EventCardTests.cs b/unity/Assets/Tests/EditMode/EventCardTests.csindex 347532981..62bf065ec 100644--- a/unity/Assets/Tests/EditMode/EventCardTests.cs+++ b/unity/Assets/Tests/EditMode/EventCardTests.cs@@ -3,6 +3,7 @@ using System.IO;using System.Linq;using NUnit.Framework;using Statecraft.Game;+using Statecraft.Game.Map.Units;using Statecraft.Game.UI;using Statecraft.Sim;using UnityEditor;@@ -16,6 +17,187 @@ public class EventCardTestsstatic readonly Content C = ContentLoader.Load(Paths.Content);static UiText Text => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);+ // R-ENEMY-007: every operation card names the sourced unit and allowed regions, disables only the operation option+ // while a required unit is elsewhere, and enables it once all required units are in place. Both language catalogues+ // use the same structured requirement rather than embedding prose in the event content.+ [Test]+ public void AnOperationCardExplainsAndEnforcesItsUnitPlacementInBothLanguages()+ {+ var unitRows = UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));+ foreach (var local in new[] { Text, He })+ {+ var c = ContentLoader.Load(Paths.Content);+ var e = c.Events.Single(x => x.Id == "operation_horev");+ var option = e.Options.Single(x => x.Id == "launch");+ var g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);+ g.State.Date = e.From;+ g.State.PendingEvents.Clear(); g.State.PendingEvents.Add(e.Id);+ using var ui = new UiTestKit();+ using var card = new EventCardPresenter(ui.Root, new SimBridge(g, local), local, null) { Units = unitRows };+ card.Render();++ Assert.IsFalse(ui.Q<Button>("option-launch").enabledSelf, "Golani begins outside Horev's regions");+ Assert.IsTrue(ui.Q<Button>("option-hold").enabledSelf, "the non-operation option remains available");+ var required = ui.Root.Query<Label>(className: EventCardPresenter.RequirementClass).ToList();+ var missing = ui.Root.Query<Label>(className: EventCardPresenter.MissingRequirementClass).ToList();+ // One line per unit: Golani is elsewhere, so it has only the "Move ... before" line, naming both regions.+ Assert.AreEqual(0, required.Count); Assert.AreEqual(1, missing.Count);+ StringAssert.Contains(local["ui.lang"] == UiLanguage.Hebrew ? "חטיבת גולני" : "Golani Brigade", missing[0].text);+ StringAssert.Contains(local["operation.region.negev"], missing[0].text);+ StringAssert.Contains(local["operation.region.southern_coast"], missing[0].text);++ var id = c.StartingForces.FindIndex(x => x.Row == "golani");+ var at = c.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ var unit = g.State.Units[id];+ g.State.Units[id] = new Unit(unit.Id, unit.Type, at.Q, at.R, unit.Service, unit.Side, unit.Strength,+ unit.Order, unit.OrderTarget, unit.HomeCity, unit.Full, unit.CombatXp);+ card.Render();+ Assert.IsTrue(ui.Q<Button>("option-launch").enabledSelf);+ Assert.AreEqual(0, ui.Root.Query<Label>(className: EventCardPresenter.MissingRequirementClass).ToList().Count);+ var inPlace = ui.Root.Query<Label>(className: EventCardPresenter.RequirementClass).ToList();+ Assert.AreEqual(1, inPlace.Count);+ StringAssert.Contains(local["ui.lang"] == UiLanguage.Hebrew ? "חטיבת גולני" : "Golani Brigade", inPlace[0].text);+ StringAssert.Contains(local["operation.region.negev"], inPlace[0].text);+ }+ }++ // Review item 6 and Q3 (owner, 7 November 2026): a required unit no longer on the board gets "no longer on the board", not+ // a "Move" line it could never follow; and while the front's armistice card is pending, the operation option is disabled+ // with a red line naming that armistice, even with its units in place. Red without them: a Move line, an enabled option.+ [Test]+ public void AnOperationCardSaysWhenItsUnitIsGoneOrItsArmisticeComesFirst()+ {+ var unitRows = UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));+ var c = ContentLoader.Load(Paths.Content);+ var e = c.Events.Single(x => x.Id == "operation_horev");+ var option = e.Options.Single(x => x.Id == "launch");+ var id = c.StartingForces.FindIndex(x => x.Row == "golani");++ var g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);+ g.State.Date = e.From; g.State.PendingEvents.Clear(); g.State.PendingEvents.Add(e.Id);+ g.State.Units.Remove(id);+ using (var ui = new UiTestKit())+ using (var card = new EventCardPresenter(ui.Root, new SimBridge(g, Text), Text, null) { Units = unitRows })+ {+ card.Render();+ var missing = ui.Root.Query<Label>(className: EventCardPresenter.MissingRequirementClass).ToList();+ Assert.AreEqual(1, missing.Count);+ StringAssert.Contains("no longer on the board", missing[0].text);+ StringAssert.DoesNotContain("Move", missing[0].text);+ }++ var h = GameSession.New(c, GoldenRun.Seed, Mode.Historical);+ h.State.Date = new System.DateTime(1949, 2, 15); h.State.PendingEvents.Clear();+ h.State.PendingEvents.Add(e.Id); h.State.PendingEvents.Add("armistice_egypt");+ var at = c.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ var u = h.State.Units[id];+ h.State.Units[id] = new Unit(u.Id, u.Type, at.Q, at.R, u.Service, u.Side, u.Strength, "", "", u.HomeCity, u.Full, u.CombatXp);+ foreach (var local in new[] { Text, He })+ {+ using var ui = new UiTestKit();+ var bridge = new SimBridge(h, local);+ using var card = new EventCardPresenter(ui.Root, bridge, local, null) { Units = unitRows };+ card.Render();+ Assert.AreEqual("armistice_egypt", card.Shown?.Id, "the armistice Horev waits for is shown first (Q3)");+ Assert.IsNull(bridge.Queue(new ChooseEventOption("armistice_egypt", "hold_out")), "the player answers it, for End Turn");+ card.Render();+ Assert.AreEqual(e.Id, card.Shown?.Id, "then Horev's card shows");+ Assert.IsFalse(ui.Q<Button>("option-launch").enabledSelf, "the armistice is decided first");+ var why = ui.Root.Query<Label>(className: EventCardPresenter.ArmisticeClass).ToList();+ Assert.AreEqual(1, why.Count);+ StringAssert.Contains(local["map.front_egypt"], why[0].text);+ }+ Assert.AreEqual(EventSystem.RefusedOperationArmisticeFirst, EventSystem.ArmisticeBlock(c, h.State, e, option));+ }++ // R-ENEMY-007 (owner, 7 November 2026: "Re-show the card (Recommended)"): an operation chosen while its units stood in+ // place is withdrawn, its Attention refunded, when a later instant move takes a required unit out of the regions, and the+ // card shows again with that unit's red "Move ... before" line, rather than End Turn refusing the choice and the minister+ // deciding it. Red without SimBridge's re-check: the choice stays queued and the card stays hidden.+ [Test]+ public void MovingARequiredUnitAwayWithdrawsTheQueuedOperationAndShowsTheCardAgain()+ {+ var unitRows = UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));+ var c = ContentLoader.Load(Paths.Content);+ var e = c.Events.Single(x => x.Id == "operation_horev");+ var option = e.Options.Single(x => x.Id == "launch");+ var g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);+ g.State.Date = e.From;+ g.State.PendingEvents.Clear(); g.State.PendingEvents.Add(e.Id);+ var id = c.StartingForces.FindIndex(x => x.Row == "golani");+ var u = g.State.Units[id];+ bool InPlace((int Q, int R) h) => c.PlayerRegions.AtHex(h.Q, h.R) is { } r && option.RequiresUnitRegions.Contains(r.Id);+ // A member hex of Horev's regions with a hex outside them in one move.+ (int Q, int R) away = default; // Golani is left on the member hex the loop stops at+ foreach (var h in option.RequiresUnitRegions.SelectMany(r => c.PlayerRegions.Regions[r].MemberHexes))+ {+ g.State.Units[id] = new Unit(u.Id, u.Type, h.Q, h.R, u.Service, u.Side, u.Strength, "", "", u.HomeCity, u.Full, u.CombatXp);+ var outside = Movement.Reachable(c, g.State, id).Keys.Where(k => !InPlace(k)).OrderBy(k => k.Q).ThenBy(k => k.R).ToList();+ if (outside.Count > 0) { away = outside[0]; break; }+ }+ Assert.AreNotEqual(default((int, int)), away, "a hex outside Horev's regions is one move away");+ var bridge = new SimBridge(g, Text);+ using var ui = new UiTestKit();+ using var card = new EventCardPresenter(ui.Root, bridge, Text, null) { Units = unitRows };+ card.Render();+ var left = bridge.AttentionLeft!.Value;+ Assert.IsNull(bridge.Queue(new ChooseEventOption(e.Id, option.Id)), "Golani stands in place, so the choice is queued");+ card.Render();+ Assert.IsNull(card.Shown, "a queued choice hides its card");++ Assert.IsNull(bridge.Queue(new Move(id, away.Q, away.R)), "the move is the player's own");+ card.Render();+ Assert.IsNull(bridge.QueuedLike(new ChooseEventOption(e.Id, "")), "the choice is withdrawn");+ Assert.AreEqual(left, bridge.AttentionLeft!.Value, 1e-9, "and its Attention refunded");+ Assert.AreEqual(e.Id, card.Shown?.Id, "the card shows again");+ var missing = ui.Root.Query<Label>(className: EventCardPresenter.MissingRequirementClass).ToList();+ Assert.AreEqual(1, missing.Count);+ StringAssert.Contains("Golani Brigade", missing[0].text);+ Assert.IsFalse(ui.Q<Button>("option-launch").enabledSelf);+ }++ // R-ENEMY-007 (owner, 7 November 2026: "Dateless variants (Recommended)", then "All approved (Recommended)"): a card shown+ // after its own window has closed shows its late text, in Hebrew its late_text_he, and inside its window its own text.+ // Rhodes Talks, which a late Horev brings. Red without it: the dated text shows after the window.+ [Test]+ public void ACardShownAfterItsWindowShowsItsLateTextInBothLanguages()+ {+ var c = ContentLoader.Load(Paths.Content);+ var e = c.Events.Single(x => x.Id == "rhodes_talks");+ foreach (var local in new[] { Text, He })+ {+ var hebrew = local["ui.lang"] == UiLanguage.Hebrew;+ foreach (var late in new[] { false, true })+ {+ var g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);+ g.State.Date = late ? e.To!.Value : e.From;+ g.State.PendingEvents.Clear(); g.State.PendingEvents.Add(e.Id);+ using var ui = new UiTestKit();+ using var card = new EventCardPresenter(ui.Root, new SimBridge(g, local), local, null);+ card.Render();+ var body = ui.Q<Label>("event-text").text;+ var want = late ? (hebrew ? "השיחות עומדות להיפתח ברודוס" : "The talks are to open at Rhodes") : (hebrew ? "עד 6 בינואר" : "By 6 January");+ StringAssert.Contains(want, body, $"{(hebrew ? "he" : "en")} late={late}");+ if (late) StringAssert.DoesNotContain(hebrew ? "בינואר" : "January", body);+ }+ }+ }++ // R-ENEMY-007: every region an operation names has its operation.region.* string in both catalogues, Hebrew in Hebrew, so+ // a region added to an operation but not to the strings fails here, not as a card that throws on a missing key.+ [Test]+ public void EveryRequiredOperationRegionHasItsNameInBothLanguages()+ {+ var ids = C.Events.SelectMany(e => e.Options).SelectMany(o => o.RequiresUnitRegions).Distinct(System.StringComparer.Ordinal).ToList();+ Assert.IsNotEmpty(ids);+ foreach (var id in ids)+ {+ Assert.IsTrue(Text.Has("operation.region." + id), "strings.en.yaml: operation.region." + id);+ Assert.IsTrue(He.Has("operation.region." + id), "strings.he.yaml: operation.region." + id);+ StringAssert.IsMatch("[א-ת]", He["operation.region." + id], id + " is Hebrew in Hebrew");+ }+ }+/// <summary>The historical game on the turn the Egyptian armistice first waits for a decision (February 1949).</summary>static SimBridge AtArmistice(){@@ -50,7 +232,11 @@ public class EventCardTestsStringAssert.Contains("David Ben-Gurion must decide whether Israel signs.", ui.Q<Label>("event-text").text);Assert.AreEqual(catalog.Get("ben_gurion"), ui.Q<VisualElement>("event-image").style.backgroundImage.value.texture);Assert.AreEqual(DisplayStyle.None, ui.Q<Label>("event-draft").style.display.value);- Assert.AreEqual("Sign the armistice (costs 2.0 Attention)", ui.Q<Button>("option-sign").text); // its price shows (#1034)+ // Its price shows (#1034), at the turn's rung: 1 x (1 + 0.25 x (rung - 1)). This run gives no orders, so under+ // R-ENEMY-007 (#2543) the operations after the second truce (set_rung 4) postpone and lapse, none of their set_rung 5+ // applies, and the war is at rung 4: 1.75, shown as 1.8. Before R-ENEMY-007 they launched, and it was 2.0 at rung 5.+ Assert.AreEqual(4, bridge.State.Rung);+ Assert.AreEqual("Sign the armistice (costs 1.8 Attention)", ui.Q<Button>("option-sign").text);}[Test]diff --git a/unity/Assets/Tests/EditMode/GameSceneTests.cs b/unity/Assets/Tests/EditMode/GameSceneTests.csindex fef40b6a7..f5d56b699 100644--- a/unity/Assets/Tests/EditMode/GameSceneTests.cs+++ b/unity/Assets/Tests/EditMode/GameSceneTests.cs@@ -1017,7 +1017,10 @@ public class GameSceneTests}/// <summary>Since the GDD cutover, 15 July 1948 brings three cards at full war, where an answer costs 2 of the 4- /// Attention: the smoke answers the two it can pay for and leaves the third to its minister, and the run still passes.</summary>+ /// Attention: the smoke answers the two it can pay for and leaves the third to its minister, and the run still passes.+ /// R-ENEMY-007 (#2543): the smoke also stops at a first option whose operation units are not in place, and this run+ /// gives no unit orders, so the test first stands each pending operation's units in its first required region, as a+ /// player would have moved them; then only the Attention decides.</summary>[Test]public void TheSmokeRunLeavesACardItCannotPayForToItsMinister(){@@ -1026,6 +1029,17 @@ public class GameSceneTestsvar g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);while (g.State.Date < new System.DateTime(1948, 7, 15)) g.Step(new Command[0]);Assert.AreEqual(3, g.State.PendingEvents.Count, string.Join(", ", g.State.PendingEvents));+ foreach (var option in g.State.PendingEvents.Select(id => c.Events.First(e => e.Id == id).Options[0]).Where(o => o.RequiresUnitRegions.Count != 0))+ {+ var at = c.PlayerRegions.Regions[option.RequiresUnitRegions[0]].MemberHexes[0];+ foreach (var row in option.UnitOrders.Select(x => x.Unit).Distinct(StringComparer.Ordinal))+ {+ int id = c.StartingForces.FindIndex(x => x.Row == row);+ Assert.IsTrue(g.State.Units.TryGetValue(id, out var u), $"{row} is on the board");+ g.State.Units[id] = new Unit(u.Id, u.Type, at.Q, at.R, u.Service, u.Side, u.Strength, "", "", u.HomeCity, u.Full, u.CombatXp); // no standing order to carry it off+ }+ Assert.IsTrue(EventSystem.OperationStatus(c, g.State, option).Met, "the operation's units stand in place");+ }var text = Text;var bridge = new SimBridge(g, text);using var toast = new ToastPresenter(ui.Root, bridge, text);diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.csindex 999d24d34..ed1fc7bdb 100644--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs@@ -131,6 +131,18 @@ public class HebrewUiTests}}+ // R-ENEMY-007: a player choice refused because its operation units are elsewhere reaches the common refusal toast.+ [Test]+ public void TheOperationPlacementRefusalHasAStringInBothLanguages()+ {+ var reason = Statecraft.Sim.EventSystem.RefusedOperationUnitsNotInPlace;+ Assert.AreEqual(reason, SimBridge.ReasonText(En, reason));+ var he = SimBridge.ReasonText(He, reason);+ Assert.AreNotEqual(reason, he);+ StringAssert.IsMatch("[\u05D0-\u05EA]", he);+ Assert.IsFalse(Regex.IsMatch(he, "[A-Za-z]"), he);+ }+// #2198, #2590: every localized Arms-purchase refusal reaches the end-of-turn toast (ReasonText) in both languages.[Test]public void EveryArmsPurchaseRefusalHasAStringInBothLanguages()diff --git a/unity/Assets/Tests/EditMode/MapOverrideEditorTests.cs b/unity/Assets/Tests/EditMode/MapOverrideEditorTests.csindex ac9301fc0..cafc0f6d7 100644--- a/unity/Assets/Tests/EditMode/MapOverrideEditorTests.cs+++ b/unity/Assets/Tests/EditMode/MapOverrideEditorTests.cs@@ -38,7 +38,8 @@ public sealed class MapOverrideEditorTestsvar hex = document.Hexes.First(x => x.Land);var terrain = document.LandBiomes.First(x => x != hex.Biome);var location = document.Locations.OrderBy(x => x.Id, StringComparer.Ordinal).First();- var target = document.Hexes.First(x => x.Land && (x.Q != location.BaseQ || x.R != location.BaseR));+ var content = LoadSavedContent();+ var target = document.Hexes.First(x => x.Land && (x.Q != location.BaseQ || x.R != location.BaseR) && InItsRegion(content, location.Id, x.Q, x.R));var controlHex = Control1948.Parse(File.ReadAllText(Path.Combine(temporary, "map", Control1948.FileName))).EditorHexes.First();var period = document.Periods[0].Id;var control = document.ControlValues.First(x => x != document.ControlAt(controlHex.q, controlHex.r, period));@@ -175,7 +176,7 @@ public sealed class MapOverrideEditorTeststry{var location = document.Locations.OrderBy(x => x.Id, StringComparer.Ordinal).First(x => x.BaseQ == end[0] && x.BaseR == end[1]);- var target = document.Hexes.First(x => x.Land && !occupied.Contains((x.Q, x.R)));+ var target = document.Hexes.First(x => x.Land && !occupied.Contains((x.Q, x.R)) && InItsRegion(content, location.Id, x.Q, x.R));StringAssert.Contains("tlv_netanya_road", string.Join("\n", document.Dependencies(location.Id).Corridors),"the corridor that ends on the location is reported before saving");document.SetLocation(location.Id, target.Q, target.R);@@ -248,7 +249,8 @@ public sealed class MapOverrideEditorTestsvar terrain = document.LandBiomes.First(x => x != hex.Biome);var location = document.Locations.OrderBy(x => x.Id, StringComparer.Ordinal).First();var before = document.LocationAt(location.Id);- var target = document.Hexes.First(x => x.Land && (x.Q != before.q || x.R != before.r));+ var content = LoadSavedContent();+ var target = document.Hexes.First(x => x.Land && (x.Q != before.q || x.R != before.r) && InItsRegion(content, location.Id, x.Q, x.R));var controlHex = Control1948.Parse(File.ReadAllText(Path.Combine(temporary, "map", Control1948.FileName))).EditorHexes.First();var period = document.Periods[0].Id;var controlBefore = document.ControlAt(controlHex.q, controlHex.r, period);@@ -370,6 +372,38 @@ public sealed class MapOverrideEditorTests}}+ /// <summary>R-ENEMY-007 (#2543) reads regions.yaml under both GDD identities, so a place that is a region's member must+ /// stay on one of that region's member hexes (PlayerRegions: "effective location lies outside member_hexes"). A move+ /// within the region is a plain edit; a place in no region can go anywhere.</summary>+ static bool InItsRegion(Content c, string id, int q, int r)+ {+ var region = c.PlayerRegions.AtLocation(id);+ return region == null || region.MemberHexes.Contains((q, r));+ }++ // R-ENEMY-007 (#2543): the editor validates through the game's loader, which reads the regions under both GDD+ // identities, so moving a region's member place off the region's hexes is refused, and the saved map stays intact.+ [Test]+ public void MovingARegionsPlaceOutsideTheRegionIsRefused()+ {+ var content = LoadSavedContent();+ var path = Path.Combine(temporary, MapOverrides.FileName);+ var before = File.ReadAllBytes(path);+ var document = MapOverrideEditorDocument.Load(temporary);+ try+ {+ var location = document.Locations.OrderBy(x => x.Id, StringComparer.Ordinal).First(x => content.PlayerRegions.AtLocation(x.Id) != null);+ var target = document.Hexes.First(x => x.Land && !InItsRegion(content, location.Id, x.Q, x.R));+ document.SetLocation(location.Id, target.Q, target.R);+ Assert.IsFalse(document.Save(out var error), "a region's place cannot leave the region's hexes");+ StringAssert.Contains("effective location lies outside member_hexes", error);+ StringAssert.Contains("regions.yaml", error, "the failure names the file to edit as well");+ CollectionAssert.AreEqual(before, File.ReadAllBytes(path), "the last valid saved map stays intact");+ Assert.DoesNotThrow(() => { LoadSavedContent(); }, "the saved map still loads in the game");+ }+ finally { UnityEngine.Object.DestroyImmediate(document); }+ }+Content LoadSavedContent() => ContentLoader.Load(relative =>{var file = Path.Combine(temporary, relative);diff --git a/unity/Assets/Tests/EditMode/OperationToastShots.cs b/unity/Assets/Tests/EditMode/OperationToastShots.csnew file mode 100644index 000000000..77b2f70e0--- /dev/null+++ b/unity/Assets/Tests/EditMode/OperationToastShots.cs@@ -0,0 +1,99 @@+#nullable enable+using System.Collections;+using System.IO;+using System.Linq;+using NUnit.Framework;+using Statecraft.Game;+using Statecraft.Game.Map.Units;+using Statecraft.Game.UI;+using Statecraft.Sim;+using UnityEditor;+using UnityEngine;+using UnityEngine.TestTools;+using UnityEngine.UIElements;+using Object = UnityEngine.Object;++/// <summary>Writes the stills for #2621's toast over Operation Hiram's card to `.superpowers/toast-2621/` (local, not committed):+/// the card at 2560x1080 on the historical run's Hiram turn (15 November 1948), with the real photographs, its requirement+/// lines (the units in place) and the longest+/// toast DecisionCardTests uses, in English and Hebrew. The environment variable STATECRAFT_SHOT_TAG names the set ("before"+/// or "after"); each still's log line gives the toast's and the credit's rectangles. Explicit, so it does not run with the+/// checks.</summary>+[Explicit("writes stills for a pull request, not a check")]+public class OperationToastShots+{+ const string Event = "operation_hiram";+ const int Width = 2560, Height = 1080;+ const string LongToast = "Not done: Not enough attention (need 4.0, have 2.0)\nNot done: No more than 2 map actions in one turn\n"+ + "Not done: The Knesset must approve it: the coalition holds 46 of 120 seats\nYour game was saved, but the browser refused the autosave";+ static readonly Content C = ContentLoader.Load(Paths.Content);++ IEnumerator Frames(int n) { for (int i = 0; i < n; i++) yield return null; }++ static void Shot(RenderTexture rt, string dir, string name, VisualElement root)+ {+ var prev = RenderTexture.active;+ RenderTexture.active = rt;+ var tex = new Texture2D(rt.width, rt.height, TextureFormat.RGB24, false);+ tex.ReadPixels(new Rect(0, 0, rt.width, rt.height), 0, 0);+ tex.Apply();+ RenderTexture.active = prev;+ File.WriteAllBytes(Path.Combine(dir, name + ".png"), tex.EncodeToPNG());+ Object.DestroyImmediate(tex);+ Debug.Log(string.Format(System.Globalization.CultureInfo.InvariantCulture, "SHOT {0}: toast {1}, credit {2}, title {3}, options {4}",+ name, root.Q("toast").worldBound, root.Q("event-photo-credit").worldBound, root.Q("event-title").worldBound, root.Q("event-options").worldBound));+ }++ IEnumerator Shots(bool hebrew)+ {+ var set = System.Environment.GetEnvironmentVariable("STATECRAFT_SHOT_TAG") ?? "after";+ var dir = Path.Combine(Directory.GetCurrentDirectory(), ".superpowers", "toast-2621");+ Directory.CreateDirectory(dir);+ var tag = $"{set}-{(hebrew ? "he" : "en")}-{Width}x{Height}";+ var rt = new RenderTexture(Width, Height, 24);+ var ps = Object.Instantiate(AssetDatabase.LoadAssetAtPath<PanelSettings>(UiPaths.Panel));+ ps.targetTexture = rt; ps.clearColor = true; ps.colorClearValue = Color.black;+ var go = new GameObject("OperationToastShots");+ go.SetActive(false);+ var doc = go.AddComponent<UIDocument>();+ doc.panelSettings = ps;+ doc.visualTreeAsset = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(UiPaths.GameUxml);+ go.SetActive(true);+ var text = hebrew ? UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml")+ : UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);+ var root = doc.rootVisualElement;+ root.Q("root").RemoveFromClassList("loading");+ root.Q("root").EnableInClassList(UiLanguage.HebrewClass, hebrew);+ // The historical run to Hiram's turn, so every unit stands where the game puts it (the 7th Brigade arrived, and the+ // automated player has staged Carmeli and the 7th Brigade in Galilee); Hiram is the only card.+ var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);+ while (!g.State.PendingEvents.Contains(Event)) g.Step(HistoricalAI.Commands(C, g.State));+ g.State.PendingEvents.RemoveAll(id => id != Event);+ var bridge = new SimBridge(g, text);+ var hud = new HudPresenter(root, bridge, text);+ var card = new EventCardPresenter(root, bridge, text,+ AssetDatabase.LoadAssetAtPath<PortraitCatalog>("Assets/UI/Portraits/PortraitCatalog.asset"),+ AssetDatabase.LoadAssetAtPath<EventImageCatalog>("Assets/Resources/EventImageCatalog.asset"))+ { Units = UnitData.Parse(File.ReadAllText(Path.Combine(Paths.Content, "map", UnitData.DefaultFileName))) };+ try+ {+ card.Render();+ for (int i = 0; i < 20 && float.IsNaN(root.Q("minimap").worldBound.width); i++) yield return null;+ yield return Frames(8);+ Shot(rt, dir, tag + "-card", root);+ var toast = root.Q<Label>("toast");+ toast.text = LongToast;+ toast.style.display = DisplayStyle.Flex;+ yield return Frames(6);+ Shot(rt, dir, tag + "-toast", root);+ }+ finally+ {+ card.Dispose(); hud.Dispose();+ Object.DestroyImmediate(go); Object.DestroyImmediate(ps); rt.Release(); Object.DestroyImmediate(rt);+ }+ }++ [UnityTest] public IEnumerator English() { yield return Shots(false); }+ [UnityTest] public IEnumerator Hebrew() { yield return Shots(true); }+}diff --git a/unity/Assets/Tests/EditMode/OperationToastShots.cs.meta b/unity/Assets/Tests/EditMode/OperationToastShots.cs.metanew file mode 100644index 000000000..ee471eaa6--- /dev/null+++ b/unity/Assets/Tests/EditMode/OperationToastShots.cs.meta@@ -0,0 +1,2 @@+fileFormatVersion: 2+guid: ba0be4ccac7ba4bf7957150ee7129726\ No newline at end of filediff --git a/unity/Assets/Tests/EditMode/TurnReportTests.cs b/unity/Assets/Tests/EditMode/TurnReportTests.csindex 6bfab568d..30eddc8be 100644--- a/unity/Assets/Tests/EditMode/TurnReportTests.cs+++ b/unity/Assets/Tests/EditMode/TurnReportTests.cs@@ -355,6 +355,42 @@ public class TurnReportTests}}+ /// <summary>R-ENEMY-007 (#2543): a postponed or lapsed operation changes no number (Delta 0), but the rule says the turn+ /// report names the units and why, so its lines get a row of their own, before the held cities, in the sim's order and+ /// the player's language. The lines are the sim's own, from Operation Horev delegated with Golani out of place, then lapsed.+ /// Red without the row: the report has no operations row and the lines are only on the Why screen.</summary>+ [Test]+ public void PostponedAndLapsedOperationsAreReportedInBothLanguages()+ {+ var e = C.Events.Single(x => x.Id == "operation_horev");+ var s = Simulation.NewGame(C, 23, Mode.Historical);+ s.Date = e.From; s.PendingEvents.Clear(); s.PendingEvents.Add(e.Id);+ var why = new List<Cause>(); EventSystem.Delegate(C, s, why);+ s.Date = e.To!.Value; s.Turn += C.Rules.Mvp!.OperationWaitTurns!.Value + 1; EventSystem.LapseExpiredOperations(C, s, why); // after its wait (R-ENEMY-007)+ var added = why.Where(w => w.Key == CauseKeys.OperationPostponed || w.Key == CauseKeys.OperationLapsed).ToList();+ Assert.AreEqual(new[] { CauseKeys.OperationPostponed, CauseKeys.OperationLapsed }, added.Select(w => w.Key).ToArray());+ var rows = UnitData.Parse(System.IO.File.ReadAllText(System.IO.Path.Combine(Paths.Content, "map", UnitData.DefaultFileName)));+ foreach (var hebrew in new[] { false, true })+ {+ var text = hebrew ? He : En;+ using var k = new Kit(text, (g, cmds) =>+ {+ var r = g.EndTurn(cmds);+ var result = new StepResult(r.State, r.Why.Concat(added).ToList(), r.Rejected);+ typeof(GameSession).GetProperty(nameof(GameSession.Last))!.SetValue(g, result);+ return result;+ });+ k.Report.Units = rows;+ k.Bridge.EndTurn();+ Assert.AreEqual(hebrew ? "מבצעים צבאיים" : "Military operations",+ k.Ui.Q<Label>("turn-report-heading-" + TurnReportPresenter.OperationsRow).text);+ CollectionAssert.AreEqual(added.Select(w => CauseText.Line(w, C, rows, text)).ToList(), Causes(k.Ui, TurnReportPresenter.OperationsRow));+ StringAssert.Contains(hebrew ? "חטיבת גולני" : "Golani Brigade", Causes(k.Ui, TurnReportPresenter.OperationsRow)[0]);+ var order = k.Ui.Q<ScrollView>("turn-report-rows").Children().Select(r => r.name).ToList();+ Assert.Greater(order.IndexOf("turn-report-" + TurnReportPresenter.OperationsRow), order.IndexOf("turn-report-arms"), "after the stocks");+ }+ }+/// <summary>R-CITY-010 (#1711): a turn with no held city has no held row.</summary>[Test]public void ATurnWithNoHeldCityGivesNoHeldRow()diff --git a/unity/Assets/UI/Statecraft.uss b/unity/Assets/UI/Statecraft.ussindex 8345fbcb9..59720acff 100644--- a/unity/Assets/UI/Statecraft.uss+++ b/unity/Assets/UI/Statecraft.uss@@ -366,8 +366,10 @@ Button:disabled { color: var(--ink-dim); border-color: rgba(120, 120, 120, 0.4);option are in the same muted ink, indented 46 px to line up with the option's text after its round sign (.event-option padding). */.event-alt-banner { display: none; white-space: normal; margin: 0 0 8px 0; padding: 2px 0 2px 10px; border-left-width: 2px; border-color: var(--gold); }.lang-he .event-alt-banner { border-left-width: 0; border-right-width: 2px; padding: 2px 10px 2px 0; }-.event-rejoin, .event-effect { white-space: normal; margin: -1px 0 4px 46px; }-.lang-he .event-rejoin, .lang-he .event-effect { margin: -1px 46px 4px 0; }+.event-rejoin, .event-effect, .event-requirement, .event-requirement-unmet { white-space: normal; margin: -1px 0 4px 46px; }+.event-requirement-unmet { color: var(--down); }+.event-requirement, .event-requirement-unmet { font-size: 15px; }+.lang-he .event-rejoin, .lang-he .event-effect, .lang-he .event-requirement, .lang-he .event-requirement-unmet { margin: -1px 46px 4px 0; }/* The line over the greyed-out options when the Attention left cannot pay for an answer (#1034). */.event-delegate { display: none; white-space: normal; margin: 4px 0; color: var(--gold-light); }/* The capture dialog (CaptureDialogPresenter): under each option its plain description, then the sim's preview of whatdiff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex c07add4ae..9305e2cda 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -243,6 +243,21 @@ event.ai_label: "AI-generated illustration"event.no_attention: "You don't have enough Attention left to answer this turn. End the turn and the decision goes to {0}."event.cabinet: "the cabinet"event.option_cost: "{0} (costs {1:0.0} Attention)"+# R-ENEMY-007 operation placement. {0} unit name; {1} the allowed region names.+event.operation_requirement: "{0} must be in {1}."+event.operation_missing: "Move {0} to {1} before this operation can begin."+event.operation_move: "Move {0} to {1}"+event.operation_refused: "The operation's required units are not in place"+event.operation_lost: "{0} is no longer on the board."+event.operation_armistice_first: "Decide the armistice with {0} first."+event.operation_armistice_signed: "The armistice with {0} is signed: this operation will not take place."+event.operation_refused_armistice_first: "The armistice on this operation's front must be decided first"+event.operation_refused_armistice_signed: "The armistice on this operation's front is signed"+operation.region.galilee: "Galilee"+operation.region.central_plain: "Central Plain"+operation.region.jerusalem_hills: "Jerusalem Hills"+operation.region.southern_coast: "Southern Coast"+operation.region.negev: "Negev"# An objective card's line under its text (#380), from Objectives.MonthsFromHistory: early, in the same month as history,# or later. The owner's wording (#379, 14 October 2026). {0} the completion date, {1} the historical date, {2} months.event.objective_early: "Completed on {0}; historically {1}; {2} months early."@@ -539,6 +554,7 @@ report.workshop_arms_n: "Workshops in {0} ({1}): +{1} Arms"report.workshop_paused_debt_n: "Workshops in {0} ({1}) paused: debt ceiling"# The held cities' row (R-CITY-010, #1711): one line a city, why.cause.city_held.report.held: "Cities held by the enemy"+report.operations: "Military operations"# The end screen (#812; D-H4): the sim's end report (EndReport.For, #810), formatted only. {0} the card's title, {1} the# player's date, {2} the historical date; the population's {1} is the date of its CBS anchor and {2} the anchor's count.end.title: "The game has ended"@@ -1032,6 +1048,11 @@ why.cause.event_new: "New: {0}"why.cause.event_chosen: "Chosen: {0}"why.cause.event_delegated: "Delegated to {0}: {1}"why.cause.event_delegated_partial: "Delegated to {0}, carried out half-heartedly: {1}"+why.cause.operation_postponed: "{0} was postponed. {1}."+why.cause.operation_lapsed: "{0} lapsed because the required units did not reach the operation regions. {1}."+why.cause.operation_lapsed_signed: "{0} lapsed because the armistice with {1} was signed."+why.cause.operation_lapsed_unit_lost: "{0} lapsed because a required unit is no longer on the board: {1}."+why.cause.operation_waits_for_armistice: "{0} was postponed until the armistice with {1} is decided."why.cause.cabinet: "the cabinet"why.cause.event_amount: "{0} {1}"why.cause.event_stock: "{0} {1} units"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex b5a8b1000..08e8299d2 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -291,6 +291,21 @@ event.no_attention: "לא נשארה לך מספיק תשומת לב לענות# Native review: owner, 3 Nov 2026 (HE batch 5: "approve all"; recorded on #564, issuecomment-6610635087).event.cabinet: "הממשלה"event.option_cost: "{0} (עולה {1:0.0} תשומת לב)"+# Agent-drafted Hebrew; native review pending (#564). R-ENEMY-007 operation placement.+event.operation_requirement: "נדרשת הצבת {0} באזור {1}."+event.operation_missing: "יש להעביר את {0} אל {1} לפני שאפשר לפתוח במבצע."+event.operation_move: "להעביר את {0} אל {1}"+event.operation_refused: "היחידות הנדרשות למבצע אינן במקומן"+event.operation_lost: "{0} כבר לא על הלוח."+event.operation_armistice_first: "יש להכריע קודם בשביתת הנשק עם {0}."+event.operation_armistice_signed: "שביתת הנשק עם {0} נחתמה: המבצע לא יתקיים."+event.operation_refused_armistice_first: "יש להכריע קודם בשביתת הנשק בחזית של המבצע"+event.operation_refused_armistice_signed: "שביתת הנשק בחזית של המבצע נחתמה"+operation.region.galilee: "הגליל"+operation.region.central_plain: "מישור החוף המרכזי"+operation.region.jerusalem_hills: "הרי ירושלים"+operation.region.southern_coast: "מישור החוף הדרומי"+operation.region.negev: "הנגב"# The objective card's line (#380; the owner's wording, #379): early, on time, later.event.objective_early: "הושלם ב־{0}; בהיסטוריה ב־{1}; מוקדם ב־{2} חודשים."event.objective_early_one: "הושלם ב־{0}; בהיסטוריה ב־{1}; מוקדם בחודש אחד."@@ -629,6 +644,7 @@ report.workshop_arms_n: "סדנאות נשק ({0}) ({1}): תוספת נשק: {1}report.workshop_paused_debt_n: "סדנאות נשק ({0}) ({1}) בהמתנה: תקרת החוב"# The held cities' row (R-CITY-010, #1711). Agent-drafted Hebrew; native review pending (#564).report.held: "ערים בשליטת האויב"+report.operations: "מבצעים צבאיים"# The end screen (#812; D-H4): the sim's end report, formatted only. For the native reviewer (#564).# The nine end.* keys below: native review: owner, 3 Nov 2026 (HE batch 3: "Approve all as they are"), except# end.population_history, reworded for #2608 (#2620: the CBS figure is the Jewish population), which waits for the@@ -1234,6 +1250,12 @@ why.cause.event_chosen: "נבחרה אפשרות: {0}"why.cause.event_delegated: "ההכרעה הועברה אל {0}: {1}"# agent-drafted Hebrew; native review: owner, in chat on 25 Oct 2026 (approved as drafted).why.cause.event_delegated_partial: "ההכרעה הועברה אל {0}, עם ביצוע חלקי: {1}"+# Agent-drafted Hebrew; native review pending (#564).+why.cause.operation_postponed: "ההחלטה על {0} נדחתה. {1}."+why.cause.operation_lapsed: "ההחלטה על {0} ירדה מן הפרק משום שהיחידות הנדרשות לא הגיעו לאזורי המבצע. {1}."+why.cause.operation_lapsed_signed: "ההחלטה על {0} ירדה מן הפרק משום שנחתם הסכם שביתת הנשק עם {1}."+why.cause.operation_lapsed_unit_lost: "ההחלטה על {0} ירדה מן הפרק משום שיחידה נדרשת כבר לא על הלוח: {1}."+why.cause.operation_waits_for_armistice: "ההחלטה על {0} נדחתה עד שתוכרע שביתת הנשק עם {1}."# agent-drafted Hebrew; native review: owner, in chat on 25 Oct 2026 (approved as drafted).why.cause.cabinet: "הממשלה"# agent-drafted Hebrew; native review: owner, in chat on 25 Oct 2026 (approved as drafted).