A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
sim: the GDD cutover, monthly turns and the GDD loop on for the real game (refs #382) (#600)
Eyal Golan26c794465016
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 29d5f2996..4c040d21f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,19 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB## [Unreleased]+### Changed+- Event timing for monthly turns (refs #382; lands with the GDD cutover, Phase 2 PR 1; owner decisions of 15 October 2026+ on #567): six war-period windows open on the monthly turn date before their decision (`idf_founding`,+ `jerusalem_military_government`, `latrun_proposal`, `operation_horev`, `elections_1949`; `operation_horev` also lets+ `sinai_withdrawal` and `rhodes_talks` fire again). `ten_days`, `bernadotte_assassination`, `operation_hiram`,+ `jerusalem_ceasefire` and `sinai_withdrawal` are rewritten as decisions during or after the fact; Hiram loses its+ "protest to the UN" option. `altalena` opens on 15 June 1948 without the Kfar Vitkin clause (Q-CUT-7). The owner+ re-reviewed the four changed sensitive events on 15 October 2026 ("Approve all 4", #600).+ Sensitive events may no longer raise food, morale or international standing either (Q-EFX-2): the gains in `altalena`,+ `bernadotte_assassination` and `reparations_claim` are removed, and each of those options carries a small cost in+ another resource instead (Q-EFX-3, design values; the reparations claim's is Money, #600). The event-gap ruling is restated in months: 6, and 2 in wartime+ (Q-CUT-8). Every golden moves; the cutover re-pins them once.+### Added- A person's sign-off beside a status (refs #375, #564, #611; owner, 15 October 2026: "Yes, humans only"): every statusrow takes `reviewed_by` (the reviewer's GitHub handle, never an email) and `reviewed_on` (the day), both or neither.@@ -349,6 +362,29 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB+0.9 ms at the gameplay zoom), not yet on an idle one.### Changed+- **The GDD cutover (GDD Phase 2 PR 1, refs #382).** The real game now plays the GDD v0.1 loop on monthly turns, from+ 15 May 1948 to the game's end on 15 January 1952, 44 turns (owner decisions D-B1, D-E1, D-E5):+ - `content/eras.yaml` sets `systems.loop: gdd` and `content/rules.yaml` sets `turn_lengths` all month (R-LOOP-001,+ R-TURN-001) and `mvp.end: 1952-01-15` (R-LOOP-004; the game is then over, `mvp_ended`).+ - The Phase 1 balance numbers move into `content/` unchanged as labelled design values (owner, Q-CUT-1): new+ `content/cities.yaml` and `content/unit_types.yaml`, the rules' `mvp:` block and the GDD orders' Attention costs, each+ tagged `# DESIGN VALUE` and listed by `DesignValuesTests` (R-LOOP-005). `attention_per_turn` stays 4 (Q-CUT-5); inertia+ and the soft-event cap stay per turn (Q-CUT-6). The overlay `MvpSlice`, its `?mvp=1` dev flag (#598) and the `mvp-slice` golden are retired: the real game is the GDD game, and a game started under it autosaves and has New Game again.+ - Event windows re-timed for monthly turns (#567): `idf_founding`, `altalena` (15 June 1948, sourced; Q-CUT-7),+ `jerusalem_military_government`, `latrun_proposal`, `operation_horev` and `elections_1949` open on the 15th on or+ before their decision (R-TURN-002), so `sinai_withdrawal` and `rhodes_talks` fire again. The gap rule is restated in+ months: 6, and 2 at full war (Q-CUT-8, R-TURN-003).+ - Old saves are refused, said once in English or Hebrew: a save from before the cutover as made under earlier rules+ (R-SAVE-001), and one from an unknown ruleset as made by a newer version (R-SAVE-002).+ - The golden runs play the reference player, and every golden moves once: `hash1950` `f97e9f81`, `hash1952` and the new+ `mvp-end` `75d38299`, `smoke5` `85191d48` (five turns end 15 October 1948), and the three scenarios+ (docs/determinism.md). The browser smoke answers cards while the turn's Attention lasts. The Defence screen shows+ monthly turns on every level. The arrivals line reads "wait for homes".+ - Every new game now opens on a card (One Army, 15 May 1948), so #620's wait under the start screen covers a new game+ too, and `GameRoot.Shutdown` disposes the card first, so New Game does not load the event photo catalog for the+ game it closes (refs #592, #321). Without a start screen (the automated runs) the visible card loads it at once.+ - A refused autosave whose code has no string falls back to the short localised reason, so the start never fails on+ it; `mvp.end` must fall before the last era's end, so the game always ends as `mvp_ended`.- The 1948 Arab villages and towns on the map are dense packs of small stone houses with lanes between them (visualgap S1, refs #32): each Arab locality is laid out on the village plot lattice, as Lod and Ramla are, with smallerone-room houses (3.8-5.4 m, still at 100x), more two-storey houses in the core, roof rooms, and terraces under thediff --git a/content/cities.yaml b/content/cities.yamlnew file mode 100644index 000000000..246cea5bd--- /dev/null+++ b/content/cities.yaml@@ -0,0 +1,14 @@+# The GDD v0.1 cities and their start values (GDD "Cities and construction"; docs/rules/mvp.md R-CITY-001 to R-CITY-005).+# Every number below is a design value: the owner's balance, set or accepted in review (Q-CUT-1, owner, 15 October 2026:+# "Labelled design values"). None is a claim about Tel Aviv in 1948. Counts are population units of rules.yaml+# mvp.people_per_unit people (D-A1). The MVP has one city so far (D-A4: Tel Aviv); Phase 3 adds the others.+# DesignValuesTests lists every number here (R-LOOP-005); changing one is a balance edit that re-pins the goldens.+cities:+ - id: tel_aviv # a settlement id of map/settlements_1948.yaml+ housing_capacity: 120 # DESIGN VALUE: owner-set balance, not a historical figure (D-A4)+ job_slots: 90 # DESIGN VALUE: owner-set balance, not a historical figure (D-A4)+ civilians: 100 # DESIGN VALUE: owner-set balance, not a historical figure (D-A4)+ employed: 80 # DESIGN VALUE: owner-set balance, not a historical figure (D-A4)+ # D-D5 (owner, 14 October 2026): one military camp and one Hakhshara exist at the start, a design assumption, not a+ # claim about 1948. More are built by pioneers (Phase 4).+ facilities: [military_camp, hakhshara]diff --git a/content/eras.yaml b/content/eras.yamlindex 4f98d59a1..606469637 100644--- a/content/eras.yaml+++ b/content/eras.yaml@@ -5,9 +5,11 @@# Optional per era: `systems: { legislature: state | assembly, map_actions: [transit_camp, housing] }` (issue #58). Absent means# a state legislature and both map actions. A key is added only with the code behind it.# `systems.loop: legacy | gdd` (GDD v0.1, docs/rules/mvp.md R-LOOP-001): which game loop runs; the same in every era. Absent-# means legacy. The real game stays legacy until the GDD cutover.+# means legacy. Since the GDD cutover (Phase 2 PR 1) the real game runs the GDD loop in every era; play ends at rules.yaml+# mvp.end (R-LOOP-004), before this era's end.eras:- id: foundingname: The Foundingfrom: 1948-05-15 # = rules.yaml startto: 1957-01-01+ systems: { loop: gdd }diff --git a/content/events/altalena.yaml b/content/events/altalena.yamlindex b500a70d5..87d5efd23 100644--- a/content/events/altalena.yaml+++ b/content/events/altalena.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: altalenatitle: The Altalena-text: 'The Altalena, a ship carrying arms for the Irgun, is due at Kfar Vitkin. Begin asks that a fifth of the arms go to the Irgun''s battalion in Jerusalem and the rest to Irgun battalions inside the IDF. {defense_minister} must decide.'+text: 'The Altalena, a ship carrying arms for the Irgun, is due off the coast within days. Begin asks that a fifth of the arms go to the Irgun''s battalion in Jerusalem and the rest to Irgun battalions inside the IDF. {defense_minister} must decide.'anchor: hardtags: [security, war-casualties]office: defense_minister@@ -13,8 +13,15 @@ office: defense_minister# dead; the Etzel account gives the agreement to the first request and Ben-Gurion's order to shell, and Ben-Gurion told# the Provisional State Council on 23 June that there was no such agreement: both below; the Ministry of Education has# Rabin commanding the IDF force off Tel Aviv; the dispersal rests on en.wiki alone). Research notes section 2.-# The window opens on 19 June, the turn date before the arrival (game timing), so the card comes before 20-22 June.-from: 1948-06-19+# The window opens on 15 June 1948, the monthly turn date before the arrival (owner decision, 15 October 2026, Q-CUT-7:+# "on 15 June", with the Kfar Vitkin clause dropped; #375). By then the government knew the ship was coming: the Etzel+# account dates Begin's meeting with government representatives to 15 June, and quotes Ben-Gurion's diary of 16 June:+# Galili and Eshkol met Begin "yesterday" and the ship is due "tomorrow or the next day" (Hebrew "מחר-מחרתיים", in the+# Daat encyclopedia entry, below). Secondary sources only: he.wiki footnotes the entry to the Ben-Gurion Archives+# (bengurionarchive.bgu.ac.il/node/14209), which did not load on 15 October 2026, and the printed War Diary (Rivlin and+# Oren, 1982) was not checked. Ben-Tzur (palyam.org) and he.wiki put the meeting on the night of 16 June. The landing+# place is not in the text: no source has it settled by 15 June.+from: 1948-06-15to: 1948-06-23options:- id: enforce@@ -30,11 +37,19 @@ options:text: Grant both requests, arming Irgun battalions inside the IDFeffects:- { target: security, delta: -0.025 }- - { target: morale, delta: 0.02 }+ # Owner decision of 15 October 2026 (Q-EFX-3, "Add a real cost"; #375): a cost in another resource, a design value.+ # Arms landed for a private force while the first truce forbade bringing in war material (first_truce.yaml).+ - { target: intl_standing, delta: -0.02 }sources:- - { url: "https://en.wikipedia.org/wiki/Altalena_Affair", checked: 2026-10-10 }+ # Also the 15 June meeting and Ben-Gurion's diary of 16 June, for the window: en.wiki gives no footnote for them, and its+ # text matches the Etzel account below word for word.+ - { url: "https://en.wikipedia.org/wiki/Altalena_affair", checked: 2026-10-15 }# The Irgun's own account (Etzel history): Begin's two requests, the fifth for Jerusalem and the rest for the IDF battalions.- - { url: "https://daat.ac.il/etzel/english/ac20.htm", checked: 2026-10-14 }+ # Also, for the window: Begin's meeting with government representatives on 15 June, and Ben-Gurion's diary of 16 June.+ - { url: "https://daat.ac.il/etzel/english/ac20.htm", checked: 2026-10-15 }+ # The Daat encyclopedia's Altalena entry (Lapidot) quotes the diary of 16 June in Hebrew: "ישבו אתמול עם בייגין.+ # מחר-מחרתיים צריכה להגיע אוניה שלהם" (they sat yesterday with Begin; tomorrow or the next day their ship is due).+ - { url: "https://www.daat.ac.il/encyclopedia/value.asp?id1=1694", checked: 2026-10-15 }- { url: "https://www.jta.org/archive/hull-of-altalena-sunk-vessel-destroyed-in-1948-when-irgun-tried-to-land-munitions", checked: 2026-10-14 }# Provisional State Council, fifth sitting, 23 June 1948 (Knesset minutes). Ben-Gurion: on 1 June the Irgun's head# signed that its arms would go to the IDF; the Irgun refused to put the ship at the government's disposal; thediff --git a/content/events/bernadotte_assassination.yaml b/content/events/bernadotte_assassination.yamlindex 88cd5453f..1fb946312 100644--- a/content/events/bernadotte_assassination.yaml+++ b/content/events/bernadotte_assassination.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: bernadotte_assassinationtitle: The Mediator Assassinated-text: 'Lehi gunmen have assassinated the UN mediator, Count Folke Bernadotte, in Jerusalem, a day after he completed his second plan. {prime_minister} must decide how the government answers the armed groups still outside the IDF: Lehi, and the Irgun battalions in Jerusalem.'+text: 'Lehi gunmen assassinated the UN mediator, Count Folke Bernadotte, in Jerusalem on 17 September, a day after he completed his second plan. Emergency regulations proclaimed Lehi a terrorist organisation, about 200 of its members were arrested, and the Irgun battalions in Jerusalem were given 24 hours to disband into the IDF. {prime_minister} must decide whether the government keeps up the crackdown.'anchor: hardtags: [security, terror]office: prime_minister@@ -28,20 +28,26 @@ office: prime_minister# Irgun accepted within the 24 hours); JVL says its battalions disbanded on 20 September, a US consul's report says the# Irgun agreed on 21 September (FRUS [S]).# Research notes facts-1948.md section 6.-from: 1948-09-17-to: 1948-09-24+# The card is a decision after the fact (owner decision, 15 October 2026, #567;+# docs/superpowers/specs/2026-10-14-event-timing-monthly.md):+# no monthly turn date falls between the killing and the government's answer. The window opens on 23 September, by+# when the regulations, the arrests and the ultimatum had all happened, and ends on 15 October.+from: 1948-09-23+to: 1948-10-16options:- id: outlaw- text: Outlaw Lehi, arrest its members and order the Irgun in Jerusalem to disband into the IDF+ text: Keep Lehi outlawed and its members under arrest, and hold the Irgun in Jerusalem to disbanding into the IDFhistorical: truerecommended: trueeffects:- { target: intl_standing, delta: -0.05 } # the killing itself, shared by both options (notes section 6)- - { target: intl_standing, delta: 0.03 } # partial recovery from the crackdown- { target: security, delta: 0.01 }+ # Owner decision of 15 October 2026 (Q-EFX-3, "Add a real cost"; #375): a cost in another resource, a design value:+ # mass arrests and a forced disbandment strain cohesion.+ - { target: morale, delta: -0.02 }- id: investigate_only# Game assumption: the notes name no advocate for this option.- text: Investigate the killing without a general crackdown+ text: Ease the crackdown and leave the killing to the investigationeffects:- { target: intl_standing, delta: -0.05 } # the killing itself, shared by both options (notes section 6)- { target: intl_standing, delta: -0.10 }diff --git a/content/events/elections_1949.yaml b/content/events/elections_1949.yamlindex 5ef0e92ba..c0ee287f7 100644--- a/content/events/elections_1949.yaml+++ b/content/events/elections_1949.yaml@@ -17,11 +17,11 @@ office: prime_minister# Central Elections Committee: 440,095 voters of 506,567, which is 86.88%; the Official Gazette's notice of the results# gives 5,411 invalid votes, which with CBS's 434,684 valid votes makes the same 440,095; the IDI's Hebrew page also# gives 86.9%; [C] its English page 87.0%, a rounding the figures do not support). 25 January was fixed on-# 25 November 1948 (Harpaz, p. 187); the card comes on 23 January, by when the date was set. Research notes sections+# 25 November 1948 (Harpaz, p. 187); the card comes on 15 January, by when the date was set. Research notes sections# 10 and 11.# One option (review I3): legislatures.yaml fixes the election and the First Knesset's sitting, so a "postpone" option-# could not change anything. The window opens on 17 January, so the card comes in the week of the vote.-from: 1949-01-17+# could not change anything. The window opens on 15 January, the monthly turn date before the vote.+from: 1949-01-15to: 1949-01-26options:- id: holddiff --git a/content/events/first_truce.yaml b/content/events/first_truce.yamlindex 45d4be19e..73338bf10 100644--- a/content/events/first_truce.yaml+++ b/content/events/first_truce.yaml@@ -10,9 +10,10 @@ office: prime_minister# July). End date [C]: 8 July (en.wiki "1948 Arab-Israeli War") vs 9 July (JVL/IDF, he.wiki; the Mediator's report S/888# and his progress report); both agree Egypt renewed fighting on 8 July (JTA reports the Defense Ministry's account of an# Egyptian attack the day before the truce ended; see ten_days.yaml). Research notes facts-1948.md section 1.-# By design, accepting leaves the security level at 5 (full war, weekly turns); do not "fix" it to 4. The truce lasted-# four weeks: at level 4 the turns would be monthly from 5 June, and the Ten Days and the second truce would both reach the-# player on 5 August, after the fact. The Defence screen shows full war during the truce as a result.+# Accepting leaves the security level at 5 (full war). On monthly turns the level no longer sets the turn length.+# The card comes on 15 June, five days after the acceptance of 10 June: no monthly turn date falls between the+# resolution of 29 May and the acceptance, and the owner accepted the delay (owner decision, 15 October 2026, #567;+# docs/superpowers/specs/2026-10-14-event-timing-monthly.md).from: 1948-06-01to: 1948-06-11options:diff --git a/content/events/idf_founding.yaml b/content/events/idf_founding.yamlindex 9a1b22140..9c203dcc9 100644--- a/content/events/idf_founding.yaml+++ b/content/events/idf_founding.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: idf_foundingtitle: One Army-text: 'Armed forces are being brought into the new Israel Defense Forces, while the Irgun and Lehi still keep their own units. {defense_minister} proposes an order that forbids any armed force other than the IDF.'+text: 'The Irgun and Lehi still keep their own armed units. {defense_minister} proposes an order that establishes the Israel Defense Forces and forbids any armed force other than the IDF.'anchor: hardtags: [security]office: defense_minister@@ -10,9 +10,10 @@ office: defense_minister# dates its publication 31 May 1948), so the window ends then. The Irgun agreed with the government on 1 June 1948 to# dissolve into the IDF (Ben-Gurion to the Provisional State Council on 23 June 1948, below), Jerusalem excepted (JVL).# Research notes facts-1948.md section 3a.-# The window opens on 22 May, the turn date before the order (game timing), so the card reaches the player in the turn-# that covers 26 May.-from: 1948-05-22+# The window opens on 15 May, the game's first day: on monthly turns the next turn date, 15 June, would come after the+# order of 26 May (game timing; docs/superpowers/specs/2026-10-14-event-timing-monthly.md). The text does not say the IDF+# exists yet: the ordinance established it.+from: 1948-05-15to: 1948-06-01# Security deltas in these war-period events were halved in fix round 1 (review I6): ten of them stacked as permanent# shifts, which moved end-1948 security from 0.34 to 0.62 with nothing anchoring it.diff --git a/content/events/jerusalem_ceasefire.yaml b/content/events/jerusalem_ceasefire.yamlindex d61f6da20..5d3421d58 100644--- a/content/events/jerusalem_ceasefire.yaml+++ b/content/events/jerusalem_ceasefire.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: jerusalem_ceasefiretitle: Cease-fire in Jerusalem-text: 'Talks began on 28 November between Dayan and Abdullah el-Tell on a full cease-fire for the Jerusalem area, with UN observers present. {prime_minister} must decide whether Israel signs it at Government House.'+text: 'After talks that began on 28 November, Dayan and Abdullah el-Tell signed a full cease-fire for the Jerusalem area at Government House on 30 November, with UN observers present. {prime_minister} must decide whether Israel keeps to it.'anchor: hardtags: [security]office: prime_minister@@ -9,14 +9,17 @@ office: prime_minister# talks began on 28 November (UN press release [S]). On 23 December el-Tell apparently received new orders and avoided# further talks (FRUS d844 [S]). Partial releases of prisoners followed [S]. Research notes facts-1948.md section 13b.# Only a player who put Jerusalem under military government sees this card. The gating is a design inference, not in the-# notes: with a demilitarised city there would be no IDF commander to sign. The card comes on 28 November, when the talks-# began; it states the talks, not their outcome (re-review N1).-from: 1948-11-28-to: 1948-12-01+# notes: with a demilitarised city there would be no IDF commander to sign. The card is a decision after the fact+# (owner decision, 15 October 2026, #567;+# docs/superpowers/specs/2026-10-14-event-timing-monthly.md):+# no monthly turn date falls between the talks and the signing, so the window opens on 30 November and ends on+# 15 December, and the text states the signing.+from: 1948-11-30+to: 1948-12-16requires: { event: jerusalem_military_government, option: military_government }options:- - id: sign- text: Sign the Jerusalem cease-fire+ - id: keep+ text: Keep to the Jerusalem cease-firehistorical: truerecommended: trueeffects:@@ -24,7 +27,7 @@ options:- id: hold_out# The alternative named in the notes (section 13b). Game assumption: no one is recorded arguing for it; its effects are# design values.- text: Hold out for the Old City and the Latrun road+ text: Press on for the Old City and the Latrun roadeffects:- { target: security, delta: -0.015 }- { target: intl_standing, delta: -0.03 }diff --git a/content/events/jerusalem_military_government.yaml b/content/events/jerusalem_military_government.yamlindex 3af5066f4..2bcd0b0ba 100644--- a/content/events/jerusalem_military_government.yaml+++ b/content/events/jerusalem_military_government.yaml@@ -16,9 +16,9 @@ office: prime_minister# of the first truce, and his progress report has it sent to Cairo and Tel Aviv on 3 July, with a working paper after# 15 July; Shertok told the council Israel had agreed to explore the first proposal, not to accept it, and rejected the# detailed one outright ([C] JVL dates the suggestion to 26 July, the day he met Shertok, as JTA reports). Research-# notes sections 5 (companion events) and 13b. The window opens on 17 July, the turn date before 2 August on the-# monthly grid of the second truce (game timing).-from: 1948-07-17+# notes sections 5 (companion events) and 13b. The window opens on 15 July, the monthly turn date before 2 August+# (game timing).+from: 1948-07-15to: 1948-08-03# Effects of both options are game assumptions: the notes give none for this event.options:diff --git a/content/events/latrun_proposal.yaml b/content/events/latrun_proposal.yamlindex 19b4673b6..5d2527017 100644--- a/content/events/latrun_proposal.yaml+++ b/content/events/latrun_proposal.yaml@@ -11,9 +11,9 @@ office: prime_minister# a primary source, is used. The text names offices whose 1948 holders are on the diary's list without a question mark:# Finance (Kaplan), Justice (Rosen) and Immigration (Shapira); with player appointments it names the appointees.# On 29 September he told the General Staff an attack was possible but not at this time [S]. Research notes section 13a.-# The window opens on 17 September, the turn date before the vote on the monthly grid of the second truce (game timing).+# The window opens on 15 September, the monthly turn date before the vote (game timing).# Only a player who complied with the second truce sees this card (it is about breaking the truce).-from: 1948-09-17+from: 1948-09-15to: 1948-09-27requires: { event: second_truce, option: comply }options:diff --git a/content/events/operation_hiram.yaml b/content/events/operation_hiram.yamlindex ff6e28b58..71f1a18e9 100644--- a/content/events/operation_hiram.yaml+++ b/content/events/operation_hiram.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: operation_hiramtitle: Operation Hiram-text: 'In breach of the truce, the Arab Liberation Army has attacked the Sheikh Abd position above Kibbutz Manara, and Qawuqji refuses to withdraw. Israel has told the UN that it feels free to act. {defense_minister} must decide whether Moshe Carmel''s forces clear the Upper Galilee.'+text: 'In breach of the truce, the Arab Liberation Army attacked the Sheikh Abd position above Kibbutz Manara on 22 October. Between 29 and 31 October Moshe Carmel''s forces drove it out of the Upper Galilee in Operation Hiram, and a cease-fire took effect on 31 October. {defense_minister} must decide whether the forces stop at the cease-fire or advance further into Lebanon.'anchor: softtags: [security, war-casualties]office: defense_minister@@ -14,27 +14,27 @@ office: defense_minister# (Ben-Gurion's diary, 31 October; S/1071 has the Israeli cease-fire order effective at 0600 GMT). Ben-Gurion declined# to authorise an advance further into Lebanon, fearing international condemnation (en.wiki "Operation Hiram"): the# third option. Owner ruling: the text stays military. Research notes facts-1948.md section 8.-from: 1948-10-24-to: 1948-10-29+# The card is a decision after the fact (owner decision, 15 October 2026, #567;+# docs/superpowers/specs/2026-10-14-event-timing-monthly.md):+# no monthly turn date falls between the attack of 22 October and the launch. The window opens on 31 October, the+# cease-fire, and ends on 15 November. The "protest to the UN" option (a game assumption) is gone: it belonged to the+# decision before the operation.+from: 1948-10-31+to: 1948-11-16options:- - id: launch- text: Launch Operation Hiram and drive the Arab Liberation Army out of the Galilee+ - id: stop_at_ceasefire+ text: Stop at the cease-fire and hold the Upper Galileehistorical: truerecommended: trueset_rung: 5effects:- { target: security, delta: 0.02 }- id: advance_into_lebanon- text: Launch it, and advance further into Lebanon+ text: Advance further into Lebanonset_rung: 5effects:- { target: security, delta: 0.025 }- { target: intl_standing, delta: -0.08 }- - id: protest_to_un- # Game assumption: the notes name no advocate for this option.- text: Protest to the UN and hold the line- effects:- - { target: security, delta: -0.02 }sources:- { url: "https://en.wikipedia.org/wiki/Operation_Hiram", checked: 2026-10-10 }- { url: "https://www.un.org/unispal/document/auto-insert-211203/", checked: 2026-10-14 }diff --git a/content/events/operation_horev.yaml b/content/events/operation_horev.yamlindex 0f2faac2c..2208286ec 100644--- a/content/events/operation_horev.yaml+++ b/content/events/operation_horev.yaml@@ -11,8 +11,9 @@ office: defense_minister# 7 January 1949 (the IDF Archives: cease-fire at 14:00; the cease-fire agreement of 24 January: effective 7 January# at 12:00 GMT). Commander Yigal Allon, five brigades (the IDF Archives: three brigades moved south to reinforce two# southern ones). Research notes facts-1948.md section 9.-# The window opens on 19 December, the turn date before the launch (game timing).-from: 1948-12-19+# The window opens on 15 December, the monthly turn date before the launch (game timing). Opening it earlier also lets+# the follow-ups (sinai_withdrawal, rhodes_talks) fire on 15 January 1949: they need Horev answered first.+from: 1948-12-15to: 1948-12-23options:- id: launchdiff --git a/content/events/operation_yoav.yaml b/content/events/operation_yoav.yamlindex d45bc3914..11bcc34c0 100644--- a/content/events/operation_yoav.yaml+++ b/content/events/operation_yoav.yaml@@ -10,8 +10,8 @@ office: defense_minister# 1948; Beersheba taken by the Negev Brigade on 21 October; cease-fire 22 October (en.wiki "Operation Yoav"; the IDF# account; the Knesset's war summary; FRUS doc. 705). At the end Allon asked to push into the Hebron hills and the Jericho# valley; Ben-Gurion refused, mainly fearing British involvement (en.wiki "Operation Yoav"). This card is that decision-# (yoav_hebron in notes section 7). The window is the operation, 15-22 October; on the monthly grid of the second truce-# the card comes on 17 October, and the turn it opens covers Allon's request.+# (yoav_hebron in notes section 7). The window is the operation, 15-22 October; on monthly turns the card comes on+# 15 October, and the turn it opens covers Allon's request.from: 1948-10-15to: 1948-10-23options:diff --git a/content/events/reparations_claim.yaml b/content/events/reparations_claim.yamlindex b98679256..2f71d40e5 100644--- a/content/events/reparations_claim.yaml+++ b/content/events/reparations_claim.yaml@@ -20,7 +20,11 @@ options:historical: truerecommended: trueeffects:- - { target: intl_standing, delta: 0.02 }+ - { target: intl_standing, delta: 0 }+ # Owner decisions of 15 October 2026: Q-EFX-3, "Add a real cost" (#375), and "Move the cost to Money" (#600). A design+ # value, IL 1 million, half the smallest Money effect of any event (maabarot_policy, IL 2 million); not a historical+ # figure and not a moral judgement of either answer.+ - { target: treasury, delta: -1 }- id: refusetext: Refuse any dealings with Germanyeffects:diff --git a/content/events/rhodes_talks.yaml b/content/events/rhodes_talks.yamlindex 3a336f34a..1ad55b759 100644--- a/content/events/rhodes_talks.yaml+++ b/content/events/rhodes_talks.yaml@@ -11,7 +11,9 @@ office: foreign_minister# January 1949 (FRUS 1949 vol. VI doc. 389). The RAF clash was on 7 January: the British statement of 8 January# (Hansard) and Israel's reply to the British protest (JTA, 19 January 1949) both give that date ([C] 6 January on# en.wiki "Operation Horev"); it is left out of the text. Research notes facts-1948.md section 9 (aftermath).-# Only a player who launched Operation Horev sees this card (the cease-fire it names ends that operation).+# Only a player who launched Operation Horev sees this card (the cease-fire it names ends that operation). On monthly+# turns it comes on 15 January, two days after the talks opened: it needs Horev answered first, and the owner accepted+# the delay (owner decision, 15 October 2026, #567; docs/superpowers/specs/2026-10-14-event-timing-monthly.md).from: 1949-01-09to: 1949-01-13requires: { event: operation_horev, option: launch }diff --git a/content/events/sinai_withdrawal.yaml b/content/events/sinai_withdrawal.yamlindex 6b636b0ea..12a70ba0e 100644--- a/content/events/sinai_withdrawal.yaml+++ b/content/events/sinai_withdrawal.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: sinai_withdrawaltitle: The British Ultimatum-text: 'Israeli forces have crossed into Sinai and reached the outskirts of El-Arish airfield. The Security Council has called for a cease-fire, the United States has added its pressure, and Britain threatens to act against Israel under its 1936 treaty with Egypt. {prime_minister} must decide whether to pull back to the Negev frontier.'+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. By 2 January the forces had been pulled back to the Negev frontier. {prime_minister} must decide whether they stay behind it.'anchor: hardtags: [security]office: prime_minister@@ -13,22 +13,26 @@ office: prime_minister# (JVL, en.wiki "1949 in Israel" and "1948 Arab-Israeli War") vs 6 January (en.wiki "Operation Horev"); Israel accepted the# cease-fire on 7 January. The alternative (holding El-Arish to cut off the Egyptian army) is in Avnery's commentary [S].# Research notes facts-1948.md section 9.-# The card comes on 2 January, a day after Ben-Gurion told McDonald the orders were given (1 January): it cannot come on-# the 26 December turn without stating the facts of 28-30 December in advance (review M6, accepted). Only a player who-# launched Operation Horev sees it.-from: 1948-12-31-to: 1949-01-03+# The card must not state the facts of 28-30 December in advance (review M6, accepted). Only a player who launched+# Operation Horev sees it.+# The card is a decision after the fact (owner decision, 15 October 2026, #567;+# docs/superpowers/specs/2026-10-14-event-timing-monthly.md):+# on monthly turns it comes on 15 January, after the withdrawal, so the window opens on 2 January and ends on+# 15 January, and the text states the withdrawal.+from: 1949-01-02+to: 1949-01-16requires: { event: operation_horev, option: launch }options:- id: withdraw- text: Withdraw from Sinai to the Negev frontier+ text: Keep the forces behind the Negev frontierhistorical: truerecommended: trueeffects:- { target: intl_standing, delta: 0.05 }- { target: security, delta: -0.01 }- id: hold_el_arish- text: Hold the positions around El-Arish+ # Game assumption: after the withdrawal, the alternative in Avnery's commentary becomes a return.+ text: Send them back toward El-Arish to cut off the Egyptian armyeffects:- { target: intl_standing, delta: -0.10 }- { target: security, delta: 0.025 }diff --git a/content/events/ten_days.yaml b/content/events/ten_days.yamlindex b7b48c9a3..4f045401c 100644--- a/content/events/ten_days.yaml+++ b/content/events/ten_days.yaml@@ -1,7 +1,7 @@# yaml-language-server: $schema=../schema/event.schema.jsonid: ten_daystitle: The Ten Days-text: 'The first truce is due to end on 9 July. Where should the main effort go when the fighting resumes? In the centre, Operation Dani under Yigal Allon would take Lydda airport and secure the road to Jerusalem. {defense_minister} must decide.'+text: 'The first truce has ended and the fighting has resumed, with Egypt attacking in the south. In the centre, Operation Dani under Yigal Allon has taken Lydda airport and is pushing to secure the road to Jerusalem. {defense_minister} must decide where the main effort goes for the rest of the fighting.'anchor: hardtags: [security, war-casualties]office: defense_minister@@ -14,14 +14,17 @@ office: defense_minister# has it taken "yesterday", without a dateline); the attacks on Latrun on 15-16 and 18 July failed (en.wiki for the# dates; the Knesset summary for the failure of the second phase). Owner ruling: the text describes the military# operation only. Research notes section 4.-# The window opens on 3 July, the turn date before the truce ends (game timing). Only a player who accepted the first-# truce sees this card (its text is about the truce ending).-from: 1948-07-03-to: 1948-07-11+# The card is a decision during the fighting (owner decision, 15 October 2026, #567;+# docs/superpowers/specs/2026-10-14-event-timing-monthly.md):+# on monthly turns it cannot come before 15 July while it needs the first truce answered. The window opens on 10 July,+# when Lydda airport was taken, and ends on 17 July, before the second truce took effect on 18 July. Only a player who+# accepted the first truce sees this card (its text is about the truce ending).+from: 1948-07-10+to: 1948-07-18requires: { event: first_truce, option: accept }options:- id: central_front- text: Strike in the centre with Operation Dani, toward Lydda airport and the Jerusalem road+ text: Keep the main effort in the centre with Operation Dani, toward the Jerusalem roadhistorical: truerecommended: trueset_rung: 5@@ -30,7 +33,7 @@ options:- id: southern_front# Game assumption: a design alternative. The notes found no cabinet debate in July; Ben-Gurion's diary of 11 July# records Yadin asking where forces should go next [S].- text: Strike against Egypt in the south first+ text: Shift the main effort south, against Egyptset_rung: 5effects:- { target: security, delta: 0.015 }diff --git a/content/rules.yaml b/content/rules.yamlindex d629cf018..a47c01e7e 100644--- a/content/rules.yaml+++ b/content/rules.yaml@@ -1,8 +1,39 @@# Game rules. Values are game balance, except where a comment cites a source.start: 1948-05-15 # first day covered by the CBS 1948 immigration series (aliyah.yaml)-start_rung: 5 # the war is under way when the slice opens-attention_per_turn: 4-attention_cost: { set_policy: 1, allocate_budget: 2, choose_event_option: 1, set_mobilization: 1, security_order: 1, appoint: 2, map_action: 1 }+start_rung: 5 # the war is under way when the game opens+attention_per_turn: 4 # kept at 4 for monthly turns (owner, 15 October 2026, Q-CUT-5)+# Attention each order costs. The GDD orders' costs are design values (the owner's balance, not history), docs/rules/mvp.md+# R-LOOP-005; a unit order will be free (D-A6).+attention_cost:+ set_policy: 1+ allocate_budget: 2+ choose_event_option: 1+ set_mobilization: 1+ security_order: 1+ appoint: 2+ map_action: 1+ assign_workers: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-A6)+ train: 1 # DESIGN VALUE: owner-set balance, not a historical figure (D-A6)+ cancel_training: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-A6)+ pioneer_work: 0 # DESIGN VALUE: owner-set balance, not a historical figure (D-A6: unit orders are free)+ stop_work: 0 # DESIGN VALUE: owner-set balance, not a historical figure (D-A6: unit orders are free)+# Turn length on each security rung, rungs 1 to 5 (R-TURN-001). The GDD MVP plays monthly turns on every rung (D-B1), so+# turns from 15 May 1948 end on the 15th of each month.+turn_lengths: [month, month, month, month, month]+# The GDD v0.1 rules (docs/rules/mvp.md). Every number here is a design value: the owner's balance, set or accepted in+# review (Q-CUT-1, owner, 15 October 2026: "Labelled design values"), never a historical claim. DesignValuesTests lists+# them all (R-LOOP-005); changing one is a balance edit that re-pins the goldens.+mvp:+ # The game ends on 15 January 1952, after 44 monthly turns (R-LOOP-004; owner, 15 October 2026, D-E5: "End on 15 Jan+ # 1952"). The founding era still runs to 1957 (G2), so its later content stays and loads, but play stops here.+ end: 1952-01-15+ people_per_unit: 1000 # DESIGN VALUE: owner-set balance, not a historical figure (D-A1: people in one population unit)+ income_per_job_per_year: 0.06 # DESIGN VALUE: owner-set balance, not a historical figure (D-C6: IL millions per employed unit a year)+ cohesion_housing_weight: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-C1, until Phase 2 PR 4)+ cohesion_jobs_weight: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-C1, until Phase 2 PR 4; the two weights sum to 1)+ arrivals_city: tel_aviv # the MVP has one city so far: every arrival lands there (R-CITY-003)+ build_yishuv_turns: 6 # DESIGN VALUE: owner-set balance, not a historical figure (D-D6: turns a pioneer build takes)+ build_yishuv_cost: 2 # DESIGN VALUE: owner-set balance, not a historical figure (D-D6: IL millions, paid at the start)# Coalition stability lost by replacing a minister (Cabinet.Appoint): a seat taken from the minister's party, or a# reshuffle within it.appoint_stability_cost_other_party: 0.06@@ -47,7 +78,10 @@ imports_per_capita_per_year: 0.00025# war-period events (playtest 1 E, which moved the turn grid by a day): the range is 194.00 to 206.83 (bisection), and the# margins at 200 are reserves $18.2m at the turn ending 1951-05-27 and $20.9m at the turn covering 19 Oct (against $45m# falling due); first crisis in the turn ending 1952-02-27 (the one covering 31 Dec 1951); reserves -36.8 at the end of-# the run. The value was not retuned.+# the run. The value was not retuned. Re-measured at the GDD cutover (monthly turns, play ending 15 January 1952): the+# anchor holds for 190.09 to 202.81 (bisection); at 200, reserves are $29.7m at the turn ending 1951-05-15 and $35.2m at+# the turn covering 19 Oct (ending 1951-11-15), against $45m falling due; the first crisis is in the turn ending+# 1951-12-15; reserves -13.0 at the game's end. The value was not retuned.capital_inflow_per_year: 200# While reserves are exhausted, food imports are cut: food_supply falls by this much per year.fx_crisis_food_per_year: -0.2diff --git a/content/sites.yaml b/content/sites.yamlindex a218c3dc0..17d7e60e2 100644--- a/content/sites.yaml+++ b/content/sites.yaml@@ -1,7 +1,7 @@# GDD v0.1 designated sites (docs/GDD.md "Pioneer work": building is allowed only at designated spots, and a new yishuv# takes its site's name). Phase 1 has one site (owner decision D-A4; the owner chose Mefalsim on #378, 14 October 2026).-# Sourced facts only: the build turns and cost are balance values, set in MvpSlice.Overlay until the owner sets them-# (ruling 2). The loader reads this file only when eras.yaml systems.loop is gdd. Research: #459,+# Sourced facts only: the build turns and cost are labelled design values in rules.yaml mvp: (Q-CUT-1, owner, 15 October+# 2026; R-LOOP-005). The loader reads this file only when eras.yaml systems.loop is gdd. Research: #459,# research_notes/GDD objectives/designated-site-1.md.sites:- id: mefalsimdiff --git a/content/unit_types.yaml b/content/unit_types.yamlnew file mode 100644index 000000000..35eaeb3e3--- /dev/null+++ b/content/unit_types.yaml@@ -0,0 +1,17 @@+# The GDD v0.1 population and unit types (GDD "Population and units"; docs/rules/mvp.md R-TRAIN-001 to R-TRAIN-003).+# D-A2: civilians, refugees and recruits are counts per city; a halutz is a movable unit. Every number below is a design+# value: the owner's balance, set or accepted in review (Q-CUT-1, owner, 15 October 2026: "Labelled design values"), not+# a historical figure. DesignValuesTests lists them all (R-LOOP-005).+types:+ - { id: civilian, kind: population }+ - { id: refugee, kind: population }+ - id: recruit # civilian to recruit, through basic training (GDD "Progression")+ kind: population # a count per city until Phase 5+ facility: military_camp+ training_turns: 3 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3)+ training_cost: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3: IL millions per group)+ - id: halutz # civilian to Halutz, through pioneer training in a Hakhshara (GDD "Progression")+ kind: unit # a movable unit (D-A2)+ facility: hakhshara+ training_turns: 4 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3)+ training_cost: 0.5 # DESIGN VALUE: owner-set balance, not a historical figure (D-A3: IL millions per group)diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex e2bc554e6..cad17ff5d 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -19,9 +19,9 @@ GitHub Releases page (and, from M4, on itch.io). Steps 1–3 are a normal pull r"$UNITY" -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression brotli -shareable -logFile "$PWD/unity-build-web-br.log"git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.assetuv run tools/web_check.py unity/Builds/Web-brotli --query "golden&smoke=5" \- --expect "GOLDEN OK 1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07" \- --expect "GOLDEN OK 1952 62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8" \- --expect "SMOKE OK 5 turns 1948-06-19 d3fdd459ddb876bd8d775c20edd1202cf56ca7134a8ad06f873d4d92034aa5b6"+ --expect "GOLDEN OK 1950 f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2" \+ --expect "GOLDEN OK 1952 75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31" \+ --expect "SMOKE OK 5 turns 1948-10-15 85191d48688be4595726b17778ecdda0175eff8f6f0fa1d976dbe3b48b42823b"bash scripts/oss/package_web.sh unity/Builds/Web-brotli unity/Builds/statecraft-israel-vX.Y.Z-web.zip```diff --git a/docs/WRITING_EVENTS.md b/docs/WRITING_EVENTS.mdindex fdf75291c..1f52557c2 100644--- a/docs/WRITING_EVENTS.md+++ b/docs/WRITING_EVENTS.md@@ -74,8 +74,9 @@ Write plain description. Do not put words in anyone's mouth: no invented quotesTags are free-form, but these four are sensitive (checked without regard to case): `holocaust`, `terror`, `massacre`,`war-casualties`. An event with any of them:-- cannot give a positive `treasury` or `fx_reserves` delta in any option (the loader refuses: it would reward the- atrocity);+- cannot give a positive delta to any resource in any option: `treasury`, `fx_reserves`, `food_supply`, `morale`+ (standing for Social cohesion) or `intl_standing` (standing for International Support). The loader refuses: it would+ reward the atrocity. Owner decision of 15 October 2026 (Q-EFX-2, "Extend it"); until then the rule covered money only;- needs `status: sensitivity-reviewed` before any build is shared. That status is set by the maintainer, not by you.Submit it as `fact-checked`. `Statecraft.Cli --release-gate`, the `-shareable` build and `tools/package_release.py`refuse to release while any sensitive event is not `sensitivity-reviewed`, and a test requires every sensitive event@@ -92,9 +93,11 @@ otherwise picks at random. With no `office`, a middling competence of 5 is used.### from and toThe window is half-open: the event can fire from `from` up to, not including, `to`. It fires on the first turn that-overlaps the window. A turn is a week, a month or a quarter, depending on the period, so a window shorter than a turn can still-fire, late. Put a comment above `from` saying why you chose the date, as the example does. The loader only requires-`from`, and that `to` is later than `from`.+overlaps the window. Turns are a month long and end on the 15th (15 June 1948, 15 July 1948, and so on, to the game's+end on 15 January 1952), so a window shorter than a turn can still fire, late. For a decision card, open the window on+the 15th on or before the historical decision, so the card reaches the player on the turn before it (R-TURN-002;+`EventRetimingTests` pins each card's turn). Put a comment above `from` saying why you chose the date, as the example+does. The loader only requires `from`, and that `to` is later than `from`.### conditions@@ -207,7 +210,7 @@ Errors are printed as `file: field: message`. These are the messages you are mos| `at most one option can be historical` | Two options have `historical: true`. || `hard anchor needs a historical option` | `anchor: hard` and no option is `historical`. || `unknown target` | An effect `target` is neither an indicator nor `treasury` or `fx_reserves`. |-| `sensitive events cannot reward` | A sensitive-tagged event with a positive `treasury` or `fx_reserves` delta. |+| `sensitive events cannot reward` | A sensitive-tagged event with a positive `treasury`, `fx_reserves`, `food_supply`, `morale` or `intl_standing` delta. || `must be 1-5` | `set_rung` outside 1 to 5. || `unknown policy` | `set_policy` names a policy that does not exist. || `must be a list` | A list field (such as `tags:`) written with no value. |diff --git a/docs/determinism.md b/docs/determinism.mdindex b9dea2803..bffd7565b 100644--- a/docs/determinism.md+++ b/docs/determinism.md@@ -17,24 +17,37 @@ The simulation must produce the same state, bit for bit, on .NET, Unity Mono and## Golden playthroughs`Statecraft.Sim.GoldenRun.Play(content, until)` starts `Simulation.NewGame(content, GoldenRun.Seed, Mode.Historical)`-with `GoldenRun.Seed = 1948` on the real `content/`, then steps with `HistoricalAI.Commands` until `Date >= until`-(or the game ends, or 1000 turns pass). Each run's final `GameState.Hash()` is pinned:+with `GoldenRun.Seed = 1948` on the real `content/`, then steps with `GoldenRun.Orders` until `Date >= until`+(or the game ends, or 1000 turns pass). Since the GDD cutover (Phase 2 PR 1) the orders are the reference player's+(`Statecraft.Sim.Reference.ReferencePlayer`, decision D-A7): a stated test policy, not game AI and not history. It sends+`HistoricalAI`'s orders, then fills each city's jobs, then trains one halutz group when there is none and none in training,+while the turn's Attention and the Treasury last. No game mode or UI reaches it (`ReferencePlayerTests`); every copy of the+golden loop (the writer preview, the invariants, the era goldens) takes its orders from `GoldenRun.Orders`. The real game+plays the GDD loop on monthly turns from 15 May 1948 and ends on 15 January 1952 after 44 turns (R-LOOP-004). Each run's+final `GameState.Hash()` is pinned:| Run | Ends | Hash ||---|---|---|-| to 1950-01-01 (`Hash1950`) | 1950-02-27, turn 35 | `71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07` |-| to 1952-01-01 (`Hash1952`) | 1952-02-27, turn 43 | `62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8` |--A third 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): `SMOKE OK 5 turns 1948-06-19 d3fdd459ddb876bd8d775c20edd1202cf56ca7134a8ad06f873d4d92034aa5b6`.+| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2` |+| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31` |+| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31` |++`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+later end date moves only `mvp-end`. `mvp-end` is pinned in the manifest and its snapshot; the players and `web_check`+check `hash1950` and `hash1952`.++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 85191d48688be4595726b17778ecdda0175eff8f6f0fa1d976dbe3b48b42823b`.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 build with:```uv run tools/web_check.py unity/Builds/Web-<compression> --query "golden&smoke=5" \- --expect "GOLDEN OK 1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07" \- --expect "GOLDEN OK 1952 62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8" \- --expect "SMOKE OK 5 turns 1948-06-19 d3fdd459ddb876bd8d775c20edd1202cf56ca7134a8ad06f873d4d92034aa5b6"+ --expect "GOLDEN OK 1950 f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2" \+ --expect "GOLDEN OK 1952 75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31" \+ --expect "SMOKE OK 5 turns 1948-10-15 85191d48688be4595726b17778ecdda0175eff8f6f0fa1d976dbe3b48b42823b"```**When a golden moves.** The test fails with the lines that changed, grouped by section (`[ind]`, `[pol]`, `[bud]`,@@ -49,7 +62,7 @@ hash), add a row to the rebaseline history, and say why in the commit message. Tstale while the hash is unchanged.**Adding an era golden.** In a test, call `EraGolden.Check("hash_<era>_<year>", content, "<era id>", new DateTime(<year>, 1, 1))`. It plays a fresh-start of that era (golden seed unless one is passed, Historical mode, `HistoricalAI`, the same loop as `GoldenRun.Play`) and checks the hash+start of that era (golden seed unless one is passed, Historical mode, `GoldenRun.Orders`, the same loop as `GoldenRun.Play`) and checks the hashagainst the manifest line of that name and the snapshot `golden/<name>.txt`. The run stays inside the era: it stops before the turn that wouldreach the era's `to`, because that turn ends on the boundary and its state already holds the next era's attention and events, so thenext era's rules would move this era's golden (`EraGoldenTests.TheRunStaysInsideTheEraSoTheNextErasRulesDoNotMoveIt`). Bless it with `STATECRAFT_UPDATE_GOLDEN=1 dotnet test sim/Statecraft.sln`, which adds the@@ -58,29 +71,30 @@ be started fresh, because `NewGame` reads the base rules' start; a later era faiThe carry-over check (play era N into N+1 and compare with a fresh N+1 on each carried quantity, chapters design section 6) waits on thatand on `EraSystem.Cross`.-**Scenario goldens.** The two hash goldens follow `HistoricalAI`, the path history took. A scenario is a path a player might take+**Scenario goldens.** The hash goldens follow the reference player, `HistoricalAI`'s orders on the path history took. A scenario is a path a player might takeinstead: `sim/Statecraft.Sim.Tests/scenarios/<name>.yaml` lists commands by date (`on:`), the runner (`Scenario`, in the sim library) playsthem from a seed (default 1948) in Historical mode until `until:`, and `ScenarioTests` checks the final hash against the manifest line`scenario-<name>` and the snapshot `golden/scenario-<name>.txt`. The file's header comment lists the command kinds. A turn with noscripted command passes. A command the sim rejects fails the test with the date, the order and the reason, and a step that never runsfails too. To add one: write the file, run `STATECRAFT_UPDATE_GOLDEN=1 dotnet test sim/Statecraft.sln --filter ScenarioTests` (it adds themanifest line and the snapshot), then run the tests plain. A scenario that moves is re-pinned with the hash goldens by the same-command; its snapshot diff in the PR shows what moved, and the commit message says why. Two play the real content: `cautious` and `reckless`. They stay in 1948, before any change a-later era makes, so they move only when a 1948 rule or event does.--**MVP goldens (GDD v0.1, before cutover).** `mvp-slice` plays `MvpSlice.Load`, the real content with the loop switch on and-monthly turns (spec 2026-10-12 section 2.1, R-LOOP-003), from the golden seed in Historical mode with the reference player until-`MvpGolden.Until` (15 March 1949, ten monthly turns). The reference player (`Statecraft.Sim.Reference.ReferencePlayer`, decision-D-A7) is a stated test policy, not game AI and not history: `HistoricalAI`'s orders, then each city's jobs filled, then each-idle halutz group sent to the first available designated site, then one halutz group trained when there is none and none in-training. Both orders borrow what the Treasury lacks, so Money never holds them back. No game mode or UI-reaches it (`ReferencePlayerTests`). `MvpGoldenTests` checks it against the manifest line `mvp-slice` and the-snapshot `golden/mvp-slice.txt`, and the update command re-pins it like the others. It is not shown in this file's table or in-`tools/web_check.py`, because the players run only the legacy goldens until cutover. A Phase 1 PR that adds a GDD rule the slice-exercises moves it, re-pins it and says why; the legacy goldens never move for it. A scenario with `content: mvp` plays the-same slice instead of the real content: `scenario-mvp-absorb-first` (GDD Phase 1 PR 3) fills Tel Aviv's jobs on the first turn.--`Scenario` and `MvpGolden` live in `Statecraft.Sim` next to `GoldenRun`, so Unity, which gets only `Statecraft.Sim.dll` and+command; its snapshot diff in the PR shows what moved, and the commit message says why. All three play the real content.+`cautious` and `reckless` stay in 1948, so they move only when a 1948 rule or event does; `mvp-absorb-first` (GDD Phase 1+PR 3) fills Tel Aviv's jobs on the first turn and plays to 15 June 1949.++**MVP goldens after the cutover.** The real game is the GDD game, so every golden above is an MVP golden. Each PR that+changes an MVP rule or a design value (R-LOOP-005) moves the goldens it reaches, re-pins them in the same PR, adds a row to+the history below and says why in the commit and the PR (spec 2026-10-12 section 3, "After cutover"). PRs merge one at a+time, so there is no "re-record at integration".++**Before cutover.** The last legacy goldens (the legacy loop, `HistoricalAI` alone, weekly, monthly and quarterly turns by+security level, play to 1957) were `hash1950` `71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07` (1950-02-27,+turn 35), `hash1952` `62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8` (1952-02-27, turn 43), `smoke5`+`SMOKE OK 5 turns 1948-06-19 d3fdd459ddb876bd8d775c20edd1202cf56ca7134a8ad06f873d4d92034aa5b6`, `scenario-cautious`+`1d5b8d71`, `scenario-reckless` `c0bd12bc`, and on the Phase 1 overlay `mvp-slice` `ec6f8c80` (after #566; retired with the overlay,+R-LOOP-003) and `scenario-mvp-absorb-first` `59ea3181`. The owner tags the last pre-cutover commit `pre-gdd-v0.1`.++`Scenario` lives in `Statecraft.Sim` next to `GoldenRun`, so Unity, which gets only `Statecraft.Sim.dll` and`YamlDotNet.dll` from `tools/build_sim_for_unity.sh`, can play the same runs (#394). The scenario files, the manifest and thesnapshots stay with the tests and are not shipped to the player.@@ -110,7 +124,7 @@ goldens (playtest 2 changed every line's casing with no hash change). They are s`FinalWaveTests.AReloadedSaveReproducesTheLastTurnsCauses` checks a reloaded save gives the same last-turn Causes, and`TheGoldenRunsCausesAreTheSameInEveryCulture` runs the 1952 golden under de-DE and ar-SA against the invariant culture.-Each golden hash is pinned in `sim/Statecraft.Sim.Tests/golden/manifest.txt` (`hash1950`, `hash1952`, `smoke5`, and the scenario and MVP lines above). The .NET tests+Each golden hash is pinned in `sim/Statecraft.Sim.Tests/golden/manifest.txt` (`hash1950`, `hash1952`, `mvp-end`, `smoke5`, and the scenario lines above). The .NET testscompare against it. These places must agree with it, and `GoldenManifestTests` fails naming the one that does not:- `sim/Statecraft.Sim/GoldenRun.cs`, which Unity code and players compare against (the update command rewrites it);- this file, `docs/RELEASING.md` and `tools/web_check.py`'s usage example (by hand).@@ -135,7 +149,8 @@ Re-checked on macOS after the issue #2 correction (2026-10-14, commit `bd683ee0``--dev` build through `tools/release_build.py --platform mac`, which runs the player with `-batchmode -nographics -golden`):**exit 0**, printing `GOLDEN OK 1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07` and`GOLDEN OK 1952 62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8` on an IL2CPP Universal player-(x86_64 and arm64; this Mac ran the arm64 slice). The run is recorded in #542.+(x86_64 and arm64; this Mac ran the arm64 slice). The run is recorded in #542. These are the legacy values (see+"Before cutover"); the GDD values are not yet re-checked on a desktop player.Re-check with:@@ -199,3 +214,10 @@ The hash reads the state keys, so it never sees a record outside its window. An| GDD Phase 1 PR 3 | mvp-slice | `f6931e24` | the slice gains its city (placeholder values) and the GDD turn: Money from jobs, housing, Social cohesion and arrivals, with the reference player filling the jobs (was `0451920a`); the legacy goldens do not move || GDD Phase 1 PR 4 | mvp-slice | `6343eee8` | training runs in the slice (step 4 of the GDD turn) and the reference player trains one halutz group on the first turn: it becomes a unit at Tel Aviv's hex on the fourth, its IL 0.5m adds to the debt, and the civilian it took frees a place that one more refugee is housed in (was `f6931e24`); the legacy goldens and `scenario-mvp-absorb-first` do not move || GDD Phase 1 PR 5 | mvp-slice | `ec6f8c80` | owner decision "Allow borrowing" (15 October 2026): training and pioneer work borrow what the Treasury lacks. The reference player's halutz group, ready on 15 September 1948, starts Mefalsim that turn (its IL 2m adds to the debt) and builds it on 15 March 1949; `MvpGolden.Until` moves from 15 January to 15 March 1949 (ten monthly turns) so the build finishes inside the run (was `6343eee8`); the legacy goldens and `scenario-mvp-absorb-first` do not move |+| GDD Phase 2 PR 1 | 1950 | `f97e9f81` | GDD v0.1: monthly turns and the GDD loop on (spec 2026-10-12 section 3 step 5). The real content runs `systems.loop: gdd` with monthly turns on every rung, and the golden runs play the reference player, so the run ends 1950-01-15 after 20 turns (was 1950-02-27, turn 35) and gains the GDD sections (`city{}`, `coh=`, `units[]`, `next=`: the halutz group trained from 15 August 1948; `site{mefalsim=done,1949-06-15}`: the build of #566, with its IL 2m in the debt). Event windows re-timed per #567 (idf_founding, altalena, jerusalem_military_government, latrun_proposal, operation_horev, elections_1949), and PR 1a (#577) merged in: the five war cards rewritten (options `keep` and `stop_at_ceasefire`) and the sensitive options' gains replaced by costs (morale and International Support lower); the Phase 1 and #566 values in content as design values, unchanged; the FRUS anchor holds with no refit; `mvp-slice` (`ec6f8c80`) retired; #315 merged earlier (#475) and moved no golden (was `71e9904d`) |+| GDD Phase 2 PR 1 | 1952 | `75d38299` | same; the game now ends on 15 January 1952 (R-LOOP-004), the first turn on or after 1 January 1952: ends 1952-01-15, turn 44, `over=mvp_ended` (was 1952-02-27, turn 43, still playing); the reparations claim's cost moves to Money (`treasury` -1, #577), so the debt is IL 1m higher (was `62f8ec61`) |+| GDD Phase 2 PR 1 | mvp-end | `75d38299` | new: the reference player over the whole game, to 15 January 1952; the same run as hash1952 |+| GDD Phase 2 PR 1 | smoke5 | `85191d48` | five monthly turns end on 1948-10-15 (was 1948-06-19); the smoke answers cards while the turn's Attention pays for them, so the third card of 15 July 1948 goes to its minister (was `d3fdd459`) |+| GDD Phase 2 PR 1 | scenario-cautious | `58eb01db` | monthly turns: ends 1949-01-15, turn 8 (was 1949-01-02, turn 23); rhodes_talks and elections_1949 now fire inside the run; the GDD sections appear; #577's rewritten cards and costs (was `1d5b8d71`) |+| GDD Phase 2 PR 1 | scenario-reckless | `e2f409a5` | same (was `c0bd12bc`) |+| GDD Phase 2 PR 1 | scenario-mvp-absorb-first | `f8858f6e` | plays the real content (the overlay is retired, `content: mvp` dropped); the Horev window edit makes rhodes_talks and sinai_withdrawal fire; #577's rewritten cards and costs (was `59ea3181`) |diff --git a/docs/gdd/loop-switch.md b/docs/gdd/loop-switch.mdindex 2119d45c8..0296c2aa2 100644--- a/docs/gdd/loop-switch.md+++ b/docs/gdd/loop-switch.md@@ -8,16 +8,16 @@ As the maintainer, I want the GDD v0.1 loop built behind one switch, so that the- `systems.loop` in eras.yaml is `legacy` or `gdd`, the same in every era; absent means legacy (R-LOOP-001).- The GDD state (cities, units, the next unit id, completed objectives, the score) is hashed only when it is set, so the legacy hash text is unchanged (R-LOOP-002).-- `MvpSlice.Overlay` gives the real content with the switch on and monthly turns, and changes nothing else (R-LOOP-003).-- A save names its ruleset, `legacy` or `gdd-0.1`; a game refuses a save from another ruleset (R-SAVE-001, decision D-E4 [S2]).-- Balance values the owner has not set live only in the overlay or in test fixtures, never under `content/` [S3].+- Until the cutover, `MvpSlice.Overlay` gave the real content with the switch on and monthly turns. The cutover turned the switch on in the real content and retired the overlay with its rule ID.+- A save names its ruleset, `legacy` or `gdd-0.1`; a game refuses a save from another ruleset (R-SAVE-001, decision D-E4 [S2]), and a save from a ruleset it does not know as made by a newer version (R-SAVE-002).+- Before the cutover, balance values the owner had not set lived only in the overlay or in test fixtures [S3]; since it they are labelled design values in `content/` (R-LOOP-005).## Data touched-- `content/eras.yaml`: `systems.loop` (the real content keeps the default).+- `content/eras.yaml`: `systems.loop` (`gdd` in the real content since the cutover).- `GameState`: `Cities`, `Units`, `NextId`, `Objectives`, `Score`.- Save files: schema 2 and the `ruleset` line.-- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: the `mvp-slice` line.+- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: the `mvp-slice` line (until the cutover).## Done when@@ -27,7 +27,7 @@ As the maintainer, I want the GDD v0.1 loop built behind one switch, so that the## Out of scope- Any GDD rule: cities, training, sites, objectives and the score are built once the owner rules on the open decisions.-- Turning the switch on for the real game, which is the cutover PR.+- Turning the switch on for the real game: the cutover PR, Phase 2 PR 1.## Sourcesdiff --git a/docs/gdd/monthly-turns.md b/docs/gdd/monthly-turns.mdindex 4347d76d2..ed2fb835c 100644--- a/docs/gdd/monthly-turns.md+++ b/docs/gdd/monthly-turns.md@@ -8,23 +8,22 @@ As a player of the MVP, I want every turn to be one month, so that 15 May 1948 t- The turn length on each security rung comes from `turn_lengths` in the rules of the era the turn starts in (R-TURN-001).- Without the key, the first three rungs have quarter turns, the fourth month turns and the fifth week turns.-- The MVP sets month on every rung. Turns from the start on 15 May 1948 then end on the 15th of each month [S2].+- The MVP sets month on every rung. Turns from the start on 15 May 1948 then end on the 15th of each month, to the game's end on 15 January 1952, 44 turns (D-E5, R-LOOP-004) [S2].- A turn that reaches an era boundary ends on it, and a turn that would end fewer than 14 days before it is lengthened to it (`SimTime.AdvanceTo`, D-E5, unchanged).## Data touched-- `content/rules.yaml` and `content/rules/<era>.yaml`: `turn_lengths`. The real content does not set it until the cutover PR.+- `content/rules.yaml` and `content/rules/<era>.yaml`: `turn_lengths`. The real content sets all five to month since the cutover (Phase 2 PR 1).- `Rules.TurnLengths`, read by `SecuritySystem.TurnLengthFor(c, date, rung)`.## Done when- `dotnet test sim/Statecraft.sln --filter TurnLengthsTests` passes.-- The goldens `hash1950`, `hash1952`, `smoke5`, `scenario-cautious` and `scenario-reckless` do not move.+- Before the cutover the goldens did not move; the cutover re-pinned them all once (docs/determinism.md, rebaseline history).## Out of scope- Year turns and the `war_mode` switch of issue #81, paused by the plan's §7.2.-- Turning monthly turns on for the real game, which is the cutover PR (the plan's §3).## Sourcesdiff --git a/docs/gdd/one-city.md b/docs/gdd/one-city.mdindex 9fd8305a4..a4ffe9266 100644--- a/docs/gdd/one-city.md+++ b/docs/gdd/one-city.md@@ -16,10 +16,10 @@ As a player of the MVP, I want to put Tel Aviv's people to work and house the im## Data touched-- `cities.yaml`, `unit_types.yaml` and `rules.yaml` `mvp:` and `attention_cost.assign_workers`: supplied by `MvpSlice.Overlay` as placeholders, never under `content/` (ruling 2 [S3]).+- `cities.yaml`, `unit_types.yaml` and `rules.yaml` `mvp:` and `attention_cost.assign_workers`: labelled design values in `content/` since the cutover (Q-CUT-1, R-LOOP-005), the overlay's placeholders before it (ruling 2 [S3]).- `GameState`: `Cities` (counts), `Cohesion` (hashed as `coh=` when the state has cities), `Treasury`.-- Save files: the `work CITY ROLE N` line. Scenarios: `assign_workers` and `content: mvp`.-- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: `mvp-slice` moves; `scenario-mvp-absorb-first` is new.+- Save files: the `work CITY ROLE N` line. Scenarios: `assign_workers` (and `content: mvp` until the cutover).+- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: `mvp-slice` moved (retired at the cutover); `scenario-mvp-absorb-first` was new.## Done whendiff --git a/docs/gdd/training.md b/docs/gdd/training.mdindex 73ee81079..d37d4aa6c 100644--- a/docs/gdd/training.md+++ b/docs/gdd/training.md@@ -16,10 +16,10 @@ As a player of the MVP, I want to send Tel Aviv's civilians without work to basi## Data touched-- `unit_types.yaml` (`recruit`, `halutz`: `facility`, `training_turns`, `training_cost`), `cities.yaml` (`facilities`) and `rules.yaml` `attention_cost.train` and `cancel_training`: supplied by `MvpSlice.Overlay` as placeholders, never under `content/` (ruling 2 [S3]).+- `unit_types.yaml` (`recruit`, `halutz`: `facility`, `training_turns`, `training_cost`), `cities.yaml` (`facilities`) and `rules.yaml` `attention_cost.train` and `cancel_training`: labelled design values in `content/` since the cutover (Q-CUT-1, R-LOOP-005), the overlay's placeholders before it (ruling 2 [S3]).- `GameState`: `Cohorts` (hashed as `train[...]` when there are some), a city's `Recruits` (in its hash record when not 0), `Units`, `NextId`, `Treasury`.- Save files: the `train CITY TRACK N` and `untrain COHORT` lines. Scenarios: `train` and `cancel_training`.-- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: `mvp-slice` moves; `scenario-mvp-absorb-first` does not.+- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: `mvp-slice` moved (retired at the cutover); `scenario-mvp-absorb-first` did not.## Done whendiff --git a/docs/m3-release.md b/docs/m3-release.mdindex de2965458..36301bc57 100644--- a/docs/m3-release.md+++ b/docs/m3-release.md@@ -233,6 +233,10 @@ war-casualties). The owner's sign-off for all seven events below is recorded in`sensitivity-reviewed`. For any new sensitive event, the owner records the sign-off **only** by moving its YAML`status:` to `sensitivity-reviewed` and committing it (the loader accepts that value). Nothing else counts as a sign-off.+**Re-review, 2026-10-15.** The event re-timing for monthly turns (#577) changed the text of `altalena`, `ten_days`,+`operation_hiram` and `bernadotte_assassination`; they went back to `fact-checked` until the owner re-reviewed them+("Approve all 4", reviewer: the owner, recorded on #600 and in D11), and they are `sensitivity-reviewed` again.+- **Gate:** `Build.Web ... -shareable` and `Build.Mac ... -shareable` refuse to build while any sensitive event is not`sensitivity-reviewed`, and name them (`Statecraft.Sim.ReleaseGate.SensitiveUnreviewed`). `tools/package_release.py`makes the shareable zip and runs the same check (`Statecraft.Cli --release-gate`) on the content inside the build, sodiff --git a/docs/m3-rulings.md b/docs/m3-rulings.mdindex 4286869b5..a77e47ccc 100644--- a/docs/m3-rulings.md+++ b/docs/m3-rulings.md@@ -28,6 +28,7 @@ These are the decisions made while building M3 where the spec or plan was silent- Cost if wrong: one more parameter re-fit. The 1952 recovery (NEP) is a Deferred M4 row.- **Event preconditions.** A minimal `requires {event, option}` precondition was added to the sim so event chains cannot contradict each other. Cost if wrong: a small sim feature to revise.- **Event cap and gaps.** The historical run may have at most a 4-turn gap with no events. A non-historical 7-turn gap is accepted, because the guard covers the historical run only. Cost: one quiet stretch off the historical path.+ - **Restated in months (owner, 15 October 2026: "Restate the rule in months", #567; Q-CUT-8: "6 months, 2 in wartime").** Turns are monthly from the GDD cutover, so the rule counts months between cards, not turns: in the historical run, no more than 6 months pass from one card to the next (or from the last card to the game's end), and no more than 2 while the country is at full war (security level 5, `SecuritySystem.AtFullWar`) on any turn of the stretch. Tests (R-TURN-003): `EventRetimingTests.NoLongStretchWithoutACard` and `TheLimitsAreSixMonthsAndTwoAtWar`, `RealContentTests.NoMoreThanSixMonthsPassWithoutACard`, and `WarEvents1948Tests.NoLongStretchWithoutACard` for the war period. Wartime is full war, security level 5 (owner, 15 October 2026: "Full-war level = wartime"). The longest stretches at the cutover are exactly 6 months (15 May to 15 November 1951) and 2 at full war.- **Dated office terms replace "vacant" when a source says an office ended.**- Immigration and War Victims end on 1951-10-08, because the Third Government has no such portfolio. No event text after that date may reference them.- The rationing minister is the minister responsible for rationing: Yosef from 1949-04-26, Lavon from 1950-11-01 (cited), then vacant from 1951-10-08.diff --git a/docs/oss/DECISIONS.md b/docs/oss/DECISIONS.mdindex 4b2c81825..b191efdee 100644--- a/docs/oss/DECISIONS.md+++ b/docs/oss/DECISIONS.md@@ -21,7 +21,7 @@ are already public. If a check fails, the file is removed from the tip with the- [x] D8 Name clearance for "Statecraft: Israel" (USPTO, EUIPO, Steam). Owner checks. Search on 2026-10-10 (factual, not legal advice): USPTO word mark STATECRAFT is live in class 9 (97497997, registered, Endstate Authentic LLC: downloadable multimedia incl. for the video game industry), pending in classes 9/41 (99035932, Metis Endeavor Advisory: podcasts), and registered in classes 35/45 (87598607, Statecraft PLLC); Steam already lists two political strategy games, "Statecraft" (2025, app 3944850) and "Statecraft: Corrupted Democracy" (2026, app 2838620). EUIPO/TMview not yet searched. Verdict: caution; needs the owner's call (keep, or get advice before any commercial release). Decided: (owner, 2026-10-14): "keep the games name as is". The owner confirmed it again to the coordinator the same day, accepting the trademark and Steam-name findings above as a risk. The name stays "Statecraft: Israel".- [x] D9 Unity edit-mode tests stay out of CI. Recommended: yes, local gate with pasted evidence. Decided (owner, 2026-10-10): yes, as recommended.- [x] D10 I know that my personal email (commit d42bd6b, `promo/fetch_portraits.py`) and the internal plans, specs and research notes in history are public and cannot be removed (owner ruling: no history rewriting); key rotation is the only remedy for a secret. Decided (owner, 2026-10-10): acknowledged.-- [x] D11 The seven sensitive events (altalena, ten_days, operation_yoav, operation_hiram, operation_horev, bernadotte_assassination, reparations_claim) are sensitivity-reviewed: each event's YAML says `status: sensitivity-reviewed` (docs/m3-release.md, "OWNER STEP: sensitivity review"). The release gate also runs the sim's own check. Decided: the owner signed off all seven on 2026-10-10 for the itch.io build.+- [x] D11 The seven sensitive events (altalena, ten_days, operation_yoav, operation_hiram, operation_horev, bernadotte_assassination, reparations_claim) are sensitivity-reviewed: each event's YAML says `status: sensitivity-reviewed` (docs/m3-release.md, "OWNER STEP: sensitivity review"). The release gate also runs the sim's own check. Decided: the owner signed off all seven on 2026-10-10 for the itch.io build. Re-review on 2026-10-15: #577 changed the text of altalena, bernadotte_assassination, operation_hiram and ten_days for monthly turns; the owner re-reviewed them ("Approve all 4", recorded on #600) and they are `sensitivity-reviewed` again.- [x] D12 Ruleset bypass. Recommended: the repository admin role bypasses `protect-main` always (you keep merging locally and pushing); everyone else needs review and green checks. Alternative: admins bypass only through a pull request. Decided (owner, 2026-10-10): the recommended admin bypass (`scripts/oss/github/ruleset-main-review.json`).- [x] D13 Licence of the derived land-use texture `unity/Assets/Textures/Map/landuse.png` (`tools/land_bake.py`, issue #33; `ASSETS.yaml` row `owner-verify`). Owner answers four questions. (1) The 1948 settlement coordinates (`content/map/settlements_1948.yaml`, taken from the Wikipedia API, CC BY-SA 4.0) are facts, used only to place the citrus belt near the towns: does share-alike, or the EU database right for about 25 points taken from one source, reach a texture computed from them? (2) D6 found that the data.gov.il licence allows derivatives of the IMS station normals: confirm it covers landuse.png, whose rainfall is CHELSA corrected by them. (3) The Copernicus DEM licence allows redistributing derived products with its attribution (NOTICE carries it), and CHELSA V2.1 is CC0: confirm. (4) Which single `licence:` value does the row take: `Copernicus-DEM` (as now), or the most restrictive input (CC-BY-SA-4.0 if (1) says share-alike applies)? The same questions cover two derived map bakes, both recorded as `CC-BY-SA-4.0` and `owner-verify` until then: `unity/Assets/Resources/Map/BiomeColours.bytes` (biome colours from `content/map/hexes.json`, whose biomes come from the DEM, CHELSA and the IMS normals; #529) and `unity/Assets/Resources/Routes/RouteRibbons.bytes` (route ribbons on the DEM-derived heightmap; #436). Decided: (owner, 2026-10-14, given to personal2 directly, after "Tick all three" to the coordinator): on the licence, "CC BY-SA 4.0 (Recommended)"; on the other inputs, "Accept as recorded (Recommended)". So (1) and (4): share-alike is taken to reach the bakes, and `landuse.png`, `BiomeColours.bytes` and `RouteRibbons.bytes` are all `CC-BY-SA-4.0`, the most restrictive input; (2) and (3): the IMS/data.gov.il (D6), Copernicus DEM and CHELSA V2.1 findings above are confirmed as written. The three `ASSETS.yaml` rows are verified.- [ ] D-P Portraits: every `owner-verify` row in `ASSETS.portraits.yaml` checked on Commons for its US status, and the `promo/ref/*-src.jpg` and `*-sheet.jpg` provenance confirmed. Check on 2026-10-10: all 26 `owner-verify` rows (13 Government Press Office photos, 1948-1960, each used twice) carry only {{PD-Israel}}/{{PD-IsraelGov}} on Commons, with no US public-domain rationale; the URAA likely restored their US copyright (Israel protected them on 1996-01-01). Verdict: risk in the US. The promo/ref sheets and the AI likenesses in promo/final 04 and 08 derive from them. Needs the owner's call (replace with US-safe sources, see the issue for it). Partial progress, 2026-10-14 (refs #30): owner rulings of 2026-10-14, given to personal2 directly ("Replace the 3 now" relayed by the coordinator): CC BY-SA 4.0 is accepted for portraits ("yes"; attribution in NOTICE, and a crop of a CC BY-SA 4.0 photograph is itself CC BY-SA 4.0); small photos that would need upscaling are not approved ("small photos not approved"); Shapira is the seated man on the right of the Meitar photograph of 23 October 1952; "Replace the 3 now". 3 replaced: Maimon and Bentov (Knesset Archives, CC BY-SA 4.0) and Shapira (Meitar Collection, Benno Rothenberg, CC BY 4.0), each cropped and downscaled to 512 px tall, never upscaled; `commons_licences.py` now records an explicit Cc-by-sa-4.0 file with a named artist and a NOTICE entry as verified. With the 4 done earlier (Ben-Gurion #172, Sharett #220, Remez and Levin #438), 7 of the 13 GPO photographs are replaced in the game. Kaplan, Gruenbaum, Bernstein and Zisling remain on GPO photographs pending larger sources (their known candidates are too small); Rosen and Sheetrit also remain, pending the owner's likeness check. The promo/ref sheets and the AI likenesses in promo/final 04 and 08 still derive from the GPO photographs. The line stays open. Decided:diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex 582f13d2d..1b7854916 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -1,24 +1,38 @@# Rules of the GDD v0.1 MVP-The rules of the 1948–1951 MVP in [docs/GDD.md](../GDD.md), as Phase 1 builds them behind the `systems.loop` switch-([the approved plan](../superpowers/specs/2026-10-12-gdd-v0.1-impact-and-plan.md), §6). Balance values are the owner's.-Until the owner sets them, they are placeholders in the dev and test overlay (`MvpSlice.Overlay`) or in test fixtures, never in `content/`.+The rules of the 1948–1951 MVP in [docs/GDD.md](../GDD.md), as Phase 1 built them behind the `systems.loop` switch+([the approved plan](../superpowers/specs/2026-10-12-gdd-v0.1-impact-and-plan.md), §6). Since the cutover (Phase 2 PR 1)+the real game runs them. Balance values are the owner's.++**15 October 2026 (owner, Q-CUT-1: "Labelled design values").** From the cutover, every balance number is a labelled+design value in `content/`, tagged on its line and listed by `DesignValuesTests` (R-LOOP-005). This replaces controller+ruling 2 of 12 October 2026, under which placeholders lived only in the dev and test overlay, never in `content/`.## Turns-R-TURN-001: The turn length on each security rung (1 to 5) is read from the rules key `turn_lengths` of the era the turn starts in. Without the key it is quarter, quarter, quarter, month, week, today's table. The GDD's monthly turns set all five to month.+R-TURN-001: The turn length on each security rung (1 to 5) is read from the rules key `turn_lengths` of the era the turn starts in. Without the key it is quarter, quarter, quarter, month, week, the legacy table. The real game sets all five to month (D-B1), so turns from 15 May 1948 end on the 15th of each month.++R-TURN-002: An event that asks for a decision opens its window on the 15th on or before the historical decision, so the card reaches the player on the turn before it (#567 §4, owner, 15 October 2026). The exceptions are listed in the tests: `first_truce` (+5 days) and `rhodes_talks` (+2 days) arrive late by design, and the five war cards PR 1a rewrites as decisions during or after the fact.++R-TURN-003: In the historical run, no more than 6 months pass from one card to the next (or from the last card to the game's end), and no more than 2 when the country is at full war (security level 5) on any turn of the stretch (owner, 15 October 2026, Q-CUT-8: "6 months, 2 in wartime"; the M3 gap ruling restated in months).## The loop switchR-LOOP-001: `systems.loop` in eras.yaml is `legacy` (the default) or `gdd`, and every era has the same value. Its ruleset id, which a save records, is `legacy` or `gdd-0.1`.-R-LOOP-003: `MvpSlice.Overlay` loads the real content with `systems.loop: gdd` in every era and `turn_lengths` all month, and adds the slice's placeholder city data (`cities.yaml`, `unit_types.yaml`, the rules' `mvp:` block and the GDD command kinds' `attention_cost`) where the content has none. It changes nothing else. Tests, the MVP goldens and the dev flag use it until cutover.-R-LOOP-002: The GDD state (cities, units, the next unit id, completed objectives, the score) is written into the state hash only when it is set. With the legacy loop the hash text is unchanged, byte for byte.+R-LOOP-004: The GDD game ends on the rules key `mvp.end`, 15 January 1952 in the real content (owner, 15 October 2026, D-E5: "End on 15 Jan 1952"), after 44 monthly turns. The end is a boundary the last turn reaches, like the last era's end; the game is then over (`mvp_ended`) and raises no new event. It is the same in every era, after the start and before the last era's end (so the game ends as `mvp_ended`, not `era_ended`). The eras after it stay in the repository and load (G2).++R-LOOP-005: Every balance number of the GDD loop (all of `cities.yaml` and `unit_types.yaml`, the rules' `mvp:` block, and the GDD orders' `attention_cost`) carries the tag `# DESIGN VALUE: owner-set balance, not a historical figure` and its decision row on its own line, and `DesignValuesTests` lists every one of them: a number missing from the list, or a listed one without the tag, fails.++The ID R-LOOP-003 (the Phase 1 overlay, `MvpSlice.Overlay`) is retired with the overlay at the cutover and is not reused.+## Saves-R-SAVE-001: A save names the ruleset it was played under (`ruleset legacy` or `ruleset gdd-0.1`, save schema 2). A game refuses a save made under another ruleset, with a message to start a new game. A schema 1 save has no ruleset line and is legacy.+R-SAVE-001: A save names the ruleset it was played under (`ruleset legacy` or `ruleset gdd-0.1`, save schema 2). A game refuses a save made under another ruleset. A schema 1 save has no ruleset line and is legacy, so the GDD game refuses it as made under earlier rules. The refusal carries a code (`older_rules`) the UI translates, and the sim's reason does not itself ask for a new game: the player reads that once (N4).++R-SAVE-002: A save that names a ruleset this build does not know, or a newer save schema, was made by a newer version of the game and is refused with the code `newer_version` (N2).## Cities@@ -28,7 +42,7 @@ R-CITY-001: `AssignWorkers(city, role, n)` sets how many of the city's civiliansR-CITY-002: Each turn every city's employed units add `employed * income_per_job_per_year * the turn's share of a year` to the Treasury.-R-CITY-003: Arrivals from the CBS series (`aliyah.yaml`) become refugees in the rules' `arrivals_city`. Let `P(t)` be the people the series brings from the first era's start to the date `t`, summed over the origin groups in ordinal order. A turn from date `d` to date `e` adds `floor(P(e) / people_per_unit) - floor(P(d) / people_per_unit)` refugees. `people_per_unit` is the same in every era (the loader refuses an era that changes it), so over any run of turns the refugees added are `floor(P(end) / people_per_unit) - floor(P(start) / people_per_unit)`: no unit is lost or counted twice. Before cutover the legacy population (`GameState.Population`) also counts the same arrivals; the two are separate views of the same people until Phase 3 makes arrivals counts.+R-CITY-003: Arrivals from the CBS series (`aliyah.yaml`) become refugees in the rules' `arrivals_city`. Let `P(t)` be the people the series brings from the first era's start to the date `t`, summed over the origin groups in ordinal order. A turn from date `d` to date `e` adds `floor(P(e) / people_per_unit) - floor(P(d) / people_per_unit)` refugees. `people_per_unit` is the same in every era (the loader refuses an era that changes it), so over any run of turns the refugees added are `floor(P(end) / people_per_unit) - floor(P(start) / people_per_unit)`: no unit is lost or counted twice. The legacy population (`GameState.Population`) also counts the same arrivals; the two are separate views of the same people until Phase 3 makes arrivals counts.R-CITY-004: Each turn, `min(refugees, max(0, housing_capacity - civilians))` of a city's refugees become civilians without a job. The cap is a placeholder while overflow (D-D1) is open.@@ -36,7 +50,7 @@ R-CITY-005: Social cohesion is `clamp(0, 1, cohesion_housing_weight * housed + c## Training-Training is step 4 of the turn in the approved order (§2.3, D-A6): it runs before production. One military camp and one Hakhshara exist in the slice's city at the start, a labelled design assumption (D-D5); pioneers will build more.+Training is step 4 of the turn in the approved order (§2.3, D-A6): it runs before production. One military camp and one Hakhshara exist in Tel Aviv at the start, a labelled design assumption (D-D5); pioneers will build more.R-TRAIN-001: `Train(city, track, n)` takes `n` of the city's civilians without a job into a cohort that trains as `track` (a unit type with a `facility`: `recruit` in a military camp, `halutz` in a Hakhshara) for the type's `training_turns`, counting the turn it was ordered in. The Treasury pays `n * training_cost` at once. When the Treasury holds less, the shortfall is borrowed, as for map actions: it is added to the debt and the Treasury stops at 0 (owner decision "Allow borrowing", 15 October 2026). The trainees leave the civilians at once; the cohort takes the next id, which units share. It is refused, with the state unchanged and the Attention refunded, when the city or track is unknown, `n` is below 1, the city lacks the facility, or it has fewer civilians without a job. The legacy loop refuses it before charging Attention.diff --git a/docs/superpowers/plans/2026-10-12-gdd-phase-1.md b/docs/superpowers/plans/2026-10-12-gdd-phase-1.mdindex a270d4757..c4dc7f498 100644--- a/docs/superpowers/plans/2026-10-12-gdd-phase-1.md+++ b/docs/superpowers/plans/2026-10-12-gdd-phase-1.md@@ -24,6 +24,7 @@- D-E3: the game's English says "War of Independence".- **Not decided, so not built (controller ruling 1, 12 October 2026).** AGENTS.md: anything the GDD marks Open, Proposal or TBD needs an owner decision before it is built, and that overrides any brief. Phase 1 needs seven more decisions, now with the owner: D-A5 (who is a refugee, and when one becomes a civilian), D-A6 (the order of resolution), D-A7 (the reference player for the goldens), D-B2 (the timing bonus), D-B6 (point values), D-D5 (whether a camp and a Hakhshara exist at start) and D-D6 (pioneer work: duration, cost, projects at once). PR 2 builds none of them. **Decided by the owner on 2026-10-14:** all seven as the impact plan recommends (§5), with D-B2's bonus at +5 points per month early, capped at +60, and D-B6 at 100 points per objective (balance values, tunable). PR 3 onward may proceed; each later PR's tasks below are drafts, to be rewritten to the answers before work starts, and its banner names the decisions it waits on.- **Placeholder values are never under `content/` (controller ruling 2, 12 October 2026; the spec's §6 risk line).** A balance value the owner has not set lives only in the dev and test overlay (`MvpSlice.Overlay`, which adds the GDD keys and files as text it supplies) or in a test fixture, marked `PLACEHOLDER: owner sets`. The loader requires the GDD keys (the `mvp:` rules block, the GDD command kinds' `attention_cost`, the city start values) only when `systems.loop` is `gdd`, so the real content stays without them until the owner sets the values. Sourced historical facts (the site, its founding date, the card's text and reference date) do belong in `content/`, with sources. Where a later task below shows a YAML block marked `# PLACEHOLDER`, that block is the shape of the text the overlay supplies, not a file under `content/`.+ - **15 October 2026 (owner, Q-CUT-1: "Labelled design values"):** from the GDD cutover (Phase 2 PR 1) the balance values are labelled design values in `content/`, each tagged on its line and listed by `DesignValuesTests` (R-LOOP-005); this ruling holds only for the work before the cutover, and the overlay is retired.- Every historical fact in `content/` has `sources:` with a URL and a `checked:` date (CONTENT_POLICY §2.1). No invented quotes. Dates show as "15 May 1948".- Event photographs: public domain, CC0, or CC BY 4.0 archival event photographs (for example the Meitar Collection) with a credit line. Never GPO, PD-Israel-only, PD-India or share-alike (CONTENT_POLICY §4, docs/event-images.md).- Determinism (docs/determinism.md): one RNG, no trigonometry, no unordered iteration into state, invariant culture. Phase 1 adds **no RNG draw**. New collections are ordered by id, hold immutable records, and use integers for counts and timers.diff --git a/sim/Statecraft.Sim.Tests/CalibrationTests.cs b/sim/Statecraft.Sim.Tests/CalibrationTests.csindex 797aa687d..b4b5ed789 100644--- a/sim/Statecraft.Sim.Tests/CalibrationTests.cs+++ b/sim/Statecraft.Sim.Tests/CalibrationTests.cs@@ -40,12 +40,12 @@ public class CalibrationTests{var s = Simulation.NewGame(C, 1948, Mode.Historical);var history = new List<GameState> { s };- while (s.Date <= End)+ while (s.Date <= End && s.GameOver == null){s = Simulation.Step(C, s, HistoricalAI.Commands(C, s)).State;history.Add(s);}- Assert.Null(s.GameOver);+ Assert.True(s.GameOver == null || s.GameOver == GameOverCodes.MvpEnded, "game over: " + s.GameOver); // the game ends on 15 January 1952 (R-LOOP-004)Assert.Equal(5, C.PopulationAnchors.Count);var report = C.PopulationAnchors.Select(a =>{diff --git a/sim/Statecraft.Sim.Tests/CitiesContentTests.cs b/sim/Statecraft.Sim.Tests/CitiesContentTests.csindex d6277328b..350b0ac85 100644--- a/sim/Statecraft.Sim.Tests/CitiesContentTests.cs+++ b/sim/Statecraft.Sim.Tests/CitiesContentTests.cs@@ -4,8 +4,8 @@ using System.Linq;using Statecraft.Sim;/// <summary>The GDD slice's city data (Phase 1 PR 3, Task 3.1): cities.yaml, unit_types.yaml and the mvp: rules block. The-/// loader reads and requires them only when systems.loop is gdd; their values are placeholders in MvpSlice.Overlay or test-/// fixtures, never under content/ (controller ruling 2).</summary>+/// loader reads and requires them only when systems.loop is gdd. The real values are labelled design values in content/+/// (Q-CUT-1, R-LOOP-005, DesignValuesTests); the fixtures' are test values.</summary>public class CitiesContentTests{static Content Load(Dictionary<string, string>? extra = null) => ContentLoader.Load(Fixture.Write(Fixture.Gdd(extra)));@@ -28,17 +28,18 @@ public class CitiesContentTests[Fact]public void TheLegacyLoopReadsNoCityData(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write(new Dictionary<string, string> // a legacy fixture with city files next to it+ { ["cities.yaml"] = Fixture.GddCities, ["unit_types.yaml"] = Fixture.GddUnitTypes }));Assert.Empty(c.Cities);Assert.Empty(c.UnitTypes);Assert.Null(c.RulesAt(c.Eras[0].From).Mvp);- Assert.Equal("Tel Aviv", c.SettlementNames["tel_aviv"]); // names are read in both loops: refusals and causes name places+ Assert.Equal("Town A", c.SettlementNames["town_a"]); // names are read in both loops: refusals and causes name places}[Fact]- public void TheSliceHasTelAvivFromTheOverlay()+ public void TheRealGameHasTelAviv(){- var c = MvpSlice.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(RealContentTests.ContentRoot());Assert.Equal("tel_aviv", Assert.Single(c.Cities).Id);Assert.Equal("tel_aviv", c.RulesAt(c.Eras[0].From).Mvp!.ArrivalsCity);Assert.True(c.Rules.AttentionCost.ContainsKey("assign_workers"));@@ -48,22 +49,6 @@ public class CitiesContentTestsAssert.True(c.Rules.AttentionCost.ContainsKey("train") && c.Rules.AttentionCost.ContainsKey("cancel_training"));}- [Fact]- public void NoBalanceValueIsUnderContent()- {- var root = RealContentTests.ContentRoot();- Assert.False(File.Exists(Path.Combine(root, "cities.yaml")));- Assert.False(File.Exists(Path.Combine(root, "unit_types.yaml")));- var overrides = Directory.Exists(Path.Combine(root, "rules")) ? Directory.GetFiles(Path.Combine(root, "rules"), "*.yaml") : new string[0];- foreach (var f in new[] { "rules.yaml" }.Concat(overrides.Select(x => "rules/" + Path.GetFileName(x))))- {- var text = File.ReadAllText(Path.Combine(root, f));- Assert.DoesNotContain("mvp:", text);- Assert.DoesNotContain("assign_workers", text);- Assert.DoesNotMatch(@"\btrain:|cancel_training|training_turns|training_cost", text);- }- }-const string City = " - { id: town_a, housing_capacity: 12, job_slots: 8, civilians: 10, employed: 6, facilities: [] }\n";static string Cities(string row) => "cities:\n" + row;diff --git a/sim/Statecraft.Sim.Tests/CitiesTests.cs b/sim/Statecraft.Sim.Tests/CitiesTests.csindex 2a1fb6587..643717225 100644--- a/sim/Statecraft.Sim.Tests/CitiesTests.cs+++ b/sim/Statecraft.Sim.Tests/CitiesTests.cs@@ -7,7 +7,7 @@ using Statecraft.Sim;/// cohesion and arrivals in TurnResolver (R-CITY-002 to R-CITY-005, in the order of spec 2026-10-12 section 2.3, D-A6).</summary>public class CitiesTests{- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());+ static readonly Content Mvp = ContentLoader.Load(RealContentTests.ContentRoot());/// <summary>The GDD fixture with one city: 20 jobs, 10 civilians, 6 of them employed, housing for 12.</summary>static Content Town(string city = " - { id: town_a, housing_capacity: 12, job_slots: 20, civilians: 10, employed: 6, facilities: [] }\n") =>@@ -24,8 +24,8 @@ public class CitiesTests}[Fact]- public void ALegacyGameHasNoCities() =>- Assert.Empty(Simulation.NewGame(ContentLoader.Load(RealContentTests.ContentRoot()), GoldenRun.Seed, Mode.Historical).Cities);+ public void ALegacyGameHasNoCities() => // the legacy loop lives on only in test fixtures since the cutover+ Assert.Empty(Simulation.NewGame(ContentLoader.Load(Fixture.Write()), GoldenRun.Seed, Mode.Historical).Cities);// R-CITY-001[Fact]@@ -58,9 +58,9 @@ public class CitiesTests[Fact]public void TheLegacyLoopRefusesTheOrderAndRefundsAttention(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the legacy loop (a fixture since the cutover)var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);- var r = Step(c, s, new AssignWorkers("tel_aviv", "job", 1));+ var r = Step(c, s, new AssignWorkers("town_a", "job", 1));Assert.Equal("That order is not available in this game", Assert.Single(r.Rejected).Reason);Assert.Equal(Step(c, s).State.Hash(), r.State.Hash());}@@ -223,7 +223,7 @@ public class CitiesTests[Fact]public void TheResolverDoesNotRunInTheLegacyLoop(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the legacy loop (a fixture since the cutover)var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);s = Step(c, s).State;Assert.Empty(s.Cities);diff --git a/sim/Statecraft.Sim.Tests/CommandGuardTests.cs b/sim/Statecraft.Sim.Tests/CommandGuardTests.csindex 2e585fb5d..8a4463fd6 100644--- a/sim/Statecraft.Sim.Tests/CommandGuardTests.cs+++ b/sim/Statecraft.Sim.Tests/CommandGuardTests.cs@@ -34,16 +34,16 @@ public class CommandGuardTestsforeach (var t in CommandTypes()) Assert.True(Samples.ContainsKey(t), $"{t.Name} has no sample: add it, then its touch-points");}- /// <summary>A GDD kind is priced in the slice (MvpSlice.Overlay, a placeholder), and every other kind in the real rules.</summary>+ /// <summary>Every kind, the GDD ones included, is priced in the real rules since the cutover (the GDD kinds' costs are+ /// design values, R-LOOP-005).</summary>[Fact]public void EveryCommandHasAnAttentionKindAndACostInTheRealRules(){var c = ContentLoader.Load(RealContentTests.ContentRoot());- var mvp = MvpSlice.Load(RealContentTests.ContentRoot());foreach (var cmd in Samples.Values){Assert.True(AttentionSystem.IsCommandKind(cmd.Kind), cmd.Kind);- Assert.True((AttentionSystem.IsGddKind(cmd.Kind) ? mvp : c).Rules.AttentionCost.ContainsKey(cmd.Kind), cmd.Kind);+ Assert.True(c.Rules.AttentionCost.ContainsKey(cmd.Kind), cmd.Kind);}}diff --git a/sim/Statecraft.Sim.Tests/CutoverTests.cs b/sim/Statecraft.Sim.Tests/CutoverTests.csnew file mode 100644index 000000000..34ff1bd9f--- /dev/null+++ b/sim/Statecraft.Sim.Tests/CutoverTests.cs@@ -0,0 +1,95 @@+using System;+using System.Collections.Generic;+using System.Linq;+using Statecraft.Sim;++/// <summary>The GDD cutover (Phase 2 PR 1): the real content runs the GDD loop on monthly turns from 15 May 1948 to+/// 15 January 1952 (spec 2026-10-12 section 3; owner decisions D-B1, D-E1 and D-E5).</summary>+public class CutoverTests+{+ static readonly Content C = ContentLoader.Load(RealContentTests.ContentRoot());++ // R-LOOP-001+ [Fact]+ public void TheRealGameRunsTheGddLoop()+ {+ Assert.True(C.IsGdd);+ Assert.Equal("gdd-0.1", C.Ruleset);+ Assert.All(C.Eras, e => Assert.Equal(EraSystems.Gdd, e.Systems.Loop));+ }++ // R-TURN-001+ [Fact]+ public void EveryRungIsAMonthInTheRealGame()+ {+ foreach (var era in C.Eras)+ for (int rung = 1; rung <= 5; rung++)+ Assert.Equal(TurnLength.Month, SecuritySystem.TurnLengthFor(C, era.From, rung));+ }++ // R-TURN-001+ [Fact]+ public void TheFirstTurnsFallOnTheFifteenth()+ {+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ Assert.Equal(new DateTime(1948, 5, 15), s.Date);+ var dates = new List<DateTime>();+ for (int i = 0; i < 3; i++) { s = Simulation.Step(C, s, HistoricalAI.Commands(C, s)).State; dates.Add(s.Date); }+ Assert.Equal(new[] { new DateTime(1948, 6, 15), new DateTime(1948, 7, 15), new DateTime(1948, 8, 15) }, dates);+ }++ // R-LOOP-004+ [Fact]+ public void TheGameEndsOnFifteenJanuary1952()+ {+ Assert.Equal(new DateTime(1952, 1, 15), C.End);+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ StepResult? last = null;+ while (s.GameOver == null && s.Turn < 1000) { last = Simulation.Step(C, s, HistoricalAI.Commands(C, s)); s = last.State; }+ Assert.Equal(new DateTime(1952, 1, 15), s.Date);+ Assert.Equal(44, s.Turn);+ Assert.Equal(GameOverCodes.MvpEnded, s.GameOver);+ Assert.Contains(last!.Why, w => w.System == "era" && w.Target == GameOverCodes.MvpEnded);+ Assert.DoesNotContain(last.Why, w => w.System == "events" && w.Message.StartsWith("New:")); // the last turn raises no event+ // A finished game takes no more orders.+ Assert.NotEmpty(Simulation.Step(C, s, new Command[] { new SecurityOrder(-1) }).Rejected);+ }++ // R-LOOP-004+ [Fact]+ public void NoTurnIsAdjustedInsideTheMvp()+ {+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ while (s.GameOver == null && s.Turn < 1000) // capped: a broken end must fail, not hang+ {+ var before = s.Date;+ s = Simulation.Step(C, s, HistoricalAI.Commands(C, s)).State;+ Assert.Equal(before.AddMonths(1), s.Date);+ Assert.Equal(15, s.Date.Day);+ }+ Assert.Equal(GameOverCodes.MvpEnded, s.GameOver);+ }++ // R-LOOP-004+ [Theory]+ [InlineData("1948-05-15", "must be after start")]+ [InlineData("1957-01-02", "before the last era's end")]+ [InlineData("1957-01-01", "before the last era's end")] // equal to the last era's end: the game would end as era_ended+ public void AnEndOutsideThePlayFailsNamingTheField(string end, string message)+ {+ var files = Fixture.Gdd();+ files["rules.yaml"] += " end: " + end + "\n";+ var e = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(files)));+ Assert.Equal(("rules.yaml", "mvp.end"), (e.File, e.Field));+ Assert.Contains(message, e.Message);+ }++ // R-LOOP-004+ [Fact]+ public void WithoutAnEndTheGameRunsToTheLastEra()+ {+ var c = ContentLoader.Load(Fixture.Write(Fixture.Gdd()));+ Assert.Null(c.Rules.Mvp!.End);+ Assert.Equal(c.Eras[c.Eras.Count - 1].To, c.End);+ }+}diff --git a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs b/sim/Statecraft.Sim.Tests/DesignValuesTests.csnew file mode 100644index 000000000..28bd52680--- /dev/null+++ b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs@@ -0,0 +1,139 @@+using System;+using System.Collections.Generic;+using System.IO;+using System.Linq;+using System.Text.RegularExpressions;+using Statecraft.Sim;+using YamlDotNet.RepresentationModel;++/// <summary>Every balance number of the GDD loop lives in content/ as a labelled design value (Q-CUT-1, owner, 15 October+/// 2026: "Labelled design values"): tagged on its own line, and listed here, so a new number cannot slip in untagged and+/// the owner reviews one list. R-LOOP-005.</summary>+public class DesignValuesTests+{+ public const string Tag = "# DESIGN VALUE: owner-set balance, not a historical figure";++ /// <summary>Every design value: file, then the path of its key (a list item by its id). Adding one here and in content is+ /// a balance change for the owner to set or accept in review.</summary>+ public static readonly (string File, string Key)[] Listed =+ {+ ("rules.yaml", "attention_cost.assign_workers"),+ ("rules.yaml", "attention_cost.train"),+ ("rules.yaml", "attention_cost.cancel_training"),+ ("rules.yaml", "attention_cost.pioneer_work"),+ ("rules.yaml", "attention_cost.stop_work"),+ ("rules.yaml", "mvp.people_per_unit"),+ ("rules.yaml", "mvp.income_per_job_per_year"),+ ("rules.yaml", "mvp.cohesion_housing_weight"),+ ("rules.yaml", "mvp.cohesion_jobs_weight"),+ ("rules.yaml", "mvp.build_yishuv_turns"),+ ("rules.yaml", "mvp.build_yishuv_cost"),+ ("cities.yaml", "cities[tel_aviv].housing_capacity"),+ ("cities.yaml", "cities[tel_aviv].job_slots"),+ ("cities.yaml", "cities[tel_aviv].civilians"),+ ("cities.yaml", "cities[tel_aviv].employed"),+ ("unit_types.yaml", "types[recruit].training_turns"),+ ("unit_types.yaml", "types[recruit].training_cost"),+ ("unit_types.yaml", "types[halutz].training_turns"),+ ("unit_types.yaml", "types[halutz].training_cost"),+ };+++ /// <summary>Every number in the GDD files and blocks, as (file, key path, the line it is on). Scope: all of cities.yaml and+ /// unit_types.yaml, rules.yaml mvp:, and the GDD kinds under rules.yaml attention_cost.</summary>+ public static List<(string File, string Key, string Line)> Numbers(string root)+ {+ var found = new List<(string, string, string)>();+ foreach (var file in new[] { "rules.yaml", "cities.yaml", "unit_types.yaml" })+ {+ var path = Path.Combine(root, file);+ if (!File.Exists(path)) continue;+ var lines = File.ReadAllLines(path);+ var yaml = new YamlStream();+ using (var r = new StringReader(File.ReadAllText(path))) yaml.Load(r);+ var top = (YamlMappingNode)yaml.Documents[0].RootNode;+ void Walk(YamlNode node, string key, bool inScope)+ {+ switch (node)+ {+ case YamlMappingNode m:+ foreach (var kv in m.Children)+ {+ var k = ((YamlScalarNode)kv.Key).Value!;+ var child = key == "" ? k : key + "." + k;+ var scope = inScope || file != "rules.yaml" || k == "mvp" || (key == "attention_cost" && AttentionSystem.IsGddKind(k));+ Walk(kv.Value, child, scope);+ }+ break;+ case YamlSequenceNode seq:+ int i = 0;+ foreach (var item in seq.Children)+ {+ var id = item is YamlMappingNode im && im.Children.TryGetValue(new YamlScalarNode("id"), out var v) ? ((YamlScalarNode)v).Value : i.ToString(System.Globalization.CultureInfo.InvariantCulture);+ Walk(item, $"{key}[{id}]", inScope);+ i++;+ }+ break;+ case YamlScalarNode sc when inScope && sc.Style == YamlDotNet.Core.ScalarStyle.Plain+ && double.TryParse(sc.Value, System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.InvariantCulture, out _):+ found.Add((file, key, lines[(int)sc.Start.Line - 1]));+ break;+ }+ }+ Walk(top, "", false);+ }+ return found;+ }++ // R-LOOP-005+ [Fact]+ public void EveryBalanceNumberIsListedAndTagged()+ {+ var numbers = Numbers(RealContentTests.ContentRoot());+ var keys = numbers.Select(n => (n.File, n.Key)).ToList();+ foreach (var listed in Listed)+ Assert.True(keys.Contains(listed), $"{listed.File}: {listed.Key} is listed as a design value but is not in content");+ foreach (var n in numbers)+ {+ Assert.True(Listed.Contains((n.File, n.Key)), $"{n.File}: {n.Key} is a GDD balance number that DesignValuesTests.Listed does not list");+ Assert.True(n.Line.Contains(Tag), $"{n.File}: {n.Key} lacks the design-value tag on its line ('{Tag}')");+ Assert.Matches(@"\(D-[A-I]\d+[^)]*\)\s*$", n.Line); // each names the decision row it belongs to+ }+ }++ // R-LOOP-005+ [Fact]+ public void TheListedValuesAreTheOnesTheGameReads()+ {+ var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var m = c.Rules.Mvp!;+ Assert.Equal((1000, 0.06, 0.5, 0.5), (m.PeoplePerUnit, m.IncomePerJobPerYear, m.CohesionHousingWeight, m.CohesionJobsWeight));+ Assert.Equal((0.5, 1.0, 0.5), (c.Rules.AttentionCost["assign_workers"], c.Rules.AttentionCost["train"], c.Rules.AttentionCost["cancel_training"]));+ Assert.Equal((0.0, 0.0), (c.Rules.AttentionCost["pioneer_work"], c.Rules.AttentionCost["stop_work"])); // D-A6: unit orders are free+ Assert.Equal((6, 2.0), (m.BuildYishuvTurns, m.BuildYishuvCost));+ var city = Assert.Single(c.Cities);+ Assert.Equal(("tel_aviv", 120, 90, 100, 80), (city.Id, city.HousingCapacity, city.JobSlots, city.Civilians, city.Employed));+ Assert.Equal(new[] { ("recruit", 3, 0.5), ("halutz", 4, 0.5) },+ c.UnitTypes.Where(t => t.Facility != "").Select(t => (t.Id, t.TrainingTurns, t.TrainingCost)));+ }++ // R-LOOP-005+ [Fact]+ public void AnUntaggedOrUnlistedNumberIsFound()+ {+ var dir = Fixture.Write(Fixture.Gdd(new Dictionary<string, string>+ {+ ["cities.yaml"] = "cities:\n - id: town_a\n housing_capacity: 12 " + Tag + " (D-A4)\n job_slots: 8\n",+ }));+ var numbers = Numbers(dir).Where(n => n.File == "cities.yaml").ToList();+ Assert.Equal(new[] { "cities[town_a].housing_capacity", "cities[town_a].job_slots" }, numbers.Select(n => n.Key));+ Assert.Contains(Tag, numbers[0].Line);+ Assert.DoesNotContain(Tag, numbers[1].Line);+ // rules.yaml: the mvp block and the GDD kinds are in scope, the legacy numbers are not.+ var rules = Numbers(dir).Where(n => n.File == "rules.yaml").Select(n => n.Key).ToList();+ Assert.Contains("mvp.people_per_unit", rules);+ Assert.Contains("attention_cost.train", rules);+ Assert.DoesNotContain("attention_cost.set_policy", rules);+ Assert.DoesNotContain("treasury_start", rules);+ }+}diff --git a/sim/Statecraft.Sim.Tests/DeterminismTests.cs b/sim/Statecraft.Sim.Tests/DeterminismTests.csindex 7daa6049c..864235b57 100644--- a/sim/Statecraft.Sim.Tests/DeterminismTests.cs+++ b/sim/Statecraft.Sim.Tests/DeterminismTests.cs@@ -1,4 +1,5 @@using System;+using System.Collections.Generic;using Statecraft.Sim;/// <summary>Fixed reference values for the generator and for the golden historical playthroughs. See docs/determinism.md.</summary>@@ -21,7 +22,7 @@ public class DeterminismTests/// golden/manifest.txt (see GoldenManifest and docs/determinism.md).</summary>static string GoldenHash => GoldenManifest.Expected("hash1950");- /// <summary>Real content, seed 1948, Historical mode, HistoricalAI until the date reaches 1950-01-01.</summary>+ /// <summary>Real content, seed 1948, Historical mode, the reference player until the date reaches 1950-01-01.</summary>public static GameState GoldenPlaythrough(Content c) => GoldenRun.Play(c, GoldenRun.Until1950);[Fact]@@ -29,7 +30,7 @@ public class DeterminismTests{var s = GoldenPlaythrough(ContentLoader.Load(RealContentTests.ContentRoot()));Assert.Null(s.GameOver);- Assert.True(s.Date >= GoldenRun.Until1950);+ Assert.Equal((new DateTime(1950, 1, 15), 20), (s.Date, s.Turn)); // the first monthly turn on or after 1 January 1950GoldenSnapshot.Check("hash1950", s, GoldenHash);}@@ -40,11 +41,27 @@ public class DeterminismTestspublic void GoldenPlaythroughTo1952HashIsFixed(){var s = GoldenRun.Play(ContentLoader.Load(RealContentTests.ContentRoot()), GoldenRun.Until1952);- Assert.Null(s.GameOver);- Assert.Equal(new DateTime(1952, 2, 27), s.Date);+ Assert.Equal(GameOverCodes.MvpEnded, s.GameOver); // the game's last turn ends on 15 January 1952 (R-LOOP-004)+ Assert.Equal((new DateTime(1952, 1, 15), 44), (s.Date, s.Turn));GoldenSnapshot.Check("hash1952", s, GoldenHash1952);}+ /// <summary>mvp-end (spec 2026-10-12 section 3): the reference player over the whole GDD game, to its end. With the end+ /// on 15 January 1952 it is the same run as hash1952, which stops at the first turn on or after 1 January 1952; both+ /// names are kept (spec section 3 step 6), so a later end date moves only this one.</summary>+ // R-LOOP-004+ [Fact]+ public void TheWholeGameToItsEndIsFixed()+ {+ var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var s = GoldenRun.PlayToEnd(c);+ Assert.Equal(GameOverCodes.MvpEnded, s.GameOver);+ Assert.Equal((c.End, 44), (s.Date, s.Turn));+ var expected = GoldenManifest.UpdateRequested ? GoldenManifest.Read().GetValueOrDefault("mvp-end", "") : GoldenManifest.Expected("mvp-end");+ GoldenSnapshot.Check("mvp-end", s, expected);+ Assert.Equal(GoldenRun.Play(c, GoldenRun.Until1952).Hash(), s.Hash());+ }+/// <summary>The library constants Unity players compare against are the values these tests pin.</summary>[Fact]public void LibraryGoldenConstantsMatchThisTest()diff --git a/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs b/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.csindex 9b8d605a2..b45804353 100644--- a/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs+++ b/sim/Statecraft.Sim.Tests/EconomyCalibrationTests.cs@@ -51,7 +51,8 @@ public class EconomyCalibrationTestspublic void ThePlaythroughSurvivesTo1952(){var last = History[History.Count - 1];- Assert.True(last.GameOver == null, "game over: " + last.GameOver);+ // The game's own end (15 January 1952, R-LOOP-004) is the only way this run may stop.+ Assert.True(last.GameOver == null || last.GameOver == GameOverCodes.MvpEnded, "game over: " + last.GameOver);Assert.True(last.CoalitionStability > PoliticsSystem.CollapseBelow);}diff --git a/sim/Statecraft.Sim.Tests/EraGolden.cs b/sim/Statecraft.Sim.Tests/EraGolden.csindex 9e2e36ff1..7bc374065 100644--- a/sim/Statecraft.Sim.Tests/EraGolden.cs+++ b/sim/Statecraft.Sim.Tests/EraGolden.cs@@ -3,7 +3,7 @@ using System.Linq;using Statecraft.Sim;/// <summary>Adds a golden for one era in a few lines (#292): <c>EraGolden.Check("hash_founding_1950", c, "founding", new DateTime(1950, 1, 1))</c>-/// plays a fresh start of that era (golden seed, Historical mode, HistoricalAI, as <see cref="GoldenRun.Play"/> does) and+/// plays a fresh start of that era (golden seed, Historical mode, the golden orders, as <see cref="GoldenRun.Play"/> does) and/// checks its hash against the manifest line and its snapshot in golden/<name>.txt, with the readable diff on a mismatch./// Bless a new one with STATECRAFT_UPDATE_GOLDEN=1 (docs/determinism.md)./// The run stays inside the era: it stops before the turn that would reach the era's <c>to</c>. That turn ends on the boundary@@ -23,7 +23,7 @@ public static class EraGoldenvar s = Simulation.NewGame(c, seed, Mode.Historical);for (int turn = 0; turn < 1000 && s.Date < until && s.GameOver == null; turn++){- var next = Simulation.Step(c, s, HistoricalAI.Commands(c, s)).State;+ var next = Simulation.Step(c, s, GoldenRun.Orders(c, s)).State;if (next.Date >= era.To) break;s = next;}diff --git a/sim/Statecraft.Sim.Tests/EraSystemsTests.cs b/sim/Statecraft.Sim.Tests/EraSystemsTests.csindex 8c575dd8a..975623052 100644--- a/sim/Statecraft.Sim.Tests/EraSystemsTests.cs+++ b/sim/Statecraft.Sim.Tests/EraSystemsTests.cs@@ -180,9 +180,9 @@ eras:// R-LOOP-001[Fact]- public void RealContentRunsTheLegacyLoop()+ public void WithoutTheSwitchTheLoopIsLegacy(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the real game runs gdd since the cutover (CutoverTests)Assert.Equal("legacy", c.Loop);Assert.False(c.IsGdd);Assert.Equal("legacy", c.Ruleset);diff --git a/sim/Statecraft.Sim.Tests/EraTests.cs b/sim/Statecraft.Sim.Tests/EraTests.csindex 402fcf704..74456a22b 100644--- a/sim/Statecraft.Sim.Tests/EraTests.cs+++ b/sim/Statecraft.Sim.Tests/EraTests.cs@@ -224,7 +224,7 @@ public class EraTestsvar c = EndingOn("1948-07-03");var s = Simulation.NewGame(c, 1948, Mode.Historical);StepResult r = null!;- while (s.GameOver == null) { r = Simulation.Step(c, s, new Command[0]); s = r.State; }+ while (s.GameOver == null && s.Turn < 1000) { r = Simulation.Step(c, s, new Command[0]); s = r.State; } // capped: a broken end fails, not hangsvar text = r.Why.Single(w => w.System == "era").Message;Assert.Equal("The chapter has ended", text);Assert.DoesNotContain("era_ended", text);diff --git a/sim/Statecraft.Sim.Tests/EventRetimingTests.cs b/sim/Statecraft.Sim.Tests/EventRetimingTests.csnew file mode 100644index 000000000..490804f6b--- /dev/null+++ b/sim/Statecraft.Sim.Tests/EventRetimingTests.cs@@ -0,0 +1,148 @@+using System;+using System.Collections.Generic;+using System.Linq;+using Statecraft.Sim;++/// <summary>The event windows re-timed for monthly turns at the cutover (docs/superpowers/specs/2026-10-14-event-timing-monthly.md,+/// #567, owner decisions of 15 October 2026), checked on the golden run (GoldenRun.Orders) from 15 May 1948 to the game's+/// end on 15 January 1952.</summary>+public class EventRetimingTests+{+ static readonly Content C = ContentLoader.Load(RealContentTests.ContentRoot());++ /// <summary>Every state of the golden run, the new game first.</summary>+ static readonly List<GameState> Run = Play();++ static List<GameState> Play()+ {+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ var run = new List<GameState> { s };+ while (s.GameOver == null && run.Count < 1000) { s = Simulation.Step(C, s, GoldenRun.Orders(C, s)).State; run.Add(s); }+ return run;+ }++ /// <summary>The date the card for <paramref name="id"/> reaches the player: the date of the first state it has fired in+ /// (a card raised at the new game comes on 15 May 1948), or null.</summary>+ static DateTime? CardDate(string id) => Run.FirstOrDefault(s => s.FiredEvents.Contains(id))?.Date;++ /// <summary>#567 section 4 item 8: all 31 events fire in the historical monthly run. Before the re-timing, sinai_withdrawal and+ /// rhodes_talks never fired (Horev's card came after both windows had closed).</summary>+ [Fact]+ public void EveryEventFiresInTheHistoricalMonthlyRun()+ {+ Assert.Equal(GameOverCodes.MvpEnded, Run[Run.Count - 1].GameOver);+ var missing = C.Events.Select(e => e.Id).Where(id => CardDate(id) == null).ToList();+ Assert.True(missing.Count == 0, "never fired: " + string.Join(", ", missing));+ Assert.Equal(31, C.Events.Count);+ }++ /// <summary>The card date of every event, from #567's tables (the "Proposed" column in the war period, "Monthly" after+ /// it). The re-timed windows (#567 section 4, edits 1 to 6, edit 2 by the owner's Q-CUT-7 answer) move idf_founding,+ /// altalena, jerusalem_military_government, latrun_proposal, operation_horev and elections_1949, and make+ /// sinai_withdrawal and rhodes_talks fire.</summary>+ // R-TURN-002+ [Theory]+ [InlineData("idf_founding", "1948-05-15")] // edit 1: the game's first day (was 15 June)+ [InlineData("first_truce", "1948-06-15")] // late by design, +5 days (owner, Q-CUT-3)+ [InlineData("altalena", "1948-06-15")] // edit 2 (owner, Q-CUT-7; was 15 July)+ [InlineData("ten_days", "1948-07-15")] // rewritten in PR 1a (#577)+ [InlineData("second_truce", "1948-07-15")]+ [InlineData("jerusalem_military_government", "1948-07-15")] // edit 3 (was 15 August)+ [InlineData("latrun_proposal", "1948-09-15")] // edit 4 (was 15 October)+ [InlineData("bernadotte_assassination", "1948-10-15")] // rewritten in PR 1a (#577)+ [InlineData("operation_yoav", "1948-10-15")]+ [InlineData("operation_hiram", "1948-11-15")] // rewritten in PR 1a (#577)+ [InlineData("jerusalem_ceasefire", "1948-12-15")] // rewritten in PR 1a (#577)+ [InlineData("operation_horev", "1948-12-15")] // edit 5 (was 15 January 1949)+ [InlineData("sinai_withdrawal", "1949-01-15")] // fires through edit 5; rewritten in PR 1a (#577)+ [InlineData("rhodes_talks", "1949-01-15")] // fires through edit 5; late by design, +2 days+ [InlineData("elections_1949", "1949-01-15")] // edit 6 (was 15 February)+ [InlineData("armistice_egypt", "1949-03-15")]+ [InlineData("armistice_lebanon", "1949-04-15")]+ [InlineData("armistice_jordan", "1949-04-15")]+ [InlineData("austerity_1949", "1949-05-15")]+ [InlineData("armistice_syria", "1949-08-15")]+ [InlineData("frumkin_commission", "1950-01-15")]+ [InlineData("maabarot_policy", "1950-04-15")]+ [InlineData("law_of_return", "1950-07-15")]+ [InlineData("clothing_rationing_1950", "1950-07-15")]+ [InlineData("ministry_supply_crisis", "1950-10-15")]+ [InlineData("education_registration_1951", "1950-12-15")]+ [InlineData("reparations_claim", "1951-03-15")]+ [InlineData("hula_drainage", "1951-03-15")]+ [InlineData("iraqi_exodus", "1951-03-15")]+ [InlineData("israel_bonds", "1951-05-15")]+ [InlineData("forex_crisis_1951", "1951-11-15")]+ public void EachEventFiresOnItsTurn(string id, string date) =>+ Assert.Equal(DateTime.Parse(date, System.Globalization.CultureInfo.InvariantCulture), CardDate(id));++ /// <summary>The gap rule in months (owner, 15 October 2026: "Restate the rule in months", Q-CUT-8: "6 months, 2 in+ /// wartime"; docs/m3-rulings.md). In the historical run no more than 6 months pass from one card to the next, or from the+ /// last card to the game's end, and no more than 2 when the country is at full war on any turn of the stretch+ /// (SecuritySystem.AtFullWar, rung 5).</summary>+ // R-TURN-003+ [Fact]+ public void NoLongStretchWithoutACard()+ {+ var gaps = Gaps(Run);+ Assert.NotEmpty(gaps);+ var bad = gaps.Where(TooLong).Select(Describe).ToList();+ Assert.True(bad.Count == 0, "stretches without a card: " + string.Join("; ", bad));+ Assert.Contains(gaps, g => g.AtWar); // the war period is measured, not skipped+ }++ public const int MaxMonths = 6, MaxMonthsAtWar = 2;++ /// <summary>R-TURN-003's limit for one stretch: 6 months, or 2 at full war.</summary>+ public static bool TooLong((DateTime From, DateTime To, int Months, bool AtWar) g) => g.Months > (g.AtWar ? MaxMonthsAtWar : MaxMonths);++ /// <summary>The owner's numbers (Q-CUT-8: "6 months, 2 in wartime"), pinned on both sides of each limit, and the real run's+ /// longest stretches, which sit exactly on them: a limit raised or lowered fails here.</summary>+ // R-TURN-003+ [Fact]+ public void TheLimitsAreSixMonthsAndTwoAtWar()+ {+ var d = new DateTime(1950, 1, 15);+ (DateTime, DateTime, int, bool) G(int months, bool war) => (d, d.AddMonths(months), months, war);+ Assert.False(TooLong(G(6, false)));+ Assert.True(TooLong(G(7, false)));+ Assert.False(TooLong(G(2, true)));+ Assert.True(TooLong(G(3, true)));+ var gaps = Gaps(Run);+ Assert.Equal(6, gaps.Where(g => !g.AtWar).Max(g => g.Months)); // 15 May to 15 November 1951+ Assert.Equal(2, gaps.Where(g => g.AtWar).Max(g => g.Months)); // 15 July to 15 September 1948, 15 January to 15 March 1949+ }++ public static List<(DateTime From, DateTime To, int Months, bool AtWar)> Gaps(List<GameState> run)+ {+ var cards = run.Where((s, i) => i == 0 ? s.FiredEvents.Count > 0 : s.FiredEvents.Count > run[i - 1].FiredEvents.Count).Select(s => s.Date).ToList();+ var end = run[run.Count - 1].Date;+ if (cards.Count == 0 || cards[cards.Count - 1] != end) cards.Add(end);+ var gaps = new List<(DateTime, DateTime, int, bool)>();+ for (int i = 1; i < cards.Count; i++)+ {+ var (a, b) = (cards[i - 1], cards[i]);+ var months = (b.Year - a.Year) * 12 + b.Month - a.Month;+ gaps.Add((a, b, months, run.Any(s => s.Date >= a && s.Date < b && SecuritySystem.AtFullWar(s))));+ }+ return gaps;+ }++ static string Describe((DateTime From, DateTime To, int Months, bool AtWar) g) =>+ FormattableString.Invariant($"{g.From:yyyy-MM-dd} to {g.To:yyyy-MM-dd}, {g.Months} months{(g.AtWar ? " at full war" : "")}");++ // R-TURN-003+ [Fact]+ public void TheGapRuleCatchesALongStretch()+ {+ DateTime D(int y, int m) => new DateTime(y, m, 15);+ GameState S(DateTime d, int rung, int fired) => new GameState { Date = d, Rung = rung, FiredEvents = new SortedSet<string>(Enumerable.Range(0, fired).Select(i => "e" + i)) };+ var peace = new List<GameState> { S(D(1950, 1), 2, 1) };+ for (int m = 2; m <= 8; m++) peace.Add(S(D(1950, m), 2, 1));+ peace.Add(S(D(1950, 9), 2, 2)); // a card after 8 months+ Assert.Equal(8, Assert.Single(Gaps(peace)).Months);+ var war = new List<GameState> { S(D(1948, 6), 5, 1), S(D(1948, 7), 5, 1), S(D(1948, 8), 5, 1), S(D(1948, 9), 5, 2) };+ var g = Assert.Single(Gaps(war));+ Assert.True(g.AtWar && g.Months == 3 && g.Months > MaxMonthsAtWar);+ }+}diff --git a/sim/Statecraft.Sim.Tests/EventTests.cs b/sim/Statecraft.Sim.Tests/EventTests.csindex 06a21e019..f738da5fb 100644--- a/sim/Statecraft.Sim.Tests/EventTests.cs+++ b/sim/Statecraft.Sim.Tests/EventTests.cs@@ -246,8 +246,7 @@ options:[Fact]public void SensitiveEventCannotRewardTreasury(){- var bad = Shortage.Replace("title: Bread lines", "title: Bread lines\ntags: [massacre]")- .Replace("target: fx_reserves\n delta: -10", "target: treasury\n delta: 50");+ var bad = Sensitive("massacre", "treasury", "50");var ex = Assert.Throws<ContentException>(() => Load(new Dictionary<string, string> { ["shortage.yaml"] = bad }));Assert.Equal("events/shortage.yaml", ex.File);Assert.Equal("events[shortage].options[import].effects.treasury", ex.Field);@@ -360,7 +359,7 @@ options:{// Fixture: pm_one holds defense until 1949-01-01, def_two from then on (open-ended).var ok = Shortage.Replace("{finance_minister}", "{defense_minister}");- Assert.Single(Load(new Dictionary<string, string> { ["shortage.yaml"] = ok }).Events);+ Assert.Single(LoadWithStanding(ok).Events);}[Theory]@@ -399,8 +398,11 @@ options:Assert.Equal("events[shortage].id", ex.Field);}+ /// <summary>The shortage event with a sensitive tag, its import option's effect replaced by <paramref name="target"/> and+ /// <paramref name="delta"/>. Its ration option's food gain becomes a cost, since a sensitive option may not raise food.</summary>static string Sensitive(string tag, string target, string delta) =>Shortage.Replace("title: Bread lines", "title: Bread lines\ntags: [" + tag + "]")+ .Replace("target: food_supply\n delta: 0.2", "target: food_supply\n delta: -0.2").Replace("target: fx_reserves\n delta: -10", "target: " + target + "\n delta: " + delta);[Theory]@@ -434,6 +436,44 @@ options:Assert.Single(c.Events);}+ /// <summary>The fixture with an intl_standing indicator, as the real model has.</summary>+ static Content LoadWithStanding(string ev) =>+ ContentLoader.Load(Fixture.Write(new Dictionary<string, string>+ {+ ["model.yaml"] = Fixture.Files["model.yaml"].Replace("indicators:\n", "indicators:\n - id: intl_standing\n base: 0.5\n name: International standing\n"),+ }, new Dictionary<string, string> { ["shortage.yaml"] = ev }));++ /// <summary>Owner decision of 15 October 2026 on Q-EFX-2, "Extend it": a sensitive option may not raise any resource. The+ /// legacy indicators stand for Food (food_supply), Social cohesion (morale) and International Support (intl_standing).</summary>+ [Theory]+ [InlineData("food_supply")]+ [InlineData("morale")]+ [InlineData("intl_standing")]+ public void SensitiveEventCannotRaiseFoodCohesionOrSupport(string target)+ {+ var ex = Assert.Throws<ContentException>(() => LoadWithStanding(Sensitive("war-casualties", target, "0.02")));+ Assert.Equal("events/shortage.yaml", ex.File);+ Assert.Equal($"events[shortage].options[import].effects.{target}", ex.Field);+ Assert.Contains("sensitive events cannot reward", ex.Message);+ }++ [Theory]+ [InlineData("food_supply", "0")]+ [InlineData("morale", "-0.02")]+ [InlineData("intl_standing", "-0.05")]+ public void SensitiveEventMayCostOrNotChangeFoodCohesionOrSupport(string target, string delta)+ {+ Assert.Single(LoadWithStanding(Sensitive("terror", target, delta)).Events);+ }++ /// <summary>A non-sensitive event may still raise them.</summary>+ [Fact]+ public void AnUntaggedEventMayRaiseCohesionAndSupport()+ {+ var ok = Shortage.Replace("target: fx_reserves\n delta: -10", "target: intl_standing\n delta: 0.05");+ Assert.Single(LoadWithStanding(ok).Events);+ }+[Fact]public void DuplicateOptionIdIsAnError(){diff --git a/sim/Statecraft.Sim.Tests/FinalWaveTests.cs b/sim/Statecraft.Sim.Tests/FinalWaveTests.csindex 0af6c4dba..7bfbcc2be 100644--- a/sim/Statecraft.Sim.Tests/FinalWaveTests.cs+++ b/sim/Statecraft.Sim.Tests/FinalWaveTests.cs@@ -18,6 +18,24 @@ public class FinalWaveTestsstatic readonly string[] SensitiveEvents ={ "altalena", "bernadotte_assassination", "operation_hiram", "operation_horev", "operation_yoav", "reparations_claim", "ten_days" };+ /// <summary>The resources a sensitive option may not raise (EventRules.NoGainTargets, internal to the sim).</summary>+ static readonly string[] Resources = { "treasury", "fx_reserves", "food_supply", "morale", "intl_standing" };++ /// <summary>Owner decision of 15 October 2026 (Q-EFX-3, "Add a real cost", #375): the three options that lost a gain under+ /// the extended no-gain rule (Q-EFX-2) each carry a real cost in a resource other than the one they gained, and raise+ /// no resource. The reparations claim's cost is Money (owner decision of 15 October 2026, "Move the cost to Money", #600).</summary>+ [Theory]+ [InlineData("altalena", "compromise", "morale", "intl_standing")]+ [InlineData("bernadotte_assassination", "outlaw", "intl_standing", "morale")]+ [InlineData("reparations_claim", "claim", "intl_standing", "treasury")]+ public void TheOptionsThatLostAGainCarryARealCostElsewhere(string id, string option, string gained, string cost)+ {+ var o = Real.Events.Single(e => e.Id == id).Options.Single(x => x.Id == option);+ Assert.DoesNotContain(o.Effects, f => Resources.Contains(f.Target) && f.Delta > 0);+ Assert.NotEqual(gained, cost);+ Assert.Contains(o.Effects, f => f.Target == cost && f.Delta < 0);+ }+[Fact]public void TheSensitiveEventsArePinned(){@@ -38,7 +56,9 @@ public class FinalWaveTests[Fact]public void AShareableBuildNeedsEverySensitiveEventReviewed(){- Assert.Empty(ReleaseGate.SensitiveUnreviewed(Real)); // the owner signed off all seven on 2026-10-10 (docs/oss/DECISIONS.md D11)+ // The owner signed off all seven on 2026-10-10 (docs/oss/DECISIONS.md D11), and re-reviewed altalena,+ // bernadotte_assassination, operation_hiram and ten_days after #577 changed them on 2026-10-15 ("Approve all 4", #600).+ Assert.Empty(ReleaseGate.SensitiveUnreviewed(Real));var reviewed = Fixture.Write(events: new Dictionary<string, string>{["a.yaml"] = "id: a\ntitle: A\ntext: x\nfrom: 1948-06-01\ntags: [terror]\noptions:\n - id: o\n text: O\nstatus: sensitivity-reviewed\n",diff --git a/sim/Statecraft.Sim.Tests/Fixture.cs b/sim/Statecraft.Sim.Tests/Fixture.csindex 4d07826b4..e67a00189 100644--- a/sim/Statecraft.Sim.Tests/Fixture.cs+++ b/sim/Statecraft.Sim.Tests/Fixture.cs@@ -197,7 +197,7 @@ series:/// <summary>The fixture with the GDD loop on (eras.yaml systems.loop: gdd) and the files and keys that loop needs: the/// mvp: rules block, the GDD command kinds' attention_cost, cities.yaml and unit_types.yaml. Every value is a fixture- /// value (PLACEHOLDER: owner sets). <paramref name="extra"/> replaces or adds files on top.</summary>+ /// value, not the game's (the real design values are in content/, R-LOOP-005). <paramref name="extra"/> replaces or adds files on top.</summary>public static Dictionary<string, string> Gdd(Dictionary<string, string>? extra = null){var o = new Dictionary<string, string>diff --git a/sim/Statecraft.Sim.Tests/GddStateTests.cs b/sim/Statecraft.Sim.Tests/GddStateTests.csindex 45089f7d3..1805f02a0 100644--- a/sim/Statecraft.Sim.Tests/GddStateTests.cs+++ b/sim/Statecraft.Sim.Tests/GddStateTests.cs@@ -8,11 +8,14 @@ public class GddStateTests{// R-LOOP-002[Fact]- public void WithTheSwitchOffTheGoldenSnapshotIsByteIdentical()+ public void WithTheSwitchOffAPlayedGameWritesNoNewSection(){- var s = GoldenRun.Play(ContentLoader.Load(RealContentTests.ContentRoot()), GoldenRun.Until1950);- Assert.Equal(GoldenSnapshot.Read("hash1950"), s.Describe());- Assert.Equal(GoldenRun.Hash1950, s.Hash());+ // Since the cutover the legacy loop is a fixture's (the real goldens run gdd): a legacy game played a year writes+ // none of the GDD sections.+ var c = ContentLoader.Load(Fixture.Write());+ var s = GoldenRun.Play(c, new DateTime(1949, 5, 15));+ Assert.True(s.Turn > 1);+ foreach (var label in new[] { "city{", "coh=", "units[", "train[", "next=", "obj{", "score=" }) Assert.DoesNotContain(label, s.Describe());}// R-LOOP-002diff --git a/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs b/sim/Statecraft.Sim.Tests/GoldenManifestTests.csindex b0483ea17..9c1b634b5 100644--- a/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs+++ b/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs@@ -15,7 +15,7 @@ public class GoldenManifestTests{var m = GoldenManifest.Read();var scenarios = System.IO.Directory.GetFiles(ScenarioTests.Dir(), "*.yaml").Select(f => "scenario-" + System.IO.Path.GetFileNameWithoutExtension(f));- var known = new[] { "hash1950", "hash1952", "smoke5", "mvp-slice" }.Concat(scenarios).OrderBy(k => k, StringComparer.Ordinal).ToArray(); // one line per scenario file (#296)+ var known = new[] { "hash1950", "hash1952", "smoke5", "mvp-end" }.Concat(scenarios).OrderBy(k => k, StringComparer.Ordinal).ToArray(); // one line per scenario file (#296)Assert.Equal(known, m.Keys.OrderBy(k => k, StringComparer.Ordinal).ToArray());Assert.All(m.Values, h => Assert.Matches("^[0-9a-f]{64}$", h));}diff --git a/sim/Statecraft.Sim.Tests/Invariants.cs b/sim/Statecraft.Sim.Tests/Invariants.csindex 32b33853b..f993fbd74 100644--- a/sim/Statecraft.Sim.Tests/Invariants.cs+++ b/sim/Statecraft.Sim.Tests/Invariants.cs@@ -118,7 +118,7 @@ public static class Invariantsvar h = new List<GameState> { s };for (int turn = 0; turn < 1000 && s.Date < until && s.GameOver == null; turn++){- s = Simulation.Step(c, s, HistoricalAI.Commands(c, s)).State;+ s = Simulation.Step(c, s, GoldenRun.Orders(c, s)).State;h.Add(s);}return h;diff --git a/sim/Statecraft.Sim.Tests/MvpGoldenTests.cs b/sim/Statecraft.Sim.Tests/MvpGoldenTests.csdeleted file mode 100644index 29019c12c..000000000--- a/sim/Statecraft.Sim.Tests/MvpGoldenTests.cs+++ /dev/null@@ -1,30 +0,0 @@-using System;-using Statecraft.Sim;--/// <summary>The mvp-slice golden: pinned in golden/manifest.txt with its snapshot, like the scenario goldens.</summary>-public class MvpGoldenTests-{- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());-- [Fact]- public void TheSliceMatchesItsGolden()- {- var s = MvpGolden.Play(Mvp);- Assert.Equal(new DateTime(1949, 3, 15), s.Date);- Assert.Equal(10, s.Turn);- // R-SITE-001, R-SITE-003: the reference player's halutz group is ready on 15 September 1948, starts Mefalsim that turn- // (borrowing the cost) and builds it at the end of the sixth turn, on 15 March 1949: the last turn the golden plays.- Assert.Equal(new DateTime(1949, 3, 15), s.Sites["mefalsim"].BuiltOn);- var expected = GoldenManifest.UpdateRequested ? GoldenManifest.Read().GetValueOrDefault("mvp-slice", "") : GoldenManifest.Expected("mvp-slice");- GoldenSnapshot.Check("mvp-slice", s, expected);- }-- [Fact]- public void TheSliceIsNotTheLegacyRun()- {- var legacy = ContentLoader.Load(RealContentTests.ContentRoot());- var s = Simulation.NewGame(legacy, GoldenRun.Seed, Mode.Historical);- while (s.Date < MvpGolden.Until) s = Simulation.Step(legacy, s, HistoricalAI.Commands(legacy, s)).State;- Assert.NotEqual(s.Hash(), MvpGolden.Play(Mvp).Hash());- }-}diff --git a/sim/Statecraft.Sim.Tests/MvpSliceTests.cs b/sim/Statecraft.Sim.Tests/MvpSliceTests.csdeleted file mode 100644index 990a80b66..000000000--- a/sim/Statecraft.Sim.Tests/MvpSliceTests.cs+++ /dev/null@@ -1,74 +0,0 @@-using System;-using System.Collections.Generic;-using System.Linq;-using Statecraft.Sim;--/// <summary>MvpSlice (GDD v0.1 Phase 1): the real content with the loop switch on and monthly turns, for tests, the MVP-/// goldens and the dev flag. The real eras.yaml and rules.yaml keep the defaults until cutover.</summary>-public class MvpSliceTests-{- static readonly Content Real = ContentLoader.Load(RealContentTests.ContentRoot());- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());-- // R-LOOP-003- [Fact]- public void TheOverlayTurnsTheSwitchOnAndSetsMonthlyTurns()- {- Assert.False(Real.IsGdd);- Assert.True(Mvp.IsGdd);- Assert.All(Mvp.Eras, e => Assert.Equal("gdd", e.Systems.Loop));- Assert.Equal(new[] { "month", "month", "month", "month", "month" }, Mvp.Rules.TurnLengths);- Assert.NotEqual(Real.Hash, Mvp.Hash); // different content: a save made on one warns on the other- }-- // R-LOOP-003- [Fact]- public void TheOverlayChangesNothingElse()- {- Assert.Equal(Real.Events.Select(e => e.Id), Mvp.Events.Select(e => e.Id));- Assert.Equal(Real.Rules.Start, Mvp.Rules.Start);- // The slice adds the GDD command kinds' costs (placeholders) and keeps every other cost.- Assert.Equal(Real.Rules.AttentionCost.Append(new KeyValuePair<string, double>("assign_workers", 0.5))- .Append(new KeyValuePair<string, double>("train", 1)).Append(new KeyValuePair<string, double>("cancel_training", 0.5))- .Append(new KeyValuePair<string, double>("pioneer_work", 0)).Append(new KeyValuePair<string, double>("stop_work", 0)).OrderBy(kv => kv.Key, StringComparer.Ordinal),- Mvp.Rules.AttentionCost.OrderBy(kv => kv.Key, StringComparer.Ordinal));- Assert.Equal(Real.Rules.BudgetStart, Mvp.Rules.BudgetStart);- Assert.Equal(Real.Rules.CapitalInflowPerYear, Mvp.Rules.CapitalInflowPerYear);- Assert.Equal(Real.Eras.Select(e => (e.Id, e.Name, e.From, e.To, e.Systems.Legislature, string.Join(",", e.Systems.MapActions))),- Mvp.Eras.Select(e => (e.Id, e.Name, e.From, e.To, e.Systems.Legislature, string.Join(",", e.Systems.MapActions))));- Assert.Equal(Real.EraRules.Keys.OrderBy(k => k), Mvp.EraRules.Keys.OrderBy(k => k));- }-- // R-LOOP-003- [Fact]- public void TheSlicePlaysMonthlyFromTheFifteenthOfMay1948()- {- var s = Simulation.NewGame(Mvp, GoldenRun.Seed, Mode.Historical);- var dates = new System.Collections.Generic.List<DateTime>();- for (int i = 0; i < 3; i++) { s = Simulation.Step(Mvp, s, HistoricalAI.Commands(Mvp, s)).State; dates.Add(s.Date); }- Assert.Equal(new[] { new DateTime(1948, 6, 15), new DateTime(1948, 7, 15), new DateTime(1948, 8, 15) }, dates);- }-- [Fact]- public void TheOverlayKeepsAnEraSwitchAlreadySet()- {- var read = MvpSlice.Overlay(rel => rel == "eras.yaml"- ? "eras:\n - id: founding\n name: F\n from: 1948-05-15\n to: 1957-01-01\n systems: { legislature: assembly }\n"- : null);- var text = read("eras.yaml")!;- Assert.Contains("legislature: assembly", text);- Assert.Contains("loop: gdd", text);- Assert.Null(read("missing.yaml"));- }-- [Fact]- public void LoadKeepsTheLoadersDirectoryChecks()- {- var dir = Fixture.Write(Fixture.Gdd());- System.IO.Directory.CreateDirectory(System.IO.Path.Combine(dir, "rules"));- System.IO.File.WriteAllText(System.IO.Path.Combine(dir, "rules", "nosuchera.yaml"), "attention_per_turn: 5\n");- var ex = Assert.Throws<ContentException>(() => MvpSlice.Load(dir));- Assert.Equal("rules/nosuchera.yaml", ex.File);- Assert.Contains("must be the id of an era", ex.Message);- }-}diff --git a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs b/sim/Statecraft.Sim.Tests/PlayerTextTests.csindex fa4f88e1e..a3ac483dd 100644--- a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs+++ b/sim/Statecraft.Sim.Tests/PlayerTextTests.cs@@ -152,7 +152,9 @@ public class PlayerTextTestsAssert.Empty(r.Rejected);causes.AddRange(r.Why);}- var s = GoldenRun.Play(c, new DateTime(1950, 6, 15));+ // From October 1949: the monthly run ends on 15 January 1952 (R-LOOP-004), and one appointment a turn needs that many+ // turns to fill every appointable office; the map actions wait in the loop until 1950 opens them.+ var s = GoldenRun.Play(c, new DateTime(1949, 10, 15));bool budget = false, camp = false, housing = false;var appointedOffices = new HashSet<string>(); var appointable = new HashSet<string>();var policiesSet = new HashSet<string>();@@ -168,8 +170,10 @@ public class PlayerTextTestsif (pick.Item1 != null) cmds.Insert(0, new Appoint(pick.Item1, pick.Item2)); // first, so attention never runs out for itif (!budget){+ // First, so it gets Attention before the appointments: the monthly run to the game's end (15 January 1952) is+ // too short for it to wait until they run out.var first = s.Budget.Keys.OrderBy(k => k, StringComparer.Ordinal).First();- cmds.Add(new AllocateBudget(new Dictionary<string, double>(s.Budget.ToDictionary(k => k.Key, k => k.Value)) { [first] = s.Budget[first] }));+ cmds.Insert(0, new AllocateBudget(new Dictionary<string, double>(s.Budget.ToDictionary(k => k.Key, k => k.Value)) { [first] = s.Budget[first] }));}foreach (var (action, done) in new[] { (MapActions.TransitCamp, camp), (MapActions.Housing, housing) }){diff --git a/sim/Statecraft.Sim.Tests/PreviewTests.cs b/sim/Statecraft.Sim.Tests/PreviewTests.csindex 7fba14ec2..2d343ca9b 100644--- a/sim/Statecraft.Sim.Tests/PreviewTests.cs+++ b/sim/Statecraft.Sim.Tests/PreviewTests.cs@@ -16,7 +16,7 @@ public class PreviewTestsvar text = Preview.Run(Root, GoldenRun.Until1950, GoldenRun.Seed, None, Show, 8);Assert.Contains("(the descriptions are identical)", text);Assert.Contains($"hash {GoldenRun.Hash1950.Substring(0, 8)} -> changed", text);- Assert.Contains($"changed 1950-02-27 hash {GoldenRun.Hash1950.Substring(0, 8)}", text);+ Assert.Contains($"changed 1950-01-15 hash {GoldenRun.Hash1950.Substring(0, 8)}", text);}[Fact]diff --git a/sim/Statecraft.Sim.Tests/ProjectsTests.cs b/sim/Statecraft.Sim.Tests/ProjectsTests.csindex cc8525539..531452c9c 100644--- a/sim/Statecraft.Sim.Tests/ProjectsTests.cs+++ b/sim/Statecraft.Sim.Tests/ProjectsTests.cs@@ -8,7 +8,7 @@ using Statecraft.Sim;/// #378's questions are the plan's recommendations, which the owner took on 14 October 2026.</summary>public class ProjectsTests{- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());+ static readonly Content Mvp = ContentLoader.Load(RealContentTests.ContentRoot());/// <summary>The GDD fixture: town_a at (1, 0) and site_a at (2, 0). A build takes 3 turns and costs IL 1.5m.</summary>static Content Town(Dictionary<string, string>? extra = null) => ContentLoader.Load(Fixture.Write(Fixture.Gdd(extra)));@@ -112,7 +112,7 @@ public class ProjectsTests[Fact]public void TheLegacyLoopRefusesBothOrdersAndRefundsAttention(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the legacy loop (a fixture since the cutover)var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);var r = Step(c, s, new PioneerWork(1, Projects.BuildYishuv, "mefalsim"), new StopWork(1));Assert.Equal(2, r.Rejected.Count);diff --git a/sim/Statecraft.Sim.Tests/RealContentTests.cs b/sim/Statecraft.Sim.Tests/RealContentTests.csindex 2e810a3e9..847113ee8 100644--- a/sim/Statecraft.Sim.Tests/RealContentTests.cs+++ b/sim/Statecraft.Sim.Tests/RealContentTests.cs@@ -1,4 +1,5 @@using System;+using System.Collections.Generic;using System.IO;using System.Linq;using Statecraft.Sim;@@ -345,11 +346,31 @@ public class RealContentTests}}+ /// <summary>The m3 ruling "Event cap and gaps", restated in months (owner decision, 15 October 2026, Q-CUT-8, "6 months,+ /// 2 in wartime", #375): in the historical run to 1952, no more than 6 months pass from one card to the next. The longest+ /// stretch is 6 months on both the legacy and the monthly turns (27 August 1949 to 27 February 1950 today; 15 May to+ /// 15 November 1951 on monthly turns).</summary>+ [Fact]+ public void NoMoreThanSixMonthsPassWithoutACard()+ {+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ var cards = new List<DateTime> { s.Date };+ while (s.Date < new DateTime(1952, 1, 1) && s.GameOver == null)+ {+ var next = Simulation.Step(C, s, HistoricalAI.Commands(C, s)).State;+ if (next.FiredEvents.Count > s.FiredEvents.Count) cards.Add(next.Date);+ s = next;+ }+ var stretches = cards.Zip(cards.Skip(1), (a, b) => (a, b)).Where(p => p.b > p.a.AddMonths(6))+ .Select(p => $"{p.a:yyyy-MM-dd} to {p.b:yyyy-MM-dd}").ToList();+ Assert.True(stretches.Count == 0, "stretches without a card: " + string.Join("; ", stretches));+ }+[Fact]public void EveryEventOf1950And1951FiresInTheHistoricalPlaythrough(){var s = GoldenRun.Play(C, new DateTime(1952, 1, 1));- Assert.Null(s.GameOver);+ Assert.Equal(GameOverCodes.MvpEnded, s.GameOver); // the run reaches the game's end, 15 January 1952 (R-LOOP-004)var expected = new[] { "clothing_rationing_1950", "education_registration_1951", "forex_crisis_1951", "frumkin_commission","hula_drainage", "iraqi_exodus", "israel_bonds", "law_of_return", "maabarot_policy", "ministry_supply_crisis", "reparations_claim" };var missing = expected.Where(id => !s.FiredEvents.Contains(id)).ToList();diff --git a/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs b/sim/Statecraft.Sim.Tests/ReferencePlayerTests.csindex 6d6d32378..be6049bbe 100644--- a/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs+++ b/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs@@ -10,12 +10,22 @@ using Statecraft.Sim.Reference;/// goldens (#394), but no game mode or UI may reach it (controller decision on PR 3, 2026-10-14).</summary>public class ReferencePlayerTests{- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());+ static readonly Content Mvp = ContentLoader.Load(RealContentTests.ContentRoot());++ /// <summary>The game's start without its first card: since the cutover idf_founding is raised on 15 May, and answering+ /// it at full war takes the Attention a halutz group needs (the golden run trains on a later turn). These tests check+ /// the stated policy, not that turn.</summary>+ static GameState Start()+ {+ var s = Simulation.NewGame(Mvp, GoldenRun.Seed, Mode.Historical);+ s.PendingEvents.Clear();+ return s;+ }[Fact]public void ItSendsHistoricalAIsOrdersThenFillsTheJobsThenTrainsOneHalutzGroup(){- var s = Simulation.NewGame(Mvp, GoldenRun.Seed, Mode.Historical);+ var s = Start();var 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));@@ -27,12 +37,36 @@ public class ReferencePlayerTestsAssert.Empty(Simulation.Step(Mvp, s, orders).Rejected);}+ /// <summary>The real start: the 15 May card (idf_founding) is answered first, at full war's price, and the jobs are+ /// filled; the halutz group no longer fits that turn's 4 Attention (Q-CUT-5 keeps 4), so the player trains on the first+ /// later turn that has the Attention (the turn from 15 August 1948 in the golden run), and every order it sends is taken.</summary>+ [Fact]+ public void OnTheRealStartItAnswersTheCardFirstAndTrainsWhenAttentionAllows()+ {+ var s = Simulation.NewGame(Mvp, GoldenRun.Seed, Mode.Historical);+ Assert.Contains("idf_founding", s.PendingEvents);+ var first = ReferencePlayer.Commands(Mvp, s);+ Assert.IsType<ChooseEventOption>(first[0]);+ Assert.Contains(first, x => x is AssignWorkers);+ Assert.DoesNotContain(first, x => x is Train);+ DateTime? trained = null;+ while (trained == null && s.GameOver == null && s.Turn < 1000)+ {+ var orders = ReferencePlayer.Commands(Mvp, s);+ var r = Simulation.Step(Mvp, s, orders);+ Assert.Empty(r.Rejected);+ if (orders.Any(x => x is Train)) trained = s.Date;+ s = r.State;+ }+ Assert.Equal(new DateTime(1948, 8, 15), trained);+ }+// R-TRAIN-001: the stated policy trains a halutz group only when there is none, none in training, a civilian without// work, and the Attention to pay. Training borrows, so Money does not hold it back (owner decision, 2026-10-15).[Fact]public void ItTrainsNoHalutzWhenOneExistsOrTrainsOrNobodyIsFreeButDoesWithNoMoney(){- var s = Simulation.NewGame(Mvp, GoldenRun.Seed, Mode.Historical);+ var s = Start();var training = Simulation.Step(Mvp, s, ReferencePlayer.Commands(Mvp, s)).State;Assert.Single(training.Cohorts);training.Treasury = 100; // only the cohort in training holds it back: Money, Attention and free civilians are there@@ -145,12 +179,12 @@ public class ReferencePlayerTests[Fact]public void ItIssuesNoGddOrderInTheLegacyLoop(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the legacy loop (a fixture since the cutover)var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);Assert.Equal(HistoricalAI.Commands(c, s).Select(x => x.Kind), ReferencePlayer.Commands(c, s).Select(x => x.Kind));}- /// <summary>Only the golden runner (MvpGolden) and tests may name it: no game mode, CLI command or Unity screen.</summary>+ /// <summary>Only the golden runner (GoldenRun) and tests may name it: no game mode, CLI command or Unity screen.</summary>[Fact]public void NoGameModeOrUiReachesIt(){@@ -164,7 +198,7 @@ public class ReferencePlayerTests.Select(Rel).Where(f => !f.StartsWith("sim/Statecraft.Sim/Reference/", StringComparison.Ordinal) && !f.StartsWith("unity/Assets/Tests/", StringComparison.Ordinal)).OrderBy(f => f, StringComparer.Ordinal);- Assert.Equal(new[] { "sim/Statecraft.Sim/MvpGolden.cs" }, users);+ Assert.Equal(new[] { "sim/Statecraft.Sim/GoldenRun.cs" }, users);Assert.Equal("Statecraft.Sim.Reference", typeof(ReferencePlayer).Namespace);}}diff --git a/sim/Statecraft.Sim.Tests/SaveGameTests.cs b/sim/Statecraft.Sim.Tests/SaveGameTests.csindex 1239a6854..dd0e1e573 100644--- a/sim/Statecraft.Sim.Tests/SaveGameTests.cs+++ b/sim/Statecraft.Sim.Tests/SaveGameTests.cs@@ -95,7 +95,7 @@ public class SaveGameTests{var c = ContentLoader.Load(RealContentTests.ContentRoot());var g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);- while (g.State.Date < GoldenRun.Until1952) g.Step(HistoricalAI.Commands(c, g.State));+ while (g.State.Date < GoldenRun.Until1952 && g.State.GameOver == null) g.Step(GoldenRun.Orders(c, g.State));Assert.Equal(GoldenRun.Hash1952, g.State.Hash());var loaded = GameSession.Load(c, g.Save.Write(), out var warnings);Assert.Empty(warnings);@@ -530,7 +530,7 @@ public class SaveGameTests[Fact]public void AGddSaveNamesItsRulesetAndRoundTrips(){- var c = MvpSlice.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(RealContentTests.ContentRoot());var g = GameSession.New(c, 1, Mode.Historical);g.Step(HistoricalAI.Commands(c, g.State));var text = g.Save.Write();@@ -554,32 +554,58 @@ public class SaveGameTestsAssert.Contains("\nruleset legacy\n", SaveGame.Parse(v1).Write());}+ /// <summary>N4 (#382): a save from before the cutover (a schema 1 save, or one that names the legacy ruleset) is refused+ /// with a stable code the UI translates, and the sim's English reason does not itself tell the player to start a new+ /// game: the UI's message says that once.</summary>// R-SAVE-001[Fact]- public void AGddGameRefusesALegacySave()+ public void ALegacySaveIsRefusedOnceWithACode(){+ var g = Played(Fixture1()); // the legacy loop: a fixture since the cutovervar real = ContentLoader.Load(RealContentTests.ContentRoot());- var g = GameSession.New(real, 1, Mode.Historical);- g.Step(new Command[0]);- var gdd = MvpSlice.Load(RealContentTests.ContentRoot());- var ex = Assert.Throws<SaveException>(() => GameSession.Load(gdd, g.Save.Write(), out _));- Assert.Equal("This save was made with an earlier version of the game's rules; start a new game.", ex.Message);+ var ex = Assert.Throws<SaveException>(() => GameSession.Load(real, g.Save.Write(), out _));+ Assert.Equal(SaveException.OlderRules, ex.Code);+ Assert.Equal("This save was made with an earlier version of the game's rules.", ex.Message);+ Assert.DoesNotContain("new game", ex.Message);var v1 = g.Save.Write().Replace("statecraft-save 2\n", "statecraft-save 1\n").Replace("ruleset legacy\n", "");- Assert.Equal(ex.Message, Assert.Throws<SaveException>(() => GameSession.Load(gdd, v1, out _)).Message);+ var ex1 = Assert.Throws<SaveException>(() => GameSession.Load(real, v1, out _));+ Assert.Equal((ex.Code, ex.Message), (ex1.Code, ex1.Message));+ }++ /// <summary>N2 (#382): a save naming a ruleset this build does not know was made by a newer version of the game, and is+ /// refused the way a newer save schema is: with the same code.</summary>+ // R-SAVE-002+ [Fact]+ public void AnUnknownRulesetSaysItIsNewer()+ {+ var real = ContentLoader.Load(RealContentTests.ContentRoot());+ var text = GameSession.New(real, 1, Mode.Historical).Save.Write().Replace("\nruleset gdd-0.1\n", "\nruleset gdd-0.2\n");+ var ex = Assert.Throws<SaveException>(() => SaveGame.Parse(text));+ Assert.Equal((SaveException.NewerVersion, 5), (ex.Code, ex.Line));+ Assert.Contains("This save was made with a newer version of the game", ex.Message);+ Assert.DoesNotContain("new game", ex.Message);+ Assert.Equal(SaveException.NewerVersion, Assert.Throws<SaveException>(() => GameSession.Load(real, text, out _)).Code);+ var schema3 = text.Replace("statecraft-save 2\n", "statecraft-save 3\n");+ Assert.Equal(SaveException.NewerVersion, Assert.Throws<SaveException>(() => SaveGame.Parse(schema3)).Code);}// R-SAVE-001[Fact]public void ALegacyGameRefusesAGddSave(){- var gdd = MvpSlice.Load(RealContentTests.ContentRoot());- var text = GameSession.New(gdd, 1, Mode.Historical).Save.Write();- var ex = Assert.Throws<SaveException>(() => GameSession.Load(ContentLoader.Load(RealContentTests.ContentRoot()), text, out _));- Assert.Equal("This save was made with another version of the game's rules; start a new game.", ex.Message);+ var text = GameSession.New(ContentLoader.Load(RealContentTests.ContentRoot()), 1, Mode.Historical).Save.Write();+ var ex = Assert.Throws<SaveException>(() => GameSession.Load(Fixture1(), text, out _)); // the legacy loop: a fixture+ Assert.Equal(SaveException.NewerVersion, ex.Code);+ Assert.Equal("This save was made with a newer version of the game's rules.", ex.Message);}+ /// <summary>A damaged save carries no refusal code: the UI shows its own reason.</summary>+ [Fact]+ public void AMalformedSaveHasNoRefusalCode() =>+ Assert.Null(Assert.Throws<SaveException>(() => SaveGame.Parse("statecraft-save x\ncontent a\nseed 1\nmode Historical\nend b\n")).Code);+[Theory]- [InlineData("ruleset chess", "unknown ruleset 'chess'")]+ [InlineData("ruleset chess", "a newer version of the game (ruleset 'chess')")][InlineData("ruleset", "expected 'ruleset'")][InlineData("turn", "expected 'ruleset'")]public void ABadRulesetLineIsRefused(string line, string message)diff --git a/sim/Statecraft.Sim.Tests/ScenarioTests.cs b/sim/Statecraft.Sim.Tests/ScenarioTests.csindex 7fffb6089..c4ac0242c 100644--- a/sim/Statecraft.Sim.Tests/ScenarioTests.cs+++ b/sim/Statecraft.Sim.Tests/ScenarioTests.cs@@ -8,10 +8,9 @@ using Statecraft.Sim;public class ScenarioTests{static readonly Content C = ContentLoader.Load(RealContentTests.ContentRoot());- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());/// <summary>The content a scenario plays on: the real content, or the GDD slice for `content: mvp`.</summary>- static Content For(Scenario sc) => sc.Content == Scenario.MvpContent ? Mvp : C;+ static Content For(Scenario sc) => C; // every scenario plays the real content since the cutover/// <summary>sim/Statecraft.Sim.Tests/scenarios, where the scenario files live (the runner, Scenario, is in the sim library).</summary>public static string Dir() =>@@ -42,7 +41,7 @@ public class ScenarioTestsAssert.Equal(hashes.Count, hashes.Distinct().Count());foreach (var (sc, hash) in scenarios.Zip(hashes, (sc, h) => (sc, h))){- var bare = Scenario.Parse($"name: {sc.Name}\nuntil: {sc.Until}\n" + (sc.Seed.HasValue ? $"seed: {sc.Seed}\n" : "") + (sc.Content != "" ? $"content: {sc.Content}\n" : ""));+ var bare = Scenario.Parse($"name: {sc.Name}\nuntil: {sc.Until}\n" + (sc.Seed.HasValue ? $"seed: {sc.Seed}\n" : ""));Assert.True(bare.Play(For(bare)).Hash() != hash, $"scenario '{sc.Name}' ends where the same run with no scripted command ends: its choices change nothing");}}@@ -83,17 +82,17 @@ public class ScenarioTestsAssert.Contains(expected, Assert.Throws<InvalidDataException>(() => Scenario.Parse(Head + command)).Message);[Fact]- public void TheMvpScenarioPlaysTheGddSlice()+ public void TheMvpScenarioPlaysTheGddLoop(){var sc = Scenario.Parse(File.ReadAllText(Path.Combine(Dir(), "mvp-absorb-first.yaml")));- Assert.Equal("mvp", sc.Content);Assert.True(For(sc).IsGdd);Assert.Equal(90, sc.Play(For(sc)).Cities["tel_aviv"].Employed);}+ /// <summary>The `content: mvp` key went with the overlay at the cutover: a scenario that still names it fails to parse.</summary>[Fact]- public void AnUnknownContentIsRefused() =>- Assert.Contains("'content' must be mvp", Assert.Throws<InvalidDataException>(() => Scenario.Parse("name: t\ncontent: civ\nuntil: 1948-08-01\n")).Message);+ public void TheRetiredContentKeyIsRefused() =>+ Assert.Contains("content", Assert.ThrowsAny<Exception>(() => Scenario.Parse("name: t\ncontent: mvp\nuntil: 1948-08-01\n")).Message);[Fact]public void ABadDateIsRefused() =>diff --git a/sim/Statecraft.Sim.Tests/SitesContentTests.cs b/sim/Statecraft.Sim.Tests/SitesContentTests.csindex cceacdd12..2fc0dccd6 100644--- a/sim/Statecraft.Sim.Tests/SitesContentTests.cs+++ b/sim/Statecraft.Sim.Tests/SitesContentTests.cs@@ -7,7 +7,7 @@ using Statecraft.Sim;using YamlDotNet.Serialization;/// <summary>The designated sites (Phase 1 PR 5, Task 5.1): content/sites.yaml holds sourced facts only (the site, its names,-/// hex, founding date and sources); the build turns and cost are placeholders in MvpSlice.Overlay or test fixtures (ruling 2).+/// hex, founding date and sources); the build turns and cost are labelled design values in rules.yaml mvp: (Q-CUT-1, R-LOOP-005)./// The loader reads sites.yaml only when systems.loop is gdd, so the legacy content hash does not move.</summary>public class SitesContentTests{@@ -30,7 +30,8 @@ public class SitesContentTests[Fact]public void TheLegacyLoopReadsNoSites(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ // The legacy loop (a fixture since the cutover), with a sites file next to it that it must not read.+ var c = ContentLoader.Load(Fixture.Write(new Dictionary<string, string> { ["sites.yaml"] = Fixture.GddSites }));Assert.Empty(c.Sites);}@@ -39,7 +40,7 @@ public class SitesContentTests[Fact]public void TheSliceHasMefalsimFromContent(){- var c = MvpSlice.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(RealContentTests.ContentRoot());var site = Assert.Single(c.Sites);Assert.Equal(("mefalsim", "Mefalsim", "מפלסים", -10, 27), (site.Id, site.Name, site.NameHe, site.Q, site.R));Assert.Equal(new[] { "yishuv" }, site.Kinds);@@ -49,7 +50,7 @@ public class SitesContentTestsAssert.Contains(site.Sources, s => s.Url.StartsWith("https://israelalbum.org.il/", StringComparison.Ordinal));Assert.All(site.Sources, s => Assert.NotEqual(default, s.Checked));var mvp = c.RulesAt(c.Eras[0].From).Mvp!;- Assert.Equal((6, 2.0), (mvp.BuildYishuvTurns, mvp.BuildYishuvCost)); // PLACEHOLDER: owner sets (MvpSlice.Overlay)+ Assert.Equal((6, 2.0), (mvp.BuildYishuvTurns, mvp.BuildYishuvCost)); // design values (rules.yaml mvp:, R-LOOP-005)Assert.Equal(0, c.Rules.AttentionCost["pioneer_work"]); // D-A6: unit orders are freeAssert.Equal(0, c.Rules.AttentionCost["stop_work"]);}@@ -63,19 +64,17 @@ public class SitesContentTestsvar root = RealContentTests.ContentRoot();var map = new DeserializerBuilder().Build().Deserialize<Dictionary<string, object>>(File.ReadAllText(Path.Combine(root, "map", "armistice_hexes_1949.yaml")));var lineHexes = ((List<object>)map["line_hexes"]).Cast<List<object>>().Select(x => (int.Parse((string)x[0], CultureInfo.InvariantCulture), int.Parse((string)x[1], CultureInfo.InvariantCulture)));- var site = Assert.Single(MvpSlice.Load(root).Sites);+ var site = Assert.Single(ContentLoader.Load(root).Sites);Assert.Contains((site.Q, site.R), lineHexes);}[Fact]- public void NoBalanceValueIsUnderContent()+ public void TheSitesFileHoldsNoBalanceValue(){- var root = RealContentTests.ContentRoot();- var sites = File.ReadAllText(Path.Combine(root, "sites.yaml"));+ // sites.yaml is sourced facts; the build turns and cost are design values in rules.yaml mvp: since the cutover+ // (Q-CUT-1), listed and tagged under DesignValuesTests (R-LOOP-005).+ var sites = File.ReadAllText(Path.Combine(RealContentTests.ContentRoot(), "sites.yaml"));Assert.DoesNotMatch(@"(?m)^[^#\n]*\b\w*(turns|cost)\w*\s*:|build_yishuv", sites); // no such key outside a comment- var overrides = Directory.Exists(Path.Combine(root, "rules")) ? Directory.GetFiles(Path.Combine(root, "rules"), "*.yaml") : new string[0];- foreach (var f in new[] { "rules.yaml" }.Concat(overrides.Select(x => "rules/" + Path.GetFileName(x))))- Assert.DoesNotMatch(@"build_yishuv|pioneer_work|stop_work", File.ReadAllText(Path.Combine(root, f)));}static string Site(string replace, string with) => Fixture.GddSites.Replace(replace, with);diff --git a/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs b/sim/Statecraft.Sim.Tests/SliceSmokeTests.csindex 551a7189a..e4f47a52a 100644--- a/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs+++ b/sim/Statecraft.Sim.Tests/SliceSmokeTests.cs@@ -24,18 +24,31 @@ public class SliceSmokeTestsstatic readonly Content Real = ContentLoader.Load(RealContentTests.ContentRoot());/// <summary>docs/determinism.md: the WebGL smoke (?smoke=5) ends here; its policy is FirstOption.</summary>- static string WebSmoke5 => "SMOKE OK 5 turns 1948-06-19 " + GoldenManifest.Expected("smoke5");+ static string WebSmoke5 => "SMOKE OK 5 turns 1948-10-15 " + GoldenManifest.Expected("smoke5");static readonly Regex IsoDate = new Regex(@"\d{4}-\d{2}-\d{2}");delegate List<Command> Policy(Content c, GameState s, int turn);- /// <summary>What GameRoot.Smoke does: answer each open event, in the card's order, with its first option button.</summary>- static List<Command> FirstOption(Content c, GameState s, int turn) =>- s.PendingEvents.Select(id => c.Events.First(e => e.Id == id))- .Select(e => (Command)new ChooseEventOption(e.Id, e.Options[0].Id)).ToList();+ /// <summary>What GameRoot.Smoke does: answer each open event, in the card's order, with its first option button, while+ /// the turn's Attention pays for an answer; the rest go to their ministers at the turn's end.</summary>+ static List<Command> FirstOption(Content c, GameState s, int turn)+ {+ var answers = new List<Command>();+ 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;+ left -= price;+ answers.Add(cmd);+ }+ return answers;+ }- static List<Command> Historical(Content c, GameState s, int turn) => HistoricalAI.Commands(c, s).ToList();+ /// <summary>The golden runs' player (GoldenRun.Orders): HistoricalAI's orders, then the reference player's GDD orders.</summary>+ static List<Command> Historical(Content c, GameState s, int turn) => GoldenRun.Orders(c, s).ToList();/// <summary>A player who uses every UI order: the event card's first options, then (in turn) an appointment, a/// budget change, a call-up change, a map build and a security-level change, each only when the sim's own check@@ -215,7 +228,7 @@ public class SliceSmokeTests{Assert.True(run.Failures.Count == 0, $"{name}: {run.Failures.Count} invariant failures:\n" + string.Join("\n", run.Failures.Take(60)));Assert.True(run.Final.Date >= GoldenRun.Until1952, $"{name}: the run stopped on {PlayerText.Date(run.Final.Date)} (game over: {run.Final.GameOver})");- Assert.Null(run.Final.GameOver);+ Assert.True(run.Final.GameOver == null || run.Final.GameOver == GameOverCodes.MvpEnded, $"{name}: game over: {run.Final.GameOver}"); // only the game's own end (R-LOOP-004)Assert.Equal(straight.Hashes, run.Hashes); // reloading every turn changes nothing}@@ -242,7 +255,7 @@ public class SliceSmokeTestsvar clock = Stopwatch.StartNew();var run = Play(Real, Historical, reload: true, PlayerTextTests.LeakGuard(Real));AssertClean("historical", run, Play(Real, Historical, reload: false, guard: null));- Assert.True(run.QueueRefusals.Count == 0, "HistoricalAI sent an order the UI would refuse:\n" + string.Join("\n", run.QueueRefusals));+ Assert.True(run.QueueRefusals.Count == 0, "the reference player sent an order the UI would refuse:\n" + string.Join("\n", run.QueueRefusals));Assert.Equal(GoldenRun.Hash1952, run.Final.Hash());Assert.True(clock.Elapsed < TimeSpan.FromMinutes(1), $"took {clock.Elapsed}");}diff --git a/sim/Statecraft.Sim.Tests/TrainingTests.cs b/sim/Statecraft.Sim.Tests/TrainingTests.csindex 033b7444d..e672287bc 100644--- a/sim/Statecraft.Sim.Tests/TrainingTests.cs+++ b/sim/Statecraft.Sim.Tests/TrainingTests.cs@@ -6,7 +6,7 @@ using Statecraft.Sim;/// and a Hakhshara, and the cohorts' progress in TurnResolver (R-TRAIN-003, step 4 of spec 2026-10-12 section 2.3, D-A6).</summary>public class TrainingTests{- static readonly Content Mvp = MvpSlice.Load(RealContentTests.ContentRoot());+ static readonly Content Mvp = ContentLoader.Load(RealContentTests.ContentRoot());/// <summary>The GDD fixture's town: 10 civilians, 6 of them employed, so 4 without work. The fixture's recruit trains for 2/// turns at 0.5 a group, its halutz for 3 turns at 0.25.</summary>@@ -115,9 +115,9 @@ public class TrainingTests[Fact]public void TheLegacyLoopRefusesBothOrdersAndRefundsAttention(){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the legacy loop (a fixture since the cutover)var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);- var r = Step(c, s, new Train("tel_aviv", "recruit", 1), new CancelTraining(0));+ var r = Step(c, s, new Train("town_a", "recruit", 1), new CancelTraining(0));Assert.All(r.Rejected, x => Assert.Equal("That order is not available in this game", x.Reason));Assert.Equal(2, r.Rejected.Count);Assert.Equal(Step(c, s).State.Hash(), r.State.Hash());diff --git a/sim/Statecraft.Sim.Tests/TurnLengthsTests.cs b/sim/Statecraft.Sim.Tests/TurnLengthsTests.csindex 2c6a4cf33..3d7702347 100644--- a/sim/Statecraft.Sim.Tests/TurnLengthsTests.cs+++ b/sim/Statecraft.Sim.Tests/TurnLengthsTests.cs@@ -16,7 +16,7 @@ public class TurnLengthsTests[InlineData(4, TurnLength.Month)] [InlineData(5, TurnLength.Week)]public void TheDefaultReproducesTheLegacyTable(int rung, TurnLength expected){- var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var c = ContentLoader.Load(Fixture.Write()); // the fixture has no turn_lengths; the real game sets all month (CutoverTests)Assert.Equal(expected, SecuritySystem.TurnLengthFor(c, c.Rules.Start, rung));Assert.Equal(SecuritySystem.TurnLengthFor(rung), SecuritySystem.TurnLengthFor(c, c.Rules.Start, rung));}diff --git a/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs b/sim/Statecraft.Sim.Tests/WarEvents1948Tests.csindex 17458c536..6bb6abcd4 100644--- a/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs+++ b/sim/Statecraft.Sim.Tests/WarEvents1948Tests.cs@@ -11,9 +11,9 @@ public class WarEvents1948Testsstatic readonly DateTime Start = new DateTime(1948, 5, 15);static readonly DateTime EgyptArmistice = new DateTime(1949, 2, 24);- /// <summary>Most consecutive turns of the historical run, before the Egyptian armistice card, that raise no card- /// (controller ruling, fix round 1, I7).</summary>- const int MaxEmptyTurns = 4;+ /// <summary>The longest time, in months, from one card of the historical run to the next, up to the Egyptian armistice+ /// card. Controller ruling, fix round 1, I7, restated in months: owner decision of 15 October 2026 (Q-CUT-8, "6 months,+ /// 2 in wartime", #375).</summary>static DateTime D(int y, int m, int d) => new DateTime(y, m, d);@@ -25,28 +25,33 @@ public class WarEvents1948Tests("idf_founding", "one_army", null, "defense_minister", "ben_gurion", 2, D(1948, 5, 26)), // order signed (§3a)("first_truce", "accept", null, "prime_minister", "ben_gurion", 2, D(1948, 6, 10)), // acceptance sent (§1)("altalena", "enforce", null, "defense_minister", "ben_gurion", 2, D(1948, 6, 20)), // force authorised (§2)- ("ten_days", "central_front", 5, "defense_minister", "ben_gurion", 2, D(1948, 7, 9)), // Dani begins (§4)+ ("ten_days", "central_front", 5, "defense_minister", "ben_gurion", 2, D(1948, 7, 18)), // the second truce ends the fighting (§4, §5)("second_truce", "comply", 4, "prime_minister", "ben_gurion", 2, D(1948, 7, 18)), // truce in force (§5)("jerusalem_military_government", "military_government", null, "prime_minister", "ben_gurion", 2, D(1948, 8, 2)),- ("bernadotte_assassination", "outlaw", null, "prime_minister", "ben_gurion", 2, D(1948, 9, 20)), // ultimatum (§6)+ ("bernadotte_assassination", "outlaw", null, "prime_minister", "ben_gurion", 2, D(1948, 9, 23)), // ordinance adopted (§6)("latrun_proposal", "accept_vote", null, "prime_minister", "ben_gurion", 2, D(1948, 9, 26)), // cabinet vote (§13a)("operation_yoav", "stop_at_ceasefire", 5, "defense_minister", "ben_gurion", 2, D(1948, 10, 22)), // Hebron refused, cease-fire (§7)- ("operation_hiram", "launch", 5, "defense_minister", "ben_gurion", 3, D(1948, 10, 28)), // launched night of 28-29 Oct (§8)- ("jerusalem_ceasefire", "sign", null, "prime_minister", "ben_gurion", 2, D(1948, 11, 30)), // signed (§13b)+ ("operation_hiram", "stop_at_ceasefire", 5, "defense_minister", "ben_gurion", 2, D(1948, 10, 31)), // cease-fire (§8)+ ("jerusalem_ceasefire", "keep", null, "prime_minister", "ben_gurion", 2, D(1948, 11, 30)), // signed (§13b)("operation_horev", "launch", 5, "defense_minister", "ben_gurion", 2, D(1948, 12, 22)), // launched (§9)- ("sinai_withdrawal", "withdraw", null, "prime_minister", "ben_gurion", 2, D(1949, 1, 1)), // orders given (§9, FRUS d341)+ ("sinai_withdrawal", "withdraw", null, "prime_minister", "ben_gurion", 2, D(1949, 1, 2)), // withdrawn (§9, FRUS d371)("rhodes_talks", "send_delegation", null, "foreign_minister", "sharett", 2, D(1949, 1, 13)), // talks open (§9)("elections_1949", "hold", null, "prime_minister", "ben_gurion", 1, D(1949, 1, 25)), // the vote (§11)};- /// <summary>Cards allowed to reach the player after DecidedBy, and why.</summary>- static readonly Dictionary<string, string> LateByDesign = new Dictionary<string, string>+ /// <summary>Cards allowed to reach the player up to Days after DecidedBy, and why (owner decision, 15 October 2026, #567:+ /// on monthly turns no turn date falls between the fact each card states and the decision).</summary>+ static readonly Dictionary<string, (int Days, string Why)> LateByDesign = new Dictionary<string, (int, string)>{- // The facts that make the ultimatum (Sinai crossing 28 Dec, UN call 29 Dec, US message 30 Dec) come after the- // Horev card's turn, so the card can only come one turn later, a day after the orders (review M6).- ["sinai_withdrawal"] = "facts of 28-30 Dec cannot be stated on the 26 Dec turn",+ ["first_truce"] = (5, "no monthly turn date between the resolution of 29 May and the acceptance of 10 June"),+ ["rhodes_talks"] = (2, "it needs Horev answered, so it comes on 15 January, after the talks opened on 13 January"),};+ /// <summary>Cards that are decisions after the fact (owner decision, 15 October 2026, #567): their text states what+ /// happened, so the card must come on or after DecidedBy, the last fact it states.</summary>+ static readonly HashSet<string> AfterTheFact = new HashSet<string>+ { "bernadotte_assassination", "operation_hiram", "jerusalem_ceasefire", "sinai_withdrawal" };+/// <summary>Follow-up events and the earlier choice they depend on (review I2).</summary>public static readonly (string Id, string Event, string Option)[] Chains ={@@ -149,13 +154,16 @@ public class WarEvents1948Tests/// <summary>Plays to March 1949 with HistoricalAI, except that <paramref name="pick"/> may choose another option.</summary>static List<Turn> Play(Func<string, string?>? pick = null){- var turns = new List<Turn>();var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ // The first entry is the new game: a card raised on 15 May 1948 (idf_founding) comes then.+ var turns = new List<Turn> { new Turn { Start = s.Date, End = s.Date, Raised = s.FiredEvents.ToList(), RungAfter = s.Rung } };while (s.Date < new DateTime(1949, 3, 1) && s.GameOver == null){- var commands = HistoricalAI.Commands(C, s)- .Select(c => c is ChooseEventOption o && pick?.Invoke(o.EventId) is string other ? new ChooseEventOption(o.EventId, other) : c)- .ToList();+ // A picked answer goes first, so it is never the card left to the minister when Attention runs out (on monthly+ // turns 15 July 1948 brings three cards and full war prices each at 2 of the 4).+ var picked = s.PendingEvents.Where(id => pick?.Invoke(id) != null).Select(id => (Command)new ChooseEventOption(id, pick!(id)!)).ToList();+ var commands = picked.Concat(HistoricalAI.Commands(C, s)+ .Where(c => !(c is ChooseEventOption o && picked.OfType<ChooseEventOption>().Any(p => p.EventId == o.EventId)))).ToList();var step = Simulation.Step(C, s, commands);turns.Add(new Turn{@@ -171,7 +179,11 @@ public class WarEvents1948Tests/// <summary>The date of the card for <paramref name="id"/>: the end of the turn that raised it.</summary>static DateTime CardDate(string id) =>- Run.FirstOrDefault(t => t.Raised.Contains(id))?.End ?? throw new Xunit.Sdk.XunitException($"{id} never fired in the historical run");+ AtStart.Contains(id) ? Start+ : Run.FirstOrDefault(t => t.Raised.Contains(id))?.End ?? throw new Xunit.Sdk.XunitException($"{id} never fired in the historical run");++ /// <summary>The cards the new game raises on its first day (idf_founding opens on 15 May).</summary>+ static readonly HashSet<string> AtStart = new HashSet<string>(Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical).FiredEvents);/// <summary>The card reaches the player in a turn that starts by the historical decision (review I1, I7).</summary>[Theory]@@ -182,8 +194,10 @@ public class WarEvents1948Testsvar card = CardDate(id);var e = Get(id);Assert.True(card >= e.From && card < e.To!.Value.AddDays(31), $"{id}: card {card:yyyy-MM-dd} far from its window");- if (LateByDesign.TryGetValue(id, out var why))- Assert.True(card <= row.DecidedBy.AddDays(1), $"{id}: card {card:yyyy-MM-dd}, more than a day after {row.DecidedBy:yyyy-MM-dd} ({why})");+ if (AfterTheFact.Contains(id))+ Assert.True(card >= row.DecidedBy, $"{id}: card {card:yyyy-MM-dd}, before the facts of {row.DecidedBy:yyyy-MM-dd} it states");+ else if (LateByDesign.TryGetValue(id, out var late))+ Assert.True(card <= row.DecidedBy.AddDays(late.Days), $"{id}: card {card:yyyy-MM-dd}, more than {late.Days} days after {row.DecidedBy:yyyy-MM-dd} ({late.Why})");elseAssert.True(card <= row.DecidedBy, $"{id}: card {card:yyyy-MM-dd}, after the historical decision of {row.DecidedBy:yyyy-MM-dd}");}@@ -200,41 +214,43 @@ public class WarEvents1948Tests[Fact]public void TheHistoricalRunMovesThroughTheTruces(){- int After(string id) => Run.Single(t => t.Start == CardDate(id)).RungAfter;+ int After(string id) => Run.Single(t => t.Start == CardDate(id) && t.End > t.Start).RungAfter; // the turn answering the cardAssert.Equal(4, After("second_truce")); // the second truce: monthly turnsAssert.Equal(5, After("operation_yoav")); // Yoav ends itAssert.Equal(5, After("sinai_withdrawal")); // full war until the armistice with Egypt}- /// <summary>Two events whose historical options set different security levels must never be answered on the same- /// turn: the order the player presses them in would decide the level.</summary>+ /// <summary>Two cards whose historical options set different security levels may come on the same turn on monthly turns+ /// (15 July 1948: ten_days at 5 and second_truce at 4). Answered in the card's order (window start, then id), the turn+ /// must end at the level of the decision taken last in history (on the same day, the card answered last), so the historical+ /// run keeps the historical level.</summary>[Fact]- public void NoTurnOfTheHistoricalRunAsksForTwoDifferentSecurityLevels()+ public void ATurnAskingForTwoSecurityLevelsEndsAtTheLaterDecisionsLevel(){- foreach (var t in Run)+ for (int i = 0; i + 1 < Run.Count; i++){- var rungs = t.Raised.Where(id => Events.Any(x => x.Id == id)).Select(id => Events.Single(x => x.Id == id).Rung)- .Where(x => x.HasValue).Distinct().ToList();- Assert.True(rungs.Count <= 1, $"card {t.End:yyyy-MM-dd} asks for levels {string.Join(", ", rungs)}");+ var rows = Run[i].Raised.Select(id => Events.SingleOrDefault(x => x.Id == id)).Where(x => x.Id != null && x.Rung.HasValue).ToList();+ if (rows.Select(x => x.Rung).Distinct().Count() <= 1) continue;+ // Decided last in history; on the same day, the card answered last (the card order: window start, then id).+ var last = rows.OrderBy(x => x.DecidedBy).ThenBy(x => Get(x.Id).From).ThenBy(x => x.Id, StringComparer.Ordinal).Last();+ Assert.True(last.Rung == Run[i + 1].RungAfter, $"card {Run[i].End:yyyy-MM-dd}: the turn ends at level {Run[i + 1].RungAfter}, not {last.Rung} ({last.Id}, decided last)");}}- /// <summary>Playtest 1 E: counted in turns of the historical run, from the start to the Egyptian armistice card, no- /// more than MaxEmptyTurns consecutive turns raise no card (review I7, I8).</summary>+ /// <summary>R-TURN-003 in the war period: no more than 2 months pass from one card to the next while the country is at+ /// full war on any turn of the stretch (owner, 15 October 2026: "Full-war level = wartime", SecuritySystem.AtFullWar), the+ /// same rule and predicate as EventRetimingTests.NoLongStretchWithoutACard, on the golden run up to March 1949.</summary>+ // R-TURN-003[Fact]- public void NoLongStretchOfTurnsWithoutACard()+ public void NoLongStretchWithoutACard(){- var armistice = Run.FindIndex(t => t.Raised.Contains("armistice_egypt"));- Assert.True(armistice > 0, "the Egyptian armistice never fired");- int empty = 0;- var stretches = new List<string>();- for (int i = 0; i <= armistice; i++)- {- if (Run[i].Raised.Count == 0) { empty++; continue; }- if (empty > MaxEmptyTurns) stretches.Add($"{empty} turns ending {Run[i - 1].End:yyyy-MM-dd}");- empty = 0;- }- Assert.True(stretches.Count == 0, "empty stretches: " + string.Join("; ", stretches));+ var s = Simulation.NewGame(C, GoldenRun.Seed, Mode.Historical);+ var run = new List<GameState> { s };+ while (s.Date < new DateTime(1949, 3, 1) && s.GameOver == null) { s = Simulation.Step(C, s, GoldenRun.Orders(C, s)).State; run.Add(s); }+ var war = EventRetimingTests.Gaps(run).Where(g => g.AtWar).ToList();+ Assert.NotEmpty(war);+ var bad = war.Where(EventRetimingTests.TooLong).Select(g => $"{g.From:yyyy-MM-dd} to {g.To:yyyy-MM-dd}").ToList();+ Assert.True(bad.Count == 0, "stretches at full war without a card: " + string.Join("; ", bad));}/// <summary>A follow-up card never fires when the player chose otherwise earlier (review I2).</summary>diff --git a/sim/Statecraft.Sim.Tests/golden/hash1950.txt b/sim/Statecraft.Sim.Tests/golden/hash1950.txtindex 3d2c15b42..4ad2c2d6f 100644--- a/sim/Statecraft.Sim.Tests/golden/hash1950.txt+++ b/sim/Statecraft.Sim.Tests/golden/hash1950.txt@@ -1,28 +1,28 @@-1950-02-27;1948;Historical;35;+1950-01-15;1948;Historical;20;ind{- food_supply=0.8475 [3FEB1EB851EB851F]- housing=0.4330532365826626 [3FDBB724EC232ACA]- intl_standing=0.8400000000000003 [3FEAE147AE147AE4]- morale=0.44505666965923585 [3FDC7BCEF84365E2]- security=0.5037912258539358 [3FE01F0EC6E1BDAD]+ food_supply=0.8886718750000001 [3FEC700000000001]+ housing=0.43452919104400284 [3FDBCF53862C3EB9]+ intl_standing=0.8100000000000003 [3FE9EB851EB851EE]+ morale=0.4254696853969594 [3FDB3AE5340E09D2]+ security=0.5042220244102726 [3FE022963A187B2A]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=0 [0000000000000000]rationing=1 [3FF0000000000000]eff{- border_villages_secure=0.03879122585393575 [3FA3DC718CD42CB9]- building_houses=0.08305323658266262 [3FB542FA16F31190]- homes_lift_morale=0.06474706472362149 [3FB093437D7FFCB2]- rationing_feeds=0.2975 [3FD30A3D70A3D70A]+ border_villages_secure=0.03922202441027243 [3FA414E8C040046D]+ building_houses=0.08452919104400287 [3FB5A3B47F17614D]+ homes_lift_morale=0.06510191087455454 [3FB0AA84D21D0271]+ rationing_feeds=0.33867187500000007 [3FD5ACCCCCCCCCCE]rationing_grates=-0.15 [BFC3333333333333]- safety_lifts_morale=0.05030960493561433 [3FA9C22E37BF0CB2]+ safety_lifts_morale=0.050367774522404846 [3FA9C9CE10B12AF4]shift{food_supply=0.15000000000000002 [3FC3333333333334]housing=0 [0000000000000000]- intl_standing=0.3400000000000003 [3FD5C28F5C28F5C8]- morale=-0.07000000000000006 [BFB1EB851EB851F0]- security=0.16500000000000004 [3FC51EB851EB8520]+ intl_standing=0.3100000000000003 [3FD3D70A3D70A3DC]+ morale=-0.09000000000000008 [BFB70A3D70A3D710]+ security=0.16500000000000015 [3FC51EB851EB8524]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -33,19 +33,19 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=52054.01585594315 [40E96AC081E452A9]- america_oceania=2229.985467792672 [40A16BF88F3C0993]- asia=86153.10721742504 [40F50891B7299E62]- europe=214207.90382761517 [410A25FF3B09F903]- unknown=18488.77061889312 [40D20E3151D1E7E8]- veterans=669284.2678813029 [41246CC88927BCF6]+ africa=48923.0534756348 [40E7E361B61288D3]+ america_oceania=1997.5820321044844 [409F3654003957EE]+ asia=79306.74669995306 [40F35CABF27BA665]+ europe=204367.90335393153 [4108F27F3A11A045]+ unknown=18021.68780893306 [40D1996C050FC259]+ veterans=667938.2378207468 [4124624479C3A414]sit[treasury=0 [0000000000000000]-debt=97.88494849189715 [405878A2FEFFD5F0]-fx=88.29485501614538 [405612DEE792D9FB]+debt=68.95239590417494 [40513CF40DF351A5]+fx=94.52989672613671 [4057A1E9D3F540F0]rung=2;cf=0;mob=0.05 [3FA999999999999A]-stab=0.507928756679837 [3FE040F3CED46932]+stab=0.5122628429406425 [3FE064750BAC5A79]att=4 [4010000000000000]fired[altalena@@ -82,10 +82,10 @@ chosen{elections_1949=holdfirst_truce=acceptidf_founding=one_army- jerusalem_ceasefire=sign+ jerusalem_ceasefire=keepjerusalem_military_government=military_governmentlatrun_proposal=accept_vote- operation_hiram=launch+ operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefirerhodes_talks=send_delegation@@ -96,4 +96,12 @@ appt{under=;map[mapturn=0001-01-01:0;-over=\ No newline at end of file+over=+city{+ tel_aviv=120,90,120,90,327+coh=0.5148601398601399 [3FE079BBF8D6D33F]+units[+ 1:halutz@-3,19+site{+ mefalsim=done,1949-06-15+next=2\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/hash1952.txt b/sim/Statecraft.Sim.Tests/golden/hash1952.txtindex f04557e01..0e9b0166f 100644--- a/sim/Statecraft.Sim.Tests/golden/hash1952.txt+++ b/sim/Statecraft.Sim.Tests/golden/hash1952.txt@@ -1,28 +1,28 @@-1952-02-27;1948;Historical;43;+1952-01-15;1948;Historical;44;ind{- food_supply=0.839833984375 [3FEADFEB851EB852]- housing=0.43485009819364695 [3FDBD4958199DCD0]- intl_standing=0.8300000000000003 [3FEA8F5C28F5C292]- morale=0.4597343174015912 [3FDD6C497C85AD8E]- security=0.5352660109379224 [3FE120E62F7470AE]+ food_supply=0.8566666665875042 [3FEB69D036922222]+ housing=0.43504947742483624 [3FDBD7D9C36B9EB6]+ intl_standing=0.7800000000000002 [3FE8F5C28F5C28F8]+ morale=0.4388039705804806 [3FDC155D3FBFE10A]+ security=0.5361322526321604 [3FE127FED36C599C]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=1 [3FF0000000000000]rationing=1 [3FF0000000000000]eff{- border_villages_secure=0.04026601093792225 [3FA49DBF203CCD5F]- building_houses=0.084850098193647 [3FB5B8BC6CCDD9AA]- homes_lift_morale=0.06665100052742542 [3FB1100A3B82CEFE]- rationing_feeds=0.339833984375 [3FD5BFD70A3D70A4]+ border_villages_secure=0.04113225263216018 [3FA50F495FBB5C36]+ building_houses=0.08504947742483629 [3FB5C5CD7414E142]+ homes_lift_morale=0.06526319974146688 [3FB0B516CC859C48]+ rationing_feeds=0.3399999999208376 [3FD5C28F5C133334]rationing_grates=-0.15 [BFC3333333333333]- safety_lifts_morale=0.053083316874165815 [3FAB2DBC8BE02064]+ safety_lifts_morale=0.05354077083901369 [3FAB69B227832BE6]shift{- food_supply=0.09999999999999998 [3FB9999999999998]+ food_supply=0.11666666666666659 [3FBDDDDDDDDDDDD8]housing=0 [0000000000000000]- intl_standing=0.3300000000000003 [3FD51EB851EB8524]- morale=-0.06000000000000005 [BFAEB851EB851EC0]- security=0.19500000000000012 [3FC8F5C28F5C28FA]+ intl_standing=0.28000000000000025 [3FD1EB851EB851F0]+ morale=-0.08000000000000007 [BFB47AE147AE1480]+ security=0.19500000000000017 [3FC8F5C28F5C28FC]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -33,20 +33,20 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=97023.87456738956 [40F7AFFDFE3A6005]- america_oceania=5293.427260779819 [40B4AD6D60F66430]- asia=243201.36816545296 [410DB00AF200BAA0]- europe=339252.8124862721 [4114B4D33FFC66BC]- unknown=25479.920679861305 [40D8E1FAEC6B3999]- veterans=692243.4377982062 [41252026E0271624]+ africa=96949.99317400213 [40F7AB5FE40A6C26]+ america_oceania=5289.453220790847 [40B4A97406471A8E]+ asia=243048.8631066492 [410DAB46E7A4757A]+ europe=338908.0345349915 [4114AF70235D240C]+ unknown=25443.180026717586 [40D8D8CB858EC81C]+ veterans=690883.9968027371 [41251587FE5CEDA9]sit[fx_crisistreasury=0 [0000000000000000]-debt=198.45839469313046 [4068CEAB2B58F4F8]-fx=-36.80544499186334 [C0426718D24D63D8]+debt=157.01852642452684 [4063A097C4BA6E8C]+fx=-12.990431328096559 [C029FB19D0A63796]rung=2;cf=0;mob=0.05 [3FA999999999999A]-stab=0.5164021806898154 [3FE0865DDDB4AAB8]+stab=0.5095235022822947 [3FE04E043B5B1119]att=4 [4010000000000000]fired[altalena@@ -99,13 +99,13 @@ chosen{idf_founding=one_armyiraqi_exodus=airliftisrael_bonds=launch- jerusalem_ceasefire=sign+ jerusalem_ceasefire=keepjerusalem_military_government=military_governmentlatrun_proposal=accept_votelaw_of_return=enactmaabarot_policy=maabarotministry_supply_crisis=restructure- operation_hiram=launch+ operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefirereparations_claim=claim@@ -117,4 +117,12 @@ appt{under=;map[mapturn=0001-01-01:0;-over=\ No newline at end of file+over=mvp_ended+city{+ tel_aviv=120,90,120,90,666+coh=0.45212082262210795 [3FDCEF8C2CC02A1E]+units[+ 1:halutz@-3,19+site{+ mefalsim=done,1949-06-15+next=2\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txtindex 7cf7ad6aa..d41a7a45d 100644--- a/sim/Statecraft.Sim.Tests/golden/manifest.txt+++ b/sim/Statecraft.Sim.Tests/golden/manifest.txt@@ -2,10 +2,10 @@# Tests read this file. To accept a deliberate change: STATECRAFT_UPDATE_GOLDEN=1 dotnet test sim/Statecraft.sln# rewrites this file, the snapshots and the GoldenRun.cs constants; then update docs/determinism.md and tools/web_check.py# (GoldenManifestTests names any place that is out of date) and add a row to the rebaseline history.-hash1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07-hash1952 62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8-smoke5 d3fdd459ddb876bd8d775c20edd1202cf56ca7134a8ad06f873d4d92034aa5b6-scenario-reckless c0bd12bc481a9f2dbeea19aebc981d5347caa1e1cf2e6fd5a5acdf107f2f9045-scenario-cautious 1d5b8d7126160021963537f2a198e377b27d478f522e8c6be63babe9e1b8f482-mvp-slice ec6f8c8039ddb276487c80e72397c0f7127b18875b5b81fc865b90eb3e851742-scenario-mvp-absorb-first 59ea3181e219ef3facbe6b5b76910b96d5c3feced0beeecd29d932295511f9fe+hash1950 f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2+hash1952 75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31+smoke5 85191d48688be4595726b17778ecdda0175eff8f6f0fa1d976dbe3b48b42823b+scenario-reckless e2f409a5382ea0ba01526123457a76ef3450ee242d1f7b7868b7a483abe149fa+scenario-cautious 58eb01db2e149f629bc298e9139441c5e9252d830f22908c7c888db55d167de0+scenario-mvp-absorb-first f8858f6ec1c263c1e7bae1542439c9d7358bc4caa39bc45276c4c3b93d0c0bb1+mvp-end 75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31diff --git a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt b/sim/Statecraft.Sim.Tests/golden/mvp-end.txtnew file mode 100644index 000000000..0e9b0166f--- /dev/null+++ b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt@@ -0,0 +1,128 @@+1952-01-15;1948;Historical;44;+ind{+ food_supply=0.8566666665875042 [3FEB69D036922222]+ housing=0.43504947742483624 [3FDBD7D9C36B9EB6]+ intl_standing=0.7800000000000002 [3FE8F5C28F5C28F8]+ morale=0.4388039705804806 [3FDC155D3FBFE10A]+ security=0.5361322526321604 [3FE127FED36C599C]+pol{+ border_settlement=0.2 [3FC999999999999A]+ housing_construction=0.3 [3FD3333333333333]+ maabarot=1 [3FF0000000000000]+ rationing=1 [3FF0000000000000]+eff{+ border_villages_secure=0.04113225263216018 [3FA50F495FBB5C36]+ building_houses=0.08504947742483629 [3FB5C5CD7414E142]+ homes_lift_morale=0.06526319974146688 [3FB0B516CC859C48]+ rationing_feeds=0.3399999999208376 [3FD5C28F5C133334]+ rationing_grates=-0.15 [BFC3333333333333]+ safety_lifts_morale=0.05354077083901369 [3FAB69B227832BE6]+shift{+ food_supply=0.11666666666666659 [3FBDDDDDDDDDDDD8]+ housing=0 [0000000000000000]+ intl_standing=0.28000000000000025 [3FD1EB851EB851F0]+ morale=-0.08000000000000007 [BFB47AE147AE1480]+ security=0.19500000000000017 [3FC8F5C28F5C28FC]+bud{+ agriculture_minister=0.07 [3FB1EB851EB851EC]+ defense_minister=0.45 [3FDCCCCCCCCCCCCD]+ education_minister=0.06 [3FAEB851EB851EB8]+ finance_minister=0.05 [3FA999999999999A]+ health_minister=0.07 [3FB1EB851EB851EC]+ interior_minister=0.05 [3FA999999999999A]+ labour_minister=0.1 [3FB999999999999A]+ prime_minister=0.15 [3FC3333333333333]+pop{+ africa=96949.99317400213 [40F7AB5FE40A6C26]+ america_oceania=5289.453220790847 [40B4A97406471A8E]+ asia=243048.8631066492 [410DAB46E7A4757A]+ europe=338908.0345349915 [4114AF70235D240C]+ unknown=25443.180026717586 [40D8D8CB858EC81C]+ veterans=690883.9968027371 [41251587FE5CEDA9]+sit[+ fx_crisis+treasury=0 [0000000000000000]+debt=157.01852642452684 [4063A097C4BA6E8C]+fx=-12.990431328096559 [C029FB19D0A63796]+rung=2;cf=0;+mob=0.05 [3FA999999999999A]+stab=0.5095235022822947 [3FE04E043B5B1119]+att=4 [4010000000000000]+fired[+ altalena+ armistice_egypt+ armistice_jordan+ armistice_lebanon+ armistice_syria+ austerity_1949+ bernadotte_assassination+ clothing_rationing_1950+ education_registration_1951+ elections_1949+ first_truce+ forex_crisis_1951+ frumkin_commission+ hula_drainage+ idf_founding+ iraqi_exodus+ israel_bonds+ jerusalem_ceasefire+ jerusalem_military_government+ latrun_proposal+ law_of_return+ maabarot_policy+ ministry_supply_crisis+ operation_hiram+ operation_horev+ operation_yoav+ reparations_claim+ rhodes_talks+ second_truce+ sinai_withdrawal+ ten_days+pending[+chosen{+ altalena=enforce+ armistice_egypt=sign+ armistice_jordan=sign+ armistice_lebanon=sign+ armistice_syria=sign+ austerity_1949=impose+ bernadotte_assassination=outlaw+ clothing_rationing_1950=extend+ education_registration_1951=press_plan+ elections_1949=hold+ first_truce=accept+ forex_crisis_1951=request_aid+ frumkin_commission=inquiry+ hula_drainage=continue_works+ idf_founding=one_army+ iraqi_exodus=airlift+ israel_bonds=launch+ jerusalem_ceasefire=keep+ jerusalem_military_government=military_government+ latrun_proposal=accept_vote+ law_of_return=enact+ maabarot_policy=maabarot+ ministry_supply_crisis=restructure+ operation_hiram=stop_at_ceasefire+ operation_horev=launch+ operation_yoav=stop_at_ceasefire+ reparations_claim=claim+ rhodes_talks=send_delegation+ second_truce=comply+ sinai_withdrawal=withdraw+ ten_days=central_front+appt{+under=;+map[+mapturn=0001-01-01:0;+over=mvp_ended+city{+ tel_aviv=120,90,120,90,666+coh=0.45212082262210795 [3FDCEF8C2CC02A1E]+units[+ 1:halutz@-3,19+site{+ mefalsim=done,1949-06-15+next=2\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/mvp-slice.txt b/sim/Statecraft.Sim.Tests/golden/mvp-slice.txtdeleted file mode 100644index 44d2f6a5f..000000000--- a/sim/Statecraft.Sim.Tests/golden/mvp-slice.txt+++ /dev/null@@ -1,93 +0,0 @@-1949-03-15;1948;Historical;10;-ind{- food_supply=0.4 [3FD999999999999A]- housing=0.4258016169309616 [3FDB40556CD35A85]- intl_standing=0.56 [3FE1EB851EB851EC]- morale=0.6429967672448158 [3FE4936DF4D801B4]- security=0.5103316220092775 [3FE054A2FB549F96]-pol{- border_settlement=0.2 [3FC999999999999A]- housing_construction=0.3 [3FD3333333333333]- maabarot=0 [0000000000000000]- rationing=0 [0000000000000000]-eff{- border_villages_secure=0.03533162200927735 [3FA216FC8216C616]- building_houses=0.0758016169309616 [3FB367BC19B3D07C]- homes_lift_morale=0.06315223190546035 [3FB02ABEA2B40F66]- rationing_feeds=0 [0000000000000000]- rationing_grates=0 [0000000000000000]- safety_lifts_morale=0.049844535339355484 [3FA9853912556D1C]-shift{- food_supply=0 [0000000000000000]- housing=0 [0000000000000000]- intl_standing=0.06000000000000005 [3FAEB851EB851EC0]- morale=-0.020000000000000018 [BF947AE147AE1480]- security=0.17500000000000016 [3FC666666666666C]-bud{- agriculture_minister=0.07 [3FB1EB851EB851EC]- defense_minister=0.45 [3FDCCCCCCCCCCCCD]- education_minister=0.06 [3FAEB851EB851EB8]- finance_minister=0.05 [3FA999999999999A]- health_minister=0.07 [3FB1EB851EB851EC]- interior_minister=0.05 [3FA999999999999A]- labour_minister=0.1 [3FB999999999999A]- prime_minister=0.15 [3FC3333333333333]-pop{- africa=16110.114738040149 [40CF770EAFBC7106]- america_oceania=766.5856652505514 [4087F4AF71434C2D]- asia=19124.004078920254 [40D2AD0042D43B46]- europe=101592.86638564836 [40F8CD8DDCB73297]- unknown=13102.557782002037 [40C9974765669086]- veterans=658603.8958591067 [41241957CAAE0B7A]-sit[-treasury=0 [0000000000000000]-debt=37.47911574995227 [4042BD53AA368592]-fx=87.53820941589427 [4055E27205E7EA92]-rung=5;cf=32;-mob=0.8 [3FE999999999999A]-stab=0.5886393017596533 [3FE2D62216C655E7]-att=4 [4010000000000000]-fired[- altalena- armistice_egypt- bernadotte_assassination- elections_1949- first_truce- idf_founding- jerusalem_ceasefire- jerusalem_military_government- latrun_proposal- operation_hiram- operation_horev- operation_yoav- second_truce- ten_days-pending[- armistice_egypt-chosen{- altalena=enforce- bernadotte_assassination=outlaw- elections_1949=hold- first_truce=accept- idf_founding=one_army- jerusalem_ceasefire=sign- jerusalem_military_government=military_government- latrun_proposal=accept_vote- operation_hiram=launch- operation_horev=launch- operation_yoav=stop_at_ceasefire- second_truce=comply- ten_days=central_front-appt{-under=;-map[-mapturn=0001-01-01:0;-over=-city{- tel_aviv=120,90,120,90,128-coh=0.6358695652173914 [3FE4590B21642C86]-units[- 1:halutz@-3,19-site{- mefalsim=done,1949-03-15-next=2\ 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 bee9cc037..383c4d9f5 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt@@ -1,28 +1,28 @@-1949-01-02;11400714819323200433;Historical;23;+1949-01-15;11400714819323200433;Historical;8;ind{- food_supply=0.47999999046325686 [3FDEB851E147AE15]- housing=0.430217536794174 [3FDB88AF22AC95FB]- intl_standing=0.53 [3FE0F5C28F5C28F6]- morale=0.555200085089712 [3FE1C432F8064B9D]- security=0.5123899107074246 [3FE0657F86A93D6E]+ food_supply=0.47968750000000004 [3FDEB33333333334]+ housing=0.42228343009948727 [3FDB06B1147AE147]+ intl_standing=0.5 [3FE0000000000000]+ morale=0.5295946677017213 [3FE0F270843D46B3]+ security=0.5086917724609377 [3FE04733F7CED918]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=0 [0000000000000000]rationing=0.4 [3FD999999999999A]eff{- border_villages_secure=0.03738991070742455 [3FA324C53760A3AA]- building_houses=0.08021753679417404 [3FB48922F118BE54]- homes_lift_morale=0.06451650621608743 [3FB084275C40121A]- rationing_feeds=0.07999999046325684 [3FB47AE11EB851EC]+ border_villages_secure=0.033691772460937505 [3FA1400C49BA5E36]+ building_houses=0.0722834300994873 [3FB2812AB851EB85]+ homes_lift_morale=0.06197826633453369 [3FAFBB9D85F06F69]+ rationing_feeds=0.07968750000000002 [3FB4666666666668]rationing_grates=-0.06 [BFAEB851EB851EB8]- safety_lifts_morale=0.050683578873624506 [3FA9F332B369B44F]+ safety_lifts_morale=0.04761640136718752 [3FA8612D4D4024B6]shift{food_supply=0 [0000000000000000]housing=0 [0000000000000000]- intl_standing=0.030000000000000027 [3F9EB851EB851EC0]- morale=-0.050000000000000044 [BFA99999999999A0]- security=0.1750000000000001 [3FC666666666666A]+ intl_standing=0 [0000000000000000]+ morale=-0.06999999999999995 [BFB1EB851EB851E8]+ security=0.17500000000000016 [3FC666666666666C]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -33,23 +33,24 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=8340.568207442666 [40C04A48BB057FCC]- america_oceania=484.295801166699 [407E44BB9A011174]- asia=4959.100106786725 [40B35F19A0992F17]- europe=77272.50246069893 [40F2DD880A143AD7]- unknown=11940.192924328829 [40C75218B1BE9176]- veterans=656387.9680859144 [41240807EFA8F4FC]+ africa=9739.110001692712 [40C3058E1489145A]+ america_oceania=535.0499244151753 [4080B8663EC59399]+ asia=7512.155402122331 [40BD5827C86EF924]+ europe=81633.61444656934 [40F3EE19D4C5ED07]+ unknown=12145.947428858311 [40C7B8F945594CDE]+ veterans=656752.739703733 [41240AE17ABA729C]sit[treasury=0 [0000000000000000]-debt=27.683596350238787 [403BAF002B9FF0C8]-fx=79.89481110412456 [4053F94495CB1402]-rung=5;cf=41;+debt=27.14873297663618 [403B26135D467D37]+fx=80.85238326859616 [4054368D728D91CC]+rung=5;cf=40;mob=0.8 [3FE999999999999A]-stab=0.6261214277961791 [3FE4092FCDF6B386]+stab=0.5976373397227674 [3FE31FD8579F498C]att=4 [4010000000000000]fired[altalenabernadotte_assassination+ elections_1949first_truceidf_foundingjerusalem_ceasefire@@ -58,20 +59,23 @@ fired[operation_hiramoperation_horevoperation_yoav+ rhodes_talkssecond_trucesinai_withdrawalten_dayspending[sinai_withdrawal+ rhodes_talks+ elections_1949chosen{altalena=enforcebernadotte_assassination=outlawfirst_truce=acceptidf_founding=one_army- jerusalem_ceasefire=sign+ jerusalem_ceasefire=keepjerusalem_military_government=military_governmentlatrun_proposal=accept_vote- operation_hiram=launch+ operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefiresecond_truce=comply@@ -80,4 +84,7 @@ appt{under=;map[mapturn=0001-01-01:0;-over=\ No newline at end of file+over=+city{+ tel_aviv=120,90,120,80,91+coh=0.6426116838487972 [3FE4904660C50EF4]\ 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 3af0108b6..46a851479 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-mvp-absorb-first.txt@@ -2,9 +2,9 @@ind{food_supply=0.7200000000000001 [3FE70A3D70A3D70B]housing=0.4311483383927494 [3FDB97EF3347C84B]- intl_standing=0.7100000000000002 [3FE6B851EB851EBA]- morale=0.4449244143453166 [3FDC79A440338690]- security=0.510599903035164 [3FE056D59B9C0EC0]+ intl_standing=0.7600000000000002 [3FE851EB851EB854]+ morale=0.4239879519429728 [3FDB229E5CDF8EC0]+ security=0.500599903035164 [3FE004EA167D566E]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]@@ -16,13 +16,13 @@ eff{homes_lift_morale=0.06417065737109631 [3FB06D7CFAC58CD2]rationing_feeds=0.17 [3FC5C28F5C28F5C3]rationing_grates=-0.15 [BFC3333333333333]- safety_lifts_morale=0.05075375697422029 [3FA9FC657CB4F1E7]+ safety_lifts_morale=0.049817294571876544 [3FA981A705EC3DAE]shift{food_supply=0.15000000000000002 [3FC3333333333334]housing=0 [0000000000000000]- intl_standing=0.2100000000000002 [3FCAE147AE147AE8]- morale=-0.07000000000000006 [BFB1EB851EB851F0]- security=0.17500000000000016 [3FC666666666666C]+ intl_standing=0.26000000000000023 [3FD0A3D70A3D70A8]+ morale=-0.09000000000000008 [BFB70A3D70A3D710]+ security=0.16500000000000015 [3FC51EB851EB8524]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -45,7 +45,7 @@ debt=57.82904503222418 [404CEA1E25CA2835]fx=94.29191537516759 [405792AEBDD362D7]rung=2;cf=0;mob=0.8 [3FE999999999999A]-stab=0.5583883508188896 [3FE1DE513F278112]+stab=0.5512986983937466 [3FE1A43D2AFDB659]att=4 [4010000000000000]fired[altalena@@ -63,7 +63,9 @@ fired[operation_hiramoperation_horevoperation_yoav+ rhodes_talkssecond_truce+ sinai_withdrawalten_dayspending[chosen{@@ -76,13 +78,15 @@ chosen{elections_1949=holdfirst_truce=acceptidf_founding=one_army- jerusalem_ceasefire=sign+ jerusalem_ceasefire=keepjerusalem_military_government=military_governmentlatrun_proposal=accept_vote- operation_hiram=launch+ operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefire+ rhodes_talks=send_delegationsecond_truce=comply+ sinai_withdrawal=withdrawten_days=central_frontappt{under=;diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txtindex 8281080a1..73a34e0d1 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt@@ -1,27 +1,27 @@-1949-01-02;11400714819323200433;Historical;23;+1949-01-15;11400714819323200433;Historical;8;ind{- food_supply=0.5999999761581422 [3FE3333326666667]- housing=0.430217536794174 [3FDB88AF22AC95FB]- intl_standing=0.41999999999999993 [3FDAE147AE147AE0]- morale=0.4307001251440333 [3FDB909741F81C59]- security=0.46738991070742464 [3FDDE9B75F3DFFFC]+ food_supply=0.59921875 [3FE32CCCCCCCCCCD]+ housing=0.42228343009948727 [3FDB06B1147AE147]+ intl_standing=0.38999999999999996 [3FD8F5C28F5C28F5]+ morale=0.4051493552017212 [3FD9EDF78FA58F71]+ security=0.4636917724609376 [3FDDAD204189374E]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=0 [0000000000000000]rationing=1 [3FF0000000000000]eff{- border_villages_secure=0.03738991070742455 [3FA324C53760A3AA]- building_houses=0.08021753679417404 [3FB48922F118BE54]- homes_lift_morale=0.06451650621608743 [3FB084275C40121A]- rationing_feeds=0.1999999761581421 [3FC9999966666667]+ border_villages_secure=0.033691772460937505 [3FA1400C49BA5E36]+ building_houses=0.0722834300994873 [3FB2812AB851EB85]+ homes_lift_morale=0.06197826633453369 [3FAFBB9D85F06F69]+ rationing_feeds=0.19921875 [3FC9800000000000]rationing_grates=-0.15 [BFC3333333333333]- safety_lifts_morale=0.0461836189279458 [3FA7A56119D01AB6]+ safety_lifts_morale=0.04317108886718751 [3FA61A855DA27288]shift{food_supply=0 [0000000000000000]housing=0 [0000000000000000]- intl_standing=-0.08000000000000007 [BFB47AE147AE1480]- morale=-0.08000000000000002 [BFB47AE147AE147C]+ intl_standing=-0.11000000000000004 [BFBC28F5C28F5C2C]+ morale=-0.10000000000000003 [BFB999999999999C]security=0.13000000000000012 [3FC0A3D70A3D70A8]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]@@ -33,23 +33,24 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=8340.568207442666 [40C04A48BB057FCC]- america_oceania=484.295801166699 [407E44BB9A011174]- asia=4959.100106786725 [40B35F19A0992F17]- europe=77272.50246069893 [40F2DD880A143AD7]- unknown=11940.192924328829 [40C75218B1BE9176]- veterans=656387.9680859144 [41240807EFA8F4FC]+ africa=9739.110001692712 [40C3058E1489145A]+ america_oceania=535.0499244151753 [4080B8663EC59399]+ asia=7512.155402122331 [40BD5827C86EF924]+ europe=81633.61444656934 [40F3EE19D4C5ED07]+ unknown=12145.947428858311 [40C7B8F945594CDE]+ veterans=656752.739703733 [41240AE17ABA729C]sit[treasury=0 [0000000000000000]-debt=35.286336076266196 [4041A4A6A9199D38]-fx=79.89481110412456 [4053F94495CB1402]-rung=5;cf=41;+debt=35.14873297663618 [40419309AEA33E9C]+fx=80.85238326859616 [4054368D728D91CC]+rung=5;cf=40;mob=1 [3FF0000000000000]-stab=0.5910920160052443 [3FE2EA39CDB56A5B]+stab=0.5607986744564208 [3FE1F2100FCDC67A]att=4 [4010000000000000]fired[altalenabernadotte_assassination+ elections_1949first_truceidf_foundingjerusalem_ceasefire@@ -58,19 +59,22 @@ fired[operation_hiramoperation_horevoperation_yoav+ rhodes_talkssecond_trucesinai_withdrawalpending[sinai_withdrawal+ rhodes_talks+ elections_1949chosen{altalena=enforcebernadotte_assassination=outlawfirst_truce=refuseidf_founding=one_army- jerusalem_ceasefire=sign+ jerusalem_ceasefire=keepjerusalem_military_government=military_governmentlatrun_proposal=accept_vote- operation_hiram=launch+ operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefiresecond_truce=comply@@ -78,4 +82,7 @@ appt{under=;map[mapturn=0001-01-01:0;-over=\ No newline at end of file+over=+city{+ tel_aviv=120,90,120,80,91+coh=0.6426116838487972 [3FE4904660C50EF4]\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yaml b/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yamlindex 6a6f5d504..f703ae65b 100644--- a/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yaml+++ b/sim/Statecraft.Sim.Tests/scenarios/mvp-absorb-first.yaml@@ -1,8 +1,7 @@-# A player who puts the slice's people to work first (GDD Phase 1 PR 3): on the first turn it fills Tel Aviv's 90 jobs, then-# plays on with no other order; events nobody answered are delegated. It runs on the GDD slice (MvpSlice: the real content-# with the loop switch on and placeholder city values), so it moves whenever a GDD rule or placeholder it reaches changes.+# A player who puts the city's people to work first (GDD Phase 1 PR 3): on the first turn it fills Tel Aviv's 90 jobs, then+# plays on with no other order; events nobody answered are delegated. It plays the real content (the GDD loop since the+# cutover), so it moves whenever a GDD rule or design value it reaches changes.name: mvp-absorb-first-content: mvpuntil: 1949-06-15steps:- on: 1948-05-15diff --git a/sim/Statecraft.Sim/Cities.cs b/sim/Statecraft.Sim/Cities.csindex 52dfcd40a..8422d20ce 100644--- a/sim/Statecraft.Sim/Cities.cs+++ b/sim/Statecraft.Sim/Cities.cs@@ -80,7 +80,7 @@ namespace Statecraft.Simif (units == 0) return;var x = s.Cities[r.ArrivalsCity];s.Cities[x.Id] = x.WithCounts(x.Civilians, x.Employed, x.Refugees + units);- why.Add(new Cause("city", x.Id, units, FormattableString.Invariant($"{PlayerText.Settlement(c, x.Id)}: {units} groups of immigrants arrived and wait for housing")));+ why.Add(new Cause("city", x.Id, units, FormattableString.Invariant($"{PlayerText.Settlement(c, x.Id)}: {units} groups of immigrants arrived and wait for homes")));}/// <summary>The whole units of <paramref name="peoplePerUnit"/> people that arrive in [from, to). Counted from the game'sdiff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.csindex 6111b1035..7f537690e 100644--- a/sim/Statecraft.Sim/Content.cs+++ b/sim/Statecraft.Sim/Content.cs@@ -431,7 +431,7 @@ namespace Statecraft.Sim/// term's day. Read through <see cref="Offices.BudgetOwner"/> and <see cref="Offices.BudgetLineOf"/>. Start-only, like budget_start.</summary>public Dictionary<string, List<BudgetOwnerTerm>> BudgetOwners { get; set; } = new Dictionary<string, List<BudgetOwnerTerm>>();/// <summary>The GDD v0.1 rules (docs/rules/mvp.md). Required, and read, only when eras.yaml systems.loop is gdd; null- /// otherwise. Its values are the owner's to set: until then they live in MvpSlice.Overlay or a test fixture.</summary>+ /// otherwise. Its numbers are design values the owner sets (R-LOOP-005).</summary>public MvpRules? Mvp { get; set; }}@@ -448,6 +448,9 @@ namespace Statecraft.Simpublic double CohesionJobsWeight { get; set; }/// <summary>The city every arrival lands in (Phase 1 has one city; R-CITY-003).</summary>public string ArrivalsCity { get; set; } = "";+ /// <summary>The day the GDD game ends (R-LOOP-004; D-E5, 15 January 1952 in the real content), or null for the last+ /// era's end. Read from rules.yaml through <see cref="Content.End"/>; the same in every era.</summary>+ public DateTime? End { get; set; }/// <summary>Turns a "build yishuv" takes, counting the turn it was ordered in (R-SITE-003).</summary>public int BuildYishuvTurns { get; set; }/// <summary>IL millions a "build yishuv" costs, paid in full when it starts (R-SITE-001).</summary>@@ -693,6 +696,9 @@ namespace Statecraft.Simpublic bool IsGdd => Loop == EraSystems.Gdd;/// <summary>The ruleset a save names (SaveGame.Ruleset): "legacy" or "gdd-0.1".</summary>public string Ruleset => IsGdd ? SaveGame.GddRuleset : SaveGame.LegacyRuleset;+ /// <summary>The day play ends, a boundary the last turn reaches (Simulation.Step): rules.yaml mvp.end in the GDD loop+ /// (R-LOOP-004), otherwise the last era's end.</summary>+ public DateTime End => IsGdd && Rules.Mvp?.End is DateTime e ? e : Eras[Eras.Count - 1].To;public List<Indicator> Indicators = new List<Indicator>();public List<Policy> Policies = new List<Policy>();public List<Effect> Effects = new List<Effect>();diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.csindex f32dca08d..1ab64717b 100644--- a/sim/Statecraft.Sim/ContentLoader.cs+++ b/sim/Statecraft.Sim/ContentLoader.cs@@ -334,21 +334,17 @@ namespace Statecraft.Sim}/// <summary>Loads content from a directory: every events/*.yaml file is an event.</summary>- public static Content Load(string contentRoot) => Load(contentRoot, read => read);-- /// <summary>Loads content from a directory through <paramref name="wrap"/>, which may change the text of the files read- /// (MvpSlice.Overlay). The directory checks are the same as for <see cref="Load(string)"/>.</summary>- internal static Content Load(string contentRoot, Func<Func<string, string?>, Func<string, string?>> wrap)+ public static Content Load(string contentRoot){var eventsDir = Path.Combine(contentRoot, "events");var eventFiles = Directory.Exists(eventsDir)? Directory.GetFiles(eventsDir, "*.yaml").Select(f => "events/" + Path.GetFileName(f)).ToList(): new List<string>();- var content = Load(wrap(rel =>+ var content = Load(rel =>{var path = Path.Combine(contentRoot, rel);return File.Exists(path) ? File.ReadAllText(path) : null;- }), eventFiles);+ }, eventFiles);// Only this overload can list the directory. The readFile overload (WebGL) cannot, so a misnamed file is caught// here and by RealContentTests before anything ships.var rulesDir = Path.Combine(contentRoot, "rules");@@ -980,7 +976,12 @@ namespace Statecraft.Simif (!cities.Contains(m.ArrivalsCity)) throw new ContentException(file, "mvp.arrivals_city", $"'{m.ArrivalsCity}' is not a city in cities.yaml");if (m.BuildYishuvTurns < 1) throw new ContentException(file, "mvp.build_yishuv_turns", "must be >= 1");if (!(m.BuildYishuvCost >= 0 && IsFinite(m.BuildYishuvCost))) throw new ContentException(file, "mvp.build_yishuv_cost", "must be a finite number >= 0");+ // One game has one last day (R-LOOP-004): an era cannot move it.+ if (m.End != c.Rules.Mvp!.End) throw new ContentException(file, "mvp.end", "must be the same in every era (the game has one end)");}+ // Strictly before the last era's end: an end on it is the era's own end, and the game would be over as era_ended.+ if (c.Rules.Mvp!.End is DateTime end && (end <= c.Rules.Start || end >= c.Eras[c.Eras.Count - 1].To))+ throw new ContentException("rules.yaml", "mvp.end", FormattableString.Invariant($"must be after start ({c.Rules.Start:yyyy-MM-dd}) and before the last era's end ({c.Eras[c.Eras.Count - 1].To:yyyy-MM-dd})"));ValidateSites(c);}diff --git a/sim/Statecraft.Sim/EventRules.cs b/sim/Statecraft.Sim/EventRules.csindex 94707eec8..7317b7508 100644--- a/sim/Statecraft.Sim/EventRules.cs+++ b/sim/Statecraft.Sim/EventRules.cs@@ -10,6 +10,11 @@ namespace Statecraft.Sim{public static readonly HashSet<string> SensitiveTags = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "holocaust", "terror", "massacre", "war-casualties" };public static readonly HashSet<string> SpecialTargets = new HashSet<string> { "treasury", "fx_reserves" };+ /// <summary>Targets a sensitive event's options may not raise (CONTENT_POLICY section 4: no mechanic rewards violence against+ /// civilians). Owner decision of 15 October 2026 on Q-EFX-2, "Extend it": every resource, not money alone. Until the+ /// GDD resources exist as targets the legacy indicators stand for them: Money (treasury, fx_reserves), Food+ /// (food_supply), Social cohesion (morale) and International Support (intl_standing). Arms has no target yet.</summary>+ public static readonly HashSet<string> NoGainTargets = new HashSet<string> { "treasury", "fx_reserves", "food_supply", "morale", "intl_standing" };public static void Validate(Content c, HashSet<string> offices, HashSet<string> indicators){@@ -81,7 +86,7 @@ namespace Statecraft.Simthrow new ContentException(e.File, F($"options[{o.Id}].effects.{fx.Target}"), "unknown target");Active(F($"options[{o.Id}].effects.{fx.Target}"), fx.Target);ContentLoader.Finite(e.File, F($"options[{o.Id}].effects.{fx.Target}.delta"), fx.Delta);- if (sensitive && (fx.Target == "treasury" || fx.Target == "fx_reserves") && fx.Delta > 0)+ if (sensitive && NoGainTargets.Contains(fx.Target) && fx.Delta > 0)throw new ContentException(e.File, F($"options[{o.Id}].effects.{fx.Target}"), $"sensitive events cannot reward {fx.Target}");}}diff --git a/sim/Statecraft.Sim/GameSession.cs b/sim/Statecraft.Sim/GameSession.csindex 076a2f945..80f5868d5 100644--- a/sim/Statecraft.Sim/GameSession.cs+++ b/sim/Statecraft.Sim/GameSession.cs@@ -45,10 +45,11 @@ namespace Statecraft.Simif (c == null) throw new ArgumentNullException(nameof(c));var saved = SaveGame.Parse(saveText);// R-SAVE-001: a save replays only under the rules it was played with (spec 2026-10-12 section 2.4, decision D-E4).+ // The refusal carries a code the UI translates; its own message tells the player a new game started (N4).if (saved.Ruleset != c.Ruleset)- throw new SaveException(0, saved.Ruleset == SaveGame.LegacyRuleset- ? "This save was made with an earlier version of the game's rules; start a new game."- : "This save was made with another version of the game's rules; start a new game.");+ throw saved.Ruleset == SaveGame.LegacyRuleset+ ? new SaveException(0, "This save was made with an earlier version of the game's rules.", SaveException.OlderRules)+ : new SaveException(0, "This save was made with a newer version of the game's rules.", SaveException.NewerVersion);var list = new List<string>();bool sameContent = saved.ContentHash == c.Hash;if (!sameContent) list.Add("This save was made with different game content; the replayed game may differ.");diff --git a/sim/Statecraft.Sim/GameState.cs b/sim/Statecraft.Sim/GameState.csindex 17992d481..a3c7a0caf 100644--- a/sim/Statecraft.Sim/GameState.cs+++ b/sim/Statecraft.Sim/GameState.cs@@ -12,6 +12,8 @@ namespace Statecraft.Sim{/// <summary>The last era's end was reached (eras.yaml).</summary>public const string EraEnded = "era_ended";+ /// <summary>The GDD game's last day was reached (rules.yaml mvp.end, R-LOOP-004).</summary>+ public const string MvpEnded = "mvp_ended";public const string CoalitionCollapse = "coalition_collapse";}diff --git a/sim/Statecraft.Sim/GoldenRun.cs b/sim/Statecraft.Sim/GoldenRun.csindex 438d9cc7a..7d58088a6 100644--- a/sim/Statecraft.Sim/GoldenRun.cs+++ b/sim/Statecraft.Sim/GoldenRun.cs@@ -1,9 +1,12 @@using System;+using System.Collections.Generic;+using Statecraft.Sim.Reference;namespace Statecraft.Sim{/// <summary>The reference playthroughs that pin determinism (docs/determinism.md): real content, seed 1948,- /// Historical mode, HistoricalAI until the date reaches the given day. The constants live in the sim library so+ /// Historical mode, the reference player (D-A7: HistoricalAI's orders, then the GDD orders it states) until the date+ /// reaches the given day or the game ends (spec 2026-10-12 section 3: "the reference player over the full loop"). The constants live in the sim library so/// Unity players (Golden check) and the editor tests compare against the same values .NET asserts.</summary>public static class GoldenRun{@@ -12,23 +15,31 @@ 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 = "71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07";+ public const string Hash1950 = "f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2";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).</summary>- public const string Hash1952 = "62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8";+ /// <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 = "75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31";public static readonly DateTime Until1952 = new DateTime(1952, 1, 1);- /// <summary>Steps with HistoricalAI until Date >= <paramref name="until"/>, the game ends, or 1000 turns pass.</summary>+ /// <summary>Steps with the reference player until Date >= <paramref name="until"/>, the game ends, or 1000 turns pass.</summary>public static GameState Play(Content c, DateTime until){if (c == null) throw new ArgumentNullException(nameof(c));var s = Simulation.NewGame(c, Seed, Mode.Historical);for (int turn = 0; turn < 1000 && s.Date < until && s.GameOver == null; turn++)- s = Simulation.Step(c, s, HistoricalAI.Commands(c, s)).State;+ s = Simulation.Step(c, s, Orders(c, s)).State;return s;}++ /// <summary>The golden runs' orders for one turn: the reference player's (D-A7). Every copy of the golden loop (the+ /// writer preview, the invariants, the era goldens) takes its orders here, so they stay the run the goldens pin.</summary>+ public static IReadOnlyList<Command> Orders(Content c, GameState s) => ReferencePlayer.Commands(c, s);++ /// <summary>The mvp-end golden: the whole game, to its end (Content.End, R-LOOP-004).</summary>+ public static GameState PlayToEnd(Content c) => Play(c ?? throw new ArgumentNullException(nameof(c)), c.End);}}diff --git a/sim/Statecraft.Sim/MvpGolden.cs b/sim/Statecraft.Sim/MvpGolden.csdeleted file mode 100644index 95949053a..000000000--- a/sim/Statecraft.Sim/MvpGolden.cs+++ /dev/null@@ -1,23 +0,0 @@-using System;-using Statecraft.Sim.Reference;--namespace Statecraft.Sim-{- /// <summary>The GDD slice's golden (spec 2026-10-12 section 3; docs/determinism.md, "MVP goldens"): MvpSlice (the real content- /// with the loop switch on, monthly turns and the slice's placeholder city), the golden seed, Historical mode and the- /// reference player (D-A7: HistoricalAI's orders, then the jobs filled), until Until.</summary>- public static class MvpGolden- {- /// <summary>Ten monthly turns from 15 May 1948: long enough for the reference player's build at Mefalsim, started on- /// 15 September 1948, to finish on 15 March 1949 (GDD Phase 1 PR 5). A test choice, not a balance value.</summary>- public static readonly DateTime Until = new DateTime(1949, 3, 15);-- public static GameState Play(Content c)- {- var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);- for (int turn = 0; turn < 1000 && s.Date < Until && s.GameOver == null; turn++)- s = Simulation.Step(c, s, ReferencePlayer.Commands(c, s)).State;- return s;- }- }-}diff --git a/sim/Statecraft.Sim/MvpSlice.cs b/sim/Statecraft.Sim/MvpSlice.csdeleted file mode 100644index 922e6cb84..000000000--- a/sim/Statecraft.Sim/MvpSlice.cs+++ /dev/null@@ -1,109 +0,0 @@-using System;-using System.Collections.Generic;-using System.Linq;-using YamlDotNet.Serialization;--namespace Statecraft.Sim-{- /// <summary>The GDD v0.1 slice before cutover (spec 2026-10-12 section 2.1): the real content with the loop switch on- /// (eras.yaml systems.loop: gdd in every era), monthly turns (rules.yaml turn_lengths all month) and the slice's city data- /// (cities.yaml, unit_types.yaml, rules.yaml mvp and the GDD command kinds' attention_cost), all placeholders, and the- /// design assumption D-D5 (one military camp and one Hakhshara at the start). Tests, the MVP- /// goldens and the dev flag load it; the real eras.yaml and rules.yaml keep the defaults until cutover. It edits YAML- /// nodes, not text, so a comment or the key order in the real files cannot break it. Balance values the owner has not set- /// may live here, and never under content/ (controller ruling 2, 12 October 2026). R-LOOP-003.</summary>- public static class MvpSlice- {- static readonly IDeserializer Reader = new DeserializerBuilder().WithDuplicateKeyChecking().Build();- static readonly ISerializer Writer = new SerializerBuilder().Build();-- /// <summary>The slice's city (D-A4: Tel Aviv). Design values, not historical figures: none is a claim about Tel Aviv- /// in 1948. Counts are population units of mvp.people_per_unit people (D-A1).</summary>- public const string Cities = @"# PLACEHOLDER: owner sets every value below (MvpSlice.Overlay; never under content/ until the owner sets them).-cities:- - id: tel_aviv- housing_capacity: 120 # PLACEHOLDER: owner sets- job_slots: 90 # PLACEHOLDER: owner sets- civilians: 100 # PLACEHOLDER: owner sets- employed: 80 # PLACEHOLDER: owner sets- # PLACEHOLDER: owner sets (D-D5: one of each exists at start; a design assumption, not a claim about 1948).- # More are built by pioneers (Phase 4).- facilities: [military_camp, hakhshara]-";-- /// <summary>The slice's population types (D-A2: civilians and refugees are counts per city; halutzim are movable- /// units) and their training (GDD "Progression").</summary>- public const string UnitTypes = @"types:- - { id: civilian, kind: population }- - { id: refugee, kind: population }- - id: recruit # civilian to recruit, through basic training (GDD ""Progression"")- kind: population # a count per city until Phase 5- facility: military_camp- training_turns: 3 # PLACEHOLDER: owner sets- training_cost: 0.5 # PLACEHOLDER: owner sets (IL millions per group)- - id: halutz # civilian to Halutz, through pioneer training in a Hakhshara (GDD ""Progression"")- kind: unit # a movable unit (D-A2)- facility: hakhshara- training_turns: 4 # PLACEHOLDER: owner sets- training_cost: 0.5 # PLACEHOLDER: owner sets (IL millions per group)-";-- /// <summary>Wraps <paramref name="readFile"/> (the loader's file reader): eras.yaml and rules.yaml come back with the- /// slice's switches and its rules, cities.yaml and unit_types.yaml with the slice's city when the content has none, and- /// every other file unchanged.</summary>- public static Func<string, string?> Overlay(Func<string, string?> readFile)- {- if (readFile == null) throw new ArgumentNullException(nameof(readFile));- return rel =>- {- var text = readFile(rel);- if (text == null && rel == "cities.yaml") return Cities;- if (text == null && rel == "unit_types.yaml") return UnitTypes;- if (text == null) return null;- if (rel == "eras.yaml")- {- var root = Reader.Deserialize<Dictionary<object, object>>(text);- if (root != null && root.TryGetValue("eras", out var list) && list is List<object> eras)- foreach (var item in eras.OfType<Dictionary<object, object>>())- {- var systems = item.TryGetValue("systems", out var x) && x is Dictionary<object, object> d ? d : new Dictionary<object, object>();- systems["loop"] = EraSystems.Gdd;- item["systems"] = systems;- }- return Writer.Serialize(root);- }- if (rel == "rules.yaml")- {- var root = Reader.Deserialize<Dictionary<object, object>>(text) ?? new Dictionary<object, object>();- root["turn_lengths"] = new List<object> { "month", "month", "month", "month", "month" };- if (!root.ContainsKey("mvp"))- root["mvp"] = new Dictionary<object, object>- {- ["people_per_unit"] = 1000, // PLACEHOLDER: owner sets (D-A1 scale)- ["income_per_job_per_year"] = 0.06, // PLACEHOLDER: owner sets (IL millions per employed unit a year; D-C6)- ["cohesion_housing_weight"] = 0.5, // PLACEHOLDER (D-C1 open)- ["cohesion_jobs_weight"] = 0.5, // PLACEHOLDER (D-C1 open; the two weights sum to 1)- ["arrivals_city"] = "tel_aviv", // Phase 1 has one city: every arrival lands there- ["build_yishuv_turns"] = 6, // PLACEHOLDER: owner sets (D-A3: durations are the owner's)- ["build_yishuv_cost"] = 2, // PLACEHOLDER: owner sets (IL millions, paid at the start)- };- if (root.TryGetValue("attention_cost", out var ac) && ac is Dictionary<object, object> costs)- {- if (!costs.ContainsKey("assign_workers")) costs["assign_workers"] = 0.5; // PLACEHOLDER: owner sets- if (!costs.ContainsKey("train")) costs["train"] = 1; // PLACEHOLDER: owner sets- if (!costs.ContainsKey("cancel_training")) costs["cancel_training"] = 0.5; // PLACEHOLDER: owner sets- // D-A6 (#456): "unit orders free". The plan's reading of a decided answer, not a placeholder (#378).- if (!costs.ContainsKey("pioneer_work")) costs["pioneer_work"] = 0;- if (!costs.ContainsKey("stop_work")) costs["stop_work"] = 0;- }- return Writer.Serialize(root);- }- return text;- };- }-- /// <summary>The content at <paramref name="contentRoot"/> (a directory laid out like content/) through <see cref="Overlay"/>,- /// with the same directory checks as ContentLoader.Load(string).</summary>- public static Content Load(string contentRoot) => ContentLoader.Load(contentRoot, Overlay);- }-}diff --git a/sim/Statecraft.Sim/PlayerText.cs b/sim/Statecraft.Sim/PlayerText.csindex 9c314af2d..12da85410 100644--- a/sim/Statecraft.Sim/PlayerText.cs+++ b/sim/Statecraft.Sim/PlayerText.cs@@ -19,6 +19,7 @@ namespace Statecraft.Simpublic static string GameOver(string code) => code switch{GameOverCodes.EraEnded => "The chapter has ended",+ GameOverCodes.MvpEnded => "The game has reached its last turn",GameOverCodes.CoalitionCollapse => "The coalition collapsed",_ => throw Unknown("game over reason", code),};diff --git a/sim/Statecraft.Sim/Preview.cs b/sim/Statecraft.Sim/Preview.csindex c6d67e1f2..a350820a8 100644--- a/sim/Statecraft.Sim/Preview.cs+++ b/sim/Statecraft.Sim/Preview.cs@@ -50,14 +50,14 @@ namespace Statecraft.Sim}, eventFiles);}- /// <summary>The states after each <paramref name="every"/>th turn and the final one, playing HistoricalAI from the golden start until <paramref name="until"/>.</summary>+ /// <summary>The states after each <paramref name="every"/>th turn and the final one, playing the golden runs' orders (GoldenRun.Orders) from the golden start until <paramref name="until"/>.</summary>public static List<GameState> Play(Content c, ulong seed, DateTime until, int every){var s = Simulation.NewGame(c, seed, Mode.Historical);var states = new List<GameState> { s };for (int turn = 0; turn < 1000 && s.Date < until && s.GameOver == null; turn++) // the same stop as GoldenRun.Play{- s = Simulation.Step(c, s, HistoricalAI.Commands(c, s)).State;+ s = Simulation.Step(c, s, GoldenRun.Orders(c, s)).State;if ((turn + 1) % every == 0 || s.Date >= until || s.GameOver != null) states.Add(s);}return states;diff --git a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs b/sim/Statecraft.Sim/Reference/ReferencePlayer.csindex 44b6979cf..8ca63ea61 100644--- a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs+++ b/sim/Statecraft.Sim/Reference/ReferencePlayer.cs@@ -7,7 +7,7 @@ namespace Statecraft.Sim.Reference/// <summary>Test policy for the GDD goldens (D-A7): a stated simple policy, not game AI and not historical. It sends/// HistoricalAI's orders, then fills each city's jobs with as many civilians as there are jobs, then sends each idle halutz/// unit to the first available yishuv site, then, when there is no halutz and none in training, trains one halutz group in- /// the first city with a Hakhshara and a civilian left without work, while the turn's Attention lasts (both orders borrow). It lives in Statecraft.Sim only so Unity can replay the MVP goldens (#394); no game mode or UI may reach it+ /// the first city with a Hakhshara and a civilian left without work, while the turn's Attention lasts (both orders borrow). It lives in Statecraft.Sim only so Unity can replay the goldens (#394; GoldenRun); no game mode or UI may reach it/// (ReferencePlayerTests.NoGameModeOrUiReachesIt).</summary>public static class ReferencePlayer{diff --git a/sim/Statecraft.Sim/SaveGame.cs b/sim/Statecraft.Sim/SaveGame.csindex df2527c05..e0f22d023 100644--- a/sim/Statecraft.Sim/SaveGame.cs+++ b/sim/Statecraft.Sim/SaveGame.cs@@ -8,9 +8,21 @@ namespace Statecraft.Sim{public sealed class SaveException : Exception{+ /// <summary><see cref="Code"/> of a save made under the rules before this build's (a schema 1 save, or ruleset legacy+ /// in the GDD game): R-SAVE-001.</summary>+ public const string OlderRules = "older_rules";+ /// <summary><see cref="Code"/> of a save made by a newer version of the game: a newer schema, or a ruleset this build+ /// does not know (R-SAVE-002).</summary>+ public const string NewerVersion = "newer_version";+/// <summary>1-based line of the save text the error is on (0 when it concerns the whole save).</summary>public int Line { get; }- public SaveException(int line, string message) : base(line > 0 ? FormattableString.Invariant($"line {line}: {message}") : message) { Line = line; }+ /// <summary>A stable refusal code the UI translates (<see cref="OlderRules"/>, <see cref="NewerVersion"/>), or null for a+ /// damaged save, whose reason the UI words itself. The English message never asks the player to start a new game:+ /// the UI says that once (N4).</summary>+ public string? Code { get; }+ public SaveException(int line, string message, string? code = null)+ : base(line > 0 ? FormattableString.Invariant($"line {line}: {message}") : message) { Line = line; Code = code; }/// <summary>A save whose replay threw <paramref name="inner"/>: kept, with its stack, for the log (#631).</summary>public SaveException(string message, Exception inner) : base(message, inner) { }}@@ -21,7 +33,8 @@ namespace Statecraft.Sim/// statecraft-save 2 schema version (a schema 1 save has no ruleset line and is legacy)/// content <hex> Content.Hash of the content it was played with/// seed <ulong> / mode Historical- /// ruleset legacy|gdd-0.1 the rules it was played under (Content.Ruleset); another ruleset refuses it (R-SAVE-001)+ /// ruleset legacy|gdd-0.1 the rules it was played under (Content.Ruleset); another ruleset refuses it (R-SAVE-001),+ /// and one this build does not know was made by a newer version (R-SAVE-002)/// turn starts the next turn's command list (one per Simulation.Step)/// <command> ... policy ID LEVEL | budget OFFICE=SHARE,... | event ID OPTION | mobilize LEVEL |/// security DELTA | appoint OFFICE PERSON | map ACTION Q R | work CITY ROLE N |@@ -131,7 +144,7 @@ namespace Statecraft.Sim}var magic = Head(0, Magic, 2);if (!int.TryParse(magic[1], NumberStyles.None, CultureInfo.InvariantCulture, out var version)) throw new SaveException(1, "bad schema version");- if (version > SchemaVersion) throw new SaveException(1, FormattableString.Invariant($"save schema version {version} is newer than this game ({SchemaVersion})"));+ if (version > SchemaVersion) throw new SaveException(1, FormattableString.Invariant($"save schema version {version} is newer than this game ({SchemaVersion})"), SaveException.NewerVersion);if (version < 1) throw new SaveException(1, FormattableString.Invariant($"unknown save schema version {version}"));var content = Head(1, "content", 2)[1];if (!IsHash(content)) throw new SaveException(2, "bad content hash");@@ -146,7 +159,9 @@ namespace Statecraft.Sim{if (n < 6) throw new SaveException(0, "Not a Statecraft save (too short)");ruleset = Head(4, "ruleset", 2)[1];- if (ruleset != LegacyRuleset && ruleset != GddRuleset) throw new SaveException(5, $"unknown ruleset '{ruleset}'");+ // R-SAVE-002 (N2): a ruleset this build does not know comes from a newer version, like a newer schema.+ if (ruleset != LegacyRuleset && ruleset != GddRuleset)+ throw new SaveException(5, $"This save was made with a newer version of the game (ruleset '{ruleset}').", SaveException.NewerVersion);first = 5;}var end = Head(n - 1, "end", 2)[1];diff --git a/sim/Statecraft.Sim/Scenario.cs b/sim/Statecraft.Sim/Scenario.csindex d3d134e34..1f177c509 100644--- a/sim/Statecraft.Sim/Scenario.cs+++ b/sim/Statecraft.Sim/Scenario.cs@@ -8,12 +8,11 @@ using YamlDotNet.Serialization.NamingConventions;namespace Statecraft.Sim{- /// <summary>A golden playthrough with scripted player choices (#296). The two hash goldens use HistoricalAI, so they cover- /// the path history took; a scenario covers a path a player might take instead. File: sim/Statecraft.Sim.Tests/scenarios/<name>.yaml.+ /// <summary>A golden playthrough with scripted player choices (#296). The hash goldens use the reference player (HistoricalAI's orders, then the+ /// GDD orders it states), so they cover the path history took; a scenario covers a path a player might take instead. File: sim/Statecraft.Sim.Tests/scenarios/<name>.yaml./// <code>/// name: reckless/// seed: 1948 # optional, default GoldenRun.Seed- /// content: mvp # optional: the GDD slice (MvpSlice.Load) instead of the real content/// until: 1949-01-01 # the run stops when the date reaches it/// steps:/// - on: 1948-05-15 # the commands go in on the first turn that starts on or after this date, once@@ -29,9 +28,6 @@ namespace Statecraft.Sim{public string Name { get; set; } = "";public ulong? Seed { get; set; }- /// <summary>"" for the real content, or <see cref="MvpContent"/> for the GDD slice. The caller loads the content it names.</summary>- public string Content { get; set; } = "";- public const string MvpContent = "mvp";public string Until { get; set; } = "";public List<ScenarioStep> Steps { get; set; } = new List<ScenarioStep>();@@ -40,7 +36,6 @@ namespace Statecraft.Simvar d = new DeserializerBuilder().WithNamingConvention(UnderscoredNamingConvention.Instance).Build();var s = d.Deserialize<Scenario>(yaml) ?? throw new InvalidDataException("the scenario file is empty");if (string.IsNullOrWhiteSpace(s.Name)) throw new InvalidDataException("a scenario needs a name");- if (s.Content != "" && s.Content != MvpContent) throw new InvalidDataException($"'content' must be mvp or left out, got '{s.Content}'");s.UntilDate = Date(s.Until, "until");foreach (var step in s.Steps){diff --git a/sim/Statecraft.Sim/SecuritySystem.cs b/sim/Statecraft.Sim/SecuritySystem.csindex 2d896b935..4552008aa 100644--- a/sim/Statecraft.Sim/SecuritySystem.cs+++ b/sim/Statecraft.Sim/SecuritySystem.cs@@ -71,11 +71,15 @@ namespace Statecraft.Simpublic static void Apply(Content c, GameState s, TurnLength len, List<Cause> why) => Apply(c, s, Weeks(len), why);+ /// <summary>True while the country is at full war: rung 5, the ladder's top. The war state the sim already keeps (the+ /// ceasefire clock runs only then); D-C4 derives the rung from the war in Phase 5. R-TURN-003 reads it.</summary>+ public static bool AtFullWar(GameState s) => s.Rung == 5;+/// <summary>Counts the ceasefire clock down by <paramref name="weeks"/> (a whole turn's weeks, or the whole weeks of/// an adjusted turn at an era's end) while the country is at full war.</summary>public static void Apply(Content c, GameState s, int weeks, List<Cause> why){- if (s.Rung != 5) return;+ if (!AtFullWar(s)) return;s.CeasefireWeeksLeft = Math.Max(0, s.CeasefireWeeksLeft - weeks);if (s.CeasefireWeeksLeft == 0){diff --git a/sim/Statecraft.Sim/Simulation.cs b/sim/Statecraft.Sim/Simulation.csindex ed8ff83c6..c5b4c6275 100644--- a/sim/Statecraft.Sim/Simulation.cs+++ b/sim/Statecraft.Sim/Simulation.cs@@ -56,9 +56,10 @@ namespace Statecraft.SimEventSystem.Delegate(c, s, why);var len = SecuritySystem.TurnLengthFor(c, s.Date, s.Rung);- // The next era's start, or the last era's end, is a boundary: the turn that reaches it ends on it, with that turn's real days (spec 4.1, 4.5).- var end = c.Eras[c.Eras.Count - 1].To;- var boundary = c.Eras.Select(e => e.From).Where(f => f > s.Date).DefaultIfEmpty(end).Min();+ // The next era's start, or the game's end (the last era's end, or mvp.end in the GDD loop, R-LOOP-004), is a+ // boundary: the turn that reaches it ends on it, with that turn's real days (spec 4.1, 4.5).+ var end = c.End;+ var boundary = c.Eras.Select(e => e.From).Where(f => f > s.Date).Concat(new[] { end }).Min();var next = SimTime.AdvanceTo(s.Date, len, boundary);var adjusted = next != SimTime.Advance(s.Date, len);var days = (next - s.Date).Days;@@ -76,8 +77,9 @@ namespace Statecraft.Sims.Turn++;if (s.GameOver == null && s.Date >= end){- s.GameOver = GameOverCodes.EraEnded; // the legacy report (#19) will come before this once it exists- why.Add(new Cause("era", "era_ended", 0, PlayerText.GameOver(s.GameOver)));+ // the legacy report (#19) will come before this once it exists+ s.GameOver = end == c.Eras[c.Eras.Count - 1].To ? GameOverCodes.EraEnded : GameOverCodes.MvpEnded;+ why.Add(new Cause("era", s.GameOver, 0, PlayerText.GameOver(s.GameOver)));}ContentWindows.Update(c, s, turnStart);Cabinet.ExpireOnGovernmentChange(c, s, why);diff --git a/tools/tests/test_release_build.py b/tools/tests/test_release_build.pyindex 57c0de223..5b924d211 100644--- a/tools/tests/test_release_build.py+++ b/tools/tests/test_release_build.py@@ -8,8 +8,8 @@ import pytestimport release_build as rb-H1950 = "71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07"-H1952 = "62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8"+H1950 = "f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2"+H1952 = "75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31"SHA = "1b7a36cb" + "0" * 32LICENCE_TEXTS = ("CC-BY-4.0.txt", "CC-BY-SA-4.0.txt", "CC0-1.0.txt", "YamlDotNet-MIT.txt")NOTICES = ["LICENSE", "LICENSES/CC-BY-4.0.txt", "LICENSES/CC-BY-SA-4.0.txt", "LICENSES/CC0-1.0.txt",diff --git a/tools/web_check.py b/tools/web_check.pyindex 0b008e03d..faef226d0 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 1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07" --expect "GOLDEN OK 1952 62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8"+ uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK 1950 f97e9f81d1feaee78c55847e1fc42f8e60bd9f12c84d234f0d10002f9dae48f2" --expect "GOLDEN OK 1952 75d382995d0f12f0eed772dd851906831990b0ab830c10f3a0af310da0547f31"Options: --query Q (page URL query, without '?'), --expect TEXT (repeatable), --fail REGEX (default: GOLDEN FAIL|SMOKE FAIL|BOOT FAIL),--timeout SECONDS (default 300), --stall SECONDS (fail when no console message arrives for that long; 0 = off),--swiftshader (software WebGL when there is no GPU), --dpr N (default 1), --shots DIR (reassemble the player'sdiff --git a/unity/Assets/Scripts/Boot/GameBoot.cs b/unity/Assets/Scripts/Boot/GameBoot.csindex 37c399962..a0d62f497 100644--- a/unity/Assets/Scripts/Boot/GameBoot.cs+++ b/unity/Assets/Scripts/Boot/GameBoot.cs@@ -41,30 +41,16 @@ namespace Statecraft.Game.Bootstatic readonly Regex BarePath = new Regex(@"(?<![\w:/.\\])(?:file://)?(?:/|[A-Za-z]:\\)[^\s'""()]+");static string FileName(string path) => path.Substring(path.LastIndexOfAny(new[] { '/', '\\' }) + 1);- static readonly Regex MvpValue = new Regex(@"[?&]mvp=([^&#]*)", RegexOptions.CultureInvariant);-- /// <summary>The ?mvp=1 dev flag (#380): load the content through MvpSlice.Overlay, the GDD slice, for playtests. Only- /// one "mvp" parameter whose value is exactly "1" turns it on (not "01", "1x" or a second value); the golden check and- /// the smoke run ignore it and keep the real content, so their pinned hashes hold.</summary>- internal static bool SliceRequested(string? url, bool golden, int smoke)- {- if (golden || smoke != 0) return false;- var values = MvpValue.Matches(url ?? "");- return values.Count == 1 && values[0].Groups[1].Value == "1";- }-async void Start(){DiagLog.Init();DiagLog.BootPhase("player started");- var slice = SliceRequested(Application.absoluteURL, GoldenCheck.Requested(), Statecraft.Game.UI.GameRoot.SmokeTurns());- if (slice) Debug.Log("MVP SLICE: content through MvpSlice.Overlay (?mvp=1); the autosave is not used");- await BootAsync(() => LoadAsync(slice));+ await BootAsync(LoadAsync);}- static async Awaitable<GameInputs> LoadAsync(bool slice) => Application.platform == RuntimePlatform.WebGLPlayer- ? await GameInputs.FetchAsync(GameInputs.StreamingUrl(), Application.buildGUID, slice)- : GameInputs.FromDisk(Paths.Content, Paths.StreamingMap, slice);+ static async Awaitable<GameInputs> LoadAsync() => Application.platform == RuntimePlatform.WebGLPlayer+ ? await GameInputs.FetchAsync(GameInputs.StreamingUrl(), Application.buildGUID)+ : GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);/// <summary>The boot Start runs, with the loader passed in so a test can drive the real failure path.</summary>internal async Awaitable BootAsync(Func<Awaitable<GameInputs>> load)diff --git a/unity/Assets/Scripts/Boot/GameInputs.cs b/unity/Assets/Scripts/Boot/GameInputs.csindex dc51fc239..af8af14d0 100644--- a/unity/Assets/Scripts/Boot/GameInputs.cs+++ b/unity/Assets/Scripts/Boot/GameInputs.cs@@ -50,9 +50,6 @@ namespace Statecraft.Game.Boot{public Content Content = null!;public MapInputs Map = null!;- /// <summary>True when Content is the GDD slice (MvpSlice.Overlay over the real files: the ?mvp=1 dev flag, #380). A- /// slice game never touches the player's autosave (GameRoot).</summary>- public bool Slice;public static MapInputs MapFromDisk(string contentDir, string mapDir) => new MapInputs{@@ -77,18 +74,17 @@ namespace Statecraft.Game.Boot/// <summary>A map-only, cosmetic input: "" when the file is missing (the map then skips that layer with a warning).</summary>static string ReadIfExists(string path) => File.Exists(path) ? File.ReadAllText(path) : "";- public static GameInputs FromDisk(string contentDir, string mapDir, bool slice = false) =>- new GameInputs { Content = slice ? MvpSlice.Load(contentDir) : ContentLoader.Load(contentDir), Map = MapFromDisk(contentDir, mapDir), Slice = slice };+ public static GameInputs FromDisk(string contentDir, string mapDir) =>+ new GameInputs { Content = ContentLoader.Load(contentDir), Map = MapFromDisk(contentDir, mapDir) };/// <summary>Builds the inputs from fetched texts (keys are manifest paths) and the packed heightmap's bytes.</summary>- public static GameInputs FromTexts(IReadOnlyDictionary<string, string> texts, IEnumerable<string> manifest, string heightmapJson, byte[] r16z, bool slice = false)+ public static GameInputs FromTexts(IReadOnlyDictionary<string, string> texts, IEnumerable<string> manifest, string heightmapJson, byte[] r16z){var events = manifest.Where(f => f.StartsWith("events/", StringComparison.Ordinal)).ToList();- Func<string, string?> read = rel => texts.TryGetValue(rel, out var t) ? t : null;- var content = ContentLoader.Load(slice ? MvpSlice.Overlay(read) : read, events); // the slice: ?mvp=1 (#380)+ var content = ContentLoader.Load(rel => texts.TryGetValue(rel, out var t) ? t : null, events);return new GameInputs{- Content = content, Slice = slice,+ Content = content,Map = new MapInputs{HeightmapJson = heightmapJson, HeightmapR16z = r16z,@@ -191,7 +187,7 @@ namespace Statecraft.Game.Boot/// <summary>Fetches the manifest, then starts every download before awaiting any (parallel), then loads. A transient/// failure is retried (Done). When one download fails for good, the others still running are aborted and disposed./// Every URL carries <paramref name="buildId"/> (WithBuildId; the player passes Application.buildGUID).</summary>- public static async Awaitable<GameInputs> FetchAsync(string baseUrl, string buildId = "", bool slice = false)+ public static async Awaitable<GameInputs> FetchAsync(string baseUrl, string buildId = ""){var manifest = ContentManifest.Parse(await Text(Start(WithBuildId(baseUrl + "/content/" + ContentManifest.FileName, buildId)), ContentManifest.FileName));var requests = manifest.Select(f => (file: f, request: Start(WithBuildId(baseUrl + "/content/" + f, buildId)))).ToList();@@ -204,7 +200,7 @@ namespace Statecraft.Game.Bootvar metaText = await Text(meta, "heightmap.json");var r16zBytes = await Bytes(r16z, HeightmapCodec.FileName);DiagLog.BootPhase($"downloaded {texts.Count + 3} files");- var inputs = FromTexts(texts, manifest, metaText, r16zBytes, slice);+ var inputs = FromTexts(texts, manifest, metaText, r16zBytes);DiagLog.BootPhase("content parsed and validated");return inputs;}diff --git a/unity/Assets/Scripts/UI/DefencePresenter.cs b/unity/Assets/Scripts/UI/DefencePresenter.csindex 652b5f17e..db3f08990 100644--- a/unity/Assets/Scripts/UI/DefencePresenter.cs+++ b/unity/Assets/Scripts/UI/DefencePresenter.cs@@ -138,7 +138,8 @@ namespace Statecraft.Game.UIfor (int rung = 1; rung <= 5; rung++){screen.Q<Label>($"rung-{rung}-name").text = text[$"defence.rung{rung}"];- screen.Q<Label>($"rung-{rung}-turn").text = text[TurnKey(SecuritySystem.TurnLengthFor(rung))];+ // The content's turn_lengths (R-TURN-001): every rung reads "month" in the GDD game.+ screen.Q<Label>($"rung-{rung}-turn").text = text[TurnKey(SecuritySystem.TurnLengthFor(c, s.Date, rung))];var row = screen.Q<VisualElement>($"rung-{rung}");row.EnableInClassList("rung-current", rung == s.Rung);row.EnableInClassList("rung-target", rung == target && target != s.Rung); // the level an order will move todiff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.csindex 7ac1103dc..a525928cc 100644--- a/unity/Assets/Scripts/UI/GameRoot.cs+++ b/unity/Assets/Scripts/UI/GameRoot.cs@@ -175,12 +175,11 @@ namespace Statecraft.Game.UIvar text = Strings();var store = Store ?? SaveStore.ForPlatform();var notes = new List<string>();- // A smoke run is reproducible: a fresh game with the golden seed, never the player's autosave. A slice game (?mvp=1,- // #380) is fresh too: the autosave was made with other rules, so it is neither read nor set aside.+ // A smoke run is reproducible: a fresh game with the golden seed, never the player's autosave.bool resumed;var session = smoke > 0? GameStart.Begin(inputs.Content, store, () => GoldenRun.Seed, notes, text, out resumed, fresh: true)- : GameStart.Begin(inputs.Content, store, GameStart.NewSeed, notes, text, out resumed, fresh: inputs.Slice);+ : GameStart.Begin(inputs.Content, store, GameStart.NewSeed, notes, text, out resumed);DiagLog.BootPhase($"session started (turn {session.State.Turn}, replayed)");var bridge = Bridge = new SimBridge(session, text);var root = document.rootVisualElement;@@ -207,8 +206,9 @@ namespace Statecraft.Game.UI// or by the first card if it comes sooner. A Continue with a decision waiting builds the card under the start// screen, which asks for the photograph only when the screen closes (issue #592). One value says whether the// screen goes up (below) and whether the card waits for it: a card waiting under no screen would never show its photo.- // A smoke run has no New Game, and a slice game's (?mvp=1, #380) would be dead: neither shows the start screen.- bool showsStart = startScreen && smoke == 0 && !inputs.Slice;+ // A smoke run has no New Game, so it shows no start screen. Since the GDD cutover every new game opens on a card+ // (One Army, 15 May 1948), so a new game's card waits under the screen too.+ bool showsStart = startScreen && smoke == 0;EventPhotos.ScheduleOn(root);card = Own(new EventCardPresenter(root, bridge, text, portraits, null, video,clips == null ? null : id => clips.TryGetValue(id, out var r) ? r : null, EventPhotos.Get,@@ -268,18 +268,14 @@ namespace Statecraft.Game.UIvar info = Own(new InfoPanelPresenter(root, bridge, text, names, nav: nav,selectedUnit: () => unitLayer.Selected is string id ? unitLayer.Tokens.First(p => p.Token.Unit.Id == id) : (Statecraft.Game.Map.Units.PlacedToken?)null,regions: regions, localitiesAt: localitiesAt));- // A smoke or slice session never touches the player's save: no autosave, and no New Game (which deletes the autosave).- // A smoke run gets no New Game at all: no file is ever deleted, no path has to be right on every platform, and the- // scripted run never presses it. A slice game (?mvp=1) hides the button and takes it out of the Tab order, and its- // presenter refuses every press (slice: true), so even a press that reaches it deletes nothing.+ // A smoke session never touches the player's save: no autosave, and no New Game (which deletes the autosave).+ // Leaving New Game out is safer than handing it a throwaway store: no file is ever deleted, no path has to be+ // right on every platform, and the scripted run never presses it.NewGamePresenter? newGame = null;- var newGameButton = root.Q<Button>("new-game");- newGameButton.style.display = inputs.Slice ? DisplayStyle.None : StyleKeyword.Null;- newGameButton.focusable = !inputs.Slice;if (smoke == 0){- newGame = Own(new NewGamePresenter(root, bridge, store, toast, text, GameStart.NewSeed, slice: inputs.Slice));- if (!inputs.Slice) Own(GameStart.Autosave(bridge, store, text, toast.Append)); // appends: the turn's refusals stay visible+ newGame = Own(new NewGamePresenter(root, bridge, store, toast, text, GameStart.NewSeed));+ Own(GameStart.Autosave(bridge, store, text, toast.Append)); // appends: the turn's refusals stay visible}// An outcome clip holds the pointer while it shows and in the frame it closes (the skipping click selects no hex).@@ -405,6 +401,10 @@ namespace Statecraft.Game.UIvoid Shutdown(){StopAllCoroutines();+ // The card first: disposing the start screen uncovers the decision layer, and a card still waiting for it would+ // then render and load the photo catalog for a game that is going away (#592; since the GDD cutover a new game's+ // card waits under the screen, so New Game's Begin would load it).+ if (card != null) { owned.Remove(card); card.Dispose(); }for (int i = owned.Count - 1; i >= 0; i--) owned[i].Dispose();owned.Clear();minimap = null; labels = null; nav = null; start = null; card = null; outcomes = null; rig = null; drawn = null; units = null; Regions = null; logCamera = false;@@ -470,8 +470,9 @@ namespace Statecraft.Game.UIDebug.Log(CameraLine(rig.Distance, rig.Yaw));}- /// <summary>Plays turns the way a player does: answers each open event by pressing the card's first option button,- /// then presses End Turn. Logs "SMOKE turn <n> <date> refused <k>" per turn through <paramref name="log"/>,+ /// <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; 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>public static IEnumerator Smoke(VisualElement root, SimBridge bridge, EventCardPresenter card, int turns, Action<string> log)@@ -482,6 +483,7 @@ namespace Statecraft.Game.UIfor (int guard = 0; card.Shown != null; guard++){var shown = card.Shown;+ if (bridge.AttentionLeft + 1e-9 < AttentionSystem.Cost(bridge.Content, bridge.State, new ChooseEventOption(shown.Id, "").Kind)) 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/GameStart.cs b/unity/Assets/Scripts/UI/GameStart.csindex 38f29fa66..3cdac058f 100644--- a/unity/Assets/Scripts/UI/GameStart.cs+++ b/unity/Assets/Scripts/UI/GameStart.cs@@ -39,10 +39,14 @@ namespace Statecraft.Game.UI{try { store.SetAsideAutosave(); } catch (Exception) { /* even this must not stop the start */ }// The sim's reasons are English and technical (line numbers, a replay's own exception), and anything else- // can carry file paths: the player gets one short reason in their language, and the full exception (with- // a replay's inner exception) goes to the log only (#631).+ // can carry file paths: the full exception (with a replay's inner exception) goes to the log only (#631).UnityEngine.Debug.LogWarning((e is SaveException ? "Autosave rejected: " : "Autosave could not be loaded: ") + e);- notes.Add(text.Format("save.unreadable", text["save.reason_other"]));+ // A refusal with a code (a save from before the GDD cutover, or from a newer version: R-SAVE-001, R-SAVE-002)+ // is said once, in the player's language (N4); anything else, and a code with no string, gets one short+ // localised reason (#631): this path never throws, so the start is never blocked.+ if (e is SaveException refused && refused.Code != null && text.Has("save.refused." + refused.Code))+ notes.Add(text["save.refused." + refused.Code]);+ else notes.Add(text.Format("save.unreadable", text["save.reason_other"]));}}return GameSession.New(c, newSeed(), Mode.Historical);diff --git a/unity/Assets/Scripts/UI/NewGamePresenter.cs b/unity/Assets/Scripts/UI/NewGamePresenter.csindex c589aabbb..a90f327eb 100644--- a/unity/Assets/Scripts/UI/NewGamePresenter.cs+++ b/unity/Assets/Scripts/UI/NewGamePresenter.cs@@ -12,10 +12,8 @@ namespace Statecraft.Game.UI{readonly VisualElement root; readonly SimBridge bridge; readonly SaveStore store; readonly ToastPresenter toast; readonly UiText text; readonly Func<ulong> seed;- public NewGamePresenter(VisualElement root, SimBridge bridge, SaveStore store, ToastPresenter toast, UiText text, Func<ulong> seed,- bool slice = false)+ public NewGamePresenter(VisualElement root, SimBridge bridge, SaveStore store, ToastPresenter toast, UiText text, Func<ulong> seed){- this.slice = slice;this.root = root; this.bridge = bridge; this.store = store; this.toast = toast; this.text = text; this.seed = seed;button = root.Q<Button>("new-game");button.clicked += Press;@@ -23,10 +21,6 @@ namespace Statecraft.Game.UI}readonly Button button;- /// <summary>A slice game (?mvp=1): New Game never deletes the player's autosave. GameRoot hides the button and builds- /// no start screen in a slice game, but builds this presenter with slice: true, so this flag is the guard that stops- /// the delete.</summary>- readonly bool slice;// Any change (an order, a turn, a new session) means the prompt no longer describes what is on screen.void Disarm() => Armed = false;@@ -51,7 +45,6 @@ namespace Statecraft.Game.UI/// <summary>One press of New Game: the first arms and shows the prompt, the second starts the new game.</summary>public void Press(){- if (slice) return;if (!Armed) { Armed = true; toast.Show(text["newgame.confirm"]); return; }Armed = false;bool deleted = true;diff --git a/unity/Assets/Scripts/UI/UiText.cs b/unity/Assets/Scripts/UI/UiText.csindex 362e71ac1..f83d643a9 100644--- a/unity/Assets/Scripts/UI/UiText.cs+++ b/unity/Assets/Scripts/UI/UiText.cs@@ -33,6 +33,9 @@ namespace Statecraft.Game.UIreturn new UiText(m, file);}+ /// <summary>True when the strings have <paramref name="key"/> (a lookup that must not throw, as GameStart's fallback).</summary>+ public bool Has(string key) => map.ContainsKey(key);+public string this[string key] =>map.TryGetValue(key, out var v) ? v : throw new KeyNotFoundException($"{file} has no key '{key}'");diff --git a/unity/Assets/Tests/EditMode/CabinetScreenTests.cs b/unity/Assets/Tests/EditMode/CabinetScreenTests.csindex dfbd92960..3334f75a7 100644--- a/unity/Assets/Tests/EditMode/CabinetScreenTests.cs+++ b/unity/Assets/Tests/EditMode/CabinetScreenTests.cs@@ -151,7 +151,8 @@ public class CabinetScreenTests/// <summary>Steps until the next turn would reach <paramref name="date"/>, so the next End Turn crosses it.</summary>static void StepUntilNextTurnCrosses(GameSession g, DateTime date){- while (SimTime.Advance(g.State.Date, SecuritySystem.TurnLengthFor(g.State.Rung)) < date) g.Step(HistoricalAI.Commands(C, g.State));+ // The content's turn lengths (monthly since the GDD cutover), not the legacy table.+ while (SimTime.Advance(g.State.Date, SecuritySystem.TurnLengthFor(C, g.State.Date, g.State.Rung)) < date) g.Step(HistoricalAI.Commands(C, g.State));}[Test]diff --git a/unity/Assets/Tests/EditMode/ControlTests.cs b/unity/Assets/Tests/EditMode/ControlTests.csindex 4155b2aea..595012e85 100644--- a/unity/Assets/Tests/EditMode/ControlTests.cs+++ b/unity/Assets/Tests/EditMode/ControlTests.cs@@ -223,7 +223,8 @@ public class ControlTests}/// <summary>The longest legend label (English and Hebrew, a period with some fronts switched: legend and caption) fits- /// beside the minimap with the real HUD and the longest event card, as ArmisticeTests.TheLongestMapLabelFitsBesideTheEventCard+ /// beside the minimap with the real HUD and the longest event card (which, being modal, may cover it: owner, 15 October+ /// 2026), as ArmisticeTests.TheLongestMapLabelFitsBesideTheEventCard/// checks the older label: on screen, clear of the card, the minimap, the info panel and the top bar, its text not cut, at/// most six lines (the approved legend is about three of them in the narrow box).</summary>[UnityTest]@@ -263,7 +264,13 @@ public class ControlTestsAssert.IsTrue(lb.xMin >= screen.xMin - 0.5f && lb.xMax <= screen.xMax + 0.5f && lb.yMin >= screen.yMin - 0.5f && lb.yMax <= screen.yMax + 0.5f,$"{at}: the label {lb} leaves the screen {screen}");Assert.IsFalse(lb.Overlaps(R("minimap")), $"{at}: the label {lb} overlaps the minimap {R("minimap")}");- Assert.IsFalse(lb.Overlaps(R("event-card")), $"{at}: the event card {R("event-card")} overlaps the label {lb}");+ // Owner, 15 October 2026, on the longest card (bernadotte_assassination since the GDD cutover) covering the+ // legend at 390x844: "Accept it, the card is modal". A modal card (its backdrop dims the map and disables+ // the minimap column, ScreenNav.DisableCovered) may cover the legend at any size; a card that covers it must+ // be modal. Today every shown card is modal, so this fails only if a shown card stops being modal.+ if (lb.Overlaps(R("event-card")))+ Assert.IsTrue(root.Q("root").ClassListContains(EventCardPresenter.ModalClass),+ $"{at}: the event card {R("event-card")} covers the label {lb} and is not modal");if (root.Q("info-panel").resolvedStyle.display == DisplayStyle.Flex)Assert.IsFalse(lb.Overlaps(R("info-panel")), $"{at}: the info panel overlaps the label {lb}");Assert.IsFalse(lb.Overlaps(R("top-bar")), $"{at}: the top bar overlaps the label");diff --git a/unity/Assets/Tests/EditMode/DefenceScreenTests.cs b/unity/Assets/Tests/EditMode/DefenceScreenTests.csindex ebc85f928..f455f33a8 100644--- a/unity/Assets/Tests/EditMode/DefenceScreenTests.cs+++ b/unity/Assets/Tests/EditMode/DefenceScreenTests.cs@@ -28,8 +28,8 @@ public class DefenceScreenTests{Assert.IsTrue(ui.Q<VisualElement>("rung-5").ClassListContains("rung-current"));Assert.IsFalse(ui.Q<VisualElement>("rung-2").ClassListContains("rung-current"));- Assert.AreEqual("turns of a week", ui.Q<Label>("rung-5-turn").text);- Assert.AreEqual("turns of a quarter", ui.Q<Label>("rung-1-turn").text);+ for (int rung = 1; rung <= 5; rung++) // the GDD game plays monthly turns on every rung (R-TURN-001)+ Assert.AreEqual("turns of a month", ui.Q<Label>($"rung-{rung}-turn").text, $"rung {rung}");Assert.AreEqual("If full war goes on, the UN imposes a ceasefire in 52 weeks", ui.Q<Label>("ceasefire").text);Assert.AreEqual("Minister of Defense David Ben-Gurion · Chief of Staff Yaakov Dori", ui.Q<Label>("defence-command").text);Assert.AreEqual("80% of reserves called up (level 5 needs at least 80%)", ui.Q<Label>("mob-level").text);@@ -141,9 +141,9 @@ public class DefenceScreenTestsvar (ui, bridge, _) = Open();using (ui){- bridge.EndTurn();- Assert.AreEqual("If full war goes on, the UN imposes a ceasefire in 51 weeks", ui.Q<Label>("ceasefire").text);- Assert.AreEqual(51, bridge.State.CeasefireWeeksLeft);+ bridge.EndTurn(); // a monthly turn counts 4 weeks (SecuritySystem.Weeks) since the GDD cutover+ Assert.AreEqual("If full war goes on, the UN imposes a ceasefire in 48 weeks", ui.Q<Label>("ceasefire").text);+ Assert.AreEqual(48, bridge.State.CeasefireWeeksLeft);}}@@ -175,7 +175,7 @@ public class DefenceScreenTestsAssert.AreEqual($"UN ceasefire: {C.Rules.CeasefireWeeks} weeks once level 5 is reached", ui.Q<Label>("ceasefire").text);bridge.EndTurn();Assert.AreEqual(5, bridge.State.Rung);- Assert.AreEqual(C.Rules.CeasefireWeeks - 1, bridge.State.CeasefireWeeksLeft); // the clock started and ran one week+ Assert.AreEqual(C.Rules.CeasefireWeeks - 4, bridge.State.CeasefireWeeksLeft); // the clock started and ran one monthly turn (4 weeks)}}diff --git a/unity/Assets/Tests/EditMode/EventCardTests.cs b/unity/Assets/Tests/EditMode/EventCardTests.csindex 275ee7367..10657bd31 100644--- a/unity/Assets/Tests/EditMode/EventCardTests.cs+++ b/unity/Assets/Tests/EditMode/EventCardTests.cs@@ -142,6 +142,8 @@ public class EventCardTestsusing var ui = new UiTestKit();var g = GameSession.New(C, GoldenRun.Seed, Mode.Historical);while (!g.State.PendingEvents.Contains("elections_1949")) g.Step(new Command[0]);+ // On monthly turns elections_1949 comes on 15 January 1949 with sinai_withdrawal and rhodes_talks; this test is about the one-option card.+ g.State.PendingEvents.RemoveAll(id => id != "elections_1949");var bridge = new SimBridge(g, Text);var card = new EventCardPresenter(ui.Root, bridge, Text, null);Assert.AreEqual("elections_1949", card.Shown!.Id);diff --git a/unity/Assets/Tests/EditMode/EventPhotosLoadTests.cs b/unity/Assets/Tests/EditMode/EventPhotosLoadTests.csindex 63e190512..2d3461792 100644--- a/unity/Assets/Tests/EditMode/EventPhotosLoadTests.cs+++ b/unity/Assets/Tests/EditMode/EventPhotosLoadTests.cs@@ -206,10 +206,19 @@ public class EventPhotosLoadTestsAssert.AreEqual(1000, delay, "a second after Begin");Assert.AreEqual(EventPhotos.PrefetchDelayMs, delay);}+ if (!startScreen)+ {+ // No start screen (the automated runs): since the GDD cutover turn 0 shows a card (One Army, 15 May 1948), and+ // a visible card takes its photograph at once; New Game reuses it, and the prefetch then has nothing to do.+ Assert.AreEqual(1, loadsNow, "the visible turn-0 card loads the catalog once");+ foreach (var (_, action, _) in scheduled) action();+ Assert.AreEqual(0, starts, "the prefetch finds it loaded");+ return;+ }Assert.AreEqual(0, starts, "nothing loads until the scheduler runs it");foreach (var (_, action, _) in scheduled) action();Assert.AreEqual(1, starts, "the action is the async prefetch, and once");- Assert.AreEqual(0, loadsNow, "never the synchronous load");+ Assert.AreEqual(0, loadsNow, "never the synchronous load: the turn-0 card waits under the start screen (#592)");Assert.IsFalse(EventPhotos.Loaded, "the catalog waits for the first card");}finally { EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); VisualToggles.Clear(); }@@ -284,15 +293,14 @@ public class EventPhotosLoadTests}/// <summary>Issue #592 review: the card waits for its photograph exactly when Begin shows the start screen (one value- /// in GameRoot decides both; #598's slice game shows none). A card waiting under no screen would never be uncovered and+ /// in GameRoot decides both; the ?mvp=1 slice went with the cutover). A card waiting under no screen would never be uncovered and/// never show its photograph.</summary>[Test]- public void TheCardWaitsForThePhotographExactlyWhenTheStartScreenShows([Values(false, true)] bool startScreen, [Values(0, 5)] int smoke,- [Values(false, true)] bool slice)+ public void TheCardWaitsForThePhotographExactlyWhenTheStartScreenShows([Values(false, true)] bool startScreen, [Values(0, 5)] int smoke){SaveWithAPhotographedDecisionWaiting();EventPhotos.Schedule = (_, _, _) => { };- var inputs = GameInputs.FromDisk(Paths.Content, Paths.StreamingMap, slice);+ var inputs = GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);try{EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);@@ -302,7 +310,7 @@ public class EventPhotosLoadTestsif (smoke > 0) UnityEngine.TestTools.LogAssert.Expect(LogType.Warning, "SMOKE FAIL the smoke run needs play mode or a player");root.Begin(inputs, smoke, startScreen);var open = Object.FindFirstObjectByType<UIDocument>().rootVisualElement.Q("root").ClassListContains(StartScreenPresenter.OpenClass);- Assert.AreEqual(startScreen && smoke == 0 && !slice, open, "the start screen shows only outside a smoke run and the slice");+ Assert.AreEqual(startScreen && smoke == 0, open, "the start screen shows only outside a smoke run");Assert.AreEqual(open, root.Card!.PhotoWaits, "the card waits for the photograph exactly when the screen covers it");}finally { EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); VisualToggles.Clear(); }@@ -330,6 +338,35 @@ public class EventPhotosLoadTestsfinally { EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); VisualToggles.Clear(); }}+ /// <summary>#592: the turn-0 card (One Army, since the GDD cutover) under the start screen asks for no photograph; when+ /// the screen closes the card takes it, so it never opens with the minister's portrait.</summary>+ [Test]+ public void TheOpeningCardTakesItsPhotographWhenTheStartScreenCloses()+ {+ var inputs = GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);+ try+ {+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);+ Object.FindFirstObjectByType<MapScene>().Build(inputs.Map);+ var root = Object.FindFirstObjectByType<GameRoot>();+ root.Store = new SaveStore(saveDir);+ root.Begin(inputs, 0, startScreen: true);+ var ui = Object.FindFirstObjectByType<UIDocument>().rootVisualElement;+ Assert.IsTrue(ui.Q("root")!.ClassListContains(StartScreenPresenter.OpenClass), "the start screen is up");+ Assert.AreEqual(0, loadsNow, "no catalog under the start screen");+ Assert.IsFalse(EventPhotos.Loaded);+ UiTestKit.Press(ui.Q<Button>("start-new-game")); // a new game: the first press closes the screen+ Assert.IsFalse(ui.Q("root")!.ClassListContains(StartScreenPresenter.OpenClass), "the start screen closed");+ Assert.AreEqual(1, loadsNow, "the card loads the catalog when it comes out from under the screen");+ var entry = Shipped.Find("idf_founding")!.Value;+ var band = ui.Q<VisualElement>("event-photo");+ Assert.AreEqual(DisplayStyle.Flex, band.style.display.value, "the photograph shows");+ Assert.AreEqual(entry.image, band.style.backgroundImage.value.texture);+ Assert.AreEqual(DisplayStyle.None, ui.Q<VisualElement>("event-image").style.display.value, "no portrait in its place");+ }+ finally { EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); VisualToggles.Clear(); }+ }+[Test]public void GameRootBeginLoadsNoPhotoCatalog([Values(false, true)] bool startScreen){@@ -344,8 +381,11 @@ public class EventPhotosLoadTestsvar before = EventImageCatalog.ResourceLoads;root.Begin(inputs, 0, startScreen);root.Begin(inputs, 0, startScreen); // New Game- Assert.AreEqual(before, EventImageCatalog.ResourceLoads, "no catalog load in Begin (the prefetch waits for the idle time)");- Assert.IsFalse(EventPhotos.Loaded);+ // Since the GDD cutover turn 0 shows a card. Under the start screen it waits, so Begin loads nothing (#592), and+ // New Game's Begin does not load it for the closing game either (GameRoot.Shutdown disposes the card first); with+ // no start screen (the automated runs) the card is visible and loads the catalog once, and New Game reuses it.+ Assert.AreEqual(before + (startScreen ? 0 : 1), EventImageCatalog.ResourceLoads, "catalog loads in Begin");+ Assert.AreEqual(!startScreen, EventPhotos.Loaded);}finally { EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single); VisualToggles.Clear(); }}diff --git a/unity/Assets/Tests/EditMode/GameSceneTests.cs b/unity/Assets/Tests/EditMode/GameSceneTests.csindex d09c61cd9..0cbee0678 100644--- a/unity/Assets/Tests/EditMode/GameSceneTests.cs+++ b/unity/Assets/Tests/EditMode/GameSceneTests.cs@@ -158,7 +158,12 @@ public class GameSceneTestsvar pointer = Object.FindFirstObjectByType<MapPointer>();var camera = Camera.main.GetComponent<CameraController>();var bridge = root.Bridge!;- Assert.IsFalse(ui.Q("root").ClassListContains(EventCardPresenter.ModalClass), "precondition: no card at the start");+ // Since the GDD cutover the game opens on a card (One Army, 15 May 1948): take it away for the "no card" half.+ var none = GameSession.New(Inputs.Content, GoldenRun.Seed, Mode.Historical);+ none.State.PendingEvents.Clear();+ bridge.Replace(none);+ for (int i = 0; i < 5; i++) yield return null;+ Assert.IsFalse(ui.Q("root").ClassListContains(EventCardPresenter.ModalClass), "precondition: no card");foreach (var (where, p) in probes){Assert.IsFalse(pointer.IsOverUi!(ScreenFor(p)), $"no card: {where} {p} is map");@@ -209,6 +214,8 @@ public class GameSceneTestsforeach (var s in ScreenNav.Screens)Assert.AreEqual(DisplayStyle.None, ui.Q("screen-" + s).resolvedStyle.display, s + " is hidden at start");+ HideTheOpeningCard(ui);+ yield return null;var panel = ui.panel;Assert.IsNull(panel.Pick(ui.worldBound.center), "the middle of the screen is map, not UI");@@ -301,6 +308,7 @@ public class GameSceneTestspublic void AClickOnTheTerrainFillsTheInfoPanel(){Boot();+ HideTheOpeningCard(Ui);var pointer = Object.FindFirstObjectByType<MapPointer>();Assert.IsTrue(pointer.HandleClick(AimAtTelAviv()), "the ray hit the terrain");Assert.AreEqual("Tel Aviv", Ui.Q<Label>("info-title").text);@@ -317,6 +325,16 @@ public class GameSceneTestsAssert.AreEqual(ground.z, b.center.z, 100f);}+ /// <summary>Since the GDD cutover the game opens on its first card, One Army (idf_founding, window from 15 May 1948 per+ /// #567: the order it asks about was signed on 26 May, before the next monthly turn), and its photograph covers the map. A+ /// player hides it to use the map; so do these tests.</summary>+ public static void HideTheOpeningCard(VisualElement ui)+ {+ var hide = ui.Q<Button>("event-hide");+ Assert.IsNotNull(hide, "the opening card has its Hide button");+ UiTestKit.Press(hide);+ }+/// <summary>Points the main camera straight down at Tel Aviv and returns Tel Aviv's screen position.</summary>static Vector2 AimAtTelAviv(){@@ -529,6 +547,29 @@ public class GameSceneTestsAssert.IsFalse(bridge.Session.Last.Why.Any(w => w.Target == "armistice_egypt" && w.Message.StartsWith("Delegated")));}+ /// <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>+ [Test]+ public void TheSmokeRunLeavesACardItCannotPayForToItsMinister()+ {+ using var ui = new UiTestKit();+ var c = Inputs.Content;+ var 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));+ var text = Text;+ var bridge = new SimBridge(g, text);+ using var toast = new ToastPresenter(ui.Root, bridge, text);+ using var hud = new HudPresenter(ui.Root, bridge, text);+ using var card = new EventCardPresenter(ui.Root, bridge, text, null);+ var log = new List<string>();+ var run = GameRoot.Smoke(ui.Root, bridge, card, 1, log.Add);+ while (run.MoveNext()) { }+ StringAssert.StartsWith("SMOKE OK 1 turns 1948-08-15", log[log.Count - 1], string.Join("\n", log));+ Assert.AreEqual(2, bridge.Session.Last!.Why.Count(w => w.System == "events" && w.Message.StartsWith("Chosen")));+ Assert.AreEqual(1, bridge.Session.Last.Why.Count(w => w.System == "events" && w.Message.StartsWith("Delegated")));+ }+[Test]public void ASmokeRunWhoseEndTurnDoesNothingFails(){diff --git a/unity/Assets/Tests/EditMode/HudTests.cs b/unity/Assets/Tests/EditMode/HudTests.csindex de1665b21..8dd54a851 100644--- a/unity/Assets/Tests/EditMode/HudTests.cs+++ b/unity/Assets/Tests/EditMode/HudTests.cs@@ -35,22 +35,24 @@ public class HudTests// ---- The score (#380): only in the GDD loop, from GameState.Score ----- static readonly Content Slice = MvpSlice.Load(Paths.Content);- static SimBridge SliceBridge() => new SimBridge(GameSession.New(Slice, GoldenRun.Seed, Mode.Historical), Text);+ /// <summary>The real game: the GDD loop since the cutover (the ?mvp=1 slice is gone with MvpSlice).</summary>+ static SimBridge GddBridge() => new SimBridge(GameSession.New(C, GoldenRun.Seed, Mode.Historical), Text);[Test]public void TheLegacyLoopShowsNoScore(){- Assert.AreEqual("", HudModel.From(NewBridge(), Text).Score);+ // The legacy loop survives only as content without the loop switch (SimBridgeGddTests.Legacy) since the cutover.+ SimBridge LegacyBridge() => new SimBridge(GameSession.New(SimBridgeGddTests.Legacy, GoldenRun.Seed, Mode.Historical), Text);+ Assert.AreEqual("", HudModel.From(LegacyBridge(), Text).Score);using var ui = new UiTestKit();- using var hud = new HudPresenter(ui.Root, NewBridge(), Text);+ using var hud = new HudPresenter(ui.Root, LegacyBridge(), Text);Assert.AreEqual(DisplayStyle.None, ui.Q<Label>("score").style.display.value);}[Test]- public void TheSliceShowsItsScore()+ public void TheGddGameShowsItsScore(){- var bridge = SliceBridge();+ var bridge = GddBridge();Assert.AreEqual("Score 0", HudModel.From(bridge, Text).Score);bridge.State.Score = 150;Assert.AreEqual("Score 150", HudModel.From(bridge, Text).Score);@@ -61,10 +63,10 @@ public class HudTests}[Test]- public void TheBarShowsTheSlicesScore()+ public void TheBarShowsTheGddGamesScore(){using var ui = new UiTestKit();- var bridge = SliceBridge();+ var bridge = GddBridge();using var hud = new HudPresenter(ui.Root, bridge, Text);var label = ui.Q<Label>("score");Assert.AreEqual("Score 0", label.text);@@ -83,12 +85,12 @@ public class HudTestsui.Press("end-turn");Assert.AreEqual(1, bridge.State.Turn);Assert.AreEqual("Turn 1", ui.Q<Label>("turn").text);- Assert.AreEqual("22 May 1948", ui.Q<Label>("date").text);+ Assert.AreEqual("15 June 1948", ui.Q<Label>("date").text); // monthly turns since the GDD cutovervar arrivals = bridge.Session.Last!.Why.Where(w => w.System == "population").Sum(w => w.Delta);Assert.AreEqual(arrivals.ToString("N0", System.Globalization.CultureInfo.InvariantCulture), ui.Q<Label>("immigration-value").text);var s0 = bridge.Session.Previous!; var s1 = bridge.State;var d = System.Math.Round((s1.Treasury - s1.Debt) - (s0.Treasury - s0.Debt), 1, System.MidpointRounding.AwayFromZero);- Assert.AreNotEqual(0.0, d, "the test needs a week with a treasury change");+ Assert.AreNotEqual(0.0, d, "the test needs a turn with a treasury change");Assert.AreEqual(PlayerText.MoneyChange(C, "treasury", d), ui.Q<Label>("treasury-delta").text);Assert.AreEqual(d < 0, ui.Q<Label>("treasury-delta").ClassListContains("delta-down"));Assert.AreEqual(d > 0, ui.Q<Label>("treasury-delta").ClassListContains("delta-up"));diff --git a/unity/Assets/Tests/EditMode/MvpFlagTests.cs b/unity/Assets/Tests/EditMode/MvpFlagTests.csdeleted file mode 100644index fb5ef567d..000000000--- a/unity/Assets/Tests/EditMode/MvpFlagTests.cs+++ /dev/null@@ -1,221 +0,0 @@-#nullable enable-using System;-using System.Collections.Generic;-using System.IO;-using System.Linq;-using NUnit.Framework;-using Statecraft.Game;-using Statecraft.Game.Boot;-using Statecraft.Game.Map;-using Statecraft.Game.UI;-using Statecraft.Sim;-using UnityEditor.SceneManagement;-using UnityEngine.UIElements;-using Object = UnityEngine.Object;--/// <summary>The ?mvp=1 dev flag (#380): it loads the content through MvpSlice.Overlay (the GDD slice) for playtests. It is-/// off by default, the golden check and the smoke run ignore it, and a slice game never reads, sets aside or writes the-/// player's autosave.</summary>-public class MvpFlagTests-{- const string Page = "https://example.org/statecraft/index.html";-- [TestCase(Page + "?mvp=1", false, 0, ExpectedResult = true)]- [TestCase(Page + "?lang=he&mvp=1", false, 0, ExpectedResult = true)]- [TestCase(Page + "?mvp=1#top", false, 0, ExpectedResult = true)]- [TestCase(Page, false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp=0", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp-x=1", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp=2", false, 0, ExpectedResult = false)] // exactly "1": not any other number- [TestCase(Page + "?mvp=10", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp=01", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp=1x", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp=1.5", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvp=1&mvp=0", false, 0, ExpectedResult = false)] // two values: not a clear request- [TestCase(Page + "?mvp=0&mvp=1", false, 0, ExpectedResult = false)]- [TestCase(Page + "?mvpx=1&mvp=1", false, 0, ExpectedResult = true)] // another parameter's name does not count- [TestCase(Page + "?xmvp=1", false, 0, ExpectedResult = false)]- [TestCase("", false, 0, ExpectedResult = false)]- [TestCase(null, false, 0, ExpectedResult = false)]- [TestCase(Page + "?golden&mvp=1", true, 0, ExpectedResult = false)] // the golden check runs the real content- [TestCase(Page + "?mvp=1&smoke=5", false, 5, ExpectedResult = false)] // and so does the smoke run- [TestCase(Page + "?golden&smoke=5&mvp=1", true, 5, ExpectedResult = false)]- public bool WhichUrlsTurnTheSliceOn(string? url, bool golden, int smoke) => GameBoot.SliceRequested(url, golden, smoke);-- [Test]- public void WithoutTheFlagTheContentIsTheRealContent()- {- var inputs = GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);- Assert.IsFalse(inputs.Slice);- Assert.IsFalse(inputs.Content.IsGdd);- Assert.AreEqual(ContentLoader.Load(Paths.Content).Hash, inputs.Content.Hash, "the real content hash does not move");- }-- [Test]- public void TheFlagLoadsTheSliceFromDisk()- {- var inputs = GameInputs.FromDisk(Paths.Content, Paths.StreamingMap, slice: true);- Assert.IsTrue(inputs.Slice);- Assert.IsTrue(inputs.Content.IsGdd);- Assert.AreEqual(new[] { "tel_aviv" }, inputs.Content.Cities.Select(c => c.Id).ToArray());- Assert.AreEqual(MvpSlice.Load(Paths.Content).Hash, inputs.Content.Hash);- }-- /// <summary>The WebGL path: the fetched texts (keys are manifest paths), with and without the flag.</summary>- [Test]- public void TheFlagLoadsTheSliceFromFetchedTexts()- {- var manifest = ContentManifest.Collect(Paths.Content);- var texts = manifest.ToDictionary(f => f, f => File.ReadAllText(Path.Combine(Paths.Content, f)));- var meta = File.ReadAllText(Path.Combine(Paths.StreamingMap, "heightmap.json"));- var r16z = File.ReadAllBytes(Path.Combine(Paths.StreamingMap, HeightmapCodec.FileName));-- var real = GameInputs.FromTexts(texts, manifest, meta, r16z);- Assert.IsFalse(real.Slice);- Assert.IsFalse(real.Content.IsGdd);- Assert.AreEqual(ContentLoader.Load(Paths.Content).Hash, real.Content.Hash);-- var slice = GameInputs.FromTexts(texts, manifest, meta, r16z, slice: true);- Assert.IsTrue(slice.Slice);- Assert.IsTrue(slice.Content.IsGdd);- Assert.AreEqual(MvpSlice.Load(Paths.Content).Hash, slice.Content.Hash);- }-- // ---- A slice game and the player's save ------ string saveDir = "";-- [SetUp] public void TempSaves() => saveDir = Path.Combine(Path.GetTempPath(), "statecraft-mvp-" + Guid.NewGuid().ToString("N"));-- [TearDown]- public void DiscardScene()- {- EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);- if (Directory.Exists(saveDir)) Directory.Delete(saveDir, true);- }-- static GameInputs? sliceInputs;- static GameInputs SliceInputs => sliceInputs ??= GameInputs.FromDisk(Paths.Content, Paths.StreamingMap, slice: true);-- GameRoot BootSlice()- {- EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);- Object.FindFirstObjectByType<MapScene>().Build(SliceInputs.Map);- var root = Object.FindFirstObjectByType<GameRoot>();- root.Store = new SaveStore(saveDir);- root.Begin(SliceInputs, 0);- return root;- }-- [Test]- public void ASliceGameLeavesThePlayersAutosaveAlone()- {- // The player's own game, saved by the real content.- var legacy = GameSession.New(ContentLoader.Load(Paths.Content), GoldenRun.Seed, Mode.Historical);- legacy.Step(Array.Empty<Command>());- var saved = legacy.Save.Write();- Directory.CreateDirectory(saveDir);- var path = Path.Combine(saveDir, SaveStore.AutosaveName);- File.WriteAllText(path, saved);-- var root = BootSlice();- Assert.IsTrue(root.Bridge!.Content.IsGdd, "the slice is running");- Assert.AreEqual(0, root.Bridge.State.Turn, "a fresh slice game, not the player's save");- root.Bridge.EndTurn();- root.Bridge.EndTurn();-- Assert.AreEqual(saved, File.ReadAllText(path), "the player's autosave is unchanged");- Assert.AreEqual(new[] { SaveStore.AutosaveName }, Directory.GetFiles(saveDir).Select(Path.GetFileName).ToArray(),- "nothing set aside, nothing added");- }-- static GameInputs? realInputs;- static GameInputs RealInputs => realInputs ??= GameInputs.FromDisk(Paths.Content, Paths.StreamingMap);-- static UnityEngine.UIElements.Button NewGameButton() =>- Object.FindFirstObjectByType<UnityEngine.UIElements.UIDocument>().rootVisualElement.Q<UnityEngine.UIElements.Button>("new-game");-- /// <summary>Defence in depth: even if a slice game ever got a New Game handler, pressing it twice (ask, confirm) would not- /// delete the player's autosave.</summary>- [Test]- public void NewGamePressedTwiceInASliceKeepsTheAutosave()- {- Directory.CreateDirectory(saveDir);- var path = Path.Combine(saveDir, SaveStore.AutosaveName);- File.WriteAllText(path, "the player's save");- using var ui = new UiTestKit();- var text = UiText.Parse(UnityEditor.AssetDatabase.LoadAssetAtPath<UnityEngine.TextAsset>(UiPaths.Strings).text);- var bridge = new SimBridge(GameSession.New(SliceInputs.Content, GoldenRun.Seed, Mode.Historical), text);- using var toast = new ToastPresenter(ui.Root, bridge, text);- using var newGame = new NewGamePresenter(ui.Root, bridge, new SaveStore(saveDir), toast, text, () => 7UL, slice: true);- var session = bridge.Session;- ui.Press("new-game");- ui.Press("new-game");- Assert.AreEqual("the player's save", File.ReadAllText(path), "the autosave is untouched");- Assert.AreSame(session, bridge.Session, "no new game started");- }-- /// <summary>A slice game booted through GameRoot with the start screen asked for: no start screen, and New Game pressed- /// twice deletes nothing and starts nothing, even with its button forced back on screen (a regression that showed it).- /// The guard is the presenter's slice flag, which GameRoot must pass.</summary>- [Test]- public void ASliceGamesNewGameThroughGameRootDeletesNothing()- {- Directory.CreateDirectory(saveDir);- var path = Path.Combine(saveDir, SaveStore.AutosaveName);- File.WriteAllText(path, "the player's save");- EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);- Object.FindFirstObjectByType<MapScene>().Build(SliceInputs.Map);- var root = Object.FindFirstObjectByType<GameRoot>();- root.Store = new SaveStore(saveDir);- root.Begin(SliceInputs, 0, startScreen: true);- var ui = Object.FindFirstObjectByType<UIDocument>().rootVisualElement;- Assert.IsFalse(ui.Q("root").ClassListContains(StartScreenPresenter.OpenClass), "no start screen in a slice game");- var session = root.Bridge!.Session;- var button = ui.Q<Button>("new-game");- button.style.display = DisplayStyle.Flex; // as if a regression drew it again- UiTestKit.Press(button);- UiTestKit.Press(button);- Assert.AreEqual("the player's save", File.ReadAllText(path), "the autosave is untouched");- Assert.AreSame(session, root.Bridge.Session, "no new game started");- }-- /// <summary>A slice game has no New Game (it would delete the player's autosave): the button is not drawn and is out of- /// the Tab order, rather than drawn and dead. A normal game keeps it, also after a slice game in the same scene.</summary>- [Test]- public void ASliceGameHasNoNewGameButton()- {- BootSlice();- var button = NewGameButton();- Assert.AreEqual(UnityEngine.UIElements.DisplayStyle.None, button.style.display.value, "not drawn");- Assert.IsFalse(button.focusable, "out of the Tab order");- Assert.IsFalse(button.canGrabFocus, "out of the Tab order");-- var root = Object.FindFirstObjectByType<GameRoot>();- root.Begin(RealInputs, 0); // the same scene, now a normal game- Assert.AreNotEqual(UnityEngine.UIElements.DisplayStyle.None, button.style.display.value, "a normal game draws it");- Assert.IsTrue(button.focusable, "a normal game keeps it in the Tab order");- }-- [Test]- public void ANormalGameHasItsNewGameButton()- {- EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);- Object.FindFirstObjectByType<MapScene>().Build(RealInputs.Map);- var root = Object.FindFirstObjectByType<GameRoot>();- root.Store = new SaveStore(saveDir);- root.Begin(RealInputs, 0);- var button = NewGameButton();- Assert.AreNotEqual(UnityEngine.UIElements.DisplayStyle.None, button.style.display.value);- Assert.IsTrue(button.focusable);- }-- [Test]- public void ASliceGameWritesNoAutosave()- {- var root = BootSlice();- root.Bridge!.EndTurn();- Assert.IsFalse(File.Exists(Path.Combine(saveDir, SaveStore.AutosaveName)));- }-}diff --git a/unity/Assets/Tests/EditMode/MvpFlagTests.cs.meta b/unity/Assets/Tests/EditMode/MvpFlagTests.cs.metadeleted file mode 100644index 169956f5f..000000000--- a/unity/Assets/Tests/EditMode/MvpFlagTests.cs.meta+++ /dev/null@@ -1,2 +0,0 @@-fileFormatVersion: 2-guid: 77710788566b49c0b6a1adfb0625ebed\ No newline at end of filediff --git a/unity/Assets/Tests/EditMode/PromoScreensTests.cs b/unity/Assets/Tests/EditMode/PromoScreensTests.csindex fde1f4015..fd6e43ab7 100644--- a/unity/Assets/Tests/EditMode/PromoScreensTests.cs+++ b/unity/Assets/Tests/EditMode/PromoScreensTests.cs@@ -35,8 +35,11 @@ public class PromoScreensTestsreturn g;}- /// <summary>One date in each legislature the content has: the Provisional State Council, the First and the Second Knesset.</summary>- static IEnumerable<DateTime> OneDatePerLegislature() => C.Legislatures.Select(l => l.From < C.Rules.Start ? C.Rules.Start : l.From.AddDays(30));+ /// <summary>One date in each legislature the game reaches: the Provisional State Council, the First and the Second+ /// Knesset. Since the GDD cutover play ends on 15 January 1952 (R-LOOP-004); the later legislatures stay in the content for+ /// the paused eras (G2), where play does not reach them.</summary>+ static IEnumerable<DateTime> OneDatePerLegislature() => C.Legislatures.Where(l => l.From < C.End.AddDays(-30))+ .Select(l => l.From < C.Rules.Start ? C.Rules.Start : l.From.AddDays(30));[Test]public void TheHalfCircleSeatsTheRealLegislatureWithTheCoalitionFirst()diff --git a/unity/Assets/Tests/EditMode/SaveUiTests.cs b/unity/Assets/Tests/EditMode/SaveUiTests.csindex 7c96fbf99..1d2f45170 100644--- a/unity/Assets/Tests/EditMode/SaveUiTests.cs+++ b/unity/Assets/Tests/EditMode/SaveUiTests.cs@@ -64,7 +64,7 @@ public class SaveUiTestsvar notes = new List<string>();var session = GameStart.Begin(C, store, () => 5UL, notes, Text);Assert.AreEqual(0, session.State.Turn);- Assert.AreEqual(new[] { Unreadable(Text) }, notes.ToArray()); // the sim's English reason goes to the log only (#631)+ Assert.AreEqual(Text["save.refused." + SaveException.NewerVersion], notes[0]); // a newer schema: R-SAVE-002 (N2)Assert.IsFalse(File.Exists(store.AutosavePath));Assert.IsTrue(File.Exists(Path.Combine(store.Directory, "autosave.bad.txt")));}@@ -104,6 +104,7 @@ public class SaveUiTestsplayed.Step(new Command[] { new SetMobilization(1.0) });var save = played.Save.Write();string logged;+ var expected = Unreadable(text);switch (kind){case "damaged line":@@ -114,6 +115,8 @@ public class SaveUiTestsvar other = C.Ruleset == SaveGame.LegacyRuleset ? SaveGame.GddRuleset : SaveGame.LegacyRuleset;save = save.Replace("ruleset " + C.Ruleset, "ruleset " + other);logged = "version of the game's rules";+ // A coded refusal since the cutover (R-SAVE-001): a legacy save in the GDD game says so in its own string (N4).+ expected = text["save.refused." + SaveException.OlderRules];break;case "replay differs":save = save.Replace("seed 9", "seed 10"); // the same content, so a replay that ends elsewhere is refused@@ -133,12 +136,58 @@ public class SaveUiTestsvar session = GameStart.Begin(content, store, () => 6UL, notes, text, out var resumed);Assert.IsFalse(resumed);Assert.AreEqual(0, session.State.Turn);- Assert.AreEqual(new[] { Unreadable(text) }, notes.ToArray());+ Assert.AreEqual(new[] { expected }, notes.ToArray());StringAssert.DoesNotContain("line", notes[0]);StringAssert.DoesNotContain("turn", notes[0]);Assert.IsTrue(File.Exists(Path.Combine(store.Directory, "autosave.bad.txt")));}+ /// <summary>A store whose autosave is refused with a code the strings do not have (a future SaveException code).</summary>+ sealed class UnknownCodeStore : SaveStore+ {+ public UnknownCodeStore(string dir) : base(dir) { }+ public override string? ReadAutosave() => throw new SaveException(0, "made by a future version", "a_code_with_no_string");+ }++ /// <summary>The start never blocks: a refusal code with no string falls back to the one short localised reason (#631),+ /// instead of throwing a missing-key error out of GameStart.Begin.</summary>+ [Test]+ public void ARefusalCodeWithNoStringFallsBackToTheShortReason()+ {+ var store = new UnknownCodeStore(TempStore().Directory);+ var notes = new List<string>();+ LogAssert.Expect(LogType.Warning, new System.Text.RegularExpressions.Regex("Autosave rejected"));+ GameSession? session = null;+ Assert.DoesNotThrow(() => session = GameStart.Begin(C, store, () => 6UL, notes, Text));+ Assert.AreEqual(0, session!.State.Turn);+ Assert.AreEqual(new[] { Unreadable(Text) }, notes.ToArray());+ }++ /// <summary>N4 (R-SAVE-001, R-SAVE-002): a save from before the GDD cutover, or from a newer version, is refused with the+ /// code's own string, in English and in Hebrew, and the player reads "a new game has started" once.</summary>+ [TestCase("ruleset legacy", SaveException.OlderRules, "earlier version of the game's rules")]+ [TestCase("ruleset gdd-0.2", SaveException.NewerVersion, "newer version of the game")]+ public void ARefusedSaveIsSaidOnceInThePlayersLanguage(string ruleset, string code, string english)+ {+ var good = GameSession.New(C, 9, Mode.Historical).Save.Write();+ StringAssert.Contains("\nruleset gdd-0.1\n", good);+ foreach (var path in new[] { UiPaths.Strings, UiPaths.StringsHebrew })+ {+ var text = UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(path).text);+ var store = TempStore();+ store.WriteAutosave(good.Replace("ruleset gdd-0.1", ruleset));+ var notes = new List<string>();+ LogAssert.Expect(LogType.Warning, new System.Text.RegularExpressions.Regex("Autosave rejected"));+ var session = GameStart.Begin(C, store, () => 6UL, notes, text, out var resumed);+ Assert.IsFalse(resumed);+ Assert.AreEqual(0, session.State.Turn);+ Assert.AreEqual(new[] { text["save.refused." + code] }, notes.ToArray(), path);+ }+ var en = UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text)["save.refused." + code];+ StringAssert.Contains(english, en);+ Assert.AreEqual(1, System.Text.RegularExpressions.Regex.Matches(en, "new game").Count, "said once (N4)");+ }+[Test]public void AReadThatFailsAndASetAsideThatFailsNeverStopTheStart(){diff --git a/unity/Assets/Tests/EditMode/SimBridgeGddTests.cs b/unity/Assets/Tests/EditMode/SimBridgeGddTests.csindex 4d26c860c..eae372f94 100644--- a/unity/Assets/Tests/EditMode/SimBridgeGddTests.cs+++ b/unity/Assets/Tests/EditMode/SimBridgeGddTests.cs@@ -8,12 +8,28 @@ using UnityEditor;using UnityEngine;/// <summary>The GDD orders through the UI's queue (#380): AssignWorkers, Train and CancelTraining queue in the slice-/// (MvpSlice), an id the content or state does not have is refused before End Turn, an order replaces an earlier one+/// (the real content, the GDD game since the cutover), an id the content or state does not have is refused before End Turn, an order replaces an earlier one/// with the same key, and the legacy loop's content queues none of them.</summary>public class SimBridgeGddTests{- static readonly Content Slice = MvpSlice.Load(Paths.Content);- static readonly Content Legacy = ContentLoader.Load(Paths.Content);+ static readonly Content Slice = ContentLoader.Load(Paths.Content);+ /// <summary>The legacy loop: the real content without eras.yaml's loop switch (the real game runs gdd since the cutover).</summary>+ internal static readonly Content Legacy = LoadLegacy();++ static Content LoadLegacy()+ {+ const string loop = " systems: { loop: gdd }\n";+ var dir = Paths.Content;+ var events = System.IO.Directory.GetFiles(System.IO.Path.Combine(dir, "events"), "*.yaml").Select(f => "events/" + System.IO.Path.GetFileName(f)).ToList();+ Assert.IsTrue(System.IO.File.ReadAllText(System.IO.Path.Combine(dir, "eras.yaml")).Contains(loop), "eras.yaml has the switch to take out");+ return ContentLoader.Load(rel =>+ {+ var path = System.IO.Path.Combine(dir, rel);+ if (!System.IO.File.Exists(path)) return null;+ var text = System.IO.File.ReadAllText(path);+ return rel == "eras.yaml" ? text.Replace(loop, "") : text;+ }, events);+ }static UiText Text => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);static SimBridge Bridge(Content c) => new SimBridge(GameSession.New(c, GoldenRun.Seed, Mode.Historical), Text);diff --git a/unity/Assets/Tests/EditMode/SimBridgeGuardTests.cs b/unity/Assets/Tests/EditMode/SimBridgeGuardTests.csindex a0812e1af..9d2ec1aa7 100644--- a/unity/Assets/Tests/EditMode/SimBridgeGuardTests.cs+++ b/unity/Assets/Tests/EditMode/SimBridgeGuardTests.cs@@ -14,7 +14,7 @@ using UnityEngine;/// sample below and its branch in SimBridge. The samples mirror the sim's CommandGuardTests.Samples.</summary>public class SimBridgeGuardTests{- static readonly Content Slice = MvpSlice.Load(Paths.Content);+ static readonly Content Slice = ContentLoader.Load(Paths.Content);static UiText Text => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);static readonly Dictionary<Type, Command> Samples = new Dictionary<Type, Command>diff --git a/unity/Assets/Tests/EditMode/SimBridgeSiteTests.cs b/unity/Assets/Tests/EditMode/SimBridgeSiteTests.csindex 7a02c9b2b..58a0992ea 100644--- a/unity/Assets/Tests/EditMode/SimBridgeSiteTests.cs+++ b/unity/Assets/Tests/EditMode/SimBridgeSiteTests.cs@@ -7,12 +7,12 @@ using Statecraft.Sim;using UnityEditor;using UnityEngine;-/// <summary>Pioneer work through the UI's queue (#378): PioneerWork and StopWork queue in the slice (MvpSlice) for a unit that+/// <summary>Pioneer work through the UI's queue (#378): PioneerWork and StopWork queue in the real content (the GDD game since the cutover) for a unit that/// exists, an id the content or state does not have is refused before End Turn, one order per unit, and the legacy loop's/// content queues neither.</summary>public class SimBridgeSiteTests{- static readonly Content Slice = MvpSlice.Load(Paths.Content);+ static readonly Content Slice = ContentLoader.Load(Paths.Content);static readonly Content Legacy = ContentLoader.Load(Paths.Content);static UiText Text => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);static SimBridge Bridge(Content c) => new SimBridge(GameSession.New(c, GoldenRun.Seed, Mode.Historical), Text);diff --git a/unity/Assets/Tests/EditMode/SimSmokeTests.cs b/unity/Assets/Tests/EditMode/SimSmokeTests.csindex ee6fc15cd..f0a436c13 100644--- a/unity/Assets/Tests/EditMode/SimSmokeTests.cs+++ b/unity/Assets/Tests/EditMode/SimSmokeTests.cs@@ -32,7 +32,7 @@ public class SimSmokeTestspublic void GoldenPlaythroughTo1952MatchesDotNet(){var s = GoldenRun.Play(ContentLoader.Load(Paths.Content), GoldenRun.Until1952);- Assert.IsNull(s.GameOver);+ Assert.AreEqual(GameOverCodes.MvpEnded, s.GameOver); // the game's last turn ends on 15 January 1952 (R-LOOP-004)Assert.AreEqual(GoldenRun.Hash1952, s.Hash());}diff --git a/unity/Assets/Tests/EditMode/SubdistrictTests.cs b/unity/Assets/Tests/EditMode/SubdistrictTests.csindex f904e4299..7215ee96a 100644--- a/unity/Assets/Tests/EditMode/SubdistrictTests.cs+++ b/unity/Assets/Tests/EditMode/SubdistrictTests.cs@@ -193,6 +193,7 @@ public class SubdistrictTestspublic void TheInfoPanelNamesTheSelectedHexsSubdistrict(){Boot(saveDir);+ GameSceneTests.HideTheOpeningCard(Object.FindFirstObjectByType<UIDocument>().rootVisualElement); // the 15 May card covers the mapvar pointer = Object.FindFirstObjectByType<MapPointer>();var map = Object.FindFirstObjectByType<MapScene>();var tlv = Inputs.Content.SettlementHexes.Single(s => s.Id == "tel_aviv");diff --git a/unity/Assets/Tests/EditMode/TopBarScoreLayoutTests.cs b/unity/Assets/Tests/EditMode/TopBarScoreLayoutTests.csindex 033fb3d83..2ee2073d6 100644--- a/unity/Assets/Tests/EditMode/TopBarScoreLayoutTests.cs+++ b/unity/Assets/Tests/EditMode/TopBarScoreLayoutTests.cs@@ -15,7 +15,7 @@ using UnityEngine.UIElements;/// text, and whole, at every window size the HUD's tests use, in English and Hebrew.</summary>public class TopBarScoreLayoutTests{- static readonly Content Slice = MvpSlice.Load(Paths.Content);+ static readonly Content Gdd = ContentLoader.Load(Paths.Content); // the real game: GDD since the cutoverstatic UiText En => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.Strings).text);static UiText He => UiText.Parse(AssetDatabase.LoadAssetAtPath<TextAsset>(UiPaths.StringsHebrew).text, "strings.he.yaml");@@ -60,7 +60,7 @@ public class TopBarScoreLayoutTestsvar root = doc.rootVisualElement;root.Q("root").RemoveFromClassList("loading");root.Q("root").EnableInClassList(UiLanguage.HebrewClass, hebrew);- var bridge = new SimBridge(GameSession.New(Slice, GoldenRun.Seed, Mode.Historical), text);+ var bridge = new SimBridge(GameSession.New(Gdd, GoldenRun.Seed, Mode.Historical), text);bridge.State.Score = WorstScore;bridge.State.Date = WorstDate;bridge.State.Turn = WorstTurn;diff --git a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs b/unity/Assets/Tests/EditMode/UnitsInPlayTests.csindex ebc9473e5..a61e088b7 100644--- a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs+++ b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs@@ -231,7 +231,7 @@ public class UnitsInPlayTestsvar tokens = UnitRoster.Build(units, C, s);Assert.AreEqual(before, s.Hash(), $"turn {turn}: building the roster changed the state");digests.Add($"{s.Date:yyyy-MM-dd} {string.Join(",", tokens)}");- s = Simulation.Step(C, s, HistoricalAI.Commands(C, s)).State;+ s = Simulation.Step(C, s, GoldenRun.Orders(C, s)).State; // the golden runs' orders (the reference player since the cutover)}Assert.AreEqual(GoldenRun.Hash1950, s.Hash(), "the golden does not move");// The presentation golden: the roster of every turn of the historical playthrough, pinned. A deliberate change to@@ -255,7 +255,8 @@ public class UnitsInPlayTestsAssert.AreEqual(WeeklyGolden, Sha256(all));}- const string RosterGolden1950 = "f07b1655defbd0299767a2e214bf62558f8c64a37d2e408ecc9ee0ed4ed24c29";+ // GDD Phase 2 PR 1 (the cutover): the golden run is 20 monthly turns with the reference player (was f07b1655).+ const string RosterGolden1950 = "573f30998628a434e6b4156cba5d20f8d974ca28b62f74388f9480de84592baa";const string WeeklyGolden = "323cbe046b9666b1d9ab46abeb139540d6e06e394a65ad03e043aa0912cba96e";// ---- Placement, the layer and the card (a built map) ---------------------------------------------------------diff --git a/unity/Assets/Tests/EditMode/WhyScreenTests.cs b/unity/Assets/Tests/EditMode/WhyScreenTests.csindex 13684b086..29972131f 100644--- a/unity/Assets/Tests/EditMode/WhyScreenTests.cs+++ b/unity/Assets/Tests/EditMode/WhyScreenTests.cs@@ -21,7 +21,7 @@ public class WhyScreenTestsAssert.AreEqual("Nothing has happened yet: end the turn to see its causes.", ui.Q<Label>("why-empty").text);bridge.Queue(new SetMobilization(1.0));var r = bridge.EndTurn();- Assert.AreEqual("15 May 1948 to 22 May 1948", ui.Q<Label>("why-turn").text);+ Assert.AreEqual("15 May 1948 to 15 June 1948", ui.Q<Label>("why-turn").text);var lines = ui.Q<ScrollView>("why-rows").Query<Label>(className: "why-line").ToList();Assert.AreEqual(r.Why.Count, lines.Count);Assert.AreEqual("Immigration and population", ui.Q<Label>("why-group-population").text);@@ -143,7 +143,7 @@ public class WhyScreenTestsvar second = ui.Q<ScrollView>("why-rows").Query<Label>(className: "why-line").ToList();Assert.AreEqual(r.Why.Count, second.Count);Assert.AreNotSame(first[0], second[0]);- Assert.AreEqual("22 May 1948 to 29 May 1948", ui.Q<Label>("why-turn").text);+ Assert.AreEqual("15 June 1948 to 15 July 1948", ui.Q<Label>("why-turn").text);}}diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 3b2e7044e..748725236 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -253,5 +253,7 @@ newgame.confirm: "Press New game again to abandon this game and start over."newgame.delete_failed: "The old saved game could not be removed; it will be replaced after your next turn."save.unreadable: "Your saved game could not be loaded ({0}). A new game has started."save.reason_other: "the file could not be read or replayed"+save.refused.older_rules: "Your saved game was made with an earlier version of the game's rules and cannot be continued. A new game has started."+save.refused.newer_version: "Your saved game was made with a newer version of the game and cannot be opened here. A new game has started."boot.failed: "Statecraft could not start: {0}. Reload the page."save.write_failed: "Your game could not be saved."diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 2ee242f4a..c235b0e4f 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -240,5 +240,7 @@ newgame.confirm: "יש ללחוץ שוב על משחק חדש כדי לעזובnewgame.delete_failed: "לא ניתן היה להסיר את השמירה הקודמת; היא תוחלף אחרי התור הבא."save.unreadable: "לא ניתן היה לטעון את המשחק השמור ({0}). משחק חדש התחיל."save.reason_other: "לא ניתן היה לקרוא את הקובץ או לשחזר את המשחק"+save.refused.older_rules: "המשחק השמור נוצר בגרסה קודמת של חוקי המשחק ואי אפשר להמשיך אותו. משחק חדש התחיל."+save.refused.newer_version: "המשחק השמור נוצר בגרסה חדשה יותר של המשחק ואי אפשר לפתוח אותו כאן. משחק חדש התחיל."boot.failed: "לא ניתן היה להפעיל את Statecraft: {0}. יש לטעון את הדף מחדש."save.write_failed: "לא ניתן היה לשמור את המשחק."