A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
sim: GDD Phase 4 PR 6, the veteran pioneer: promoted after 6 turns of work, builds twice as fast (refs #790) (#868)
Berif6746d737bb2
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 860ddbc3d..89aae648d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -165,6 +165,13 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB(Q-CUT-8). Every golden moves; the cutover re-pins them once.### Added+- A halutz group becomes a veteran pioneer (`veteran_halutz`) after 6 turns of work, one yishuv's build, and a+ veteran builds twice as fast: 2 turns of progress a turn (refs #790; GDD Phase 4 PR 6, D-D9, R-VET-001, R-VET-002).+ Only turns whose project progressed count. Both numbers are labelled design values from the Phase 4 plan, which the+ owner took on #782. A unit's service is hashed only when it is not 0. hash1950, hash1952 and mvp-end are re-pinned:+ the reference player's halutz group becomes a veteran after Beit Kama and builds Gilat, Mefalsim and Re'im in 3 turns+ each, so the first new yishuv completes on 1949-09-15 (was 1950-03-15), and by 1950 the score is 100 and the debt is+ IL 2m higher. The 1952 score and debt do not change.- City and town pills start with their population tier, a gold disc with a number from 1 to 9 (refs #710). The tier isstatic: it comes from the city's 1948 people in `content/cities.yaml` (#821), not from the sim's live count (owner,15 October 2026). The scale is the design value proposed on #710 and not yet ruled: tiers double from 1,000, so underdiff --git a/content/rules.yaml b/content/rules.yamlindex 1c1dca748..02af729c9 100644--- a/content/rules.yaml+++ b/content/rules.yaml@@ -47,6 +47,11 @@ mvp:# about what the legacy direct cut (fx_crisis_food_per_year) took over the same weeks. Neither is a historical figure.k_food: 0.1 # DESIGN VALUE: owner-set balance, not a historical figure (D-C2: food_supply lost with an empty Food stock)cover_months: 3 # DESIGN VALUE: owner-set balance, not a historical figure (D-C2: months of need a full Food stock holds)+ # The veteran pioneer (R-VET-001, R-VET-002; D-D9). Agent-proposed design values the owner took on 17 October 2026 (#782:+ # "take all of the plan's recommendations"; Phase 4 plan Q-VET-1, Q-VET-2). Service is build_yishuv_turns, so one+ # completed yishuv makes a veteran pioneer.+ veteran_halutz_service: 6 # DESIGN VALUE: owner-set balance, not a historical figure (D-D9, Q-VET-1: turns of work to become a veteran)+ veteran_progress: 2 # DESIGN VALUE: owner-set balance, not a historical figure (D-D9, Q-VET-2: a veteran's turns of progress a turn)# 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.06diff --git a/content/unit_types.yaml b/content/unit_types.yamlindex 35eaeb3e3..f9a52f5b2 100644--- a/content/unit_types.yaml+++ b/content/unit_types.yaml@@ -15,3 +15,4 @@ types:facility: hakhsharatraining_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)+ - { id: veteran_halutz, kind: unit } # a halutz unit after rules.yaml mvp.veteran_halutz_service turns of work (R-VET-001; D-D9); not traineddiff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex 4b4d73b47..aab3337d1 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -19,8 +19,8 @@ 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 37c510500b6524af0d033bf31824ac33c3b6f14e1afeb68b4a18c7bf774dca2b" \- --expect "GOLDEN OK 1952 7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa" \+ --expect "GOLDEN OK 1950 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f" \+ --expect "GOLDEN OK 1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3" \--expect "SMOKE OK 5 turns 1948-10-15 2436927c8b24f28c42be0e7b5a6fe30900f2f6c6a3ba77e4be943c1f50db57cc"bash scripts/oss/package_web.sh unity/Builds/Web-brotli unity/Builds/statecraft-israel-vX.Y.Z-web.zip```diff --git a/docs/determinism.md b/docs/determinism.mdindex 77991c30e..3e2a5983f 100644--- a/docs/determinism.md+++ b/docs/determinism.md@@ -28,9 +28,9 @@ final `GameState.Hash()` is pinned:| Run | Ends | Hash ||---|---|---|-| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `37c510500b6524af0d033bf31824ac33c3b6f14e1afeb68b4a18c7bf774dca2b` |-| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa` |-| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa` |+| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f` |+| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3` |+| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3` |`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@@ -45,8 +45,8 @@ Check every build with:```uv run tools/web_check.py unity/Builds/Web-<compression> --query "golden&smoke=5" \- --expect "GOLDEN OK 1950 37c510500b6524af0d033bf31824ac33c3b6f14e1afeb68b4a18c7bf774dca2b" \- --expect "GOLDEN OK 1952 7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa" \+ --expect "GOLDEN OK 1950 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f" \+ --expect "GOLDEN OK 1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3" \--expect "SMOKE OK 5 turns 1948-10-15 2436927c8b24f28c42be0e7b5a6fe30900f2f6c6a3ba77e4be943c1f50db57cc"```@@ -255,3 +255,6 @@ The hash reads the state keys, so it never sees a record outside its window. An| GDD Phase 4 PR 1 | 1950 | `37c51050` | the MVP's four yishuv sites (R-SITE-004, Q-SITE-1, #785): the reference player builds them in ordinal id order, so Beit Kama is built on 1949-03-15 and Gilat on 1949-09-15, and Mefalsim is still being built on 1 January 1950. The first-new-yishuv objective and its card leave the run (score 0, was 115), and the debt is IL 4m higher for the extra builds (was `2766b45b`) || GDD Phase 4 PR 1 | 1952 | `7745031b` | same; Mefalsim is built on 1950-03-15 and Re'im on 1950-09-15, so the objective completes nine months after its reference date with no timing bonus (score 100, was 115); the debt is IL 6m higher (was `f8cd22d7`) || GDD Phase 4 PR 1 | mvp-end | `7745031b` | same; the same run as hash1952 (was `f8cd22d7`) |+| GDD Phase 4 PR 6 | 1950 | `ef765972` | the veteran pioneer (R-VET-001, R-VET-002, D-D9, #790): the reference player's halutz group works the six turns of the Beit Kama build (still built on 1949-03-15), becomes a `veteran_halutz` with 6 turns of service (`1:veteran_halutz@-3,19/6`) and builds the other three sites in 3 turns each: Gilat on 1949-06-15 (was 1949-09-15), Mefalsim on 1949-09-15 and Re'im on 1949-12-15. The first-new-yishuv objective completes on 1949-09-15 and its card fires and is answered in the run (score 100, was 0), and the debt is IL 2m higher for the extra builds (was `37c51050`) |+| GDD Phase 4 PR 6 | 1952 | `7b4bffe0` | same; Mefalsim is built on 1949-09-15 (was 1950-03-15) and Re'im on 1949-12-15 (was 1950-09-15). The objective still completes after its reference date with no timing bonus, so the score (100) and the debt do not change (was `7745031b`) |+| GDD Phase 4 PR 6 | mvp-end | `7b4bffe0` | same; the same run as hash1952 (was `7745031b`) |diff --git a/docs/gdd/build-yishuv.md b/docs/gdd/build-yishuv.mdindex 7e87168eb..c895b61a7 100644--- a/docs/gdd/build-yishuv.md+++ b/docs/gdd/build-yishuv.md@@ -14,7 +14,7 @@ As a player of the MVP, I want to send a group of halutzim to build a new yishuv- It is refused, with the state unchanged, for an unknown unit, a unit that is not a halutz or already has a project (one project per unit, D-D6), an unknown action or site, a site being built or built (one unit per site), or the legacy loop (R-SITE-001).- `StopWork(unit)` ends the build. The site is available again; the progress and the Money paid are lost (D-A3) (R-SITE-002).- Construction resolves after training and before production in each turn (D-A6). A build ordered this turn counts this turn: it takes 6 turns, a placeholder (R-SITE-003).-- When the build finishes, the site is marked built on the turn's end date and the unit is idle again. It stays a halutz unit. Nothing else changes yet: no city, housing, jobs, population or Social cohesion. The objective and its card come with the objective PR (R-SITE-003).+- When the build finishes, the site is marked built on the turn's end date and the unit is idle again. It stays a halutz unit until it has worked `veteran_halutz_service` turns (docs/gdd/veteran-pioneer.md). Nothing else changes yet: no city, housing, jobs, population or Social cohesion. The objective and its card come with the objective PR (R-SITE-003).## Data toucheddiff --git a/docs/gdd/veteran-pioneer.md b/docs/gdd/veteran-pioneer.mdnew file mode 100644index 000000000..70b83885e--- /dev/null+++ b/docs/gdd/veteran-pioneer.md@@ -0,0 +1,43 @@+# Veteran pioneer++## Player story++As a player of the MVP, I want a group of halutzim that has worked long enough to become veteran pioneers who build faster, so that keeping a group at work pays off (GDD "Veteran pioneer: Experienced pioneer unit" and "Progression: Halutz to veteran pioneer" [S1]; decision D-D9 [S2]).++## Rules++- A halutz unit gains 1 turn of service in each turn its project progressed, the turn the build finishes included. An idle turn adds no service [S3][S4] (R-VET-001).+- At 6 turns of service, `veteran_halutz_service`, the unit becomes a `veteran_halutz` at the end of that turn. It keeps its id, hex, service and project, and the Why screen says "A group of halutzim became veteran pioneers". A build takes 6 turns, so one completed yishuv makes a veteran pioneer (R-VET-001).+- A veteran's project gains 2 turns of progress a turn, `veteran_progress`, against a halutz's 1 turn, so a build of 6 turns takes a veteran 3 turns [S3][S4] (R-VET-002).+- A veteran does the same pioneer work as a halutz, with the same cost and the same refusals (R-SITE-001). A veteran gains no more service.+- Both numbers are labelled design values that an agent proposed and the owner took (owner answer on #782 [S4]); the owner may still change them.++## Data touched++- `content/rules.yaml` `mvp.veteran_halutz_service` and `mvp.veteran_progress` (design values, listed in `DesignValuesTests`; the loader requires both, at least 1 (unitless)).+- `content/unit_types.yaml` `veteran_halutz` (a unit type with no facility: it is promoted, never trained).+- `GameState.Units`: a unit's `Service`, written into the state hash as `/N` only when it is not 0, so a unit with none hashes as before. Phase 5 Q-UNIT-2 counts soldiers' service in the same field.+- `Projects.Start` and `Projects.Advance` (step 5), and the reference player, which sends a veteran to build as it does a halutz.+- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: `hash1950`, `hash1952` and `mvp-end` move, because the reference player's halutz group becomes a veteran after Beit Kama and builds the other three sites in 3 turns each, so Mefalsim and the first new yishuv come six months sooner.++## Done when++- `dotnet test sim/Statecraft.sln` passes, including `VeteranTests`, `ProjectsTests`, `GddStateTests` and `DesignValuesTests`.+- `smoke5`, `scenario-cautious`, `scenario-reckless` and `scenario-mvp-absorb-first` do not move; `hash1950`, `hash1952` and `mvp-end` have a row in docs/determinism.md.++## Out of scope++- Corridor segments (roads and rail): `Corridors.cs` is Phase 4 PR 2 (#786), which applies `veteran_progress` to segment progress there.+- A Hebrew name or a token for the veteran on the map: no screen shows a unit's type yet. The owner approved "חלוץ ותיק" on #782 [S4] for when one does.+- Veteran soldiers (Phase 5, #742), and any benefit other than speed.++## Sources++- [S1] The game design of record, docs/GDD.md+- [S2] GDD v0.1 impact analysis and phased plan, section 5, docs/superpowers/specs/2026-10-12-gdd-v0.1-impact-and-plan.md+- [S3] GDD Phase 4 plan, PR 6 and the Q-VET-1 and Q-VET-2 rows, docs/superpowers/plans/2026-10-15-gdd-phase-4.md+- [S4] The owner's answer, "take all of the plan's recommendations", https://github.com/eyalgolan/statecraft-israel/issues/782#issuecomment-6231352128, checked 2026-10-17++## Open questions++- None.diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex 41a8e84ce..2af09baf1 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -68,11 +68,17 @@ R-TRAIN-003: Each turn, in ascending id, every cohort has one turn less to go. AConstruction is step 5 of the turn in the approved order (§2.3, D-A6): after training, before production. The designated sites are sourced facts in `content/sites.yaml`; Phase 1 has one, Mefalsim (owner decision on #378). The answers below are the plan's recommendations, which the owner took on 14 October 2026 (#378).-R-SITE-001: `PioneerWork(unit, build_yishuv, site)` starts building a yishuv at a designated site whose kinds include `yishuv` and which is neither being built nor built, with a halutz unit that has no other project (D-D6: one project per unit). The Treasury pays `build_yishuv_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 site has `build_yishuv_turns` to go, counting the turn of the order. The unit does not move. It is refused, with the state unchanged and the Attention refunded, for an unknown unit, a unit that is not a halutz or is busy, an unknown action or site, a site that is not for a yishuv, or a site being built or built (one unit per site). The legacy loop refuses it before charging Attention. Its Attention cost is 0 (D-A6: unit orders are free).+R-SITE-001: `PioneerWork(unit, build_yishuv, site)` starts building a yishuv at a designated site whose kinds include `yishuv` and which is neither being built nor built, with a halutz or veteran halutz unit that has no other project (D-D6: one project per unit). The Treasury pays `build_yishuv_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 site has `build_yishuv_turns` to go, counting the turn of the order. The unit does not move. It is refused, with the state unchanged and the Attention refunded, for an unknown unit, a unit that is not a halutz or veteran halutz or is busy, an unknown action or site, a site that is not for a yishuv, or a site being built or built (one unit per site). The legacy loop refuses it before charging Attention. Its Attention cost is 0 (D-A6: unit orders are free).R-SITE-002: `StopWork(unit)` ends the unit's build: the site is available again, the unit is idle, and the progress and the Money paid are lost (D-A3). A unit that does not exist or is not building is refused with the state unchanged. Its Attention cost is 0.-R-SITE-003: Each turn, in ordinal site id order, every site being built has one turn less to go. A site that reaches 0 is built, on the turn's end date, and its unit is idle again. The unit stays a halutz unit, and no city, housing, job, population or Social cohesion changes. Sites being built or built are written into the state hash only when there are some.+R-SITE-003: Each turn, in ordinal site id order, every site being built has one turn less to go. A site that reaches 0 is built, on the turn's end date, and its unit is idle again. A veteran's site has `veteran_progress` turns less to go (R-VET-002), and the unit's type changes only by R-VET-001. No city, housing, job, population or Social cohesion changes. Sites being built or built are written into the state hash only when there are some.++## Veteran pioneers++R-VET-001: In step 5, after its site's progress, a halutz unit whose site is being built gains one turn of service, the turn the site is built included; an idle unit gains none. At `veteran_halutz_service` turns of service it becomes a `veteran_halutz` at the end of that turn, keeping its id, hex, service and project, and a cause says so. A veteran gains no more service. A unit's service is written into the state hash only when it is not 0 (D-D9; Q-VET-1, owner, 17 October 2026, #782).++R-VET-002: A veteran's site being built has `veteran_progress` turns less to go each turn, against a halutz's 1; one with that many or fewer left is built that turn. A veteran does the same pioneer work as a halutz (R-SITE-001) (D-D9; Q-VET-2, owner, 17 October 2026, #782).R-SITE-004: Every designated site has one or more kinds from a fixed list: `yishuv`, `field`, `swamp`, `military_camp` and `hakhshara` (Phase 4, Q-FIELD-1, Q-SWAMP-1, Q-CAMP-3). A pioneer action is accepted only at a site of its kind; any other is refused with the state unchanged and the Attention refunded. A yishuv site has a founding date inside the MVP's years and no other kind has one. A camp site (`military_camp` or `hakhshara`) names a city of `cities.yaml`, the city it trains for (Q-CAMP-1), and no other kind names one. The loader refuses any other row, naming the file and field.diff --git a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs b/sim/Statecraft.Sim.Tests/DesignValuesTests.csindex 14894fa9f..004ca0ba4 100644--- a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs+++ b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs@@ -31,6 +31,8 @@ public class DesignValuesTests("rules.yaml", "mvp.objective_bonus_cap"),("rules.yaml", "mvp.k_food"),("rules.yaml", "mvp.cover_months"),+ ("rules.yaml", "mvp.veteran_halutz_service"),+ ("rules.yaml", "mvp.veteran_progress"),// Q-START-1 (owner, 15 October 2026, #375): no city has a sourced housing stock or job count, so every city's// housing is its start people and its job slots its start employed; seven towns with no CBS working share take// the national one. The census people and the five CBS shares are sourced, not design values (R-CITY-006).diff --git a/sim/Statecraft.Sim.Tests/EventRetimingTests.cs b/sim/Statecraft.Sim.Tests/EventRetimingTests.csindex 5a8c87bcd..2f4b58e4a 100644--- a/sim/Statecraft.Sim.Tests/EventRetimingTests.cs+++ b/sim/Statecraft.Sim.Tests/EventRetimingTests.cs@@ -62,8 +62,8 @@ public class EventRetimingTests[InlineData("armistice_lebanon", "1949-04-15")][InlineData("armistice_jordan", "1949-04-15")][InlineData("austerity_1949", "1949-05-15")]- [InlineData("first_new_yishuv", "1950-03-15")] // R-OBJ-003: the turn the reference player builds Mefalsim (1949-03-15 before GDD Phase 4 PR 1, when it was the only site; 1949-06-15 before GDD Phase 3 PR 1)[InlineData("armistice_syria", "1949-08-15")]+ [InlineData("first_new_yishuv", "1949-09-15")] // R-OBJ-003: the turn the reference player builds Mefalsim (1950-03-15 before GDD Phase 4 PR 6's veteran; 1949-03-15 before GDD Phase 4 PR 1, when it was the only site; 1949-06-15 before GDD Phase 3 PR 1)[InlineData("frumkin_commission", "1950-01-15")][InlineData("maabarot_policy", "1950-04-15")][InlineData("law_of_return", "1950-07-15")]diff --git a/sim/Statecraft.Sim.Tests/Fixture.cs b/sim/Statecraft.Sim.Tests/Fixture.csindex 50b387538..0fd2757a5 100644--- a/sim/Statecraft.Sim.Tests/Fixture.cs+++ b/sim/Statecraft.Sim.Tests/Fixture.cs@@ -227,6 +227,8 @@ mvp:objective_bonus_cap: 60k_food: 0.1cover_months: 3+ veteran_halutz_service: 4+ veteran_progress: 2";public static readonly string GddCities = "\ncities:\n" + City("town_a", 12, 8, 10, 6, "[military_camp, hakhshara]");diff --git a/sim/Statecraft.Sim.Tests/GddStateTests.cs b/sim/Statecraft.Sim.Tests/GddStateTests.csindex 6059c226d..e38085fee 100644--- a/sim/Statecraft.Sim.Tests/GddStateTests.cs+++ b/sim/Statecraft.Sim.Tests/GddStateTests.cs@@ -61,7 +61,8 @@ public class GddStateTestsvar cities = new[] { new City("a", 1, 1, 1, 1, 1), new City("b", 1, 1, 1, 1, 1), new City("a", 2, 1, 1, 1, 1), new City("a", 1, 2, 1, 1, 1),new City("a", 1, 1, 2, 1, 1), new City("a", 1, 1, 1, 2, 1), new City("a", 1, 1, 1, 1, 2) };Assert.Equal(cities.Length, new HashSet<string>(Array.ConvertAll(cities, H)).Count);- var units = new[] { new Unit(1, "halutz", 0, 0), new Unit(2, "halutz", 0, 0), new Unit(1, "recruit", 0, 0), new Unit(1, "halutz", 1, 0), new Unit(1, "halutz", 0, 1) };+ var units = new[] { new Unit(1, "halutz", 0, 0), new Unit(2, "halutz", 0, 0), new Unit(1, "recruit", 0, 0), new Unit(1, "halutz", 1, 0), new Unit(1, "halutz", 0, 1),+ new Unit(1, "halutz", 0, 0, 1) };Assert.Equal(units.Length, new HashSet<string>(Array.ConvertAll(units, U)).Count);string K(Cohort k) { var s = new GameState(); s.Cohorts.Add(k.Id, k); return s.Hash(); }var cohorts = new[] { new Cohort(1, "recruit", "a", 1, 1), new Cohort(2, "recruit", "a", 1, 1), new Cohort(1, "halutz", "a", 1, 1),@@ -81,6 +82,14 @@ public class GddStateTestsAssert.Equal("mefalsim=done,1949-06-15", SiteWork.Built("mefalsim", new DateTime(1949, 6, 15)).Canonical());}+ // R-LOOP-002, R-VET-001: a unit's service reaches the hash, and a unit with none hashes as it did before Phase 4 PR 6.+ [Fact]+ public void ServiceReachesTheHashOnlyWhenThereIsSome()+ {+ Assert.Equal("1:halutz@0,0", new Unit(1, "halutz", 0, 0).Canonical());+ Assert.Equal("1:veteran_halutz@0,0/6", new Unit(1, "veteran_halutz", 0, 0, 6).Canonical());+ }+// R-SITE-003: a built site holds no unit. Unit ids start at 0, so "no unit" is null, never 0: unit 0 is free once its// site is built, and a record cannot be built and have a unit, or be building without one.[Fact]diff --git a/sim/Statecraft.Sim.Tests/ObjectivesTests.cs b/sim/Statecraft.Sim.Tests/ObjectivesTests.csindex add8a772e..dfe000b28 100644--- a/sim/Statecraft.Sim.Tests/ObjectivesTests.cs+++ b/sim/Statecraft.Sim.Tests/ObjectivesTests.cs@@ -264,11 +264,12 @@ eras:[Fact]public void TheGoldenRunCompletesTheFirstNewYishuvOnTheBuildDate(){- var s = GoldenRun.Play(Real, GoldenRun.Until1952); // to 1952: Mefalsim is built in 1950 since #785+ var s = GoldenRun.Play(Real, GoldenRun.Until1952);var built = s.Sites["mefalsim"].BuiltOn!.Value;// Since Phase 4 PR 1 (#785) the reference player builds the yishuv sites in id order, one after another as its halutzim- // come free: Beit Kama and Gilat first, so Mefalsim is built in March 1950, nine months after its founding date (12 June 1949).- Assert.Equal(new DateTime(1950, 3, 15), built);+ // come free: Beit Kama and Gilat first. Since Phase 4 PR 6 (#790) its group is a veteran after Beit Kama and builds in+ // 3 turns, so Mefalsim is built in September 1949, three months after its founding date (12 June 1949); it was March 1950.+ Assert.Equal(new DateTime(1949, 9, 15), built);Assert.Equal(built, s.Objectives["first_new_yishuv"]);Assert.Equal(100, s.Score); // D-B6; no D-B2 bonus, as it is built after the reference dateAssert.Equal("continue", s.ChosenOptions["first_new_yishuv"]);diff --git a/sim/Statecraft.Sim.Tests/ProjectsTests.cs b/sim/Statecraft.Sim.Tests/ProjectsTests.csindex aa8eee36e..de4313492 100644--- a/sim/Statecraft.Sim.Tests/ProjectsTests.cs+++ b/sim/Statecraft.Sim.Tests/ProjectsTests.cs@@ -290,7 +290,8 @@ public class ProjectsTestsfor (int i = 0; i < 2; i++) { built = Step(c, built).State; idle = Step(c, idle).State; }Assert.NotNull(built.Sites["site_a"].BuiltOn);Assert.Equal(idle.Cities.Values.Select(x => x.Canonical()), built.Cities.Values.Select(x => x.Canonical()));- Assert.Equal(idle.Units.Values.Select(x => x.Canonical()), built.Units.Values.Select(x => x.Canonical()));+ // The unit's service is the one change (R-VET-001, VeteranTests); its type and hex stay.+ Assert.Equal(idle.Units.Values.Select(x => (x.Id, x.Type, x.Q, x.R)), built.Units.Values.Select(x => (x.Id, x.Type, x.Q, x.R)));Assert.Equal(idle.Indicators["morale"], built.Indicators["morale"]); // Social cohesionAssert.Equal(idle.Treasury - 1.5, built.Treasury, 9); // only the cost paid at the start: founding adds no MoneyAssert.Equal(idle.Debt, built.Debt);diff --git a/sim/Statecraft.Sim.Tests/VeteranTests.cs b/sim/Statecraft.Sim.Tests/VeteranTests.csnew file mode 100644index 000000000..beac6df65--- /dev/null+++ b/sim/Statecraft.Sim.Tests/VeteranTests.cs@@ -0,0 +1,109 @@+using System;+using System.Collections.Generic;+using System.Linq;+using Statecraft.Sim;++/// <summary>The veteran pioneer (GDD "Experienced pioneer unit"; D-D9; Phase 4 PR 6). A halutz group that has worked+/// veteran_halutz_service turns becomes a veteran_halutz (R-VET-001), whose project gains veteran_progress turns of+/// progress a turn (R-VET-002). Q-VET-1 and Q-VET-2 are the plan's recommendations, which the owner took on 17 October+/// 2026 (#782).</summary>+public class VeteranTests+{+ /// <summary>The GDD fixture (town_a, site_a) with each (from, to) of <paramref name="edits"/> replaced in rules.yaml.+ /// The fixture's build takes 3 turns; a halutz becomes a veteran after 4 turns of work, one more than a build, and a veteran makes 2 turns of+ /// progress a turn.</summary>+ static Content Town(params (string From, string To)[] edits)+ {+ var files = Fixture.Gdd();+ foreach (var (from, to) in edits) files["rules.yaml"] = files["rules.yaml"].Replace(from, to);+ return ContentLoader.Load(Fixture.Write(files));+ }++ static GameState WithUnit(Content c, string type, out int id)+ {+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ id = s.NextId++;+ s.Units.Add(id, new Unit(id, type, 1, 0));+ return s;+ }++ static StepResult Step(Content c, GameState s, params Command[] commands) => Simulation.Step(c, s, commands);++ static PioneerWork Build(int unit) => new PioneerWork(unit, Projects.BuildYishuv, "site_a");++ // R-VET-001: only a turn whose project progressed counts, and the promotion keeps the unit's id, hex and project.+ [Fact]+ public void AHalutzBecomesAVeteranAfterNTurnsOfWork()+ {+ var c = Town(("veteran_halutz_service: 4", "veteran_halutz_service: 2"));+ var s = WithUnit(c, "halutz", out var id);+ s = Step(c, s).State; // an idle turn+ Assert.Equal(0, s.Units[id].Service);+ s = Step(c, s, Build(id)).State; // the first turn of work: the order's turn counts (D-A6)+ Assert.Equal(("halutz", 1), (s.Units[id].Type, s.Units[id].Service));+ var r = Step(c, s); // the second: promoted at the end of the turn+ var u = r.State.Units[id];+ Assert.Equal(("veteran_halutz", 2, 1, 0), (u.Type, u.Service, u.Q, u.R));+ Assert.Equal(1, r.State.Sites["site_a"].TurnsLeft); // promoted after this turn's progress, which was a halutz's+ Assert.True(Projects.IsBusy(r.State, id)); // the same project+ Assert.Contains(r.Why, x => x.System == "map" && x.Message == "A group of halutzim became veteran pioneers");+ var built = Step(c, r.State).State; // a veteran gains no more service+ Assert.Equal(2, built.Units[id].Service);+ Assert.NotNull(built.Sites["site_a"].BuiltOn);+ }++ // R-VET-001: one completed yishuv makes a veteran pioneer in the real content (veteran_halutz_service is+ // build_yishuv_turns), and the turn the build finishes counts.+ [Fact]+ public void OneYishuvMakesAVeteranInTheRealContent()+ {+ var c = ContentLoader.Load(RealContentTests.ContentRoot());+ var r = c.Rules.Mvp!;+ Assert.Equal(r.BuildYishuvTurns, r.VeteranHalutzService);+ var s = WithUnit(c, "halutz", out var id);+ var site = c.Sites.First(x => x.Kinds.Contains(Projects.YishuvKind)).Id;+ s = Step(c, s, new PioneerWork(id, Projects.BuildYishuv, site)).State;+ for (int i = 1; i < r.BuildYishuvTurns; i++) s = Step(c, s).State;+ Assert.NotNull(s.Sites[site].BuiltOn);+ Assert.Equal("veteran_halutz", s.Units[id].Type);+ }++ // R-VET-002: a veteran may start pioneer work, and the same build finishes sooner, by veteran_progress turns a turn.+ [Fact]+ public void AVeteranBuildsFaster()+ {+ // A halutz that is not promoted during the build: service above the build's 6 turns.+ var c = Town(("build_yishuv_turns: 3", "build_yishuv_turns: 6"), ("veteran_halutz_service: 4", "veteran_halutz_service: 7"));+ int TurnsToBuild(string type)+ {+ // "With the same cost": both types pay build_yishuv_cost and the site starts with build_yishuv_turns, so only+ // the progress a turn differs (review of #868).+ var m = c.Rules.Mvp!;+ var paid = WithUnit(c, type, out var payer);+ double before = paid.Treasury;+ Assert.Null(Projects.Start(c, paid, payer, Projects.BuildYishuv, "site_a", new List<Cause>()));+ Assert.Equal((before - m.BuildYishuvCost, m.BuildYishuvTurns), (paid.Treasury, paid.Sites["site_a"].TurnsLeft));+ var s = WithUnit(c, type, out var id);+ var r = Step(c, s, Build(id));+ Assert.Empty(r.Rejected);+ int turns = 1;+ for (s = r.State; s.Sites["site_a"].BuiltOn == null; turns++) s = Step(c, s).State;+ return turns;+ }+ Assert.Equal(6, TurnsToBuild("halutz"));+ Assert.Equal(3, TurnsToBuild("veteran_halutz")); // 6 turns of progress at 2 a turn+ }++ // R-VET-001, R-VET-002: both values are required in the GDD loop and at least 1, so a missing key is never read as 0.+ [Theory]+ [InlineData(" veteran_halutz_service: 4\n", "", "mvp.veteran_halutz_service", "required when eras.yaml systems.loop is gdd")]+ [InlineData("veteran_halutz_service: 4", "veteran_halutz_service: 0", "mvp.veteran_halutz_service", "must be >= 1")]+ [InlineData(" veteran_progress: 2\n", "", "mvp.veteran_progress", "required when eras.yaml systems.loop is gdd")]+ [InlineData("veteran_progress: 2", "veteran_progress: 0", "mvp.veteran_progress", "must be >= 1")]+ public void BadVeteranValuesFailLoad(string from, string to, string field, string message)+ {+ var ex = Assert.Throws<ContentException>(() => Town((from, to)));+ Assert.Equal(("rules.yaml", field), (ex.File, ex.Field));+ Assert.Contains(message, ex.Message);+ }+}diff --git a/sim/Statecraft.Sim.Tests/golden/hash1950.txt b/sim/Statecraft.Sim.Tests/golden/hash1950.txtindex e9e68002e..dda79fc95 100644--- a/sim/Statecraft.Sim.Tests/golden/hash1950.txt+++ b/sim/Statecraft.Sim.Tests/golden/hash1950.txt@@ -43,7 +43,7 @@ pop{veterans=667938.2378207468 [4124624479C3A414]sit[treasury=0 [0000000000000000]-debt=75.50032828298673 [4052E00560EB2C47]+debt=77.50032828298673 [4053600560EB2C47]fx=94.52989672613671 [4057A1E9D3F540F0]rung=2;cf=0;mob=0.05 [3FA999999999999A]@@ -58,6 +58,7 @@ fired[austerity_1949bernadotte_assassinationelections_1949+ first_new_yishuvfirst_trucefrumkin_commissionidf_founding@@ -82,6 +83,7 @@ chosen{austerity_1949=imposebernadotte_assassination=outlawelections_1949=hold+ first_new_yishuv=continuefirst_truce=acceptidf_founding=one_armyjerusalem_ceasefire=keep@@ -113,10 +115,14 @@ city{tiberias=6,2,6,2,3zikhron_yaakov=2,1,2,1,1units[- 1:halutz@-3,19+ 1:veteran_halutz@-3,19/6site{beit_kama=done,1949-03-15- gilat=done,1949-09-15- mefalsim=b,1,2+ gilat=done,1949-06-15+ mefalsim=done,1949-09-15+ reim=done,1949-12-15next=2+obj{+ first_new_yishuv=1949-09-15+score=100food=3003,1001,0\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/hash1952.txt b/sim/Statecraft.Sim.Tests/golden/hash1952.txtindex 97d9283a6..b30b9e14d 100644--- a/sim/Statecraft.Sim.Tests/golden/hash1952.txt+++ b/sim/Statecraft.Sim.Tests/golden/hash1952.txt@@ -136,14 +136,14 @@ city{tiberias=6,2,6,2,7zikhron_yaakov=2,1,2,1,2units[- 1:halutz@-3,19+ 1:veteran_halutz@-3,19/6site{beit_kama=done,1949-03-15- gilat=done,1949-09-15- mefalsim=done,1950-03-15- reim=done,1950-09-15+ gilat=done,1949-06-15+ mefalsim=done,1949-09-15+ reim=done,1949-12-15next=2obj{- first_new_yishuv=1950-03-15+ first_new_yishuv=1949-09-15score=100food=2732,1390,0\ No newline at end of filediff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txtindex eab96a17c..be9f5eaf9 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 37c510500b6524af0d033bf31824ac33c3b6f14e1afeb68b4a18c7bf774dca2b-hash1952 7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa+hash1950 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f+hash1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3smoke5 2436927c8b24f28c42be0e7b5a6fe30900f2f6c6a3ba77e4be943c1f50db57ccscenario-reckless af7b2abd4c6e477cc78555700b09822030773e9fc6b856ffc0a7109bedc1e7ddscenario-cautious 28fd140536e326922fadf21571b64bdaae5125f97f2609b44b4baa5ca9bceda3scenario-mvp-absorb-first b16a87402c03324f6260b57b915a0b7767f12cc166420ace257a21b54b341dd4-mvp-end 7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa+mvp-end 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3diff --git a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt b/sim/Statecraft.Sim.Tests/golden/mvp-end.txtindex 97d9283a6..b30b9e14d 100644--- a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt+++ b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt@@ -136,14 +136,14 @@ city{tiberias=6,2,6,2,7zikhron_yaakov=2,1,2,1,2units[- 1:halutz@-3,19+ 1:veteran_halutz@-3,19/6site{beit_kama=done,1949-03-15- gilat=done,1949-09-15- mefalsim=done,1950-03-15- reim=done,1950-09-15+ gilat=done,1949-06-15+ mefalsim=done,1949-09-15+ reim=done,1949-12-15next=2obj{- first_new_yishuv=1950-03-15+ first_new_yishuv=1949-09-15score=100food=2732,1390,0\ No newline at end of filediff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.csindex e6ecbe72c..8f96fd982 100644--- a/sim/Statecraft.Sim/Content.cs+++ b/sim/Statecraft.Sim/Content.cs@@ -487,6 +487,12 @@ namespace Statecraft.Sim/// <summary>The months of the nation's need the Food stock holds when full: the start stock and the level the monthly/// imports keep (R-FOOD-001, R-FOOD-002). Required in the GDD loop, at least 1.</summary>public int? CoverMonths { get; set; }+ /// <summary>Turns of work after which a halutz unit becomes a veteran_halutz (R-VET-001; D-D9, Q-VET-1). Required in+ /// the GDD loop, at least 1.</summary>+ public int? VeteranHalutzService { get; set; }+ /// <summary>Turns of progress a veteran's project gains each turn, against a halutz's 1 (R-VET-002; D-D9, Q-VET-2).+ /// Required in the GDD loop, at least 1.</summary>+ public int? VeteranProgress { get; set; }}/// <summary>A designated site (sites.yaml; docs/GDD.md "Pioneer work": building is allowed only at designated spots, and adiff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.csindex 1c77af6f0..e2004599d 100644--- a/sim/Statecraft.Sim/ContentLoader.cs+++ b/sim/Statecraft.Sim/ContentLoader.cs@@ -1056,6 +1056,12 @@ namespace Statecraft.Simif (!(m.KFood >= 0 && m.KFood <= 1)) throw new ContentException(file, "mvp.k_food", "must be between 0 and 1");if (m.CoverMonths == null) throw new ContentException(file, "mvp.cover_months", "required when eras.yaml systems.loop is gdd");if (m.CoverMonths < 1) throw new ContentException(file, "mvp.cover_months", "must be >= 1");+ // R-VET-001, R-VET-002: required, so a missing key is not read as 0 (a veteran after no work, or one that builds nothing).+ foreach (var (key, v) in new[] { ("veteran_halutz_service", m.VeteranHalutzService), ("veteran_progress", m.VeteranProgress) })+ {+ if (v == null) throw new ContentException(file, "mvp." + key, "required when eras.yaml systems.loop is gdd");+ if (v < 1) throw new ContentException(file, "mvp." + key, "must be >= 1");+ }if (c.Indicators.All(i => i.Id != Pools.FoodIndicator))throw new ContentException(file, "mvp.k_food", "the Food stock feeds the food_supply indicator, which model.yaml must define");// One game has one last day (R-LOOP-004): an era cannot move it.diff --git a/sim/Statecraft.Sim/GddState.cs b/sim/Statecraft.Sim/GddState.csindex 5007b1e09..0c893747d 100644--- a/sim/Statecraft.Sim/GddState.cs+++ b/sim/Statecraft.Sim/GddState.cs@@ -49,11 +49,15 @@ namespace Statecraft.Simpublic string Type { get; }public int Q { get; }public int R { get; }+ /// <summary>Turns of work done as a halutz (R-VET-001). Phase 5 Q-UNIT-2 counts soldiers' service in the same field.</summary>+ public int Service { get; }- public Unit(int id, string type, int q, int r) { Id = id; Type = type; Q = q; R = r; }+ public Unit(int id, string type, int q, int r, int service = 0) { Id = id; Type = type; Q = q; R = r; Service = service; }- /// <summary>The record as the state hash writes it.</summary>- public string Canonical() => string.Format(CultureInfo.InvariantCulture, "{0}:{1}@{2},{3}", Id, Type, Q, R);+ /// <summary>The record as the state hash writes it. The service is written only when there is some, so a unit with none+ /// hashes as it did before Phase 4 PR 6 (R-LOOP-002's rule).</summary>+ public string Canonical() => string.Format(CultureInfo.InvariantCulture, "{0}:{1}@{2},{3}", Id, Type, Q, R)+ + (Service == 0 ? "" : "/" + Service.ToString(CultureInfo.InvariantCulture));}/// <summary>A group of a city's people in training (GDD "Progression"; R-TRAIN-001): <see cref="Count"/> population unitsdiff --git a/sim/Statecraft.Sim/GoldenRun.cs b/sim/Statecraft.Sim/GoldenRun.csindex a9da5c07f..49adc204a 100644--- a/sim/Statecraft.Sim/GoldenRun.cs+++ b/sim/Statecraft.Sim/GoldenRun.cs@@ -15,13 +15,13 @@ namespace Statecraft.Sim/// <summary>Final hash of Play(content, Until1950). Changing it is a deliberate rules or content change: the value/// is pinned in sim/Statecraft.Sim.Tests/golden/manifest.txt, and STATECRAFT_UPDATE_GOLDEN=1 dotnet test rewrites/// both (docs/determinism.md). Say why in the commit message.</summary>- public const string Hash1950 = "37c510500b6524af0d033bf31824ac33c3b6f14e1afeb68b4a18c7bf774dca2b";+ public const string Hash1950 = "ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f";public static readonly DateTime Until1950 = new DateTime(1950, 1, 1);/// <summary>Final hash of Play(content, Until1952): the M3 content range (to 31 December 1951). The GDD game ends on/// 15 January 1952 (R-LOOP-004), the first turn on or after Until1952, so this is also the mvp-end run.</summary>- public const string Hash1952 = "7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa";+ public const string Hash1952 = "7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3";public static readonly DateTime Until1952 = new DateTime(1952, 1, 1);diff --git a/sim/Statecraft.Sim/Projects.cs b/sim/Statecraft.Sim/Projects.csindex 72e6c70b9..457a367c7 100644--- a/sim/Statecraft.Sim/Projects.cs+++ b/sim/Statecraft.Sim/Projects.cs@@ -18,6 +18,11 @@ namespace Statecraft.Simpublic const string BuildYishuv = "build_yishuv";/// <summary>The kind of site a yishuv may be built at (sites.yaml kinds).</summary>public const string YishuvKind = "yishuv";+ /// <summary>The unit type a halutz unit becomes after veteran_halutz_service turns of work (R-VET-001; impact plan §1.3's id, D-E3).</summary>+ public const string VeteranType = "veteran_halutz";++ /// <summary>Whether a unit of <paramref name="type"/> does pioneer work: a halutz, or a veteran one (R-SITE-001, R-VET-001).</summary>+ public static bool IsPioneer(string type) => type == "halutz" || type == VeteranType;/// <summary>Whether a site being built names <paramref name="unit"/>: the unit has a project (D-D6).</summary>public static bool IsBusy(GameState s, int unit) => s.Sites.Values.Any(w => w.BuiltOn == null && w.Unit == unit);@@ -30,7 +35,7 @@ namespace Statecraft.Simpublic static string? Start(Content c, GameState s, int unit, string action, string site, List<Cause> why){if (!s.Units.TryGetValue(unit, out var u)) return "There is no such unit";- if (u.Type != "halutz") return "Only halutzim do pioneer work";+ if (!IsPioneer(u.Type)) return "Only halutzim do pioneer work";var busy = s.Sites.Values.FirstOrDefault(w => w.BuiltOn == null && w.Unit == unit);if (busy != null) return $"That group of halutzim is already building {PlayerText.Site(c, busy.Site)}";if (action != BuildYishuv) return "There is no such pioneer work";@@ -64,15 +69,28 @@ namespace Statecraft.Sim}/// <summary>R-SITE-003, step 5 of the turn (spec 2026-10-12 section 2.3, D-A6): in ordinal site id order, each site being- /// built has one turn less to go. One that reaches 0 is built on <paramref name="next"/>, the turn's end date, and its- /// unit is idle again. Nothing else changes: the unit stays a halutz unit, and no city is founded (Phase 1).</summary>+ /// built has one turn less to go, or veteran_progress less with a veteran (R-VET-002). One that reaches 0 is built on+ /// <paramref name="next"/>, the turn's end date, and its unit is idle again. No city is founded (Phase 1). Then the+ /// unit, a halutz, gains a turn of service, and at veteran_halutz_service becomes a veteran_halutz (R-VET-001).</summary>public static void Advance(Content c, GameState s, DateTime next, List<Cause> why){+ var r = c.RulesAt(s.Date).Mvp!; // the loader requires it in the GDD loop, the only loop TurnResolver runs this inforeach (var w in s.Sites.Values.Where(x => x.BuiltOn == null).ToList()){- if (w.TurnsLeft > 1) { s.Sites[w.Site] = w.WithTurnsLeft(w.TurnsLeft - 1); continue; }- s.Sites[w.Site] = SiteWork.Built(w.Site, next);- why.Add(new Cause("map", w.Site, 1, $"{PlayerText.Site(c, w.Site)} founded"));+ var u = s.Units[w.Unit!.Value]; // a site being built always names its unit (SiteWork)+ var progress = u.Type == VeteranType ? r.VeteranProgress!.Value : 1;+ if (w.TurnsLeft > progress) s.Sites[w.Site] = w.WithTurnsLeft(w.TurnsLeft - progress);+ else+ {+ s.Sites[w.Site] = SiteWork.Built(w.Site, next);+ why.Add(new Cause("map", w.Site, 1, $"{PlayerText.Site(c, w.Site)} founded"));+ }+ // R-VET-001: the project progressed this turn, so a halutz serves a turn; a veteran counts no further.+ if (u.Type != "halutz") continue;+ var service = u.Service + 1;+ var promoted = service >= r.VeteranHalutzService!.Value;+ s.Units[u.Id] = new Unit(u.Id, promoted ? VeteranType : u.Type, u.Q, u.R, service);+ if (promoted) why.Add(new Cause("map", w.Site, 1, "A group of halutzim became veteran pioneers"));}}}diff --git a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs b/sim/Statecraft.Sim/Reference/ReferencePlayer.csindex 8ca63ea61..7b10a0cd9 100644--- a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs+++ b/sim/Statecraft.Sim/Reference/ReferencePlayer.cs@@ -27,7 +27,7 @@ namespace Statecraft.Sim.Referencevar halutz = c.UnitTypes.FirstOrDefault(t => t.Id == "halutz");if (halutz == null) return list;Build(c, s, list, ref left);- if (s.Units.Values.Any(u => u.Type == halutz.Id) || s.Cohorts.Values.Any(k => k.Type == halutz.Id)) return list;+ if (s.Units.Values.Any(u => Projects.IsPioneer(u.Type)) || s.Cohorts.Values.Any(k => k.Type == halutz.Id)) return list;var trainCost = AttentionSystem.Cost(c, s, Training.TrainKind);if (trainCost > left + 1e-9) return list; // training borrows, so the Treasury does not hold it backforeach (var city in s.Cities.Values)@@ -40,13 +40,13 @@ namespace Statecraft.Sim.Referencereturn list;}- /// <summary>Sends each idle halutz unit, in id order, to the first yishuv site without a record, in ordinal id order,+ /// <summary>Sends each idle halutz unit, veterans too, in id order, to the first yishuv site without a record, in ordinal id order,/// while the turn's Attention lasts. Pioneer work borrows, so the Treasury does not hold it back.</summary>static void Build(Content c, GameState s, List<Command> list, ref double left){var cost = AttentionSystem.Cost(c, s, Projects.PioneerKind);var taken = new HashSet<string>(s.Sites.Keys, StringComparer.Ordinal);- foreach (var u in s.Units.Values.Where(u => u.Type == "halutz" && !Projects.IsBusy(s, u.Id)))+ foreach (var u in s.Units.Values.Where(u => Projects.IsPioneer(u.Type) && !Projects.IsBusy(s, u.Id))){var site = c.Sites.Where(x => x.Kinds.Contains(Projects.YishuvKind) && !taken.Contains(x.Id)).OrderBy(x => x.Id, StringComparer.Ordinal).FirstOrDefault();if (site == null || cost > left + 1e-9) return;diff --git a/tools/web_check.py b/tools/web_check.pyindex 3b5a9c44a..b2de7f3b6 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 37c510500b6524af0d033bf31824ac33c3b6f14e1afeb68b4a18c7bf774dca2b" --expect "GOLDEN OK 1952 7745031b2096354784178b4e7c7ea80777afbe8968cb52eeb12122ce5e55cfaa"+ uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK 1950 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f" --expect "GOLDEN OK 1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3"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's