A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Fixes #80 (#1386)
Eyal Golan3c8f3098e549
diff --git a/changelog.d/80.md b/changelog.d/80.mdnew file mode 100644index 000000000..b83bc9099--- /dev/null+++ b/changelog.d/80.md@@ -0,0 +1,4 @@+### Changed+- The rationing policy and its two effects (food supply up, cohesion down) start on 10 March 1949 with the rationing+ office, not on 15 May 1948 (#80, owner ruling 22 Oct 2026). Moves smoke5, smoke-orders, scenario-cautious and+ scenario-reckless.diff --git a/content/model.yaml b/content/model.yamlindex 61ef36d24..7cb2bf090 100644--- a/content/model.yaml+++ b/content/model.yaml@@ -9,11 +9,10 @@ indicators:- { id: security, base: 0.30, name: Security }- { id: intl_standing, base: 0.50, name: International support }# Windows (issue #80, Yishuv design 5.1 and 5.5; the dates are game design, not historical facts): the policies, effects and-# actors that only make sense in a state begin on 15 May 1948, the Founding start, so a Founding start holds the same-# records as before. `rationing` and `rationing_feeds` stay windowless because their office, rationing_minister, only-# exists from 10 March 1949 and the loader needs an office to cover its policy's whole window.+# actors that only make sense in a state begin on 15 May 1948, the Founding start. The rationing policy and its effects+# follow the rationing office's window from 10 March 1949 (owner ruling 22 October 2026, #80).policies:- - { id: rationing, default: 0.0, office: rationing_minister, name: Rationing }+ - { id: rationing, from: 1949-03-10, default: 0.0, office: rationing_minister, name: Rationing }- { id: housing_construction, from: 1948-05-15, default: 0.3, office: labour_minister, name: Housing construction }- { id: border_settlement, from: 1948-05-15, default: 0.2, office: agriculture_minister, name: Border settlement }# 1 = transit camps (ma'abarot) where residents earn their own living replace the free-board immigrant camps.@@ -21,8 +20,8 @@ policies:# Minister, who decided it with the Jewish Agency (and the Ministry of Immigration ends on 1951-10-08).- { id: maabarot, from: 1948-05-15, default: 0.0, office: prime_minister, name: Transit camps (ma'abarot) }effects:- - { id: rationing_feeds, source: rationing, target: food_supply, k: 0.40, inertia: 2, office: rationing_minister, name: Rations share out food }- - { id: rationing_grates, from: 1948-05-15, source: rationing, target: morale, k: -0.15, inertia: 1, name: Rationing wears on cohesion }+ - { id: rationing_feeds, from: 1949-03-10, source: rationing, target: food_supply, k: 0.40, inertia: 2, office: rationing_minister, name: Rations share out food }+ - { id: rationing_grates, from: 1949-03-10, source: rationing, target: morale, k: -0.15, inertia: 1, name: Rationing wears on cohesion }- { id: building_houses, from: 1948-05-15, source: housing_construction, target: housing, k: 0.35, inertia: 4, office: labour_minister, name: New housing }- { id: homes_lift_morale, source: housing, target: morale, k: 0.15, inertia: 2, name: Homes lift cohesion }- { id: border_villages_secure, from: 1948-05-15, source: border_settlement, target: security, k: 0.30, inertia: 4, office: agriculture_minister, name: Border villages }diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 15d5660f7..8dda28de6 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -31,7 +31,7 @@ macOS IL2CPP parity check is not an MVP release gate.# one GOLDEN OK line per manifest golden (#394), e.g. "GOLDEN OK hash1950 f3ec68b734a3beb24df9a873e0400f0253aed48f3cde2ea12415f1890dcaa5b0"# and "GOLDEN OK hash1952 6b374f69a0ed276eeea69737e2a8b0e72d26feb930dab35e8f7c50113c4e9c0b"uv run tools/web_check.py unity/Builds/Web-gzip --query "golden&smoke=5" "${golden_expect[@]}" \- --expect "SMOKE OK 5 turns 1948-10-15 d449bf194d94e882d36b899079ce573094ea710327db7ac6e84939632c46bf85"+ --expect "SMOKE OK 5 turns 1948-10-15 bc2ab42b43bab8f19eb9b25368a3d4da5f2d3fdfed092b480c8d2738b035a298"uv run tools/web_check.py unity/Builds/Web-gzip --startscreen new --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-gzip --startscreen recording --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-gzip --startscreen new --query lang=he --timeout 300 --stall 90@@ -61,7 +61,7 @@ macOS IL2CPP parity check is not an MVP release gate."$UNITY" -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -buildTarget WebGL -executeMethod Statecraft.Game.EditorTools.Build.Web -compression gzip -decompressionFallback -shareable -out Builds/Web-pages -logFile "$PWD/unity-build-web-pages.log"git checkout -- unity/Assets/Settings unity/ProjectSettings/ProjectSettings.assetuv run tools/web_check.py unity/Builds/Web-pages --query "golden&smoke=5" "${golden_expect[@]}" \- --expect "SMOKE OK 5 turns 1948-10-15 d449bf194d94e882d36b899079ce573094ea710327db7ac6e84939632c46bf85"+ --expect "SMOKE OK 5 turns 1948-10-15 bc2ab42b43bab8f19eb9b25368a3d4da5f2d3fdfed092b480c8d2738b035a298"uv run tools/web_check.py unity/Builds/Web-pages --startscreen new --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-pages --startscreen recording --timeout 300 --stall 90uv run tools/web_check.py unity/Builds/Web-pages --startscreen new --query lang=he --timeout 300 --stall 90diff --git a/docs/determinism.md b/docs/determinism.mdindex 934174d82..3f1fa580e 100644--- a/docs/determinism.md+++ b/docs/determinism.md@@ -53,7 +53,7 @@ player check enumerate the manifest, so it and every scenario are checked withouA further value is pinned for the browser smoke run (`?smoke=5`: the golden seed, five turns played through the UI's ownbuttons, 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 d449bf194d94e882d36b899079ce573094ea710327db7ac6e84939632c46bf85`.+ministers): `SMOKE OK 5 turns 1948-10-15 bc2ab42b43bab8f19eb9b25368a3d4da5f2d3fdfed092b480c8d2738b035a298`.It depends on the UI path as well as the sim (which option is first, the turn grid), so re-record it when either changes.Check every WebGL build with every manifest entry (plus the UI-path smoke line) with:@@ -64,7 +64,7 @@ while read -r name hash; dogolden_expect+=(--expect "GOLDEN OK $name $hash")done < sim/Statecraft.Sim.Tests/golden/manifest.txtuv run tools/web_check.py unity/Builds/Web-<compression> --query "golden&smoke=5" "${golden_expect[@]}" \- --expect "SMOKE OK 5 turns 1948-10-15 d449bf194d94e882d36b899079ce573094ea710327db7ac6e84939632c46bf85"+ --expect "SMOKE OK 5 turns 1948-10-15 bc2ab42b43bab8f19eb9b25368a3d4da5f2d3fdfed092b480c8d2738b035a298"````smoke-orders` (GDD Phase 5 PR 15, #754) is the same kind of browser run for the unit orders (`?smoke-orders`, desktop@@ -72,14 +72,14 @@ uv run tools/web_check.py unity/Builds/Web-<compression> --query "golden&smoke=5hex of the unit `GoldenRun.SmokeMove` names (the lowest-id unit `Movement.Reachable` has a hex for: unit 0, Golani, on10,9), presses the unit card's Move button, clicks the first lit hex in `Reachable`'s (q, r) order that is no enemy-heldplace (7,11; it skips Nazareth's 7,10, so the run captures nothing) and presses End Turn:-`SMOKE ORDERS OK 1948-06-15 ee6bfee561120532416c1aff2cd7cd741256aaafb443d19b414031356b680ae6`.+`SMOKE ORDERS OK 1948-06-15 9f224bd44792f73f393a8ec8f552f20d3bc3c05ab26d08d1b58762b2bf075114`.`GoldenRun.PlaySmokeOrders` plays the same turn with that one `Move`, so the value is in the manifest (`SliceSmokeTests.TheSmokeOrdersRunMovesOneUnitAndEndsOnTheGolden`) and the player's golden checkprints it as `GOLDEN OK smoke-orders`. Re-record it when the sim or the order path on the card changes; the fortify, hold andattack slices can add their orders to it. Check a WebGL build with:```uv run tools/web_check.py unity/Builds/Web-<compression> --query "smoke-orders" \- --expect "SMOKE ORDERS OK 1948-06-15 ee6bfee561120532416c1aff2cd7cd741256aaafb443d19b414031356b680ae6"+ --expect "SMOKE ORDERS OK 1948-06-15 9f224bd44792f73f393a8ec8f552f20d3bc3c05ab26d08d1b58762b2bf075114"```**When a golden moves.** The test fails with the lines that changed, grouped by section (`[ind]`, `[pol]`, `[bud]`,@@ -111,7 +111,7 @@ scripted command passes. A command the sim rejects fails the test with the date,fails 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 samecommand; its snapshot diff in the PR shows what moved, and the commit message says why. All four 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+`cautious` and `reckless` run through March 1949, setting rationing on the first turn after its office opens; `mvp-absorb-first` (GDD Phase 1PR 3) fills Tel Aviv's jobs on the first turn and completes the absorb objective on 15 January 1950; `mvp-defeat` (GDD Phase 7 PR 5) overspends andturns down every source of foreign currency until Money and Food run out, and ends in `defeat_economy` (R-END-002).@@ -407,3 +407,7 @@ The hash reads the state keys, so it never sees a record outside its window. An| GDD Phase 5 PR 3: recruit formations and their upkeep (#742, #1130) | scenario-mvp-absorb-first | `d6d47fd8` | same; debt alone rises by IL 8.2m (was `912504be`) || GDD Phase 5 PR 3: recruit formations and their upkeep (#742, #1130) | scenario-mvp-defeat | `584a828a` | same; debt alone rises by IL 17.8m; the defeat is unchanged (was `109b0a5e`) || GDD Phase 7 PR 6, slice 1: the score's parts (R-SCORE-001, #809) | scenario-mvp-absorb-first | `6aa49f62` | the state keeps the score's parts as they score, a new `scoreparts=` line (objective points, timing bonuses, prisoner points): `scoreparts=100,0,0` beside `score=100`. Nothing else moves; the other goldens score nothing, so they keep their hashes (was `d6d47fd8`) |+| #80: rationing, rationing_feeds and rationing_grates from 10 March 1949 (owner ruling 22 Oct 2026) | smoke5 | `bc2ab42b` | the rationing policy and its two effects leave the state before 10 March 1949, so their keys (all at 0 in this run) leave the hashed state; no value moves (was `d449bf19`) |+| #80: rationing, rationing_feeds and rationing_grates from 10 March 1949 (owner ruling 22 Oct 2026) | smoke-orders | `9f224bd4` | same as smoke5 (was `ee6bfee5`) |+| #80: rationing, rationing_feeds and rationing_grates from 10 March 1949 (owner ruling 22 Oct 2026) | scenario-cautious | `f672a0f3` | rationing can no longer be set on 15 May 1948, so the scenario sets it (0.4) on the first turn the office exists (15 March 1949) and runs to 15 April 1949 (was 15 January 1949) so it acts; the snapshot moves with the three extra turns (was `95982cf8`) |+| #80: rationing, rationing_feeds and rationing_grates from 10 March 1949 (owner ruling 22 Oct 2026) | scenario-reckless | `cb1c96d5` | same as cautious, rationing 1.0 (was `6650ed3e`) |diff --git a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs b/sim/Statecraft.Sim.Tests/PlayerTextTests.csindex 6617df9a9..cfec445d9 100644--- a/sim/Statecraft.Sim.Tests/PlayerTextTests.cs+++ b/sim/Statecraft.Sim.Tests/PlayerTextTests.cs@@ -147,7 +147,10 @@ public class PlayerTextTestsforeach (var o in e.Options){var g = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);- g.Date = e.From; g.PendingEvents.Clear(); g.PendingEvents.Add(e.Id);+ var start = g.Date;+ g.Date = e.From;+ ContentWindows.Update(c, g, start);+ g.PendingEvents.Clear(); g.PendingEvents.Add(e.Id);var r = Simulation.Step(c, g, new Command[] { new ChooseEventOption(e.Id, o.Id) });Assert.Empty(r.Rejected);causes.AddRange(r.Why);diff --git a/sim/Statecraft.Sim.Tests/YishuvWindowsTests.cs b/sim/Statecraft.Sim.Tests/YishuvWindowsTests.csindex 331519def..cadac9fab 100644--- a/sim/Statecraft.Sim.Tests/YishuvWindowsTests.cs+++ b/sim/Statecraft.Sim.Tests/YishuvWindowsTests.cs@@ -2,21 +2,36 @@ using System;using System.Linq;using Statecraft.Sim;-/// <summary>The Yishuv windows in the real content (#80): a fresh Founding start holds exactly the records it held before.</summary>+/// <summary>The Yishuv windows in the real content (#80).</summary>public class YishuvWindowsTests{static readonly Content C = ContentLoader.Load(RealContentTests.ContentRoot());[Fact]- public void AFreshFoundingStartHoldsTheSameRecordsAsBeforeTheWindows()+ public void AFreshFoundingStartHoldsOnlyTheRecordsActiveThen(){var s = Simulation.NewGame(C, 1, Mode.Historical);Assert.Equal(new[] { "food_supply", "housing", "intl_standing", "morale", "security" }, s.Indicators.Keys.OrderBy(k => k, StringComparer.Ordinal));- Assert.Equal(new[] { "border_settlement", "housing_construction", "maabarot", "rationing" }, s.Policies.Keys.OrderBy(k => k, StringComparer.Ordinal));- Assert.Equal(new[] { "border_villages_secure", "building_houses", "food_lifts_cohesion", "homes_lift_morale", "rationing_feeds", "rationing_grates", "safety_lifts_morale", "work_lifts_cohesion" },+ Assert.Equal(new[] { "border_settlement", "housing_construction", "maabarot" }, s.Policies.Keys.OrderBy(k => k, StringComparer.Ordinal));+ Assert.Equal(new[] { "border_villages_secure", "building_houses", "food_lifts_cohesion", "homes_lift_morale", "safety_lifts_morale", "work_lifts_cohesion" },s.EffectContributions.Keys.OrderBy(k => k, StringComparer.Ordinal));}+ [Fact]+ public void RationingAndItsEffectsBeginWithTheRationingOffice()+ {+ var from = new DateTime(1949, 3, 10);+ var before = C.At(from.AddDays(-1));+ Assert.DoesNotContain(before.Policies, p => p.Id == "rationing");+ Assert.DoesNotContain(before.Effects, e => e.Id == "rationing_feeds");+ Assert.DoesNotContain(before.Effects, e => e.Id == "rationing_grates");++ var on = C.At(from);+ Assert.Contains(on.Policies, p => p.Id == "rationing");+ Assert.Contains(on.Effects, e => e.Id == "rationing_feeds");+ Assert.Contains(on.Effects, e => e.Id == "rationing_grates");+ }+[Fact]public void TheStateRecordsBeginOnTheFoundingDateAndTheUnOnItsOwn(){diff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txtindex 26b7c72e1..63c7cb4ba 100644--- a/sim/Statecraft.Sim.Tests/golden/manifest.txt+++ b/sim/Statecraft.Sim.Tests/golden/manifest.txt@@ -4,10 +4,10 @@# (GoldenManifestTests names any place that is out of date) and add a row to the rebaseline history.hash1950 f3ec68b734a3beb24df9a873e0400f0253aed48f3cde2ea12415f1890dcaa5b0hash1952 6b374f69a0ed276eeea69737e2a8b0e72d26feb930dab35e8f7c50113c4e9c0b-smoke5 d449bf194d94e882d36b899079ce573094ea710327db7ac6e84939632c46bf85-smoke-orders ee6bfee561120532416c1aff2cd7cd741256aaafb443d19b414031356b680ae6-scenario-reckless 6650ed3e18610fc3f53e7b8b815c0a1057d43cde08b47c0f1c6fb61ddb577fc1-scenario-cautious 95982cf8d54e4040f40ecdceee5a53dc8c8f63df8a892c2d57496f66243cf120+smoke5 bc2ab42b43bab8f19eb9b25368a3d4da5f2d3fdfed092b480c8d2738b035a298+smoke-orders 9f224bd44792f73f393a8ec8f552f20d3bc3c05ab26d08d1b58762b2bf075114+scenario-reckless cb1c96d52d08ec2ca41dc12a87e899b24604d7efe4e22c073dfa46cbcb425e46+scenario-cautious f672a0f36fd34752f7a51cbd1698db760b168380e7771c55ef13c7e83ffa5216scenario-mvp-absorb-first 6aa49f62b0c9bce24393a98d8aac1b4da9f7aed58dbee6bf3eae694c31097a76mvp-end 6b374f69a0ed276eeea69737e2a8b0e72d26feb930dab35e8f7c50113c4e9c0bscenario-mvp-defeat 584a828a24355f522b8717646a7173b4567d2c202c111c048461d435fd66ccb1diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txtindex 25d3c1dfc..19f6b972f 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt@@ -1,30 +1,30 @@-1949-01-15;4354685564936847302;Historical;8;+1949-04-15;4354685564936847302;Historical;11;ind{- food_supply=0.47968750000000004 [3FDEB33333333334]- housing=0.41912251055925737 [3FDAD2E738F7A4A9]- intl_standing=0.5 [3FE0000000000000]- morale=0.6178523929802675 [3FE3C57261B360FC]- security=0.5086917724609377 [3FE04733F7CED918]+ food_supply=0.468 [3FDDF3B645A1CAC1]+ housing=0.38982590078831036 [3FD8F2E855C1400A]+ intl_standing=0.6600000000000001 [3FE51EB851EB8520]+ morale=0.6390118119906916 [3FE472C8E6483F40]+ security=0.49734871650695817 [3FDFD48FB606B7AD]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=0 [0000000000000000]rationing=0.4 [3FD999999999999A]eff{- border_villages_secure=0.033691772460937505 [3FA1400C49BA5E36]- building_houses=0.0722834300994873 [3FB2812AB851EB85]- food_lifts_cohesion=0.04756250000000001 [3FA85A1CAC083128]- homes_lift_morale=0.06197826633453369 [3FAFBB9D85F06F69]- rationing_feeds=0.07968750000000002 [3FB4666666666668]+ border_villages_secure=0.03234871650695801 [3FA09002CEEE0F3D]+ building_houses=0.0781137126982212 [3FB3FF42A16872B0]+ food_lifts_cohesion=0.03998046875000001 [3FA47851EB851EBA]+ homes_lift_morale=0.06141436009563127 [3FAF71B3F83B234E]+ rationing_feeds=0.068 [3FB16872B020C49C]rationing_grates=-0.06 [BFAEB851EB851EB8]- safety_lifts_morale=0.04761640136718752 [3FA8612D4D4024B6]- work_lifts_cohesion=0.04069522527854631 [3FA4D6012B597372]+ safety_lifts_morale=0.049692999160766624 [3FA9715C5C78A6DE]+ work_lifts_cohesion=0.03792398398429362 [3FA36AC5BDE4A4AD]shift{food_supply=0 [0000000000000000]housing=0 [0000000000000000]- intl_standing=0 [0000000000000000]- morale=-0.07000000000000006 [BFB1EB851EB851F0]- security=0.17500000000000016 [3FC666666666666C]+ intl_standing=0.16000000000000014 [3FC47AE147AE1480]+ morale=-0.040000000000000036 [BFA47AE147AE1480]+ security=0.16500000000000015 [3FC51EB851EB8524]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -35,22 +35,25 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=9739.110001692712 [40C3058E1489145A]- america_oceania=535.0499244151753 [4080B8663EC59399]- asia=7512.155402122331 [40BD5827C86EF924]- europe=81633.61444656934 [40F3EE19D4C5ED07]- unknown=12145.947428858311 [40C7B8F945594CDE]- veterans=656752.739703733 [41240AE17ABA729C]+ africa=19463.392190725444 [40D301D919A720E5]+ america_oceania=888.4378761355052 [408BC380C5340D8D]+ asia=25236.449380098522 [40D8A51CC2A4BEA8]+ europe=112094.44437567116 [40FB5DE71C29A9EC]+ unknown=13605.290002933149 [40CA92A51ED0ECCF]+ veterans=659531.4296791082 [41242096DBFEE66B]sit[treasury=0 [0000000000000000]-debt=24.360591926047697 [40385C4FC0A19396]-fx=80.85238326859616 [4054368D728D91CC]-rung=5;cf=0;-mob=0.8 [3FE999999999999A]-stab=0.6255260111471207 [3FE4044F2015932B]+debt=40.587931893724964 [40444B415A2FE97B]+fx=90.22947100954694 [40568EAFA72C5897]+rung=2;cf=0;+mob=0.05 [3FA999999999999A]+stab=0.5984188572337665 [3FE3263F4DA41E7A]att=4 [4010000000000000]fired[altalena+ armistice_egypt+ armistice_jordan+ armistice_lebanonbernadotte_assassinationelections_1949first_truce@@ -66,12 +69,13 @@ fired[sinai_withdrawalten_dayspending[- sinai_withdrawal- rhodes_talks- elections_1949+ armistice_lebanon+ armistice_jordanchosen{altalena=enforce+ armistice_egypt=signbernadotte_assassination=outlaw+ elections_1949=holdfirst_truce=acceptidf_founding=one_armyjerusalem_ceasefire=keep@@ -80,7 +84,9 @@ chosen{operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefire+ rhodes_talks=send_delegationsecond_truce=comply+ sinai_withdrawal=withdrawten_days=central_frontappt{under=;@@ -88,17 +94,17 @@ map[mapturn=0001-01-01:0;over=city{- hadera=12,5,12,5,1,c0.35 [3FD6666666666666]- haifa=99,42,101,42,4,c0.347029702970297 [3FD635BC123FDF8E]- jerusalem=84,29,86,29,4,c0.3465116279069767 [3FD62D3F1B62D3F1]- netanya=12,5,12,5,1,c0.35 [3FD6666666666666]- petah_tikva=22,10,22,10,1,c0.35 [3FD6666666666666]- rehovot=13,5,13,5,1,c0.35 [3FD6666666666666]- rishon_lezion=10,5,10,5,1,c0.35 [3FD6666666666666]+ hadera=12,5,13,5,1,c0.3384615384615384 [3FD5A95A95A95A95]+ haifa=99,42,112,42,5,c0.3099074502230443 [3FD3D5860EDFA98B]+ jerusalem=84,29,95,29,4,c0.3076727623013407 [3FD3B0E918FD1245]+ netanya=12,5,13,5,1,c0.3384615384615384 [3FD5A95A95A95A95]+ petah_tikva=22,10,24,10,2,c0.33097826086956517 [3FD52EBF7187CA92]+ rehovot=13,5,14,5,1,c0.3285714285714285 [3FD5075075075074]+ rishon_lezion=10,5,10,5,2,c0.35 [3FD6666666666666]rosh_pinna=1,0,1,0,0,c0.35 [3FD6666666666666]- safed=2,1,2,1,0,c0.35 [3FD6666666666666]- tel_aviv=248,106,255,106,9,c0.3458823529411765 [3FD622EFBC895623]- tiberias=6,2,6,2,0,c0.35 [3FD6666666666666]+ safed=2,1,2,1,1,c0.35 [3FD6666666666666]+ tel_aviv=248,106,281,106,12,c0.3059752977620755 [3FD395196A51680F]+ tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]units[0:veteran_soldier@10,9|side=israel|strength=4@@ -115,5 +121,5 @@ units[12:arab_liberation_army@12,4|side=ala|strength=4|order=fortify|target=12,413:veteran_soldier@-4,23|side=israel|strength=2next=14-food=2253,751,0+food=2427,809,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txtindex a76606917..1cf722c1d 100644--- a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt+++ b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt@@ -1,30 +1,30 @@-1949-01-15;4354685564936847302;Historical;8;+1949-04-15;4354685564936847302;Historical;11;ind{- food_supply=0.59921875 [3FE32CCCCCCCCCCD]- housing=0.41912251055925737 [3FDAD2E738F7A4A9]- intl_standing=0.38999999999999996 [3FD8F5C28F5C28F5]- morale=0.5049852054802675 [3FE028D6BBD00D04]- security=0.4636917724609376 [3FDDAD204189374E]+ food_supply=0.5700000000000001 [3FE23D70A3D70A3E]+ housing=0.38982590078831036 [3FD8F2E855C1400A]+ intl_standing=0.55 [3FE199999999999A]+ morale=0.5145186479281915 [3FE076EFCFC1143D]+ security=0.4523487165069581 [3FDCF34807F23CCB]pol{border_settlement=0.2 [3FC999999999999A]housing_construction=0.3 [3FD3333333333333]maabarot=0 [0000000000000000]rationing=1 [3FF0000000000000]eff{- border_villages_secure=0.033691772460937505 [3FA1400C49BA5E36]- building_houses=0.0722834300994873 [3FB2812AB851EB85]- food_lifts_cohesion=0.059140625 [3FAE47AE147AE148]- homes_lift_morale=0.06197826633453369 [3FAFBB9D85F06F69]- rationing_feeds=0.19921875 [3FC9800000000000]+ border_villages_secure=0.03234871650695801 [3FA09002CEEE0F3D]+ building_houses=0.0781137126982212 [3FB3FF42A16872B0]+ food_lifts_cohesion=0.03998046875000001 [3FA47851EB851EBA]+ homes_lift_morale=0.06141436009563127 [3FAF71B3F83B234E]+ rationing_feeds=0.17 [3FC5C28F5C28F5C3]rationing_grates=-0.15 [BFC3333333333333]- safety_lifts_morale=0.04317108886718751 [3FA61A855DA27288]- work_lifts_cohesion=0.04069522527854631 [3FA4D6012B597372]+ safety_lifts_morale=0.04519983509826662 [3FA7246ECB10342D]+ work_lifts_cohesion=0.03792398398429362 [3FA36AC5BDE4A4AD]shift{food_supply=0 [0000000000000000]housing=0 [0000000000000000]- intl_standing=-0.11000000000000004 [BFBC28F5C28F5C2C]- morale=-0.10000000000000009 [BFB99999999999A0]- security=0.13000000000000012 [3FC0A3D70A3D70A8]+ intl_standing=0.050000000000000044 [3FA99999999999A0]+ morale=-0.07000000000000006 [BFB1EB851EB851F0]+ security=0.1200000000000001 [3FBEB851EB851EC0]bud{agriculture_minister=0.07 [3FB1EB851EB851EC]defense_minister=0.45 [3FDCCCCCCCCCCCCD]@@ -35,22 +35,25 @@ bud{labour_minister=0.1 [3FB999999999999A]prime_minister=0.15 [3FC3333333333333]pop{- africa=9739.110001692712 [40C3058E1489145A]- america_oceania=535.0499244151753 [4080B8663EC59399]- asia=7512.155402122331 [40BD5827C86EF924]- europe=81633.61444656934 [40F3EE19D4C5ED07]- unknown=12145.947428858311 [40C7B8F945594CDE]- veterans=656752.739703733 [41240AE17ABA729C]+ africa=19463.392190725444 [40D301D919A720E5]+ america_oceania=888.4378761355052 [408BC380C5340D8D]+ asia=25236.449380098522 [40D8A51CC2A4BEA8]+ europe=112094.44437567116 [40FB5DE71C29A9EC]+ unknown=13605.290002933149 [40CA92A51ED0ECCF]+ veterans=659531.4296791082 [41242096DBFEE66B]sit[treasury=0 [0000000000000000]-debt=24.360591926047697 [40385C4FC0A19396]-fx=80.85238326859616 [4054368D728D91CC]-rung=5;cf=0;-mob=0.8 [3FE999999999999A]-stab=0.5917932390134901 [3FE2EFF85FF1D1BA]+debt=40.587931893724964 [40444B415A2FE97B]+fx=90.22947100954694 [40568EAFA72C5897]+rung=2;cf=0;+mob=0.05 [3FA999999999999A]+stab=0.5744408218619746 [3FE261D1B7EC4E2D]att=4 [4010000000000000]fired[altalena+ armistice_egypt+ armistice_jordan+ armistice_lebanonbernadotte_assassinationelections_1949first_truce@@ -65,12 +68,13 @@ fired[second_trucesinai_withdrawalpending[- sinai_withdrawal- rhodes_talks- elections_1949+ armistice_lebanon+ armistice_jordanchosen{altalena=enforce+ armistice_egypt=signbernadotte_assassination=outlaw+ elections_1949=holdfirst_truce=refuseidf_founding=one_armyjerusalem_ceasefire=keep@@ -79,24 +83,26 @@ chosen{operation_hiram=stop_at_ceasefireoperation_horev=launchoperation_yoav=stop_at_ceasefire+ rhodes_talks=send_delegationsecond_truce=comply+ sinai_withdrawal=withdrawappt{under=;map[mapturn=0001-01-01:0;over=city{- hadera=12,5,12,5,1,c0.35 [3FD6666666666666]- haifa=99,42,101,42,4,c0.347029702970297 [3FD635BC123FDF8E]- jerusalem=84,29,86,29,4,c0.3465116279069767 [3FD62D3F1B62D3F1]- netanya=12,5,12,5,1,c0.35 [3FD6666666666666]- petah_tikva=22,10,22,10,1,c0.35 [3FD6666666666666]- rehovot=13,5,13,5,1,c0.35 [3FD6666666666666]- rishon_lezion=10,5,10,5,1,c0.35 [3FD6666666666666]+ hadera=12,5,13,5,1,c0.3384615384615384 [3FD5A95A95A95A95]+ haifa=99,42,112,42,5,c0.3099074502230443 [3FD3D5860EDFA98B]+ jerusalem=84,29,95,29,4,c0.3076727623013407 [3FD3B0E918FD1245]+ netanya=12,5,13,5,1,c0.3384615384615384 [3FD5A95A95A95A95]+ petah_tikva=22,10,24,10,2,c0.33097826086956517 [3FD52EBF7187CA92]+ rehovot=13,5,14,5,1,c0.3285714285714285 [3FD5075075075074]+ rishon_lezion=10,5,10,5,2,c0.35 [3FD6666666666666]rosh_pinna=1,0,1,0,0,c0.35 [3FD6666666666666]- safed=2,1,2,1,0,c0.35 [3FD6666666666666]- tel_aviv=248,106,255,106,9,c0.3458823529411765 [3FD622EFBC895623]- tiberias=6,2,6,2,0,c0.35 [3FD6666666666666]+ safed=2,1,2,1,1,c0.35 [3FD6666666666666]+ tel_aviv=248,106,281,106,12,c0.3059752977620755 [3FD395196A51680F]+ tiberias=6,2,6,2,1,c0.35 [3FD6666666666666]zikhron_yaakov=2,1,2,1,0,c0.35 [3FD6666666666666]units[0:veteran_soldier@10,9|side=israel|strength=4@@ -113,5 +119,5 @@ units[12:arab_liberation_army@12,4|side=ala|strength=4|order=fortify|target=12,413:veteran_soldier@-4,23|side=israel|strength=2next=14-food=2253,751,0+food=2427,809,0arms=12\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/scenarios/cautious.yaml b/sim/Statecraft.Sim.Tests/scenarios/cautious.yamlindex f3a2772dd..a9dc133a7 100644--- a/sim/Statecraft.Sim.Tests/scenarios/cautious.yaml+++ b/sim/Statecraft.Sim.Tests/scenarios/cautious.yaml@@ -1,11 +1,11 @@-# A cautious player: modest rationing from the start, and accepts the First Truce (the historical answer, written out so the-# scenario does not lean on delegation).+# A cautious player: modest rationing from the rationing office's first turn, and accepts the First Truce (the historical+# answer, written out so the scenario does not lean on delegation).name: cautious-until: 1949-01-01+until: 1949-04-01steps:- - on: 1948-05-15- commands:- - { kind: set_policy, policy: rationing, level: 0.4 }- on: 1948-06-01commands:- { kind: choose_event_option, event: first_truce, option: accept }+ - on: 1949-03-10+ commands:+ - { kind: set_policy, policy: rationing, level: 0.4 }diff --git a/sim/Statecraft.Sim.Tests/scenarios/reckless.yaml b/sim/Statecraft.Sim.Tests/scenarios/reckless.yamlindex 6a3eac8a6..2d659acfd 100644--- a/sim/Statecraft.Sim.Tests/scenarios/reckless.yaml+++ b/sim/Statecraft.Sim.Tests/scenarios/reckless.yaml@@ -1,11 +1,11 @@-# A reckless player: full rationing from the first turn and refuses the First Truce. The call-up follows the war rung-# (R-WAR-002, #750: the GDD loop refuses the set_mobilization order to call up everyone this scenario used to send).+# A reckless player: full rationing from the rationing office's first turn and refuses the First Truce. The call-up follows+# the war rung (R-WAR-002, #750: the GDD loop refuses the set_mobilization order to call up everyone this scenario used to send).name: reckless-until: 1949-01-01+until: 1949-04-01steps:- - on: 1948-05-15- commands:- - { kind: set_policy, policy: rationing, level: 1.0 }- on: 1948-06-01commands:- { kind: choose_event_option, event: first_truce, option: refuse }+ - on: 1949-03-10+ commands:+ - { kind: set_policy, policy: rationing, level: 1.0 }diff --git a/tools/web_check.py b/tools/web_check.pyindex 56191b5dd..7574bef25 100644--- a/tools/web_check.py+++ b/tools/web_check.py@@ -9,7 +9,7 @@ fail on a failure line or a timeout. Uses Chrome for Testing from the PlaywrightUsage (from the repo root):uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK hash1950 f3ec68b734a3beb24df9a873e0400f0253aed48f3cde2ea12415f1890dcaa5b0" --expect "GOLDEN OK hash1952 6b374f69a0ed276eeea69737e2a8b0e72d26feb930dab35e8f7c50113c4e9c0b"- uv run tools/web_check.py unity/Builds/Web-disabled --query "smoke-orders" --expect "SMOKE ORDERS OK 1948-06-15 ee6bfee561120532416c1aff2cd7cd741256aaafb443d19b414031356b680ae6"+ uv run tools/web_check.py unity/Builds/Web-disabled --query "smoke-orders" --expect "SMOKE ORDERS OK 1948-06-15 9f224bd44792f73f393a8ec8f552f20d3bc3c05ab26d08d1b58762b2bf075114"(the smoke-orders golden: one Move given through the unit card, docs/determinism.md)Options: --query Q (page URL query, without '?'), --expect TEXT (repeatable), --fail REGEX (default: GOLDEN FAIL|SMOKE FAIL|BOOT FAIL),--timeout SECONDS (default 300), --stall SECONDS (fail when no console message arrives for that long; 0 = off),diff --git a/unity/Assets/Tests/EditMode/EventEffectTextTests.cs b/unity/Assets/Tests/EditMode/EventEffectTextTests.csindex ae95992af..41ac14cfc 100644--- a/unity/Assets/Tests/EditMode/EventEffectTextTests.cs+++ b/unity/Assets/Tests/EditMode/EventEffectTextTests.cs@@ -44,7 +44,7 @@ public class EventEffectTextTestsnew CityEffect { City = City, Field = EventSystem.JobsField, Delta = -100 },new CityEffect { City = City, Field = EventSystem.ConditionField, Delta = .051 },},- SetPolicy = new Dictionary<string, double> { ["rationing"] = .75 }, SetRung = 4, Rejoin = Rejoin,+ SetPolicy = new Dictionary<string, double> { ["housing_construction"] = .75 }, SetRung = 4, Rejoin = Rejoin,};[TestCase(false, "en-US")]@@ -75,14 +75,14 @@ public class EventEffectTextTests"חלוצים: 2, מיקום: " + Place, "מגויסים: 1, מיקום: " + Place,"חלוצים ותיקים: 3, מיקום: " + Place, "יחידות: 4, מיקום: " + Place,Place + ": קיבולת דיור, שינוי +3", Place + ": מקומות עבודה, שינוי -100", Place + ": מצב הדיור, שינוי +5.1%",- "Rationing: ערך חדש 75%", "רמת הביטחון תיקבע ל־4", "חזרה למסלול ההיסטורי: " + title,+ "Housing construction: ערך חדש 75%", "רמת הביטחון תיקבע ל־4", "חזרה למסלול ההיסטורי: " + title,} : new[]{"Social cohesion +4.1%", "Money IL -1.3m", "Food +3 units", "Arms -100 units","Halutzim: 2 at " + Place, "Recruits: 1 at " + Place,"Veteran Halutzim: 3 at " + Place, "Units: 4 at " + Place,Place + ": housing capacity +3", Place + ": job slots -100", Place + ": housing condition +5.1%",- "Rationing set to 75%", "Security level set to 4", "Returns to the recorded course: " + title,+ "Housing construction set to 75%", "Security level set to 4", "Returns to the recorded course: " + title,};CollectionAssert.AreEqual(expected, actual);Assert.AreEqual(hash, s.Hash(), "formatting must not choose, spend, queue or mutate state");@@ -94,7 +94,7 @@ public class EventEffectTextTests[TestCase(0, "לכידות", "לכידות: שינוי +4.1%")][TestCase(4, "עיר לדוגמה", "חלוצים: 2, מיקום: עיר לדוגמה")][TestCase(8, "עיר לדוגמה", "עיר לדוגמה: קיבולת דיור, שינוי +3")]- [TestCase(11, "קיצוב", "קיצוב: ערך חדש 75%")]+ [TestCase(11, "בניית דיור", "בניית דיור: ערך חדש 75%")][TestCase(13, "כותרת מתורגמת", "חזרה למסלול ההיסטורי: כותרת מתורגמת")]public void TheCallerMaySupplyALocalizedNameWithoutChangingTheSim(int index, string name, string expected){diff --git a/unity/Assets/Tests/EditMode/HudTests.cs b/unity/Assets/Tests/EditMode/HudTests.csindex 9f86ab2bb..04b0f7c6d 100644--- a/unity/Assets/Tests/EditMode/HudTests.cs+++ b/unity/Assets/Tests/EditMode/HudTests.cs@@ -244,7 +244,7 @@ public class HudTestsnew HudPresenter(ui.Root, bridge, text);new ToastPresenter(ui.Root, bridge, text);Assert.AreEqual(DisplayStyle.None, ui.Q<Label>("toast").style.display.value);- bridge.Queue(new SetPolicy(C.Policies[0].Id, 2)); // a known policy at an impossible level: the sim refuses it+ bridge.Queue(new SetPolicy(C.At(bridge.State.Date).Policies[0].Id, 2)); // a policy in force now at an impossible level: the sim refuses itui.Press("end-turn");Assert.AreEqual("Not done: Policy level must be between 0 and 1", ui.Q<Label>("toast").text);Assert.AreEqual(DisplayStyle.Flex, ui.Q<Label>("toast").style.display.value);diff --git a/unity/Assets/Tests/EditMode/OutcomeClipTests.cs b/unity/Assets/Tests/EditMode/OutcomeClipTests.csindex fec7896ff..47b0e4ab8 100644--- a/unity/Assets/Tests/EditMode/OutcomeClipTests.cs+++ b/unity/Assets/Tests/EditMode/OutcomeClipTests.cs@@ -75,7 +75,9 @@ public class OutcomeClipTestsRoot = doc.rootVisualElement;Root.Q("root").RemoveFromClassList("loading");var g = GameSession.New(c, GoldenRun.Seed, Mode.Historical);+ var start = g.State.Date;g.State.Date = c.Events.First(e => e.Id == events[0]).From;+ ContentWindows.Update(c, g.State, start); // as a turn does when the date moves (#80)g.State.PendingEvents.Clear(); g.State.PendingEvents.AddRange(events);Bridge = new SimBridge(g, t, step);owned.Add(new HudPresenter(Root, Bridge, t));