Skip to content

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 3, build a training camp at Camp 80 or Tzrifin (refs #787) (#927)

Berid93220d8ef07
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 557fbc1f8..93e628951 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,12 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
### Added
- The 1948 unit roster gives 20 formations a sourced Hebrew name (`name_he`, agent-checked until #564's read); a
name's source does not count toward `wikipedia_only` (refs #902).
+- Pioneers can build a training camp: `PioneerWork(unit, build_camp, site)` at a camp site takes 6 turns and IL 2m
+ (labelled design values the owner accepted; #813 may tune them), and once built its city can train there from the next
+ turn, with no capacity limit (refs #787; GDD Phase 4 PR 3, D-D5, R-CAMP-001; R-TRAIN-001 reworded). `sites.yaml` gains
+ the two camp sites the owner chose (Q-CAMP-2, #785), both military camps and draft rows: Camp 80 near Pardes Hanna for
+ Hadera, and Tzrifin for Rishon LeZion, the nearest of four cities one hex away by km (R-CAMP-002). The reference player builds them once every yishuv site is taken, so
+ `hash1950`, `hash1952` and `mvp-end` move (docs/determinism.md).
- Event options can now move the national Food stock: `food` is an effect target in whole units, the loader
validates it, and the sensitive-event no-gain rule covers it (R-EFX-001 and R-EFX-002; refs #729). The Arms
target follows with its pool (#781).
diff --git a/content/rules.yaml b/content/rules.yaml
index 02af729c9..46d181636 100644
--- a/content/rules.yaml
+++ b/content/rules.yaml
@@ -35,6 +35,11 @@ mvp:
city_arrivals_from: 1948-11-08 # https://www.cbs.gov.il/he/publications/DocLib/shnaton_saruk/shnaton1963_num14.pdf, checked 2026-10-15
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)
+ # Build a training camp (R-CAMP-001; D-D5, Q-CAMP-3). Proposed by an agent under "Agents propose design values" (owner,
+ # 15 October 2026, #375): the yishuv build's pair, since no source sets a camp's cost in game units. The owner accepted
+ # them ("Accept 6 turns, IL 2m", 17 October 2026, #927); the Phase 7 balance pass (#813) may tune them.
+ build_camp_turns: 6 # DESIGN VALUE: owner-set balance, not a historical figure (D-D5, Q-CAMP-3: turns a camp build takes)
+ build_camp_cost: 2 # DESIGN VALUE: owner-set balance, not a historical figure (D-D5, Q-CAMP-3: IL millions, paid at the start)
objective_points: 100 # DESIGN VALUE: owner-set balance, not a historical figure (D-B6: points per objective)
objective_bonus_per_month: 5 # DESIGN VALUE: owner-set balance, not a historical figure (D-B2: points per month early)
objective_bonus_cap: 60 # DESIGN VALUE: owner-set balance, not a historical figure (D-B2: the most bonus points)
diff --git a/content/sites.yaml b/content/sites.yaml
index 2b542e952..9ceb35829 100644
--- a/content/sites.yaml
+++ b/content/sites.yaml
@@ -1,10 +1,16 @@
# 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 had one site (owner decision D-A4; the owner chose Mefalsim on #378, 14 October 2026).
# Phase 4 PR 1 (#785) adds the MVP's other yishuv sites, Beit Kama, Re'im and Gilat (Q-SITE-1, owner, 17 October 2026, #782:
-# "take all of the plan's recommendations"), and a field site in each yishuv's hex (Q-FIELD-1). The Hula swamp site and the
-# camp sites wait for the owner (#785). Research for the three: research_notes/GDD objectives/settlements-1949-51.md, rows
+# "take all of the plan's recommendations"), and a field site in each yishuv's hex (Q-FIELD-1). The Hula swamp site waits
+# for the owner (#785). Research for the three: research_notes/GDD objectives/settlements-1949-51.md, rows
# 22, 23 and 25. Their sources carry that note's checked date (14 October 2026); no person has re-read them since, so the
# rows stay draft.
+# Phase 4 PR 3 (#787) adds the two camp sites (Q-CAMP-2, owner, 17 October 2026, #785: "Both"): Camp 80 near Pardes Hanna
+# and Tzrifin, both military camps (owner, "Both military", 17 October 2026, #927). Research: research_notes/gdd-phase-4-sourcing.md, rows C1 and C4, and the research recorded on #785
+# (issuecomment-6233553842 and the camp-site gaps, issuecomment-6237625295). Their sources carry the checked date of the
+# note or comment that read them (15 or 17 October 2026). Only AI agents have read them (the note's pass and the #785
+# research); no person has, so the rows stay draft, and a person verifies them before release (owner, "OK for draft rows",
+# 17 October 2026, #927; the #570 "verify later" rule).
# The yishuv rows are sourced facts. The field rows are design placements, not facts (Q-FIELD-1). 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.
@@ -149,3 +155,64 @@ sites:
sources:
- { url: "https://www.cbs.gov.il/he/publications/doclib/2019/ishuvim/bycode2024.xlsx", checked: 2026-10-14 }
status: draft
+ - id: camp_80
+ name: Camp 80
+ # For the native reviewer (#564): "Camp 80", the name Gshur and the Palmach archive use (מחנה 80, also מחנה שמונים).
+ name_he: מחנה 80
+ # Hex from the Hebrew Wikipedia point 32.4628 N, 34.9866 E (the Camp 80 article, today Bahad Dotan; tools/hexgrid.py),
+ # at the north-east entrance to Pardes Hanna-Karkur. No 1948 settlement in the hex.
+ q: 2
+ r: 13
+ # A military training camp (owner, "Both military", 17 October 2026, #927): Gshur describes Gadna training there, which
+ # included five settlement nuclei that became part of the Nahal's first intake (research on #785).
+ kinds: [military_camp]
+ # Q-CAMP-1, R-CAMP-002: the nearest MVP city, Hadera, one hex and about 6.7 km away (Zikhron Ya'akov and Netanya are two
+ # hexes).
+ city: hadera
+ # In the window: the Gadna training of the 1931-born intake, settlement nuclei among them, moved here from Kfar Yona on
+ # 13 July 1948, after artillery fire hit that camp during the Ten Days (Gshur, pp. 114-115). The first course ended in
+ # early October 1948 (Gshur, pp. 120 and 122: the trainees were made soldiers on 12 September and trained about a
+ # month more). The Nahal Association gives September 1948; the IDF-published, footnoted article is preferred
+ # (CONTENT_POLICY §1) and the disagreement is recorded here (#785, issuecomment-6237625295). [GAP] The day the
+ # course ended. [GAP] No depopulated Arab locality was found in the sources read, but no historical GIS clearance has
+ # been done (#785). Sources read by AI agents only; status stays draft.
+ sources:
+ # Benny Gshur, "From a stocking cap to a tembel hat: the Nahal in its first year", Hevra, Tzava uBitahon Leumi 9
+ # (Maarachot, July 2025), pp. 114-115: the move to Camp 80 near Pardes Hanna on 13 July 1948; pp. 120 and 122: the
+ # first course's end, early October 1948.
+ - { url: "https://www.maarachot.idf.il/media/qyen3yoj/%D7%9E%D7%9B%D7%95%D7%91%D7%A2-%D7%92%D7%A8%D7%91-%D7%9C%D7%9B%D7%95%D7%91%D7%A2-%D7%98%D7%9E%D7%91%D7%9C-%D7%94%D7%A0%D7%97%D7%9C-%D7%91%D7%A9%D7%A0%D7%AA%D7%95-%D7%94%D7%A8%D7%90%D7%A9%D7%95%D7%A0%D7%94.pdf", checked: 2026-10-17 }
+ # Nahal Association, "Magal ve-Herev": the training at Camp 80 near Pardes Hanna; the first intake finished in
+ # September 1948 (the disagreement above).
+ - { url: "https://www.nahal.co.il/%D7%9E%D7%92%D7%9C-%D7%95%D7%97%D7%A8%D7%91/", checked: 2026-10-17 }
+ # Hebrew Wikipedia, "Batar Dotan" (Camp 80), the revision read for the note: the coordinates of the hex.
+ - { url: "https://he.wikipedia.org/w/index.php?oldid=43463565", checked: 2026-10-15 }
+ status: draft
+ - id: tzrifin
+ name: Tzrifin
+ name_he: צריפין
+ # Hex from the Hebrew Wikipedia point 31.9587 N, 34.8395 E (the Tzrifin article; tools/hexgrid.py), a modern point, not
+ # the 1948-51 camp's position. The only source-given point is the 2016 survey's Compound 1 (ITM 185821, 651281, about
+ # 31.9541 N, 34.8487 E), the south-east compound of today's camp; it falls in the same hex (#785,
+ # issuecomment-6237625295). [GAP] A coordinate for the 1948-51 camp. No 1948 settlement in the hex.
+ q: -3
+ r: 20
+ kinds: [military_camp]
+ # Q-CAMP-1, R-CAMP-002: Rishon LeZion, about 3.9 km away. Petah Tikva, Rehovot and Tel Aviv are also one hex away; the
+ # tie goes to the nearest by km, Rishon LeZion (owner, 17 October 2026, #927; research note row C4).
+ city: rishon_lezion
+ # In the window: taken by the Givati Brigade on 18-19 May 1948 and an IDF camp from then; from 1949 Bahad 4, the IDF's
+ # recruit training base, until 1967. SENSITIVE, owner review (#785): research note row C4 records a sensitivity
+ # flag for this site. Any card text built from it goes through D-F1 review. [GAP] No historical GIS clearance done.
+ # Sources read by AI agents only; status stays draft. The 1949 Bahad 4 date rests on Hebrew Wikipedia alone here (no
+ # citation there); the #785 research adds Israel Hayom and English Wikipedia, which no person has read either.
+ sources:
+ # Hebrew Wikipedia, "Tzrifin", the revision read for the note: the coordinates and the capture on 18-19 May 1948
+ # (citing Al HaMishmar and Haaretz, 20 May 1948, not read).
+ - { url: "https://he.wikipedia.org/w/index.php?oldid=43963697", checked: 2026-10-15 }
+ # Hebrew Wikipedia, "Bahad 4", the revision read for the note: at Tzrifin from 1949 (year only, no citation).
+ - { url: "https://he.wikipedia.org/w/index.php?oldid=43873223", checked: 2026-10-15 }
+ # Leshem-Shefer, historical survey of Tzrifin's Compound 1 (January 2016): the camp's place between Road 44, Rishon
+ # LeZion, Derekh Haim Herzog and Road 4313, Compound 1's grid point, 1939-46 plans and maps, and the camp taken by
+ # the Givati Brigade in 1948.
+ - { url: "https://soil-remediation.co.il/wp-content/uploads/2019/06/%D7%A1%D7%A7%D7%A8-%D7%96%D7%99%D7%94%D7%95%D7%9D-%D7%A7%D7%A8%D7%A7%D7%A2-2016.pdf", checked: 2026-10-17 }
+ status: draft
diff --git a/docs/RELEASING.md b/docs/RELEASING.md
index aab3337d1..e32c8c970 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.asset
uv run tools/web_check.py unity/Builds/Web-brotli --query "golden&smoke=5" \
- --expect "GOLDEN OK 1950 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f" \
- --expect "GOLDEN OK 1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3" \
+ --expect "GOLDEN OK 1950 38c8a4844a0d7cb25076c4286e05fea75f0df9294fd29943345bce57a0ddead3" \
+ --expect "GOLDEN OK 1952 1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4" \
--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.md
index 3e2a5983f..c683b000f 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 | `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` |
+| to 1950-01-01 (`Hash1950`) | 1950-01-15, turn 20 | `38c8a4844a0d7cb25076c4286e05fea75f0df9294fd29943345bce57a0ddead3` |
+| to 1952-01-01 (`Hash1952`) | 1952-01-15, turn 44 (the game's end) | `1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4` |
+| to the game's end (`mvp-end`) | 1952-01-15, turn 44 | `1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4` |
`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 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f" \
- --expect "GOLDEN OK 1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3" \
+ --expect "GOLDEN OK 1950 38c8a4844a0d7cb25076c4286e05fea75f0df9294fd29943345bce57a0ddead3" \
+ --expect "GOLDEN OK 1952 1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4" \
--expect "SMOKE OK 5 turns 1948-10-15 2436927c8b24f28c42be0e7b5a6fe30900f2f6c6a3ba77e4be943c1f50db57cc"
```
@@ -258,3 +258,6 @@ The hash reads the state keys, so it never sees a record outside its window. An
| 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`) |
+| GDD Phase 4 PR 3 | 1950 | `38c8a484` | build a training camp (R-CAMP-001, #787): once the four yishuv sites are taken, the reference player's veteran group builds the camp sites in ordinal id order. At the end of the 1950 run (1950-01-15) Camp 80 is being built (`camp_80=b,1,4`), and the debt is IL 2m higher (was `ef765972`) |
+| GDD Phase 4 PR 3 | 1952 | `1e21fcd3` | same; at 2 turns of progress a turn (R-VET-002) Camp 80 is built on 1950-03-15 and Tzrifin on 1950-06-15. The debt is IL 4m higher (2 x IL 2m). The reference player trains no group after the first, so the new facilities (a military camp each for Hadera and Rishon LeZion, owner "Both military" on #927) change nothing else (was `7b4bffe0`) |
+| GDD Phase 4 PR 3 | mvp-end | `1e21fcd3` | same; the same run as hash1952 (was `7b4bffe0`) |
diff --git a/docs/gdd/training.md b/docs/gdd/training.md
index d37d4aa6c..42e473775 100644
--- a/docs/gdd/training.md
+++ b/docs/gdd/training.md
@@ -6,7 +6,9 @@ As a player of the MVP, I want to send Tel Aviv's civilians without work to basi
## Rules
-- One military camp and one Hakhshara exist in Tel Aviv at the start. This is a design assumption, not a claim about the city, and pioneers will build more in Phase 4 (D-D5 [S2]). The GDD leaves training capacity open, so there is no capacity limit (unitless).
+- One military camp and one Hakhshara exist in Tel Aviv at the start. This is a design assumption, not a claim about the city (D-D5 [S2]). The GDD leaves training capacity open, so there is no capacity limit (unitless).
+- Pioneers build more: `PioneerWork(unit, build_camp, site)` at a camp site takes 6 turns and IL 2m, labelled design values an agent proposed and the owner accepted (#927; the balance pass, #813, may tune them), and follows the yishuv build's rules. Built, the site's city has the facility from the next turn, with no capacity limit (`Q-CAMP-1`, `Q-CAMP-3` [S4]) (R-CAMP-001).
+- The camp sites are `Camp 80` near Pardes Hanna, for Hadera, and Tzrifin, for Rishon LeZion, both military camps (`Q-CAMP-2` [S5]; owner, "Both military", #927). A camp serves the city nearest by hex, and a tie goes to the nearest by km (R-CAMP-002). Both rows are drafts: their sources were read by AI agents for the research note, and Tzrifin's exact position and a GIS clearance are still gaps.
- `Train(city, track, n)` takes civilians without a job into training as recruits (military camp) or halutzim (Hakhshara). It costs 1 Attention and IL 0.5m per group, both placeholders, paid at once. A short Treasury borrows the rest, as map actions do (owner decision on #468) (R-TRAIN-001).
- It is refused, with the state unchanged, for fewer than 1 group (unitless), more than the city's civilians without a job, an unknown city or track, a city without the facility, or the legacy loop (R-TRAIN-001).
- People in training are neither civilians nor recruits: they hold no job and are not counted by housing or Social cohesion while they train.
@@ -16,25 +18,28 @@ 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`: 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`.
+- `unit_types.yaml` (`recruit`, `halutz`: `facility`, `training_turns`, `training_cost`), `cities.yaml` (`facilities`), `rules.yaml` `attention_cost.train`, `cancel_training`, `mvp.build_camp_turns` and `mvp.build_camp_cost`: 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`, and a built camp's `Sites` record, which is where `Training.HasFacility` reads a built camp from.
+- `content/sites.yaml`: the `camp_80` and `tzrifin` rows, each with a `city`.
- 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` moved (retired at the cutover); `scenario-mvp-absorb-first` did not.
+- `sim/Statecraft.Sim.Tests/golden/manifest.txt`: `mvp-slice` moved (retired at the cutover); `scenario-mvp-absorb-first` did not. Phase 4 PR 3 moves `hash1950`, `hash1952` and `mvp-end`: the reference player builds the two camps once the yishuv sites are taken (docs/determinism.md).
## Done when
-- `dotnet test sim/Statecraft.sln` passes, including `TrainingTests`, `CitiesContentTests`, `GddStateTests` and `ReferencePlayerTests`.
-- `hash1950`, `hash1952`, `smoke5`, `scenario-cautious`, `scenario-reckless` and `scenario-mvp-absorb-first` do not move.
+- `dotnet test sim/Statecraft.sln` passes, including `TrainingTests`, `CampsTests`, `SitesContentTests`, `CitiesContentTests`, `GddStateTests` and `ReferencePlayerTests`.
+- `smoke5`, `scenario-cautious`, `scenario-reckless` and `scenario-mvp-absorb-first` do not move; `hash1950`, `hash1952` and `mvp-end` have a row for #787 in docs/determinism.md.
## Out of scope
-- Building more camps or a Hakhshara (Phase 4), training capacity, recruits as units and combat (Phase 5), veterans, craftsmen (D-D4), Arms consumed by training (D-G6), and any display (PRs 7 and 8).
+- The start camps of Jerusalem (Schneller) and Petah Tikva (Tel HaShomer), which the owner ruled the cities already have (#375); this PR keeps the start facilities as they are. Training capacity, recruits as units and combat (Phase 5), veterans, craftsmen (D-D4), Arms consumed by training (D-G6), and any display (PRs 7 and 8).
## 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 1 implementation plan, PR 4, docs/superpowers/plans/2026-10-12-gdd-phase-1.md
+- [S4] GDD Phase 4 plan, PR 3 and the Q-CAMP-1 to Q-CAMP-3 rows, docs/superpowers/plans/2026-10-15-gdd-phase-4.md; 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
+- [S5] The owner's Q-CAMP-2 answer, "Both", https://github.com/eyalgolan/statecraft-israel/issues/785#issuecomment-6233777137; the research, https://github.com/eyalgolan/statecraft-israel/issues/785#issuecomment-6233553842 and research_notes/gdd-phase-4-sourcing.md, rows C1 and C4; links checked 2026-10-17
## Open questions
diff --git a/docs/rules/mvp.md b/docs/rules/mvp.md
index b88f6fc92..80fd186c2 100644
--- a/docs/rules/mvp.md
+++ b/docs/rules/mvp.md
@@ -56,9 +56,9 @@ R-CITY-007: A city starts with `civilians` = `people / people_per_unit` to the n
## 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 Tel Aviv 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 build more at camp sites (R-CAMP-001).
-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.
+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. A city has a facility when `cities.yaml` gives it one at the start or a camp site of that kind built for it is in the state (R-CAMP-001). The legacy loop refuses it before charging Attention.
R-TRAIN-002: `CancelTraining(cohort)` returns the cohort's people to its city as civilians without a job and refunds none of the Money paid (D-A3). A cohort that does not exist, or has finished, is refused with the state unchanged.
@@ -84,6 +84,12 @@ R-SITE-004: Every designated site has one or more kinds from a fixed list: `yish
R-SITE-005: At most one `yishuv` site sits in a hex, so a hex shows at most one new yishuv. A site of another kind may share a hex with a yishuv site, as a yishuv's field site does (Q-SITE-3).
+## Camps
+
+R-CAMP-001: `PioneerWork(unit, build_camp, site)` builds a training camp at a site whose kinds include `military_camp` or `hakhshara`, by R-SITE-001 to R-SITE-003's rules, with `build_camp_turns` and `build_camp_cost` (labelled design values, required in the GDD loop). One action builds either facility, as the site's kind says (Q-CAMP-3, owner, 17 October 2026, #782). Built, on the turn's end date, the camp gives the site's city (Q-CAMP-1) the site's facility, with no capacity limit, so `Train` accepts that city for the matching track from the next turn (R-TRAIN-001). A camp being built gives nothing. The facility is read from the built site's record, so the state hash gains nothing beyond the site's own record. The MVP's camp sites are Camp 80 (for Hadera) and Tzrifin (for Rishon LeZion), both `military_camp` (Q-CAMP-2, owner, 17 October 2026, #785; "Both military", owner, 17 October 2026, #927).
+
+R-CAMP-002: A camp site's `city` is the MVP city (`cities.yaml`) nearest to the site by hex distance (Q-CAMP-1). When several are equally near, it is the one of them nearest by straight-line km from the point the site's hex comes from to the city's point in `map/settlements_1948.yaml` (owner, 17 October 2026, #927). Tzrifin's hex is one hex from Tel Aviv, Petah Tikva, Rehovot and Rishon LeZion, so it serves Rishon LeZion, about 3.9 km away.
+
## Objectives
R-OBJ-001: An objective (`objectives.yaml`) names its condition, `completes_when: { site_built: <site> }`, a designated site of kind yishuv whose `founded` date must equal the objective's `reference_date`. In the last step of each GDD turn (spec §2.3, step 11; D-A6), in id order, an objective whose site is built and that is not yet recorded is recorded once, with the turn's end date (the site's `BuiltOn`). Recording it again, or in the legacy loop, changes nothing; a stopped build completes nothing.
diff --git a/sim/Statecraft.Sim.Tests/CampsTests.cs b/sim/Statecraft.Sim.Tests/CampsTests.cs
new file mode 100644
index 000000000..410238e80
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/CampsTests.cs
@@ -0,0 +1,98 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Statecraft.Sim;
+
+/// <summary>Build a training camp (GDD "Pioneer work": "Build training camp"; D-D5's "More are built by pioneers"; Phase 4
+/// PR 3). Q-CAMP-1 and Q-CAMP-3 are the plan's recommendations, which the owner took on 17 October 2026 (#782): a camp site
+/// belongs to one city, building it adds the site's facility to that city, and one action builds a military camp or a
+/// Hakhshara, as the site's kind says, with no capacity limit.</summary>
+public class CampsTests
+{
+ /// <summary>The GDD fixture with town_a holding no facility, its yishuv site site_a on (2, 0), and camp_a, a site of
+ /// <paramref name="kind"/> on (3, 0) that belongs to town_a. The fixture's camp takes 2 turns and IL 1m.</summary>
+ static Content Town(string kind = "military_camp") => ContentLoader.Load(Fixture.Write(Fixture.Gdd(new Dictionary<string, string>
+ {
+ ["cities.yaml"] = "\ncities:\n" + Fixture.City("town_a", 12, 8, 10, 6),
+ ["sites.yaml"] = Fixture.GddSites + Fixture.GddSites.Replace("sites:\n", "").Replace("site_a", "camp_a").Replace("Site A", "Camp A")
+ .Replace("q: 2", "q: 3").Replace("kinds: [yishuv]", $"kinds: [{kind}]").Replace(" founded: 1949-06-12\n", " city: town_a\n"),
+ })));
+
+ static GameState WithHalutz(Content c, out int id)
+ {
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ id = s.NextId++;
+ s.Units.Add(id, new Unit(id, "halutz", 1, 0));
+ return s;
+ }
+
+ static StepResult Step(Content c, GameState s, params Command[] commands) => Simulation.Step(c, s, commands);
+
+ static readonly Train Recruits = new Train("town_a", "recruit", 1);
+
+ // R-CAMP-001: the order pays build_camp_cost and starts build_camp_turns; Train is refused until the camp is built, and
+ // accepted from the turn after the one it is built on (an order on turn T with 2 turns is built at the end of T+1).
+ [Fact]
+ public void ABuiltCampLetsItsCityTrain()
+ {
+ var c = Town();
+ var s = WithHalutz(c, out var id);
+ var paid = s.Clone();
+ double before = paid.Treasury;
+ Assert.Null(Projects.Start(c, paid, id, Projects.BuildCamp, "camp_a", new List<Cause>()));
+ Assert.Equal((before - 1.0, 2), (paid.Treasury, paid.Sites["camp_a"].TurnsLeft));
+
+ var first = Step(c, s, new PioneerWork(id, Projects.BuildCamp, "camp_a"), Recruits);
+ Assert.Equal("Town A has no military camp", Assert.Single(first.Rejected).Reason);
+ var built = Step(c, first.State, Recruits);
+ Assert.Equal("Town A has no military camp", Assert.Single(built.Rejected).Reason); // the order came before the build
+ Assert.Equal(built.State.Date, built.State.Sites["camp_a"].BuiltOn);
+ Assert.Contains(built.Why, x => x.System == "map" && x.Message == "Camp A built");
+ Assert.False(Projects.IsBusy(built.State, id));
+ var next = Step(c, built.State, Recruits);
+ Assert.Empty(next.Rejected);
+ Assert.Single(next.State.Cohorts);
+ }
+
+ // R-CAMP-001, Q-CAMP-3: the camp gives its city the site's facility and no other; a Hakhshara trains halutzim.
+ [Fact]
+ public void ACampGivesItsCityOnlyTheSitesFacility()
+ {
+ var c = Town("hakhshara");
+ var s = WithHalutz(c, out var id);
+ s.Sites["camp_a"] = SiteWork.Built("camp_a", s.Date);
+ Assert.True(Training.HasFacility(c, s, "town_a", "hakhshara"));
+ Assert.False(Training.HasFacility(c, s, "town_a", "military_camp"));
+ Assert.Equal("Town A has no military camp", Training.Start(c, s.Clone(), "town_a", "recruit", 1, new List<Cause>()));
+ Assert.Empty(Step(c, s, new Train("town_a", "halutz", 1)).Rejected);
+ }
+
+ // R-SITE-004: build_camp only at a camp site, and build_yishuv not at one; refused with the state untouched.
+ [Fact]
+ public void ACampSiteOfTheOtherKindIsRefused()
+ {
+ var c = Town();
+ var s = WithHalutz(c, out var id);
+ var before = s.Clone();
+ Assert.Equal("Site A is not a site for a training camp", Projects.Start(c, s, id, Projects.BuildCamp, "site_a", new List<Cause>()));
+ Assert.Equal("Camp A is not a site for a new yishuv", Projects.Start(c, s, id, Projects.BuildYishuv, "camp_a", new List<Cause>()));
+ Assert.Equal(before.Treasury, s.Treasury);
+ Assert.Empty(s.Sites);
+ }
+
+ // R-CAMP-001: both values are required in the GDD loop, so a missing key is never read as 0 (a free camp, or one built at once).
+ [Theory]
+ [InlineData(" build_camp_turns: 2\n", "", "mvp.build_camp_turns", "required when eras.yaml systems.loop is gdd")]
+ [InlineData("build_camp_turns: 2", "build_camp_turns: 0", "mvp.build_camp_turns", "must be >= 1")]
+ [InlineData(" build_camp_cost: 1\n", "", "mvp.build_camp_cost", "required when eras.yaml systems.loop is gdd")]
+ [InlineData("build_camp_cost: 1", "build_camp_cost: -1", "mvp.build_camp_cost", "must be a finite number >= 0")]
+ [InlineData("build_camp_cost: 1", "build_camp_cost: .nan", "mvp.build_camp_cost", "must be a finite number >= 0")]
+ public void BadCampValuesFailLoad(string from, string to, string field, string message)
+ {
+ var files = Fixture.Gdd();
+ files["rules.yaml"] = files["rules.yaml"].Replace(from, to);
+ var ex = Assert.Throws<ContentException>(() => ContentLoader.Load(Fixture.Write(files)));
+ Assert.Equal(("rules.yaml", field), (ex.File, ex.Field));
+ Assert.Contains(message, ex.Message);
+ }
+}
diff --git a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
index 004ca0ba4..ef169e15b 100644
--- a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
+++ b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
@@ -26,6 +26,8 @@ public class DesignValuesTests
("rules.yaml", "mvp.income_per_job_per_year"),
("rules.yaml", "mvp.build_yishuv_turns"),
("rules.yaml", "mvp.build_yishuv_cost"),
+ ("rules.yaml", "mvp.build_camp_turns"),
+ ("rules.yaml", "mvp.build_camp_cost"),
("rules.yaml", "mvp.objective_points"),
("rules.yaml", "mvp.objective_bonus_per_month"),
("rules.yaml", "mvp.objective_bonus_cap"),
diff --git a/sim/Statecraft.Sim.Tests/Fixture.cs b/sim/Statecraft.Sim.Tests/Fixture.cs
index 0fd2757a5..6b70c9a4c 100644
--- a/sim/Statecraft.Sim.Tests/Fixture.cs
+++ b/sim/Statecraft.Sim.Tests/Fixture.cs
@@ -222,6 +222,8 @@ mvp:
city_arrivals_from: 1948-05-15
build_yishuv_turns: 3
build_yishuv_cost: 1.5
+ build_camp_turns: 2
+ build_camp_cost: 1
objective_points: 100
objective_bonus_per_month: 5
objective_bonus_cap: 60
diff --git a/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs b/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs
index 1986853f3..205f45a48 100644
--- a/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs
+++ b/sim/Statecraft.Sim.Tests/ReferencePlayerTests.cs
@@ -107,10 +107,13 @@ public class ReferencePlayerTests
oneLeft.Sites["beit_kama"] = new SiteWork("beit_kama", 9, 3, null);
oneLeft.Sites["gilat"] = SiteWork.Built("gilat", new DateTime(1949, 6, 15));
oneLeft.Sites["mefalsim"] = SiteWork.Built("mefalsim", new DateTime(1949, 6, 15));
- var last = Assert.Single(ReferencePlayer.Commands(Mvp, oneLeft).OfType<PioneerWork>()); // one site left: the second group waits
- Assert.Equal((7, "reim"), (last.Unit, last.Site));
- var none = oneLeft.Clone();
+ // One yishuv site left: the first group takes it, and the second builds the first camp site (R-CAMP-001).
+ var lastTwo = ReferencePlayer.Commands(Mvp, oneLeft).OfType<PioneerWork>().Select(b => (b.Unit, b.Action, b.Site));
+ Assert.Equal(new[] { (7, "build_yishuv", "reim"), (8, "build_camp", "camp_80") }, lastTwo);
+ var none = oneLeft.Clone(); // every yishuv and camp site taken: the idle group waits
none.Sites["reim"] = new SiteWork("reim", 7, 3, null);
+ none.Sites["camp_80"] = SiteWork.Built("camp_80", new DateTime(1949, 6, 15));
+ none.Sites["tzrifin"] = SiteWork.Built("tzrifin", new DateTime(1949, 6, 15));
Assert.DoesNotContain(ReferencePlayer.Commands(Mvp, none), x => x is PioneerWork);
var poor = s.Clone();
poor.Treasury = 0;
diff --git a/sim/Statecraft.Sim.Tests/SitesContentTests.cs b/sim/Statecraft.Sim.Tests/SitesContentTests.cs
index 05d2185c2..cc373e22e 100644
--- a/sim/Statecraft.Sim.Tests/SitesContentTests.cs
+++ b/sim/Statecraft.Sim.Tests/SitesContentTests.cs
@@ -4,6 +4,7 @@ using System.Globalization;
using System.IO;
using System.Linq;
using Statecraft.Sim;
+using YamlDotNet.RepresentationModel;
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,
@@ -85,6 +86,49 @@ public class SitesContentTests
Assert.All(yishuvim, x => Assert.True(x.Sources.Count(s => s.Checked != default) >= 2, x.Id));
}
+ /// <summary>Q-CAMP-2 (owner, 17 October 2026, #785: "Both"): the camp sites are Camp 80 near Pardes Hanna and Tzrifin, both
+ /// military camps (owner, "Both military", 17 October 2026, #927), each for its nearest MVP city (Q-CAMP-1, R-CAMP-002).</summary>
+ [Fact]
+ public void TheMvpCampSitesAreCamp80AndTzrifin()
+ {
+ var c = ContentLoader.Load(RealContentTests.ContentRoot());
+ var camps = c.Sites.Where(Projects.IsCamp).Select(x => (x.Id, x.Name, string.Join(",", x.Kinds), x.City));
+ Assert.Equal(new[] { ("camp_80", "Camp 80", "military_camp", "hadera"), ("tzrifin", "Tzrifin", "military_camp", "rishon_lezion") }, camps);
+ }
+
+ /// <summary>R-CAMP-002 (owner, 17 October 2026, #927): a camp site's city is the MVP city nearest by hex distance, and a tie
+ /// goes to the nearest by km. Camp 80 has one city a hex away, Hadera. Tzrifin has four, and Rishon LeZion, about 3.9 km
+ /// away, is the nearest of them.</summary>
+ // R-CAMP-002
+ [Fact]
+ public void ACampSiteServesTheNearestCityByHexThenByKm()
+ {
+ var root = RealContentTests.ContentRoot();
+ var c = ContentLoader.Load(root);
+ // The point each camp row's hex comes from, as the row's comment in sites.yaml gives it (Hebrew Wikipedia).
+ var sitePoints = new Dictionary<string, (double Lat, double Lon)> { ["camp_80"] = (32.4628, 34.9866), ["tzrifin"] = (31.9587, 34.8395) };
+ var yaml = new YamlStream();
+ using (var r = new StringReader(File.ReadAllText(Path.Combine(root, "map", "settlements_1948.yaml")))) yaml.Load(r);
+ var rows = (YamlSequenceNode)((YamlMappingNode)yaml.Documents[0].RootNode)[new YamlScalarNode("settlements")];
+ string Scalar(YamlMappingNode m, string key) => ((YamlScalarNode)m[new YamlScalarNode(key)]).Value!;
+ var cityPoints = rows.Cast<YamlMappingNode>().ToDictionary(m => Scalar(m, "id"),
+ m => (Lat: double.Parse(Scalar(m, "lat"), CultureInfo.InvariantCulture), Lon: double.Parse(Scalar(m, "lon"), CultureInfo.InvariantCulture)));
+ // Straight-line km on a local flat projection; at a few km the curvature is far below the gaps between the cities.
+ static double Km((double Lat, double Lon) a, (double Lat, double Lon) b) =>
+ 111.32 * Math.Sqrt(Math.Pow(a.Lat - b.Lat, 2) + Math.Pow((a.Lon - b.Lon) * Math.Cos((a.Lat + b.Lat) / 2 * Math.PI / 180), 2));
+ var hexes = c.SettlementHexes.ToDictionary(x => x.Id);
+ var nearest = new Dictionary<string, string[]>();
+ foreach (var site in c.Sites.Where(Projects.IsCamp))
+ {
+ var byHex = c.Cities.Select(x => (x.Id, Hexes: MapActions.Distance(site.Q, site.R, hexes[x.Id].Q, hexes[x.Id].R))).ToList();
+ var tied = byHex.Where(x => x.Hexes == byHex.Min(y => y.Hexes)).Select(x => x.Id).OrderBy(x => x, StringComparer.Ordinal).ToArray();
+ nearest[site.Id] = tied;
+ Assert.Equal(tied.OrderBy(x => Km(sitePoints[site.Id], cityPoints[x])).First(), site.City);
+ }
+ Assert.Equal(new[] { "hadera" }, nearest["camp_80"]);
+ Assert.Equal(new[] { "petah_tikva", "rehovot", "rishon_lezion", "tel_aviv" }, nearest["tzrifin"]);
+ }
+
/// <summary>Q-FIELD-1 and Q-SITE-3 (#782): each yishuv site has one field site in its own hex, and no other site shares a
/// yishuv's hex (R-SITE-005 allows it only for another kind).</summary>
[Fact]
diff --git a/sim/Statecraft.Sim.Tests/golden/hash1950.txt b/sim/Statecraft.Sim.Tests/golden/hash1950.txt
index dda79fc95..2a2764e0f 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=77.50032828298673 [4053600560EB2C47]
+debt=79.50032828298673 [4053E00560EB2C47]
fx=94.52989672613671 [4057A1E9D3F540F0]
rung=2;cf=0;
mob=0.05 [3FA999999999999A]
@@ -118,6 +118,7 @@ units[
1:veteran_halutz@-3,19/6
site{
beit_kama=done,1949-03-15
+ camp_80=b,1,4
gilat=done,1949-06-15
mefalsim=done,1949-09-15
reim=done,1949-12-15
diff --git a/sim/Statecraft.Sim.Tests/golden/hash1952.txt b/sim/Statecraft.Sim.Tests/golden/hash1952.txt
index b30b9e14d..1fe64b8aa 100644
--- a/sim/Statecraft.Sim.Tests/golden/hash1952.txt
+++ b/sim/Statecraft.Sim.Tests/golden/hash1952.txt
@@ -44,7 +44,7 @@ pop{
sit[
fx_crisis
treasury=0 [0000000000000000]
-debt=176.89012071283815 [40661C7BDE6EE43A]
+debt=180.89012071283815 [40669C7BDE6EE43A]
fx=-12.990431328096559 [C029FB19D0A63796]
rung=2;cf=0;
mob=0.05 [3FA999999999999A]
@@ -139,9 +139,11 @@ units[
1:veteran_halutz@-3,19/6
site{
beit_kama=done,1949-03-15
+ camp_80=done,1950-03-15
gilat=done,1949-06-15
mefalsim=done,1949-09-15
reim=done,1949-12-15
+ tzrifin=done,1950-06-15
next=2
obj{
first_new_yishuv=1949-09-15
diff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txt
index be9f5eaf9..50536ccac 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 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f
-hash1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3
+hash1950 38c8a4844a0d7cb25076c4286e05fea75f0df9294fd29943345bce57a0ddead3
+hash1952 1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4
smoke5 2436927c8b24f28c42be0e7b5a6fe30900f2f6c6a3ba77e4be943c1f50db57cc
scenario-reckless af7b2abd4c6e477cc78555700b09822030773e9fc6b856ffc0a7109bedc1e7dd
scenario-cautious 28fd140536e326922fadf21571b64bdaae5125f97f2609b44b4baa5ca9bceda3
scenario-mvp-absorb-first b16a87402c03324f6260b57b915a0b7767f12cc166420ace257a21b54b341dd4
-mvp-end 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3
+mvp-end 1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4
diff --git a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt
index b30b9e14d..1fe64b8aa 100644
--- a/sim/Statecraft.Sim.Tests/golden/mvp-end.txt
+++ b/sim/Statecraft.Sim.Tests/golden/mvp-end.txt
@@ -44,7 +44,7 @@ pop{
sit[
fx_crisis
treasury=0 [0000000000000000]
-debt=176.89012071283815 [40661C7BDE6EE43A]
+debt=180.89012071283815 [40669C7BDE6EE43A]
fx=-12.990431328096559 [C029FB19D0A63796]
rung=2;cf=0;
mob=0.05 [3FA999999999999A]
@@ -139,9 +139,11 @@ units[
1:veteran_halutz@-3,19/6
site{
beit_kama=done,1949-03-15
+ camp_80=done,1950-03-15
gilat=done,1949-06-15
mefalsim=done,1949-09-15
reim=done,1949-12-15
+ tzrifin=done,1950-06-15
next=2
obj{
first_new_yishuv=1949-09-15
diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.cs
index 8f96fd982..684e60c6e 100644
--- a/sim/Statecraft.Sim/Content.cs
+++ b/sim/Statecraft.Sim/Content.cs
@@ -475,6 +475,11 @@ namespace Statecraft.Sim
public int BuildYishuvTurns { get; set; }
/// <summary>IL millions a "build yishuv" costs, paid in full when it starts (R-SITE-001).</summary>
public double BuildYishuvCost { get; set; }
+ /// <summary>Turns a "build camp" takes, counting the turn it was ordered in (R-CAMP-001; Q-CAMP-3). Required in the GDD
+ /// loop, at least 1.</summary>
+ public int? BuildCampTurns { get; set; }
+ /// <summary>IL millions a "build camp" costs, paid in full when it starts (R-CAMP-001). Required in the GDD loop.</summary>
+ public double? BuildCampCost { get; set; }
/// <summary>Points for each completed objective (R-OBJ-002; D-B6, #456).</summary>
public int? ObjectivePoints { get; set; }
/// <summary>Bonus points for each calendar month an objective is completed before its reference date's month (R-OBJ-002; D-B2, #456).</summary>
diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.cs
index e2004599d..94368e5a5 100644
--- a/sim/Statecraft.Sim/ContentLoader.cs
+++ b/sim/Statecraft.Sim/ContentLoader.cs
@@ -1051,6 +1051,11 @@ namespace Statecraft.Sim
if (m.CityArrivalsFrom != c.Rules.Mvp!.CityArrivalsFrom) throw new ContentException(file, "mvp.city_arrivals_from", "must be the same in every era (the cities count arrivals from one day)");
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");
+ // R-CAMP-001: required, so a missing key is not read as 0 (a camp built at once, or for nothing).
+ if (m.BuildCampTurns == null) throw new ContentException(file, "mvp.build_camp_turns", "required when eras.yaml systems.loop is gdd");
+ if (m.BuildCampTurns < 1) throw new ContentException(file, "mvp.build_camp_turns", "must be >= 1");
+ if (m.BuildCampCost == null) throw new ContentException(file, "mvp.build_camp_cost", "required when eras.yaml systems.loop is gdd");
+ if (!(m.BuildCampCost >= 0 && IsFinite(m.BuildCampCost.Value))) throw new ContentException(file, "mvp.build_camp_cost", "must be a finite number >= 0");
// R-FOOD-001 to R-FOOD-003: required, so a missing key is never read as 0 (a stock term of 0, or no stock).
if (m.KFood == null) throw new ContentException(file, "mvp.k_food", "required when eras.yaml systems.loop is gdd");
if (!(m.KFood >= 0 && m.KFood <= 1)) throw new ContentException(file, "mvp.k_food", "must be between 0 and 1");
diff --git a/sim/Statecraft.Sim/GoldenRun.cs b/sim/Statecraft.Sim/GoldenRun.cs
index 49adc204a..2ad552c2a 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 = "ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f";
+ public const string Hash1950 = "38c8a4844a0d7cb25076c4286e05fea75f0df9294fd29943345bce57a0ddead3";
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 = "7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3";
+ public const string Hash1952 = "1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4";
public static readonly DateTime Until1952 = new DateTime(1952, 1, 1);
diff --git a/sim/Statecraft.Sim/Projects.cs b/sim/Statecraft.Sim/Projects.cs
index 457a367c7..4e79be470 100644
--- a/sim/Statecraft.Sim/Projects.cs
+++ b/sim/Statecraft.Sim/Projects.cs
@@ -16,6 +16,9 @@ namespace Statecraft.Sim
public const string StopKind = "stop_work";
/// <summary>The one pioneer action Phase 1 has (GDD "Pioneer work": "Build yishuv").</summary>
public const string BuildYishuv = "build_yishuv";
+ /// <summary>The pioneer action that builds a military camp or a Hakhshara, as the site's kind says (GDD "Pioneer work":
+ /// "Build training camp"; Q-CAMP-3; Phase 4 PR 3).</summary>
+ public const string BuildCamp = "build_camp";
/// <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>
@@ -31,30 +34,38 @@ namespace Statecraft.Sim
/// record. The Treasury pays build_yishuv_cost now and borrows what it lacks; the site gets build_yishuv_turns to go; the unit
/// does not move. Refused, state untouched, 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 is being built or is built. Step
- /// has already refused it in the legacy loop.</summary>
+ /// has already refused it in the legacy loop. R-CAMP-001: build_camp at a military_camp or hakhshara site follows the same
+ /// rules, with build_camp_turns and build_camp_cost.</summary>
public 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 (!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";
+ if (action != BuildYishuv && action != BuildCamp) return "There is no such pioneer work";
var place = c.Sites.FirstOrDefault(x => x.Id == site);
if (place == null) return "There is no such site";
- if (!place.Kinds.Contains(YishuvKind)) return $"{place.Name} is not a site for a new yishuv";
+ var camp = action == BuildCamp;
+ if (camp ? !IsCamp(place) : !place.Kinds.Contains(YishuvKind))
+ return camp ? $"{place.Name} is not a site for a training camp" : $"{place.Name} is not a site for a new yishuv";
if (s.Sites.TryGetValue(site, out var work))
return work.BuiltOn == null ? $"{place.Name} is already being built" : $"{place.Name} is already built";
var r = c.RulesAt(s.Date).Mvp!; // the loader requires it in the GDD loop
// Owner decision "Allow borrowing" (2026-10-15, #378 question 13): a short Treasury borrows, as map actions do.
- EconomySystem.PayOrBorrow(c, s, r.BuildYishuvCost, "to build a yishuv", why);
+ var cost = camp ? r.BuildCampCost!.Value : r.BuildYishuvCost; // the loader requires build_camp_cost in the GDD loop
+ EconomySystem.PayOrBorrow(c, s, cost, camp ? "to build a training camp" : "to build a yishuv", why);
// The same reading of D-A6 as training's: the turn of the order is the first build turn, so with
// build_yishuv_turns 6 an order on turn T is built at the end of T+5
// (ProjectsTests.AnOrderOnTurnTWithSixTurnsIsBuiltAtTheEndOfTurnTPlusFive).
- s.Sites[site] = new SiteWork(site, unit, r.BuildYishuvTurns, null);
- why.Add(new Cause("map", site, 1, $"{place.Name}: a group of halutzim began building a yishuv, cost {PlayerText.Money(c, "treasury", r.BuildYishuvCost)}"));
+ s.Sites[site] = new SiteWork(site, unit, camp ? r.BuildCampTurns!.Value : r.BuildYishuvTurns, null);
+ why.Add(new Cause("map", site, 1, $"{place.Name}: a group of halutzim began building {(camp ? "a training camp" : "a yishuv")}, cost {PlayerText.Money(c, "treasury", cost)}"));
return null;
}
+ /// <summary>Whether a training camp may be built at <paramref name="site"/>: its kinds include military_camp or hakhshara
+ /// (R-CAMP-001). Built, its city gains those facilities (Training.HasFacility).</summary>
+ public static bool IsCamp(Site site) => site.Kinds.Contains("military_camp") || site.Kinds.Contains("hakhshara");
+
/// <summary>R-SITE-002 (D-A3): the unit's site loses its record, so it is available again and the unit is idle. The
/// progress and the Money spent are lost. Refused, state untouched, for an unknown unit or one with no work. Step has
/// already refused it in the legacy loop.</summary>
@@ -71,7 +82,8 @@ 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, 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>
+ /// unit, a halutz, gains a turn of service, and at veteran_halutz_service becomes a veteran_halutz (R-VET-001). A built
+ /// camp site gives its city the facility from the next turn (R-CAMP-001, Training.HasFacility).</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 in
@@ -83,7 +95,8 @@ namespace Statecraft.Sim
else
{
s.Sites[w.Site] = SiteWork.Built(w.Site, next);
- why.Add(new Cause("map", w.Site, 1, $"{PlayerText.Site(c, w.Site)} founded"));
+ var place = c.Sites.First(x => x.Id == w.Site); // a site being built is always in sites.yaml (Start)
+ why.Add(new Cause("map", w.Site, 1, $"{place.Name} {(IsCamp(place) ? "built" : "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;
diff --git a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs b/sim/Statecraft.Sim/Reference/ReferencePlayer.cs
index 7b10a0cd9..a36e59990 100644
--- a/sim/Statecraft.Sim/Reference/ReferencePlayer.cs
+++ b/sim/Statecraft.Sim/Reference/ReferencePlayer.cs
@@ -6,7 +6,8 @@ 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
+ /// unit to the first available yishuv site (then to the first available camp 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 goldens (#394; GoldenRun); no game mode or UI may reach it
/// (ReferencePlayerTests.NoGameModeOrUiReachesIt).</summary>
public static class ReferencePlayer
@@ -33,7 +34,7 @@ namespace Statecraft.Sim.Reference
foreach (var city in s.Cities.Values)
{
var employed = list.OfType<AssignWorkers>().Where(a => a.City == city.Id).Select(a => a.Count).DefaultIfEmpty(city.Employed).Last();
- if (city.Civilians - employed < 1 || !c.Cities.First(x => x.Id == city.Id).Facilities.Contains(halutz.Facility)) continue;
+ if (city.Civilians - employed < 1 || !Training.HasFacility(c, s, city.Id, halutz.Facility)) continue;
list.Add(new Train(city.Id, halutz.Id, 1));
break;
}
@@ -41,7 +42,7 @@ namespace Statecraft.Sim.Reference
}
/// <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>
+ /// and once every yishuv site has one, to build the first camp site without a record (R-CAMP-001), 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);
@@ -49,8 +50,14 @@ namespace Statecraft.Sim.Reference
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();
+ var action = Projects.BuildYishuv;
+ if (site == null)
+ {
+ site = c.Sites.Where(x => Projects.IsCamp(x) && !taken.Contains(x.Id)).OrderBy(x => x.Id, StringComparer.Ordinal).FirstOrDefault();
+ action = Projects.BuildCamp;
+ }
if (site == null || cost > left + 1e-9) return;
- list.Add(new PioneerWork(u.Id, Projects.BuildYishuv, site.Id));
+ list.Add(new PioneerWork(u.Id, action, site.Id));
taken.Add(site.Id);
left -= cost;
}
diff --git a/sim/Statecraft.Sim/Training.cs b/sim/Statecraft.Sim/Training.cs
index c7422720d..0b639bb73 100644
--- a/sim/Statecraft.Sim/Training.cs
+++ b/sim/Statecraft.Sim/Training.cs
@@ -6,7 +6,8 @@ namespace Statecraft.Sim
{
/// <summary>The GDD v0.1 training (docs/GDD.md "Progression"; Phase 1 PR 4): a city's civilians train in a military camp to
/// become recruits, or in a Hakhshara to become halutzim, over several turns (D-A3). The facilities are read from
- /// cities.yaml: one of each exists at the start (D-D5, a design assumption), and pioneers will build more (Phase 4). Runs only
+ /// cities.yaml: one of each exists at the start (D-D5, a design assumption), and pioneers build more at camp sites
+ /// (R-CAMP-001). Runs only
/// when eras.yaml systems.loop is gdd. Its causes go to the "city" group of the Why screen: they move a city's people and
/// pay for it, like the other city rules.</summary>
public static class Training
@@ -22,10 +23,16 @@ namespace Statecraft.Sim
static string Groups(int n) => n == 1 ? "1 group" : FormattableString.Invariant($"{n} groups");
+ /// <summary>R-TRAIN-001, R-CAMP-001: whether <paramref name="city"/> has <paramref name="facility"/>: one it starts with
+ /// (cities.yaml, D-D5), or a camp site of that kind built for it (sites.yaml city). A camp being built does not count.</summary>
+ public static bool HasFacility(Content c, GameState s, string city, string facility) =>
+ c.Cities.First(k => k.Id == city).Facilities.Contains(facility)
+ || c.Sites.Any(x => x.City == city && x.Kinds.Contains(facility) && s.Sites.TryGetValue(x.Id, out var w) && w.BuiltOn != null);
+
/// <summary>R-TRAIN-001: <paramref name="count"/> of the city's civilians without work start training as
/// <paramref name="track"/>, a unit type with a facility. The Treasury pays count * training_cost now and borrows what it
/// lacks. The trainees leave the civilians at once, and the cohort takes the next id. Refused, state untouched, when the
- /// city or track is unknown, the count is below 1, the city has no such facility, or it has fewer civilians without
+ /// city or track is unknown, the count is below 1, the city has no such facility (<see cref="HasFacility"/>), or it has fewer civilians without
/// work. Step has already refused it in the legacy loop.</summary>
public static string? Start(Content c, GameState s, string city, string track, int count, List<Cause> why)
{
@@ -34,7 +41,7 @@ namespace Statecraft.Sim
if (type == null) return "There is no such training";
if (count < 1) return "Train at least one group";
var name = PlayerText.Settlement(c, city);
- if (!c.Cities.First(k => k.Id == city).Facilities.Contains(type.Facility)) return $"{name} has no {Place(type.Facility)}";
+ if (!HasFacility(c, s, city, type.Facility)) return $"{name} has no {Place(type.Facility)}";
var idle = x.Civilians - x.Employed;
if (count > idle) return FormattableString.Invariant($"{name} has {idle} civilians without work");
var cost = count * type.TrainingCost;
diff --git a/tools/web_check.py b/tools/web_check.py
index b2de7f3b6..dcfe1daa4 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 ef765972402fabcca48d07a6f630783279c132ab3660b7aa46d3aba105921f0f" --expect "GOLDEN OK 1952 7b4bffe079beebac7608eca3334fd606810a786af5a3dcab91c1db0af59b76d3"
+ uv run tools/web_check.py unity/Builds/Web-disabled --query "golden" --expect "GOLDEN OK 1950 38c8a4844a0d7cb25076c4286e05fea75f0df9294fd29943345bce57a0ddead3" --expect "GOLDEN OK 1952 1e21fcd3e5d99159b7bf2c803e8c92ca78ec52c36445aa511edbfeac082514f4"
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