A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Tests and rules text: the legacy loop refuses ResolveCapture before charging; R-UNIT-009's player-side qualification (Refs #2733 items 2 and 7) (#2747)
Beria5a5eb92f3e4
diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex b456f4c91..7b5cc5633 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -276,7 +276,7 @@ R-UNIT-007: Open mode starts no forces (Q-START-2, owner, 15 October 2026); `SimR-UNIT-008: Artillery and the armoured car are acquired by training at a military camp (Q-ARTY-3, owner, 15 October 2026, #375: "Take all recommendations"; Phase 5 PR 9, part 2, #748). Each is a `Train` track (R-TRAIN-001 to R-TRAIN-003): `Train(city, artillery, n)` takes n groups of the city's civilians without work as the crew, pays n times the type's `training_cost` in Money and takes n times its `training_arms` in Arms when it starts, refused for a short stock and returned on cancel as R-ARMS-003 says for recruits. A finished cohort becomes one formation of its type at the city's settlement hex, its strength the cohort's count, housed in that city (R-UNIT-003, R-HOUSE-003, Q-HOUSE-5). It is not a recruit, so service never promotes it (R-UNIT-004); it pays the military upkeep (R-UNIT-010). The loader requires `training_arms` (at least 1) on a trained military type other than the recruit, whose Arms stay `mvp.arms_per_recruit_group`, and refuses it on any other type. The values are agent defaults proposed on #748 for the owner to set or accept (https://github.com/eyalgolan/statecraft-israel/issues/748#issuecomment-6341182392): 3 turns, IL 1.0m a group, and 3 Arms a group for the guns, 2 for the armoured car. Event grants of either type stay with Phase 7 (D-H2, R-EFX-003).-R-UNIT-009: A row of `map/units_1948.yaml` that meets R-UNIT-006 except that its `strength`'s `as_of` is after the start day arrives on that day (#1241, owner, 21 October 2026, answer 1(a): "enters the game on that date with its sourced strength, read from its row as a dated arrival"): in the GDD loop's resolution (step 9, after the immigrants' arrivals) of the turn that starts before that day and ends on or after it, once, on the hex of the anchor whose window covers that day, with that strength in population units and its side's type, as a starting force. Such rows follow the starting rows in `Content.StartingForces`, and their unit ids are reserved when the game starts, so unit i is still row i and the release gate names them too. An arrival ignores the stack limit and the hex's other units, as a starting force does. A row whose `as_of` is before the start starts nothing; the loader refuses an `as_of` that is not a `YYYY-MM-DD` date, naming the file and the row. Today the 7th Brigade arrives: 1,650 on 24 May 1948 at Hulda, 2 units from the 15 June 1948 turn.+R-UNIT-009: A row of `map/units_1948.yaml` that meets R-UNIT-006 except that its `strength`'s `as_of` is after the start day arrives on that day (#1241, owner, 21 October 2026, answer 1(a): "enters the game on that date with its sourced strength, read from its row as a dated arrival"): in the GDD loop's resolution (step 9, after the immigrants' arrivals) of the turn that starts before that day and ends on or after it, once, on the hex of the anchor whose window covers that day, with that strength in population units and its side's type, as a starting force. Such rows follow the starting rows in `Content.StartingForces`, and their unit ids are reserved when the game starts, so unit i is still row i and the release gate names them too. An arrival ignores the stack limit and the hex's other units, as a starting force does. A row whose `as_of` is before the start starts nothing; the loader refuses an `as_of` that is not a `YYYY-MM-DD` date, naming the file and the row. Only a player-side (`side: israel`) row arrives: the loader refuses an enemy-side row whose `as_of` is after the start, naming the file and the row, and the resolver refuses to add one (R-ENEMY-004). Today the 7th Brigade arrives: 1,650 on 24 May 1948 at Hulda, 2 units from the 15 June 1948 turn.R-UNIT-010: In step 7, after production, Food consumption/imports and civilian upkeep, and before housing, each Israeli military formation pays `military_upkeep_per_turn` Money, including a formation that graduated this turn. The owner-accepted initial rate is IL 0.05m per formation per turn, independent of strength and turn length, a labelled design value under Q-GEN-1 (19 October 2026, https://github.com/eyalgolan/statecraft-israel/pull/1130#issuecomment-6269103829). Civilian, enemy and default records without a military side pay none. R-MONEY-003 borrows a shortfall; no strength is removed or Arms consumed for upkeep (Q-UNIT-3; owner, 15 October 2026). The loader requires a finite rate >= 0. R-ARMS-003 remains the training/refund rule; the Phase 5 plan's suggested reuse of that id is obsolete.diff --git a/sim/Statecraft.Sim.Tests/CommandGuardTests.cs b/sim/Statecraft.Sim.Tests/CommandGuardTests.csindex 243f1a5dc..d9c54176d 100644--- a/sim/Statecraft.Sim.Tests/CommandGuardTests.cs+++ b/sim/Statecraft.Sim.Tests/CommandGuardTests.cs@@ -89,4 +89,21 @@ public class CommandGuardTests[Fact]public void EveryAttentionKindHasACommand() =>Assert.Equal(AttentionSystem.CommandKinds.OrderBy(k => k, StringComparer.Ordinal), Samples.Values.Select(x => x.Kind).OrderBy(k => k, StringComparer.Ordinal));++ // R-CITY-001 (#2733 item 2): ResolveCapture is a GDD order, so the legacy loop refuses it before charging (the legacy+ // rules give it no price): the exact reason and the missing resolve_capture price (a charge would throw+ // KeyNotFoundException) pin the guard; the hash compare shows nothing else changed. Attention is refilled at the end of+ // every turn, so its compare cannot fail and pins nothing.+ [Fact]+ public void TheLegacyLoopRefusesResolveCaptureBeforeCharging()+ {+ var c = ContentLoader.Load(Fixture.Write()); // the legacy loop (a fixture since the cutover)+ Assert.False(c.IsGdd);+ var s = Simulation.NewGame(c, GoldenRun.Seed, Mode.Historical);+ var r = Simulation.Step(c, s, new Command[] { new ResolveCapture("town_a", SettlementControl.Raid) });+ Assert.Equal("That order is not available in this game", Assert.Single(r.Rejected).Reason);+ var empty = Simulation.Step(c, s, Array.Empty<Command>());+ Assert.Equal(empty.State.Attention, r.State.Attention);+ Assert.Equal(empty.State.Hash(), r.State.Hash());+ }}