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.

GDD 0.3 arms workshops: kind, worker slot, monthly cycle (Refs #1701) (#2270)

Eyal Golanb0329be888b5
diff --git a/changelog.d/1701-arms-workshop.md b/changelog.d/1701-arms-workshop.md
new file mode 100644
index 000000000..4c917ba10
--- /dev/null
+++ b/changelog.d/1701-arms-workshop.md
@@ -0,0 +1,10 @@
+### Added
+
+- GDD 0.3 arms workshops in the sim (Refs #1701): under the gdd-0.3 ruleset only, a city can build an arms workshop (IL 15m,
+ 3 turns), staff it with one person without a job, and each staffed workshop pays for a cycle at the monthly production
+ step (IL 5m for an ordinary worker, borrowing a short Treasury but never past the debt ceiling) and makes 1 Arms every 3
+ staffed months, starting the next cycle by itself. The turn-report panel names the workshops' Arms and ceiling
+ pauses, one line a city for each, with a count for two or more. Staffing can take its worker from a city's automatic jobs, and a staffed worker cannot be sent to training.
+ The current game (gdd-0.1) is unchanged, though `projects.yaml` gained
+ the gdd-0.3 row, so older saves show the "different game content" notice. The Hebrew workshop name and turn-report lines
+ are agent drafts awaiting a native read. The hex panel order and the b21 map model come later.
diff --git a/content/projects.yaml b/content/projects.yaml
index 61f42c368..a974b6ed8 100644
--- a/content/projects.yaml
+++ b/content/projects.yaml
@@ -14,6 +14,11 @@
# industry: the Mefalsim build's pair (build_yishuv_cost 2, build_yishuv_turns 6).
# winery: the plan's Q-SPEC-2 values (PR 6: industry's IL 2m and 6 turns, and 10 job slots, more than industry's 5).
# It needs vineyards (`requires:`, R-PROJ-005), which only Rishon LeZion has (cities.yaml; owner, 20 October 2026, #737).
+# arms_workshop: GDD 0.3 only (`rulesets: [gdd-0.3]`; R-ARMS-004, #1701): the loader leaves it out of every other ruleset.
+# IL 15m and 3 turns (owner, 2 November 2026, #1701 OQ2: "IL 15m, 3 turns (Recommended)"; gdd03-balance.yaml
+# arms_workshop cost 15 and work 3). Built, it gives one workshop worker slot (`worker_slots`, the catalogue's 1) and no
+# housing, condition or job slots. Its cycle (R-ARMS-006) reads workshop.staffed_turns and workshop.cost there; the
+# owner's rulings 27M-11 to 27M-14 and Q55 are in docs/rules/mvp.md R-ARMS-004 to R-ARMS-007.
# name: the phrase the player reads in a sentence ("a transit camp").
# name_he: the Hebrew UI's noun for the kind (#1122, owner ruling 3), optional: without it the Hebrew UI shows `name`.
# Draft wording, not a native-language approval: name_he_review: agent-checked until a native speaker reviews it.
@@ -23,3 +28,4 @@ projects:
- { id: transit_camp, name: a transit camp, name_he: מעברה, name_he_review: agent-checked, cost: 1.5, turns: 1, capacity: 5, condition: -0.02, job_slots: 0 } # DESIGN VALUE: owner-set balance, not a historical figure (D-C6, D-A3, D-D3; Q-PROJ-1, Q-HOUSE-3: the low-condition type)
- { id: industry, name: an industry project, name_he: מיזם תעשייה, name_he_review: agent-checked, cost: 2, turns: 6, capacity: 0, condition: 0, job_slots: 5 } # DESIGN VALUE: owner-set balance, not a historical figure (D-C6, D-A3; Q-PROJ-1: job slots)
- { id: winery, name: a winery, name_he: יקב, name_he_review: agent-checked, cost: 2, turns: 6, capacity: 0, condition: 0, job_slots: 10, requires: vineyards } # DESIGN VALUE: owner-set balance, not a historical figure (D-D8, D-C6; Q-SPEC-2: the specialised industry)
+ - { id: arms_workshop, name: an arms workshop, name_he: סדנת נשק, name_he_review: agent-checked, cost: 15, turns: 3, capacity: 0, condition: 0, job_slots: 0, worker_slots: 1, rulesets: [gdd-0.3] } # DESIGN VALUE: owner-set balance, not a historical figure (D-G6, D-A3; #1701 OQ2, owner 2 November 2026: IL 15m and 3 turns, the recommended option)
diff --git a/docs/rules/mvp.md b/docs/rules/mvp.md
index f926ff610..893496d66 100644
--- a/docs/rules/mvp.md
+++ b/docs/rules/mvp.md
@@ -90,9 +90,9 @@ R-SAVE-004: A schema 2 save of the GDD game with a player attack (`order <unit>
Each GDD turn resolves in the order of the approved plan's section 2.3 (decision D-A6): production, then housing and Social cohesion, then arrivals.
-R-CITY-001: Under legacy/gdd-0.1, `AssignWorkers(city, role, n)` sets how many of the city's people work in `role` (only `job` exists: a craftsman fills an ordinary job slot, R-CRAFT-002). It is refused, with the state unchanged and the Attention refunded, when the city or role is unknown, `n` is negative, or `n` is above the city's jobs or its civilians and craftsmen. An accepted order turns the city's job default off (R-CITY-009). The legacy loop refuses it before charging Attention. The gdd-0.3 population foundation uses one typed assignment per ledger id (R-POP-002); initialized ledger fixtures refuse this aggregate command path, pending producer integration.
+R-CITY-001: Under legacy/gdd-0.1, `AssignWorkers(city, role, n)` sets how many of the city's people work in `role` (only `job` exists: a craftsman fills an ordinary job slot, R-CRAFT-002). It is refused, with the state unchanged and the Attention refunded, when the city or role is unknown, `n` is negative, or `n` is above the city's jobs or its civilians and craftsmen. An accepted order turns the city's job default off (R-CITY-009). The legacy loop refuses it before charging Attention. The gdd-0.3 population foundation uses one typed assignment per ledger id (R-POP-002); initialized ledger fixtures refuse this aggregate command path, pending producer integration. Under gdd-0.3 the role `workshop` staffs the city's arms workshops instead (R-ARMS-005), and a `job` count is refused above the city's civilians and craftsmen less its staffed workshops, whose workers hold no job; the job default (R-CITY-009) fills to the same number.
-R-CITY-002: Each turn every city's employed units add `employed * income_per_job_per_year * the turn's share of a year` to the Treasury (an employed craftsman earns more, R-CRAFT-002). The gdd-0.3 catalogue's `industry.income` tiers (ordinary or novice / apprentice / expert: 1 / 2 / 3) are multiples of this per-unit rate (owner, 1 November 2026: "Main's base x 0.3's tiers (Recommended)"; #2112). The inactive synthetic fixtures (`Gdd03AssignmentFixture.IndustryRate`, `Gdd03CraftArithmetic`) quote the catalogue multiple itself, not Money; `Gdd03IndustryRates.MoneyPerTurn` converts it, and no live system reads either.
+R-CITY-002: Each turn every city's employed units add `employed * income_per_job_per_year * the turn's share of a year` to the Treasury (an employed craftsman earns more, R-CRAFT-002). The gdd-0.3 catalogue's `industry.income` tiers (ordinary or novice / apprentice / expert: 1 / 2 / 3) are multiples of this per-unit rate (owner, 1 November 2026: "Main's base x 0.3's tiers (Recommended)"; #2112). The inactive synthetic fixtures (`Gdd03AssignmentFixture.IndustryRate`, `Gdd03CraftArithmetic`) quote the catalogue multiple itself, not Money; `Gdd03IndustryRates.MoneyPerTurn` converts it, and no live system reads either. A staffed arms workshop's worker is not employed and earns nothing here (R-ARMS-005).
GDD 0.3 fixture clarification for R-CITY-001/002: the owner’s 28 October Q34 answer makes reassignment to the same job a no-op ([owner-relayed answer](https://github.com/eyalgolan/statecraft-israel/pull/1668#issuecomment-6465662174)). The detached generic Work fixture returns `NoOp` and preserves the complete state when given its current target; its different-target transition already applies immediately. This records the settled fixture result, without a production command or a new course, service or save policy.
@@ -112,7 +112,7 @@ The #1696 status comment of 27 October 2026 says, "It does not yet provide the l
R-CITY-009: The job default (Q-JOBS-1, owner, 15 October 2026). On each housing step, after the refugees become civilians (R-CITY-004), each city whose default is on sets its employed to `min(job slots, civilians + craftsmen)`, in ascending city id, at no Attention cost. Every city's default is on at the start; an accepted `AssignWorkers` order fixes that city's number and turns its default off for the rest of the game. Each change is a `city` cause on the Why screen ("Town: N groups in work"). A city's record writes `jobs=manual` into the state hash only when its default is off.
-R-CITY-010: A city the enemy holds pauses (decision D6, owner, 1 November 2026, "Approve all six (Recommended)", [answers](https://github.com/eyalgolan/statecraft-israel/pull/1668#issuecomment-6553884547); #1711). Under gdd-0.3 only, a city is held in a turn when an enemy military unit (a unit with a `side` other than the player's; a halutz has no side and holds nothing, R-UNIT-001) stands on its settlement hex when steps 5 and 6 run, after step 3: no later step moves an enemy unit, so that is where it stands at the turn's end. An enemy formation that arrives on the hex at step 9 (R-UNIT-009) holds the city from the next turn. That turn a held city pays no R-CITY-002 job income and its R-PROJ-003 projects gain no progress: their records, turns left and carried fraction stay as they were. Housing, residents, jobs and every id are unchanged, nobody is evacuated, and an objective already awarded stays awarded. A turn in which no enemy unit is on the hex pays and builds as before. Cities have no Food production of their own on main (R-FIELD-002 fields belong to no city), so there is nothing else to pause until #1694 links fields to cities. gdd-0.1 and legacy are unchanged, and gdd-0.1 keeps its R-END-003 defeat. The turn-report line for a held city is still to come.
+R-CITY-010: A city the enemy holds pauses (decision D6, owner, 1 November 2026, "Approve all six (Recommended)", [answers](https://github.com/eyalgolan/statecraft-israel/pull/1668#issuecomment-6553884547); #1711). Under gdd-0.3 only, a city is held in a turn when an enemy military unit (a unit with a `side` other than the player's; a halutz has no side and holds nothing, R-UNIT-001) stands on its settlement hex when steps 5 and 6 run, after step 3: no later step moves an enemy unit, so that is where it stands at the turn's end. An enemy formation that arrives on the hex at step 9 (R-UNIT-009) holds the city from the next turn. That turn a held city pays no R-CITY-002 job income and its R-PROJ-003 projects gain no progress: their records, turns left and carried fraction stay as they were. Its staffed arms workshops pause the same way: no charge and no progress, the cycle kept (R-ARMS-006). Housing, residents, jobs and every id are unchanged, nobody is evacuated, and an objective already awarded stays awarded. A turn in which no enemy unit is on the hex pays and builds as before. Cities have no Food production of their own on main (R-FIELD-002 fields belong to no city), so there is nothing else to pause until #1694 links fields to cities. gdd-0.1 and legacy are unchanged, and gdd-0.1 keeps its R-END-003 defeat. The turn-report line for a held city is still to come.
R-CITY-005: The cities' employed share (employed over civilians and craftsmen, summed over all cities; 1 with none) is an effect-web source of `morale`, Social cohesion (`work_lifts_cohesion`, source id `employed_share`), read after the turn's housing. The legacy loop has no cities, so there it reads 0 and adds nothing. Housing reaches Social cohesion through the existing `housing` link (`homes_lift_morale`) until Phase 3 makes it the cities' aggregate (Q-NAT-2, decided 15 October 2026). Phase 1's separate cohesion value and its two weights are gone (D-C1, Reading 2).
@@ -142,7 +142,7 @@ R-HOUSE-004: In the GDD loop the base of the national `housing` indicator is the
## City projects
-A city project is built in a city (GDD "Cities and construction"; Phase 3 PR 4, #735). The kinds are in `content/projects.yaml`, every number a design value (Q-PROJ-1, Q-PROJ-5, owner, 15 October 2026, #375: "Take all recommendations", with agent-proposed values the owner may override): permanent housing (`housing`), the transit camp (`transit_camp`, D-D3, Q-HOUSE-3) and `industry`. They replace the legacy map actions, which the GDD loop refuses (R-PROJ-004).
+A city project is built in a city (GDD "Cities and construction"; Phase 3 PR 4, #735). The kinds are in `content/projects.yaml`, every number a design value (Q-PROJ-1, Q-PROJ-5, owner, 15 October 2026, #375: "Take all recommendations", with agent-proposed values the owner may override): permanent housing (`housing`), the transit camp (`transit_camp`, D-D3, Q-HOUSE-3) and `industry`, and, under gdd-0.3 only, the arms workshop (`arms_workshop`, R-ARMS-004). They replace the legacy map actions, which the GDD loop refuses (R-PROJ-004).
R-PROJ-001: `StartProject(kind, city, q, r)` starts a city project of a `projects.yaml` kind for a city on hex (q, r). The Treasury pays the kind's cost at once and borrows what it lacks (Q-PROJ-1, Q-MONEY-3, "Allow borrowing"); the project takes the next id and the kind's turns, the turn of the order the first (D-A3). It needs no workers (Q-PROJ-3). It is refused, state and Attention unchanged, for an unknown kind or city; a locked kind that no event has unlocked (R-EFX-008); a transit camp without the `maabarot` policy at 0.5 or more (Q-HOUSE-3: the policy carries the camp's sourced date, and the map actions' 1 January 1950 window does not apply); a hex that is not land, is more than `map_action_max_distance` from the city's settlement hex, or holds a map-action placement or another city project, built or not (Q-PROJ-2); and once `map_actions_per_turn` projects were started this turn, counted nationally (Q-PROJ-4; the GDD loop builds no map action, R-PROJ-004). The legacy loop refuses it before charging Attention. Its Attention cost is `attention_cost.start_project` (1, Q-PROJ-5).
@@ -160,7 +160,7 @@ For R-PROJ-001 and R-PROJ-003, the preceding rules and the IL 0m upkeep of R-MON
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`, `artillery` and `armoured_car` in a military camp (R-UNIT-008), `halutz` in a Hakhshara, `craftsman` at industry, R-CRAFT-001) 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. `Reinforce` (R-TRAIN-004) starts a cohort by the same rules, aimed at a unit. A queued `ReassignCraftsmen` or `ReassignPioneers` (R-QUAL-004, R-QUAL-005) takes its civilians without a job as a queued `Train` does (counted in full, so the orders are accepted in any order), in `Training.Ordered` and `Training.Available` (#1548; owner, 24 October 2026: "Yes, count them", https://github.com/eyalgolan/statecraft-israel/issues/1511#issuecomment-6378360813).
+R-TRAIN-001: `Train(city, track, n)` takes `n` of the city's civilians without a job (not a staffed arms workshop's worker, R-ARMS-005) into a cohort that trains as `track` (a unit type with a `facility`: `recruit`, `artillery` and `armoured_car` in a military camp (R-UNIT-008), `halutz` in a Hakhshara, `craftsman` at industry, R-CRAFT-001) 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. `Reinforce` (R-TRAIN-004) starts a cohort by the same rules, aimed at a unit. A queued `ReassignCraftsmen` or `ReassignPioneers` (R-QUAL-004, R-QUAL-005) takes its civilians without a job as a queued `Train` does (counted in full, so the orders are accepted in any order), in `Training.Ordered` and `Training.Available` (#1548; owner, 24 October 2026: "Yes, count them", https://github.com/eyalgolan/statecraft-israel/issues/1511#issuecomment-6378360813).
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 recruit cohort's Arms go back to the pool (R-ARMS-003). A cohort that does not exist, or has finished, is refused with the state unchanged. Replacements (R-TRAIN-004) cancel the same way.
@@ -402,7 +402,7 @@ R-MONEY-001: The GDD's Money is the Treasury (`model.yaml` money `treasury`, in
R-MONEY-002: In step 7, after Food consumption and imports, the Treasury pays each existing civilian kind's annual upkeep for the turn's share of a year; an unfinished project pays none, and R-MONEY-003 covers a shortfall. In the MVP, cities, completed permanent-housing projects, completed industry projects, completed transit camps, military camps and Hakhsharot each have an explicit upkeep of **IL 0m per year** in `rules.yaml`. These are design values, not historical claims. Phase 5 decides military-unit upkeep separately (#742; owner, 18 October 2026, #884 option 3). It applies under `gdd-0.3` too, and the six rates stay IL 0m (the owner's 30 October 2026 "Keep ruling" on UPKEEP; D1; #1702).
-R-MONEY-003: A GDD cost above the Treasury is paid, and the shortfall moves to debt, as map actions do: the Treasury stops at 0, and a cause names what the shortfall was borrowed for (Q-MONEY-3, owner decision "Allow borrowing", 15 October 2026, for training and pioneer work; the Phase 2 plan applies it to every GDD cost). It covers the deficit, map actions, training (R-TRAIN-001), pioneer work (R-SITE-001) and an event option's Treasury cost. The same rule applies under `gdd-0.3` (D1; #1702): `debt_ceiling` is only the economic-defeat threshold (R-END-001), so every cost still borrows past it, except an Arms purchase whose borrowing would take the debt past it, which is refused (R-ARMS-002, #2198). A shortfall changes nothing but the Treasury and the debt, and a refused order changes nothing (`Gdd03MoneyLedgerTests`).
+R-MONEY-003: A GDD cost above the Treasury is paid, and the shortfall moves to debt, as map actions do: the Treasury stops at 0, and a cause names what the shortfall was borrowed for (Q-MONEY-3, owner decision "Allow borrowing", 15 October 2026, for training and pioneer work; the Phase 2 plan applies it to every GDD cost). It covers the deficit, map actions, training (R-TRAIN-001), pioneer work (R-SITE-001), an event option's Treasury cost and an arms workshop's cycle (R-ARMS-006). The same rule applies under `gdd-0.3` (D1; #1702): `debt_ceiling` is only the economic-defeat threshold (R-END-001), so every cost still borrows past it, except an Arms purchase whose borrowing would take the debt past it, which is refused (R-ARMS-002, #2198), and an arms workshop's cycle whose borrowing would take the debt past it, which waits unpaid that month (R-ARMS-006). A shortfall changes nothing but the Treasury and the debt, and a refused order changes nothing (`Gdd03MoneyLedgerTests`).
R-MONEY-004: "Spend the dollars" (#813; owner, 2 November 2026: "Spend the dollars (Recommended)", https://github.com/eyalgolan/statecraft-israel/issues/813#issuecomment-6564883926). `ConvertDollars(amount)`, save line `dollars N`, scenario kind `convert_dollars`, converts `amount` US$ millions of foreign currency into Money: the reserves lose `amount` and the Treasury gains `amount` times the `mvp.il_per_dollar` rate in force on the turn's date, with a cause line, so the turn's deficit borrows that much less (R-MONEY-003); no principal is added to Debt (Q5). A turn's conversions run before its Arms purchases, whatever the queue order, so a purchase borrows only what the conversions leave it short (#2206; owner, 2 November 2026: "Conversion counts first (Recommended)", [#813](https://github.com/eyalgolan/statecraft-israel/issues/813#issuecomment-6569645587)). It is a GDD order, refused in the legacy loop. It is refused, state and Attention unchanged, below $1m ("Convert at least $1m"), outside the war, a rung below 4 at the turn's start ("Dollars can be converted only during the war"), when the turn's conversions would pass `mvp.dollars_per_turn` (4; "That is more dollars than may be converted this month"), when the game's would pass `mvp.dollars_total` (100, the Export-Import Bank's 1949 credit, FRUS 1949 vol. VI, d407; "That would pass the total of dollars that may be converted"), or when the reserves would go below 0 ("There are not enough dollars in the reserves"). `GameState.DollarsConverted` keeps the game's total and is hashed as `dollars=` only when not 0. The rate is sourced and dated: IL 0.333 per $ ($3.00), the effective dollar rate, to 18 September 1949 (the official sterling parity gave IL 0.248 per $, but most dollar transactions ran at 0.333), and IL 0.357 per $ ($2.80) from the devaluation of 19 September 1949 to 14 February 1952 (IMF, Annual Report 1950, Appendix I, pp. 88-89; Federal Reserve Bulletin, November 1949, p. 1336; Michaely, *Israel's Foreign Exchange Rate System* (1971), p. 10 and Table 2-1; Patinkin, *The Israel Economy: The First Decade*, Table 43, p. 121 (gathered on [#813](https://github.com/eyalgolan/statecraft-israel/issues/813#issuecomment-6565039439))). `dollars_per_turn` and `dollars_total` are labelled design values, and the Attention cost `attention_cost.convert_dollars` is 0 (owner, 2 November 2026: "Keep 0 (Recommended)", [#2204](https://github.com/eyalgolan/statecraft-israel/pull/2204#issuecomment-6569134870)). The Defence screen makes the order and shows the foreign-currency reserve beside it. With a conversion queued, a new amount in its box replaces the order at once, or withdraws it when the amount would be refused, so the box, its Money line and what End turn converts agree; the reserve and the total converted keep the turn's start until End turn (owner, 2 November 2026: "Box shows queued order (Recommended)", [#813](https://github.com/eyalgolan/statecraft-israel/issues/813#issuecomment-6569645587)). Outside the war the panel stays visible but disabled, with one line saying conversion is for wartime only (owner, 2 November 2026: "Grey it with the reason (Recommended)", [#813](https://github.com/eyalgolan/statecraft-israel/issues/813#issuecomment-6569645587)); the top bar gains nothing and keeps its Foreign currency meter (owner, 2 November 2026: "Keep it", [#2204](https://github.com/eyalgolan/statecraft-israel/pull/2204#issuecomment-6569134870)). The same rules apply under `gdd-0.1` and `gdd-0.3`, which share this economy (D1).
@@ -422,12 +422,20 @@ R-FOOD-003: `food_supply` stays the 0 to 1 level the UI, the situations and the
The national Arms pool (D-G6, decided 15 October 2026: "From events (sourced arms deals) and Money. Training and attacks consume it"). The four numbers are the owner's (18 October 2026, #781: "Approve as drafted"); each is a labelled design value in `rules.yaml`, and the balance pass (#813) may tune them. An event can move the Arms stock (R-EFX-001, R-EFX-002), and the Arms an attack spends is Phase 5 (Q-COMBAT-4).
-R-ARMS-001: Arms is a national stock of whole units (`GameState.Arms`, hashed as `arms=` only when not 0); one Arms is the equipment package for one recruit group of `people_per_unit` (1,000) people. A new game starts the stock at `arms_start` (12). It never goes below 0. `arms_start`, `arms_price` and `arms_per_recruit_group` are required in the GDD loop (`rules.yaml` `mvp:`); a missing or negative value is a load error.
+R-ARMS-001: Arms is a national stock of whole units (`GameState.Arms`, hashed as `arms=` only when not 0); one Arms is the equipment package for one recruit group of `people_per_unit` (1,000) people. A new game starts the stock at `arms_start` (12). It never goes below 0. Under gdd-0.3 an arms workshop's completed cycle adds 1 (R-ARMS-006). `arms_start`, `arms_price` and `arms_per_recruit_group` are required in the GDD loop (`rules.yaml` `mvp:`); a missing or negative value is a load error.
-R-ARMS-002: `BuyArms(count)` adds `count` units to the stock at once, with no delivery delay, and the Treasury pays `count * arms_price` (IL 1m an Arms), borrowing what it lacks (R-MONEY-003). It is refused, state and Attention unchanged, for fewer than one unit, a stock that would pass a whole number's range, or a purchase whose borrowing would take the debt past `debt_ceiling` (#2198; owner, 2 November 2026: "Refuse buys over ceiling (Recommended)", https://github.com/eyalgolan/statecraft-israel/issues/2198#issuecomment-6564721486), with the reason "Buying that many Arms would take the debt past its ceiling"; the legacy loop refuses it before charging Attention. The debt after is R-MONEY-003's: the debt plus what the Treasury lacks (`Debt + max(0, cost - Treasury)`). A debt exactly at the ceiling is allowed, and a purchase the Treasury pays in full borrows nothing and is never refused at it, even with the debt already past it. This overrides Q22 for Arms purchases only; every other cost still borrows past the ceiling (R-MONEY-003). The Defence screen shows the same reason before End turn when End turn would refuse the amount for the ceiling with the turn's orders as they stand: it runs them from the turn's start on a copy, as End turn runs them, with this purchase in place of a queued one or after them, so the dollar conversions and any other spending queued before the purchase count (#2206). The turn's dollar conversions (R-MONEY-004) run before its Arms purchases, whatever the queue order: a conversion queued after the turn's first `BuyArms` runs just before it, with the other such conversions in their queue order, and every other order keeps its queue place (#2206). Its Attention cost is `attention_cost.buy_arms` (1), whatever the count.
+R-ARMS-002: `BuyArms(count)` adds `count` units to the stock at once, with no delivery delay, and the Treasury pays `count * arms_price` (IL 1m an Arms), borrowing what it lacks (R-MONEY-003). It is refused, state and Attention unchanged, for fewer than one unit, a stock that would pass a whole number's range, or a purchase whose borrowing would take the debt past `debt_ceiling` (#2198; owner, 2 November 2026: "Refuse buys over ceiling (Recommended)", https://github.com/eyalgolan/statecraft-israel/issues/2198#issuecomment-6564721486), with the reason "Buying that many Arms would take the debt past its ceiling"; the legacy loop refuses it before charging Attention. The debt after is R-MONEY-003's: the debt plus what the Treasury lacks (`Debt + max(0, cost - Treasury)`). A debt exactly at the ceiling is allowed, and a purchase the Treasury pays in full borrows nothing and is never refused at it, even with the debt already past it. This overrides Q22 for Arms purchases; an arms workshop's cycle also waits rather than borrow past it (R-ARMS-006), and every other cost still borrows past the ceiling (R-MONEY-003). The Defence screen shows the same reason before End turn when End turn would refuse the amount for the ceiling with the turn's orders as they stand: it runs them from the turn's start on a copy, as End turn runs them, with this purchase in place of a queued one or after them, so the dollar conversions and any other spending queued before the purchase count (#2206). The turn's dollar conversions (R-MONEY-004) run before its Arms purchases, whatever the queue order: a conversion queued after the turn's first `BuyArms` runs just before it, with the other such conversions in their queue order, and every other order keeps its queue place (#2206). Its Attention cost is `attention_cost.buy_arms` (1), whatever the count.
R-ARMS-003: Recruit training (R-TRAIN-001) takes `arms_per_recruit_group` (1) Arms for each group when it starts, after its other checks and before it pays. A stock short of that refuses the order with a reason naming the need and the stock, state and Attention unchanged (Q-UNIT-3). A gun or armoured car crew takes its type's `training_arms` a group instead, by the same rule (R-UNIT-008). Pioneer training takes no Arms. The cohort keeps the Arms it took, and the state hash writes them with it; cancelling the cohort (R-TRAIN-002) returns them to the pool, up to the most the stock can hold, although the Money stays paid (owner, 18 October 2026, #1047: "Refund on cancel"). Replacement groups (R-TRAIN-004) take their course's Arms by the same rule (owner, 23 October 2026, #1510: "Replacements cost Arms").
+R-ARMS-004: Under gdd-0.3 only, the arms workshop (`projects.yaml` `arms_workshop`, #1701) is a city project kind: `StartProject` builds it as R-PROJ-001 to R-PROJ-003 build any kind, for IL 15m and 3 turns (owner, 2 November 2026, #1701 OQ2: "IL 15m, 3 turns (Recommended)"; the gdd-0.3 catalogue's `arms_workshop` cost 15 and work 3). Built, it gives one workshop worker slot (`worker_slots: 1`, the catalogue's `arms_workshop.parts.worker_slots`) and adds no housing, condition or job slots: a workshop gives no Industry job (`docs/gdd/cities.md`, "Arms workshops"). Its row carries `rulesets: [gdd-0.3]`, and the loader leaves it out of every other ruleset's kinds, so a gdd-0.1 game neither lists nor starts it (`StartProject` refuses it as an unknown kind) and its state does not change; the row still moves the content hash. The loader refuses an unknown ruleset id in `rulesets`, `worker_slots` other than 0 or 1, a kind with a worker slot that has capacity, condition or job slots or is not limited to exactly gdd-0.3, and, under gdd-0.3, an `arms_workshop` whose worker slots differ from the catalogue's. It pays no upkeep: R-MONEY-002 has no rate for it (the catalogue's 0.50 is a Default). Its Hebrew name סדנת נשק is a draft awaiting a native speaker's review (`name_he_review: agent-checked`, #564; owner, 2 November 2026, #1701 OQ8).
+
+R-ARMS-005: Under gdd-0.3, `AssignWorkers(city, "workshop", n)` is a standing order that staffs the city's first `n` built arms workshops, in ascending project id, and leaves the rest unstaffed (27M-13, owner-approved 1 November 2026: "Any free civilian. The cost tier follows the worker (novice or ordinary / apprentice / expert)."). A newly staffed workshop takes one of the city's civilians and craftsmen who hold no job; the worker stays one of them, with no job, profession or qualification change, is not employed (R-CITY-001) and earns no job income (R-CITY-002). On the aggregate cities every worker is priced at the ordinary or novice tier until the population ledger's tiers are live (owner, 2 November 2026, #1701 OQ6: "Accept all four (Recommended)"; R-POP-004). It is refused, state unchanged, for an unknown city, a negative count, more than the city's built workshops ("Town A has 1 arms workshop"), or more newly staffed workshops than the city's people without a job ("... civilians and craftsmen without a job"); under every other ruleset the `workshop` role is refused as "There is no such role". While the city's job default is on (R-CITY-009), a newly staffed workshop may take its worker from the default's jobs instead: the order is refused only past the city's civilians and craftsmen less its staffed workshops ("... civilians and craftsmen"), the city's employed falls to at most its civilians and craftsmen less the staffed workshops (a `city` cause, "Town: N groups in work"), and the default stays on, filling one job fewer (R-CITY-001; #2270 review fix, 2 November 2026). A number of jobs the player set (default off) is never lowered: there the order needs people without a job. A staffed workshop's worker is not idle: `Train` (R-TRAIN-001) and `ReassignPioneers` (R-QUAL-005) cannot take them, and the Train panel's limit (`Training.Available`) counts a pending `workshop` order's newly staffed workers, never as jobs. An unstaffed workshop keeps its record, paid cost and progress (a pause, R-ARMS-007). There is no limit on workshops per city beyond one project a hex and the starts a turn (R-PROJ-001; #1701 OQ7). `GameState.Workshops` holds every workshop ever staffed, by project id, and is hashed as `wshop[...]` only when it has one (R-LOOP-002). The order is not on the Unity hex panel yet (#1701 slice E).
+
+R-ARMS-006: On step 6 of the turn, after the cities' job income, in ascending project id, each staffed arms workshop under gdd-0.3 works this month when its city is not held (R-CITY-010) and one of the city's people without a job is left for it (each workshop of the city takes one, in ascending project id; when none is left for it, it waits, and the Why screen says so). A workshop with no cycle under way first pays for one there (27M-11: "At the monthly production step."), at its worker's tier from the gdd-0.3 catalogue: `workshop.cost` IL 5m / 4m / 3m (ordinary or novice / apprentice / expert; `docs/GDD.md`'s balance ruling: "`workshop.cost` is Money per Arms and stays."), beside the IL 1m an Arms of R-ARMS-002 (owner, 2 November 2026, #1701 OQ1: "Keep as ruled"). A short Treasury borrows the rest (R-MONEY-003; 27M-12: "Automatic each month while the workshop is staffed, paid like any GDD cost."), but a cycle whose borrowing would take the debt past `debt_ceiling` is not paid: the workshop waits that month, the turn report says why (below), and nothing is borrowed (owner, 2 November 2026, #1701 OQ4: "Refuse past the ceiling (Recommended)"; exactly at the ceiling is allowed, and a Treasury that pays in full is never refused, as in R-ARMS-002). The month a cycle is paid is its first staffed month (#1701 OQ3: "Accept all four (Recommended)"). After `workshop.staffed_turns` (3) staffed months the cycle adds 1 Arms to the stock (R-ARMS-001) and ends, and the next month starts the next one by itself, with no order. A worker change keeps the cycle's paid cost and progress; only the next cycle is priced at the new worker's tier (27M-13). An unstaffed workshop, or one in a held city, keeps its cycle as it is and is not charged. The turn-report panel lists, in a row of its own after the stocks, each Arms a workshop made ("Workshop in Town: +1 Arms") and each ceiling pause ("Workshop in Town paused: debt ceiling") (owner, 2 November 2026, #1701 A1: "Yes, in the panel (Recommended)", the option "The turn-report panel shows 'Workshop in <city>: +1 Arms' and 'Workshop in <city> paused: debt ceiling'."); a no-worker pause is on the Why screen only. A city's Arms are one line and its ceiling pauses another, each with its count when there are two or more ("Workshops in Town (2): +2 Arms", "Workshops in Town (2) paused: debt ceiling"), in the order each first appears among the turn's causes (owner, 2 November 2026: "Combine per city (Recommended)", the option "'Workshops in Tel Aviv (6): +6 Arms'; pauses likewise combined with a count."). The option gives no wording for one workshop, so a city with one keeps A1's line. The count is the number of the sim's causes; the UI computes nothing else.
+
+R-ARMS-007: A workshop's cycle progress is lost and its Money is not refunded on a destructive cancellation, destruction or transfer of the workshop (27M-14, owner-approved 1 November 2026: "Cycle progress is lost and the Money paid is not refunded."). The MVP has none (owner, 2 November 2026, #1701 OQ5: "Accept all four (Recommended)"): a built project cannot be cancelled (R-PROJ-002), a held city pauses (R-CITY-010) and unstaffing pauses (R-ARMS-005), and each keeps the cycle; a later mechanism that destroys or transfers a workshop applies this rule. Workshop work changes no qualification, profession or craftsman count (Q55, owner-approved 1 November 2026: "No. Only the stated apprentice-to-expert progression counts").
+
## Defeat
The game can be lost (D-B5, decided: "Money and Food exhausted for N turns, or a war loss. Values for the owner. Coalition collapse is off in the MVP"; Phase 7 PR 5, #8). This part covers the economic defeat (R-END-001, R-END-002), which remains in gdd-0.3, and the gdd-0.1 war loss (R-END-003). The defeat texts are decided (Q-DEF-4 (b), owner, 18 October 2026, #784): a short factual line per cause - "Money and Food ran out" and "The enemy holds a city" - plus one sourced history note beside each, which goes on the end screen with #812.
diff --git a/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.cs b/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.cs
new file mode 100644
index 000000000..dfbc7f222
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.cs
@@ -0,0 +1,538 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using Statecraft.Sim;
+
+/// <summary>#1701 (GDD 0.3 arms workshops), on the aggregate cities: the gdd-0.3 `arms_workshop` project kind (R-ARMS-004).
+/// The fixture's town_a is on (1, 0), with (1, 1) and (2, 0) land next to it; its workshop row has the real row's numbers
+/// (owner, 2 November 2026, OQ2: "IL 15m, 3 turns (Recommended)").</summary>
+public class ArmsWorkshopTests
+{
+ internal const string Row = " - { id: arms_workshop, name: an arms workshop, cost: 15, turns: 3, capacity: 0, condition: 0, job_slots: 0, worker_slots: 1, rulesets: [gdd-0.3] }\n";
+
+ /// <summary>The GDD fixture with <paramref name="projects"/> as projects.yaml, under gdd-0.3 (with the real balance
+ /// catalogue, which that ruleset requires) or gdd-0.1.</summary>
+ internal static Dictionary<string, string> Files(bool gdd03, string projects = Fixture.GddProjects + Row)
+ {
+ var f = Fixture.Gdd(new Dictionary<string, string>
+ {
+ ["projects.yaml"] = projects,
+ // An enemy type, so a test can hold town_a (R-CITY-010).
+ ["unit_types.yaml"] = Fixture.GddUnitTypes + " - { id: enemy, kind: unit, side: egypt, class: infantry, movement_points: 3 }\n",
+ });
+ if (!gdd03) return f;
+ f["eras.yaml"] = f["eras.yaml"].Replace("loop: gdd", "loop: gdd, ruleset: " + SaveGame.Gdd03Ruleset);
+ f[Gdd03BalanceCatalogue.FileName] = File.ReadAllText(Path.Combine(RealContentTests.ContentRoot(), Gdd03BalanceCatalogue.FileName));
+ return f;
+ }
+
+ internal static Content Load(bool gdd03, string projects = Fixture.GddProjects + Row) => ContentLoader.Load(Fixture.Write(Files(gdd03, projects)));
+
+ static StepResult Step(Content c, GameState s, params Command[] commands) => Simulation.Step(c, s, commands);
+
+ // R-ARMS-004: the row is read under gdd-0.3 only; gdd-0.1 keeps exactly its kinds, in their order, so its Build list,
+ // its StartProject and its hash do not change.
+ [Fact]
+ public void TheWorkshopIsAKindUnderGdd03Only()
+ {
+ Assert.Equal(new[] { "housing", "transit_camp", "industry" }, Load(false).ProjectKinds.Select(k => k.Id));
+ var c = Load(true);
+ Assert.Equal(new[] { "housing", "transit_camp", "industry", "arms_workshop" }, c.ProjectKinds.Select(k => k.Id));
+ var k = c.ProjectKinds.Single(x => x.Id == "arms_workshop");
+ Assert.Equal((15.0, 3, 0, 0.0, 0, 1), (k.Cost, k.Turns, k.Capacity, k.Condition, k.JobSlots, k.WorkerSlots));
+ Assert.Equal(new[] { SaveGame.Gdd03Ruleset }, k.Rulesets);
+ Assert.Equal(0, c.ProjectKinds.Single(x => x.Id == "industry").WorkerSlots);
+ }
+
+ // R-ARMS-004 (OQ2, owner 2 November 2026: "IL 15m, 3 turns (Recommended)"; OQ8: the Hebrew name awaits a native read):
+ // the real game (gdd-0.1) has its four kinds, and the real row loads under gdd-0.3 with the ruled numbers.
+ [Fact]
+ public void TheRealRowIsTheRuledWorkshop()
+ {
+ var real = ContentLoader.Load(RealContentTests.ContentRoot());
+ Assert.Equal(new[] { "housing", "transit_camp", "industry", "winery" }, real.ProjectKinds.Select(k => k.Id));
+ var line = File.ReadAllLines(Path.Combine(RealContentTests.ContentRoot(), "projects.yaml")).Single(l => l.Contains("id: arms_workshop"));
+ var k = Load(true, Fixture.GddProjects + line + "\n").ProjectKinds.Single(x => x.Id == "arms_workshop");
+ Assert.Equal((15.0, 3, 0, 0.0, 0, 1), (k.Cost, k.Turns, k.Capacity, k.Condition, k.JobSlots, k.WorkerSlots));
+ Assert.Equal(("סדנת נשק", HebrewReview.AgentChecked), (k.NameHe, k.NameHeReview));
+ }
+
+ // R-ARMS-004: under gdd-0.1 the kind does not exist, so StartProject refuses it as unknown and nothing changes.
+ [Fact]
+ public void Gdd01RefusesTheWorkshopAsAnUnknownKind()
+ {
+ var c = Load(false);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ var r = Step(c, s, new StartProject("arms_workshop", "town_a", 1, 1));
+ Assert.Equal("There is no such city project", Assert.Single(r.Rejected).Reason);
+ Assert.Equal(Step(c, s).State.Hash(), r.State.Hash());
+ }
+
+ // R-ARMS-004 with R-PROJ-001 and R-PROJ-003: under gdd-0.3 the workshop is built like any project: paid in full at the
+ // start (borrowing the shortfall), built after its 3 turns, and it adds no housing, condition or job slots.
+ [Fact]
+ public void Gdd03BuildsTheWorkshopLikeAnyProject()
+ {
+ var c = Load(true);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ s.Treasury = 10; s.Debt = 0;
+ var one = Step(c, s, new StartProject("arms_workshop", "town_a", 1, 1));
+ Assert.Empty(one.Rejected);
+ Assert.Equal(-15, one.Why.Single(w => w.Key == CauseKeys.Paid && w.Args[0] == CauseKeys.Purpose.Project).Delta, 9);
+ Assert.Equal(5, one.Why.Single(w => w.Key == CauseKeys.Borrowed && w.Args[0] == CauseKeys.Purpose.Project).Delta, 9); // IL 15m against IL 10m
+ var p = one.State.CityProjects.Values.Single();
+ Assert.Equal(("arms_workshop", 2, (DateTime?)null), (p.Kind, p.TurnsLeft, p.BuiltOn));
+ var built = Step(c, Step(c, one.State).State).State;
+ Assert.NotNull(built.CityProjects[p.Id].BuiltOn);
+ var before = s.Cities["town_a"]; var after = built.Cities["town_a"];
+ Assert.Equal((before.HousingCapacity, before.JobSlots, before.Condition), (after.HousingCapacity, after.JobSlots, after.Condition));
+ }
+
+ // R-ARMS-004: the loader refuses a row that could not be a gdd-0.3 workshop slot, naming the field.
+ [Theory]
+ [InlineData("rulesets: [gdd-0.3]", "rulesets: [gdd-0.9]", false, "projects[arms_workshop].rulesets")]
+ [InlineData("worker_slots: 1", "worker_slots: 2", true, "projects[arms_workshop].worker_slots")]
+ [InlineData("worker_slots: 1", "worker_slots: -1", true, "projects[arms_workshop].worker_slots")]
+ [InlineData("job_slots: 0, worker_slots", "job_slots: 1, worker_slots", true, "projects[arms_workshop].job_slots")]
+ [InlineData("capacity: 0, condition: 0, job_slots: 0, worker", "capacity: 2, condition: 0, job_slots: 0, worker", true, "projects[arms_workshop].capacity")]
+ [InlineData("condition: 0, job_slots: 0, worker", "condition: 0.1, job_slots: 0, worker", true, "projects[arms_workshop].condition")]
+ [InlineData("rulesets: [gdd-0.3]", "rulesets: [gdd-0.1, gdd-0.3]", true, "projects[arms_workshop].rulesets")]
+ [InlineData(", rulesets: [gdd-0.3]", "", false, "projects[arms_workshop].rulesets")]
+ [InlineData("worker_slots: 1", "worker_slots: 0", true, "projects[arms_workshop].worker_slots")] // the catalogue's 1
+ public void ABadWorkshopRowIsRefused(string from, string to, bool gdd03, string where)
+ {
+ Assert.Contains(from, Row);
+ var e = Assert.Throws<ContentException>(() => Load(gdd03, Fixture.GddProjects + Row.Replace(from, to)));
+ Assert.Contains(where, e.Message);
+ }
+
+ // ---- R-ARMS-005: the workshop's worker (slice B) ----
+
+ /// <summary>A gdd-0.3 game whose town_a has <paramref name="jobs"/> job slots, <paramref name="civilians"/> civilians,
+ /// <paramref name="employed"/> of them in jobs, and a built arms workshop on (1, 1): its id is the second value.</summary>
+ internal static (Content C, GameState S, int Id) Built(int civilians = 10, int employed = 6, int jobs = 8, bool jobsDefault = true)
+ {
+ var c = Load(true);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ var x = s.Cities["town_a"];
+ s.Cities["town_a"] = new City(x.Id, x.HousingCapacity, jobs, civilians, employed, 0, 0, x.Condition, jobsDefault: jobsDefault);
+ var id = s.NextId++;
+ s.CityProjects.Add(id, new CityProject(id, Workshops.ArmsWorkshop, "town_a", 1, 1, 0, s.Date));
+ return (c, s, id);
+ }
+
+ internal static AssignWorkers Staff(int count, string city = "town_a") => new AssignWorkers(city, Workshops.Role, count);
+
+ // R-ARMS-005 (27M-13, "Any free civilian. The cost tier follows the worker"; #1701 OQ6, owner 2 November 2026: "Accept
+ // all four (Recommended)": every aggregate worker is priced as ordinary): AssignWorkers(city, "workshop", n) staffs the
+ // city's first n built workshops with people without a job. The order changes no Money, profession or job.
+ [Fact]
+ public void StaffingTakesOnePersonWithoutAJob()
+ {
+ var (c, s, id) = Built(jobsDefault: false);
+ var r = Step(c, s, Staff(1));
+ Assert.Empty(r.Rejected);
+ var w = r.State.Workshops[id];
+ Assert.Equal((true, SyntheticWorkshopTier.Ordinary), (w.Staffed, w.WorkerTier));
+ var line = Assert.Single(r.Why, x => x.Key == CauseKeys.WorkshopWorkers);
+ Assert.Equal(("town_a", "1", "Town A: arms workshops staffed: 1"), (line.Target, string.Join("|", line.Args), line.Message));
+ var x = r.State.Cities["town_a"]; var before = Step(c, s).State.Cities["town_a"];
+ Assert.Equal((before.Civilians, before.Craftsmen, before.Employed, before.Qualified), (x.Civilians, x.Craftsmen, x.Employed, x.Qualified));
+ }
+
+ // R-ARMS-005 with R-CITY-001 and R-CITY-009: the worker holds no job, so the city's most workers is one fewer and the job
+ // default fills one job fewer; R-CITY-002: the worker earns no job income.
+ [Fact]
+ public void TheWorkerHoldsNoJobAndEarnsNoWage()
+ {
+ var (c, s, _) = Built(civilians: 10, employed: 6, jobs: 12);
+ var staffed = Step(c, s, Staff(1));
+ Assert.Equal(9, Cities.MaxWorkers(staffed.State, staffed.State.Cities["town_a"]));
+ Assert.Equal(9, staffed.State.Cities["town_a"].Employed); // the job default (step 8) fills 9 of the 10
+ Assert.Equal(10, Step(c, s).State.Cities["town_a"].Employed);
+ double Wages(StepResult r) => r.Why.Single(w => w.Key == CauseKeys.WagesPaid && w.Target == "town_a").Delta;
+ var next = Step(c, staffed.State);
+ var nine = staffed.State.Clone(); nine.Workshops.Clear();
+ nine.Cities["town_a"] = new City("town_a", nine.Cities["town_a"].HousingCapacity, 9, 10, 9, 0, 0, nine.Cities["town_a"].Condition);
+ Assert.Equal(Wages(Step(c, nine)), Wages(next), 12); // the wages of 9 jobs, as a city with 9 jobs and one idle
+ var refused = Step(c, staffed.State, new AssignWorkers("town_a", "job", 10));
+ Assert.Equal("Town A has 9 civilians and craftsmen", Assert.Single(refused.Rejected).Reason);
+ }
+
+ public static IEnumerable<object[]> StaffRefusals() => new List<object[]>
+ {
+ new object[] { "gdd-0.1", "There is no such role" },
+ new object[] { "unknown city", "There is no such city" },
+ new object[] { "negative", "The number of workers cannot be negative" },
+ new object[] { "more than built", "Town A has 1 arms workshop" },
+ new object[] { "still building", "Town A has 0 arms workshops" },
+ new object[] { "nobody without a job", "Town A has 0 civilians and craftsmen without a job" },
+ new object[] { "nobody at all", "Town A has 0 civilians and craftsmen" },
+ };
+
+ // R-ARMS-005: each refusal leaves the state as if the order had not been given.
+ [Theory]
+ [MemberData(nameof(StaffRefusals))]
+ public void StaffingRefusalsChangeNothing(string why, string reason)
+ {
+ // "nobody without a job": the player set the jobs (R-CITY-009's default is off), so no job is given up for it.
+ var (c, s, id) = Built(civilians: why == "nobody at all" ? 0 : 10, employed: why == "nobody without a job" ? 10 : why == "nobody at all" ? 0 : 6, jobs: 10,
+ jobsDefault: why != "nobody without a job");
+ if (why == "gdd-0.1") { c = Load(false); s = Simulation.NewGame(c, 1, Mode.Historical); }
+ if (why == "still building") s.CityProjects[id] = new CityProject(id, Workshops.ArmsWorkshop, "town_a", 1, 1, 2);
+ var order = why switch
+ {
+ "unknown city" => Staff(1, "atlantis"),
+ "negative" => Staff(-1),
+ "more than built" => Staff(2),
+ _ => Staff(1),
+ };
+ var r = Step(c, s, order);
+ Assert.Equal(reason, Assert.Single(r.Rejected).Reason);
+ Assert.Equal(Step(c, s).State.Hash(), r.State.Hash());
+ }
+
+ // R-ARMS-005: lowering the count unstaffs the last workshops; the record stays, so a paid cycle is kept (R-ARMS-007).
+ [Fact]
+ public void UnstaffingKeepsTheRecord()
+ {
+ var (c, s, id) = Built(jobsDefault: false);
+ var off = Step(c, Step(c, s, Staff(1)).State, Staff(0));
+ Assert.Empty(off.Rejected);
+ Assert.False(off.State.Workshops[id].Staffed);
+ Assert.Equal(new[] { "0" }, off.Why.Single(x => x.Key == CauseKeys.WorkshopWorkers).Args);
+ }
+
+ // R-ARMS-005, R-LOOP-002: the workshops are hashed as wshop[...] only when there is one, so a gdd-0.1 state hashes as before.
+ [Fact]
+ public void TheWorkshopsAreHashedOnlyWhenPresent()
+ {
+ var (c, s, id) = Built(jobsDefault: false);
+ Assert.DoesNotContain("wshop", s.Describe());
+ var staffed = Step(c, s, Staff(1)).State;
+ Assert.Contains("wshop", staffed.Describe());
+ var other = staffed.Clone(); other.Workshops[id] = other.Workshops[id].WithStaffed(false);
+ Assert.NotEqual(staffed.Hash(), other.Hash());
+ }
+
+ // ---- R-ARMS-006: the monthly cycle at the production step (slice C) ----
+
+ static readonly SyntheticWorkshopRules Rules = SyntheticWorkshopRules.FromCatalogue(Load(true).Gdd03Balance!);
+
+ static IEnumerable<Cause> Charges(StepResult r) => r.Why.Where(w => w.Key == CauseKeys.Paid && w.Args[0] == CauseKeys.Purpose.Workshop);
+
+ /// <summary>A gdd-0.3 game with town_a's workshop already staffed at <paramref name="tier"/>, no jobs (so no wages reach
+ /// the Treasury before step 6), and the given Treasury and Debt.</summary>
+ static (Content C, GameState S, int Id) Staffed(double treasury = 100, double debt = 0, SyntheticWorkshopTier tier = SyntheticWorkshopTier.Ordinary,
+ decimal? paid = null, int progress = 0)
+ {
+ var (c, s, id) = Built(civilians: 10, employed: 0, jobs: 0);
+ s.Workshops.Add(id, new Workshop(id, true, tier, paid, progress));
+ s.Treasury = treasury; s.Debt = debt;
+ return (c, s, id);
+ }
+
+ static (GameState S, List<StepResult> Turns) Run(Content c, GameState s, int turns, Func<int, Command[]>? orders = null)
+ {
+ var all = new List<StepResult>();
+ for (int t = 0; t < turns; t++) { var r = Step(c, s, orders?.Invoke(t) ?? Array.Empty<Command>()); all.Add(r); s = r.State; }
+ return (s, all);
+ }
+
+ // R-ARMS-006 (27M-11, owner-approved 1 November 2026: "At the monthly production step."): the order pays nothing; the
+ // cycle is reserved and paid at step 6, after the city's wages, at the worker's price (IL 5m for an ordinary worker).
+ [Fact]
+ public void TheCycleIsReservedAtTheProductionStepNotOnTheOrder()
+ {
+ var (c, s, id) = Built(jobsDefault: false);
+ s.Treasury = 100;
+ var preview = Simulation.Preview(c, s, new Command[] { Staff(1) });
+ Assert.Equal(s.Treasury, preview.State.Treasury);
+ Assert.Null(preview.State.Workshops[id].PaidCost);
+ var r = Step(c, s, Staff(1));
+ var charge = Assert.Single(Charges(r));
+ Assert.Equal(-5.0, charge.Delta, 12);
+ var why = r.Why.ToList();
+ var at = why.IndexOf(charge);
+ Assert.True(why.FindIndex(w => w.Key == CauseKeys.WagesPaid) < at);
+ Assert.True(why.FindIndex(w => w.Key == CauseKeys.WorkshopWorkers) < at);
+ Assert.Equal((5m, 1), (r.State.Workshops[id].PaidCost, r.State.Workshops[id].Progress)); // OQ3: the month it is paid counts
+ }
+
+ // R-ARMS-006 (27M-12: "Automatic each month while the workshop is staffed, paid like any GDD cost."; OQ3, owner 2
+ // November 2026: "Accept all four (Recommended)": the month a cycle is paid is its first staffed month):
+ // workshop.staffed_turns (3) staffed months make 1 Arms, and the next cycle starts by itself the month after.
+ [Fact]
+ public void AStaffedWorkshopMakesOneArmsEveryThreeStaffedTurnsAndRepeats()
+ {
+ var (c, s, id) = Staffed();
+ var (idle, _) = Run(c, Clear(s), 6);
+ var (after, turns) = Run(c, s, 6);
+ Assert.Equal(3, Rules.StaffedTurns);
+ Assert.Equal(new[] { 0, 0, 1, 1, 1, 2 }, turns.Select(t => t.State.Arms - Run(c, Clear(s), turns.IndexOf(t) + 1).S.Arms));
+ Assert.Equal(new[] { 1, 0, 0, 1, 0, 0 }, turns.Select(t => Charges(t).Count()));
+ Assert.Equal(2, turns.Sum(t => t.Why.Count(w => w.Key == CauseKeys.WorkshopArms)));
+ var made = turns[2].Why.Single(w => w.Key == CauseKeys.WorkshopArms);
+ Assert.Equal(("town_a", 1.0, "Town A: an arms workshop made 1 Arms"), (made.Target, made.Delta, made.Message));
+ Assert.Equal(idle.Arms + 2, after.Arms);
+ Assert.Equal((null, 0), (after.Workshops[id].PaidCost, after.Workshops[id].Progress));
+ }
+
+ static GameState Clear(GameState s) { var x = s.Clone(); x.Workshops.Clear(); return x; }
+
+ // R-ARMS-006 (27M-13: "The cost tier follows the worker (novice or ordinary / apprentice / expert)."; gdd03-balance
+ // workshop.cost 5/4/3, which docs/GDD.md:370 keeps as "Money per Arms"; OQ1, owner 2 November 2026: "Keep as ruled").
+ [Theory]
+ [InlineData(SyntheticWorkshopTier.Ordinary, 5)]
+ [InlineData(SyntheticWorkshopTier.Novice, 5)]
+ [InlineData(SyntheticWorkshopTier.Apprentice, 4)]
+ [InlineData(SyntheticWorkshopTier.Expert, 3)]
+ public void TheCyclePaysTheWorkersTierPrice(SyntheticWorkshopTier tier, int price)
+ {
+ Assert.Equal(price, Rules.Price(tier));
+ var (c, s, id) = Staffed(tier: tier);
+ var r = Step(c, s);
+ Assert.Equal(-price, Assert.Single(Charges(r)).Delta, 12);
+ Assert.Equal((decimal?)price, r.State.Workshops[id].PaidCost);
+ }
+
+ // R-ARMS-006 with R-MONEY-003 (27M-12: "paid like any GDD cost"): a Treasury short of the price borrows the rest.
+ [Fact]
+ public void AShortTreasuryBorrowsTheRest()
+ {
+ var (c, s, _) = Staffed(treasury: 2, debt: 0);
+ var r = Step(c, s);
+ Assert.Equal(-5.0, Assert.Single(Charges(r)).Delta, 12);
+ Assert.Equal(3.0, r.Why.Single(w => w.Key == CauseKeys.Borrowed && w.Args[0] == CauseKeys.Purpose.Workshop).Delta, 12);
+ }
+
+ // R-ARMS-006 (#1701 OQ4, owner 2 November 2026: "Refuse past the ceiling (Recommended)"): a cycle whose borrowing would
+ // take the debt past mvp.debt_ceiling (the fixture's 10) is not paid that month: the workshop pauses, the turn report
+ // says why, and nothing is borrowed. Exactly at the ceiling is allowed, and a Treasury that pays in full is never refused.
+ [Theory]
+ [InlineData(0, 8, false)] // 8 + 5 = 13 > 10
+ [InlineData(0, 5, true)] // 5 + 5 = 10, at the ceiling
+ [InlineData(5, 50, true)] // paid in full: nothing borrowed
+ [InlineData(4, 9.5, false)] // 9.5 + 1 = 10.5 > 10
+ public void PastTheDebtCeilingTheCycleWaits(double treasury, double debt, bool paid)
+ {
+ var (c, s, id) = Staffed(treasury, debt);
+ var r = Step(c, s);
+ Assert.Equal(paid ? 1 : 0, Charges(r).Count());
+ Assert.Equal(paid ? 1 : 0, r.State.Workshops[id].Progress);
+ var waits = r.Why.Where(w => w.Key == CauseKeys.WorkshopPaused).ToList();
+ if (paid) { Assert.Empty(waits); return; }
+ var line = Assert.Single(waits);
+ Assert.Equal((Workshops.DebtCeiling, "Town A: an arms workshop's next cycle waits: paying for it would take the debt past its ceiling"),
+ (line.Args.Single(), line.Message));
+ Assert.Null(r.State.Workshops[id].PaidCost);
+ Assert.DoesNotContain(r.Why, w => w.Key == CauseKeys.Borrowed && w.Args[0] == CauseKeys.Purpose.Workshop);
+ }
+
+ // R-ARMS-006 (27M-13): a cycle keeps the price it was paid at when the worker changes; only the next cycle is priced at
+ // the new worker's tier, and nothing is refunded or charged twice.
+ [Fact]
+ public void AWorkerChangeKeepsThePaidCycleAndPricesTheNext()
+ {
+ var (c, s, id) = Staffed(tier: SyntheticWorkshopTier.Ordinary, paid: 3m, progress: 1); // paid at the expert's IL 3m
+ var (after, turns) = Run(c, s, 3);
+ Assert.Equal(new[] { 0, 0, 1 }, turns.Select(t => Charges(t).Count()));
+ Assert.Equal(1, turns[1].Why.Count(w => w.Key == CauseKeys.WorkshopArms));
+ Assert.Equal(-5.0, Charges(turns[2]).Single().Delta, 12); // the next cycle: the ordinary worker's IL 5m
+ Assert.Equal((5m, 1), (after.Workshops[id].PaidCost, after.Workshops[id].Progress));
+ }
+
+ // R-ARMS-006, R-ARMS-007: an unstaffed workshop is paused, not cancelled: it keeps its paid cost and progress, is not
+ // charged again, and resumes where it stopped.
+ [Fact]
+ public void AnUnstaffedWorkshopPausesAndResumes()
+ {
+ var (c, s, id) = Built(civilians: 10, employed: 0, jobs: 0);
+ s.Treasury = 100;
+ var (after, turns) = Run(c, s, 5, t => t == 0 ? new Command[] { Staff(1) } : t == 1 ? new Command[] { Staff(0) } : t == 3 ? new Command[] { Staff(1) } : Array.Empty<Command>());
+ Assert.Equal(new[] { 1, 0, 0, 0, 0 }, turns.Select(t => Charges(t).Count()));
+ Assert.Equal(new[] { 1, 1, 1, 2, 0 }, turns.Select(t => t.State.Workshops[id].Progress));
+ Assert.Equal(1, turns[4].Why.Count(w => w.Key == CauseKeys.WorkshopArms));
+ Assert.Null(after.Workshops[id].PaidCost);
+ }
+
+ // R-ARMS-006 with R-CITY-010 (D6: a held city "pauses"): a workshop in a city the enemy holds is not charged and makes no
+ // progress, and resumes once the city is retaken.
+ [Fact]
+ public void AHeldCityPausesItsWorkshop()
+ {
+ var (c, s, id) = Staffed(paid: 5m, progress: 1);
+ s.Units.Add(s.NextId, new Unit(s.NextId++, "enemy", 1, 0, side: "egypt", strength: 3));
+ var held = Step(c, s);
+ Assert.Equal((5m, 1), (held.State.Workshops[id].PaidCost, held.State.Workshops[id].Progress));
+ Assert.Empty(Charges(held));
+ var free = held.State.Clone(); free.Units.Clear();
+ Assert.Equal(2, Step(c, free).State.Workshops[id].Progress);
+ }
+
+ // R-ARMS-006: the workshop's worker is one of the city's people without a job; when an order has taken them all (a Train
+ // order counts only the idle civilians), the workshop pauses that month and says why.
+ [Fact]
+ public void AWorkshopWithNoOneFreeWaits()
+ {
+ var (c, s, id) = Staffed(paid: 5m, progress: 1);
+ var x = s.Cities["town_a"];
+ s.Cities["town_a"] = new City(x.Id, x.HousingCapacity, 10, 10, 10, 0, 0, x.Condition, jobsDefault: false);
+ var r = Step(c, s);
+ Assert.Equal((5m, 1), (r.State.Workshops[id].PaidCost, r.State.Workshops[id].Progress));
+ var line = Assert.Single(r.Why, w => w.Key == CauseKeys.WorkshopPaused);
+ Assert.Equal((Workshops.NoWorker, "Town A: an arms workshop has no worker without a job this month"), (line.Args.Single(), line.Message));
+ }
+
+ // R-ARMS-006: the cycle runs under gdd-0.3 only. A gdd-0.1 state that somehow holds a staffed workshop one month from its
+ // Arms (gdd-0.1 can neither build nor staff one, R-ARMS-004/005) makes no Arms, pays nothing and gives no workshop cause,
+ // so the turn report's workshop row (TurnReportPresenter.WorkshopRow, #1701 A1) never shows outside gdd-0.3.
+ [Fact]
+ public void Gdd01RunsNoWorkshopCycle()
+ {
+ var c = Load(false);
+ var s = Simulation.NewGame(c, 1, Mode.Historical);
+ var id = s.NextId++;
+ s.CityProjects.Add(id, new CityProject(id, "industry", "town_a", 1, 1, 0, s.Date));
+ s.Workshops.Add(id, new Workshop(id, true, SyntheticWorkshopTier.Ordinary, 5m, 2));
+ var (after, turns) = Run(c, s, 3);
+ Assert.DoesNotContain(turns.SelectMany(t => t.Why), w => w.Key == CauseKeys.WorkshopArms || w.Key == CauseKeys.WorkshopPaused);
+ Assert.Empty(turns.SelectMany(Charges));
+ Assert.Equal(Run(c, Clear(s), 3).S.Arms, after.Arms);
+ Assert.Equal((5m, 2), (after.Workshops[id].PaidCost, after.Workshops[id].Progress));
+ }
+
+ // R-ARMS-006, R-SAVE: a game saved in the middle of a cycle replays to the same state: no charge or Arms is repeated.
+ [Fact]
+ public void AReplayedGameRepeatsNoChargeOrArms()
+ {
+ var c = Load(true);
+ var orders = new Dictionary<int, Command[]>
+ {
+ [0] = new Command[] { new StartProject(Workshops.ArmsWorkshop, "town_a", 1, 1) },
+ [3] = new Command[] { Staff(1) },
+ };
+ var whole = GameSession.New(c, 7, Mode.Historical);
+ for (int t = 0; t < 8; t++) whole.Step(orders.TryGetValue(t, out var o) ? o : Array.Empty<Command>());
+ var half = GameSession.New(c, 7, Mode.Historical);
+ for (int t = 0; t < 5; t++) half.Step(orders.TryGetValue(t, out var o) ? o : Array.Empty<Command>());
+ var loaded = GameSession.Load(c, half.Save.Write(), out _);
+ Assert.Equal(half.State.Hash(), loaded.State.Hash());
+ for (int t = 5; t < 8; t++) loaded.Step(Array.Empty<Command>());
+ Assert.Equal(whole.State.Hash(), loaded.State.Hash());
+ Assert.Contains(":on,Ordinary/5,2", half.State.Describe()); // saved two turns into its first cycle
+ Assert.Contains(":on,Ordinary/5,2", whole.State.Describe()); // two turns into the second: the first made its Arms
+ }
+
+ // ---- R-ARMS-007: 27M-14 and Q55 (slice D) ----
+
+ // R-ARMS-007 (Q55, owner-approved 1 November 2026: "No. Only the stated apprentice-to-expert progression counts"):
+ // months of workshop work change no profession, craftsman count or qualification.
+ [Fact]
+ public void WorkshopWorkChangesNoQualification()
+ {
+ var (c, s, _) = Staffed();
+ var (worked, turns) = Run(c, s, 6);
+ var (idle, _) = Run(c, Clear(s), 6);
+ Assert.Equal(2, turns.Sum(t => t.Why.Count(w => w.Key == CauseKeys.WorkshopArms)));
+ var a = worked.Cities["town_a"]; var b = idle.Cities["town_a"];
+ Assert.Equal((b.Civilians, b.Craftsmen, b.Employed, b.Qualified), (a.Civilians, a.Craftsmen, a.Employed, a.Qualified));
+ }
+
+ // R-ARMS-007 (27M-14: "Cycle progress is lost and the Money paid is not refunded."; #1701 OQ5, owner 2 November 2026:
+ // "Accept all four (Recommended)": the MVP has no destructive cancellation, destruction or transfer of a workshop):
+ // a built workshop cannot be cancelled, so its paid cycle is never refunded or lost by an order.
+ [Fact]
+ public void ABuiltWorkshopCannotBeCancelledSoItsCycleStays()
+ {
+ var (c, s, id) = Staffed(paid: 5m, progress: 2);
+ var r = Step(c, s, new CancelProject(id));
+ Assert.Equal("An arms workshop is already built", Assert.Single(r.Rejected).Reason);
+ Assert.Contains(r.Why, w => w.Key == CauseKeys.WorkshopArms); // the cycle finished as usual
+ Assert.DoesNotContain(r.Why, w => w.Key == CauseKeys.Paid && w.Delta > 0);
+ }
+
+ // ---- Review fixes (2 November 2026) ----
+
+ // R-ARMS-004 (#1701 OQ2, owner 2 November 2026: "IL 15m, 3 turns (Recommended)"): the real row's cost and turns are
+ // the gdd-0.3 balance catalogue's arms_workshop.parts.cost and .work, so a catalogue change cannot drift from it silently.
+ [Fact]
+ public void TheRealRowMatchesTheCataloguesCostAndWork()
+ {
+ var line = File.ReadAllLines(Path.Combine(RealContentTests.ContentRoot(), "projects.yaml")).Single(l => l.Contains("id: arms_workshop"));
+ var c = Load(true, Fixture.GddProjects + line + "\n");
+ var k = c.ProjectKinds.Single(x => x.Id == Workshops.ArmsWorkshop);
+ var row = Gdd03ProjectCatalogue.Read(c).Projects.Single(p => p.Key == Workshops.ArmsWorkshop);
+ Assert.Equal((15m, 3m), (row.Cost.Amount, row.Work.Amount));
+ Assert.Equal((row.Cost.Amount, row.Work.Amount), ((decimal)k.Cost, (decimal)k.Turns));
+ }
+
+ // R-ARMS-006: two staffed workshops in one city with one person without a job: the lower project id works, the other
+ // waits with no_worker, whatever order the records were added in.
+ [Fact]
+ public void TwoWorkshopsAndOneFreePersonStaffTheLowerIdOnly()
+ {
+ var (c, s, first) = Built(civilians: 10, employed: 9, jobs: 9, jobsDefault: false);
+ var second = s.NextId++;
+ s.CityProjects.Add(second, new CityProject(second, Workshops.ArmsWorkshop, "town_a", 2, 0, 0, s.Date));
+ s.Workshops.Add(second, new Workshop(second, true, SyntheticWorkshopTier.Ordinary));
+ s.Workshops.Add(first, new Workshop(first, true, SyntheticWorkshopTier.Ordinary));
+ s.Treasury = 100;
+ var r = Step(c, s);
+ Assert.Single(Charges(r));
+ Assert.Equal((5m, 1), (r.State.Workshops[first].PaidCost, r.State.Workshops[first].Progress));
+ Assert.Equal(((decimal?)null, 0), (r.State.Workshops[second].PaidCost, r.State.Workshops[second].Progress));
+ Assert.Equal(Workshops.NoWorker, Assert.Single(r.Why, w => w.Key == CauseKeys.WorkshopPaused).Args.Single());
+ }
+
+ // R-TRAIN-001, R-QUAL-005 with R-ARMS-005: a staffed workshop's worker holds no job but is not idle, so neither Train
+ // nor a pioneer reassignment (which takes civilians out of the city) can take them.
+ [Fact]
+ public void TrainCannotTakeAStaffedWorkshopsWorker()
+ {
+ var (c, s, id) = Built(civilians: 3, employed: 2, jobs: 2, jobsDefault: false);
+ var x = s.Cities["town_a"];
+ s.Cities["town_a"] = x.WithQualified(new Qualified(0, 0, new[] { 0 }));
+ s.Workshops.Add(id, new Workshop(id, true, SyntheticWorkshopTier.Ordinary));
+ Assert.Equal(0, Training.Available(s, "town_a", Array.Empty<Command>()));
+ foreach (var order in new Command[] { new Train("town_a", "halutz", 1), new ReassignPioneers("town_a", "halutz", 1) })
+ {
+ var r = Step(c, s, order);
+ Assert.Equal("Town A has 0 civilians without work", Assert.Single(r.Rejected).Reason);
+ Assert.DoesNotContain(r.Why, w => w.Key == CauseKeys.WorkshopPaused);
+ }
+ }
+
+ // R-TRAIN-001: Training.Available reads only a "job" AssignWorkers as a jobs order; a pending "workshop" order takes
+ // its newly staffed workers off the idle civilians instead, so a Train up to the limit stays accepted in either order.
+ [Fact]
+ public void APendingStaffingOrderIsNotAJobsOrder()
+ {
+ var (c, s, _) = Built(civilians: 10, employed: 4, jobs: 10, jobsDefault: false);
+ var pending = new Command[] { Staff(1) };
+ Assert.Equal(5, Training.Available(s, "town_a", pending));
+ foreach (var order in new[] { new Command[] { Staff(1), new Train("town_a", "halutz", 5) }, new Command[] { new Train("town_a", "halutz", 5), Staff(1) } })
+ Assert.Empty(Step(c, s, order).Rejected);
+ Assert.Equal(6, Training.Available(s, "town_a", new Command[] { new AssignWorkers("town_a", "job", 4) }));
+ }
+
+ // R-ARMS-005 with R-CITY-009: while the city's job default is on, staffing takes its worker from the default's jobs and
+ // leaves the default on, so a city whose people are all in work can staff a workshop; the default then fills one job fewer.
+ [Fact]
+ public void StaffingTakesItsWorkerFromTheJobDefault()
+ {
+ var (c, s, id) = Built(civilians: 10, employed: 10, jobs: 10);
+ s.Treasury = 100;
+ var r = Step(c, s, Staff(1));
+ Assert.Empty(r.Rejected);
+ Assert.True(r.State.Workshops[id].Staffed);
+ var x = r.State.Cities["town_a"];
+ Assert.Equal((9, true), (x.Employed, x.JobsDefault));
+ var jobs = Assert.Single(r.Why, w => w.Key == CauseKeys.WorkersAssigned && w.Target == "town_a");
+ Assert.Equal((-1.0, "Town A: 9 groups in work"), (jobs.Delta, jobs.Message));
+ Assert.Single(Charges(r)); // the workshop works this month
+ Assert.DoesNotContain(r.Why, w => w.Key == CauseKeys.WorkshopPaused);
+ Assert.Equal(9, Step(c, r.State).State.Cities["town_a"].Employed);
+ }
+}
diff --git a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
index 17ed29e6f..f9c1515d5 100644
--- a/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
+++ b/sim/Statecraft.Sim.Tests/DesignValuesTests.cs
@@ -141,6 +141,13 @@ public partial class DesignValuesTests
("projects.yaml", "projects[winery].capacity"),
("projects.yaml", "projects[winery].condition"),
("projects.yaml", "projects[winery].job_slots"),
+ // The gdd-0.3 arms workshop (R-ARMS-004; #1701 OQ2, owner 2 November 2026: "IL 15m, 3 turns (Recommended)").
+ ("projects.yaml", "projects[arms_workshop].cost"),
+ ("projects.yaml", "projects[arms_workshop].turns"),
+ ("projects.yaml", "projects[arms_workshop].capacity"),
+ ("projects.yaml", "projects[arms_workshop].condition"),
+ ("projects.yaml", "projects[arms_workshop].job_slots"),
+ ("projects.yaml", "projects[arms_workshop].worker_slots"),
// Movement (Phase 5 PR 5, #744; Q-MOVE-1, Q-MOVE-3): agent-proposed under "Take all recommendations" (#375).
("rules.yaml", "attention_cost.move"),
("rules.yaml", "mvp.move_cost.coastal_plain"),
diff --git a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs
index a76ef5ccb..e1fc306c1 100644
--- a/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs
+++ b/sim/Statecraft.Sim.Tests/RemainingCauseKeysTests.cs
@@ -115,7 +115,7 @@ public class RemainingCauseKeysTests
sites++;
}
}
- Assert.Equal(107, sites); // 107 with R-MONEY-004's DollarsConverted (#813); 106 since #2212: EconomySystem.OtherMoney's line (105 since #2199: PayOrBorrow's Paid line)
+ Assert.Equal(112, sites); // 112 with the arms workshops' five (R-ARMS-005 with its job-default line, R-ARMS-006; #1701); 107 with R-MONEY-004's DollarsConverted (#813); 106 since #2212: EconomySystem.OtherMoney's line (105 since #2199: PayOrBorrow's Paid line)
}
[Fact]
diff --git a/sim/Statecraft.Sim/Cause.cs b/sim/Statecraft.Sim/Cause.cs
index a397994c9..c401a6ba3 100644
--- a/sim/Statecraft.Sim/Cause.cs
+++ b/sim/Statecraft.Sim/Cause.cs
@@ -130,6 +130,12 @@ namespace Statecraft.Sim
public const string ProjectCompleted = "project_completed";
/// <summary>Args: CauseKeys.Number(cost).</summary>
public const string ArmsBought = "arms_bought";
+ /// <summary>R-ARMS-005: a city's staffed arms workshops. Args: CauseKeys.Number(count).</summary>
+ public const string WorkshopWorkers = "workshop_workers";
+ /// <summary>R-ARMS-006: an arms workshop's cycle made 1 Arms. Args: none.</summary>
+ public const string WorkshopArms = "workshop_arms";
+ /// <summary>R-ARMS-006: a staffed arms workshop did not work this month. Args: Workshops.NoWorker or Workshops.DebtCeiling.</summary>
+ public const string WorkshopPaused = "workshop_paused";
/// <summary>Args: CauseKeys.Number(amount), the US$ millions converted.</summary>
public const string DollarsConverted = "dollars_converted";
/// <summary>Args: f.Id.</summary>
@@ -235,11 +241,13 @@ namespace Statecraft.Sim
public const string MapAction = "map_action";
/// <summary>Args: the event's id, its English title as shown, and "1" when its title_he names it (no variant title).</summary>
public const string Event = "event";
+ /// <summary>An arms workshop's cycle (R-ARMS-006). Args: none.</summary>
+ public const string Workshop = "workshop";
public static readonly IReadOnlyList<string> All = new[]
{
Deficit, CivilianUpkeep, MilitaryUpkeep, Corridor, Arms, Training, Prisoners, TrainingCamp, Plow, Drain, Yishuv,
- Deport, Occupation, Project, MapAction, Event,
+ Deport, Occupation, Project, MapAction, Event, Workshop,
};
}
@@ -250,7 +258,7 @@ namespace Statecraft.Sim
EventNew, EventChosen, EventDelegated, EventDelegatedPartial, EventAmount, EventStock, EventGrant, EventCity,
EventUnlock, EventPolicy, EventSetRung, EventRejoin, MilitaryUpkeep,
ObjectiveCompleted, PrisonersReturned, SoldiersReturned,
- WorkersAssigned, WagesPaid, ImmigrantsHoused, HousingShortage, ImmigrantsWaiting, RecruitsVeteran, CorridorStarted, CorridorCancelled, CorridorCompleted, PioneersVeteran, MapBorrowed, MapBuilt, LandWorkStarted, SiteStarted, SiteCancelled, SiteCompleted, ProjectStarted, ProjectCancelled, ProjectCompleted, ArmsBought, DollarsConverted, FoodHarvest, FoodShortage, FoodWithoutImports, PrisonerFood, PrisonerFoodShortage, CraftsmenReturned, CraftsmenReassigned, PioneerReturned, PioneersReassigned, TrainingStarted, TrainingArms, TrainingCancelled, TrainingArmsReturned, ReplacementsStopped, ReplacementsJoined, MilitaryTrained, PioneersTrained, CraftsmenTrained, Appointed, Reshuffle, AppointmentsEnded, ApprovalStability, CoalitionCollapsed, LegislatureConvened, GovernmentTookOffice, CoalitionChanged, EraEnded, AdvisoryPolicyRejected, PolicyRejected, PolicySet, AdvisoryBudgetRejected, BudgetRejected, PlaceCaptured, EnemyRegained, PlaceAnnexed, PlaceWithdrawn, PlaceDeported, DeportEffect, DeportCost, OccupationStarted, PendingBecameRaid, OccupationLostUnit, OccupationCountdown, DepopulationSupport,
+ WorkersAssigned, WagesPaid, ImmigrantsHoused, HousingShortage, ImmigrantsWaiting, RecruitsVeteran, CorridorStarted, CorridorCancelled, CorridorCompleted, PioneersVeteran, MapBorrowed, MapBuilt, LandWorkStarted, SiteStarted, SiteCancelled, SiteCompleted, ProjectStarted, ProjectCancelled, ProjectCompleted, ArmsBought, WorkshopWorkers, WorkshopArms, WorkshopPaused, DollarsConverted, FoodHarvest, FoodShortage, FoodWithoutImports, PrisonerFood, PrisonerFoodShortage, CraftsmenReturned, CraftsmenReassigned, PioneerReturned, PioneersReassigned, TrainingStarted, TrainingArms, TrainingCancelled, TrainingArmsReturned, ReplacementsStopped, ReplacementsJoined, MilitaryTrained, PioneersTrained, CraftsmenTrained, Appointed, Reshuffle, AppointmentsEnded, ApprovalStability, CoalitionCollapsed, LegislatureConvened, GovernmentTookOffice, CoalitionChanged, EraEnded, AdvisoryPolicyRejected, PolicyRejected, PolicySet, AdvisoryBudgetRejected, BudgetRejected, PlaceCaptured, EnemyRegained, PlaceAnnexed, PlaceWithdrawn, PlaceDeported, DeportEffect, DeportCost, OccupationStarted, PendingBecameRaid, OccupationLostUnit, OccupationCountdown, DepopulationSupport,
};
/// <summary>A number as an Arg: invariant and round-trip, so the UI rounds exactly the value Message rounded.</summary>
diff --git a/sim/Statecraft.Sim/Cities.cs b/sim/Statecraft.Sim/Cities.cs
index 225248180..1c6aa17d6 100644
--- a/sim/Statecraft.Sim/Cities.cs
+++ b/sim/Statecraft.Sim/Cities.cs
@@ -14,6 +14,11 @@ namespace Statecraft.Sim
/// civilians and craftsmen (a craftsman fills an ordinary job slot, R-CRAFT-002). R-CITY-009's default fills to it.</summary>
public static int MaxWorkers(City city) => Math.Min(city.JobSlots, city.Civilians + city.Craftsmen);
+ /// <summary>R-CITY-001 with R-ARMS-005: <see cref="MaxWorkers(City)"/> less the city's staffed arms workshops, whose
+ /// workers hold no job. The same number where no workshop is staffed (always, outside gdd-0.3).</summary>
+ public static int MaxWorkers(GameState s, City city) =>
+ Math.Max(0, Math.Min(city.JobSlots, city.Civilians + city.Craftsmen - Workshops.Staffed(s, city.Id)));
+
/// <summary>R-CITY-001 with R-TRAIN-001: <see cref="MaxWorkers(City)"/> once the city's Train, Reinforce and Reassign
/// orders in <paramref name="pending"/> (this turn's queue) have taken their civilians, so a count up to it keeps every one
/// of them accepted, whatever order they run in. Every queued reassignment counts in full, craftsmen too (#1548): if the
@@ -21,7 +26,7 @@ namespace Statecraft.Sim
public static int MaxWorkers(GameState s, string city, IEnumerable<Command> pending)
{
var x = s.Cities[city];
- return Math.Max(0, Math.Min(x.JobSlots, x.Civilians + x.Craftsmen - Training.Ordered(city, pending)));
+ return Math.Max(0, Math.Min(x.JobSlots, x.Civilians + x.Craftsmen - Workshops.Staffed(s, city) - Training.Ordered(city, pending)));
}
/// <summary>R-CITY-007: a city's start people in units: the nearest unit (a half rounds up), and at least 1 for a city
@@ -65,13 +70,15 @@ namespace Statecraft.Sim
{
PopulationLedger.RefuseAggregate(s);
if (!s.Cities.TryGetValue(city, out var x)) return "There is no such city";
+ // R-ARMS-005: under gdd-0.3 the "workshop" role staffs the city's arms workshops.
+ if (role == Workshops.Role && c.Ruleset == SaveGame.Gdd03Ruleset) return Workshops.Staff(c, s, city, count, why);
// Craftsmen fill ordinary job slots (Q-CRAFT-2, R-CRAFT-002), so "job" stays the only role.
if (role != "job") return "There is no such role";
if (count < 0) return "The number of workers cannot be negative";
- if (count > MaxWorkers(x))
+ if (count > MaxWorkers(s, x))
return count > x.JobSlots
? FormattableString.Invariant($"{PlayerText.Settlement(c, city)} has {x.JobSlots} jobs")
- : FormattableString.Invariant($"{PlayerText.Settlement(c, city)} has {x.Civilians + x.Craftsmen} civilians and craftsmen");
+ : FormattableString.Invariant($"{PlayerText.Settlement(c, city)} has {x.Civilians + x.Craftsmen - Workshops.Staffed(s, city)} civilians and craftsmen");
s.Cities[city] = x.WithCounts(x.Civilians, count, x.Refugees).WithJobsDefault(false);
why.Add(new Cause("city", city, count - x.Employed, FormattableString.Invariant($"{PlayerText.Settlement(c, city)}: {count} groups in work"), key: CauseKeys.WorkersAssigned, args: new[] { CauseKeys.Number(count) }));
return null;
@@ -154,7 +161,7 @@ namespace Statecraft.Sim
var housed = absorbed == 0 ? x : x.WithCounts(x.Civilians + absorbed, x.Employed, x.Refugees - absorbed);
if (absorbed != 0)
why.Add(new Cause("city", x.Id, absorbed, FormattableString.Invariant($"{PlayerText.Settlement(c, x.Id)}: {absorbed} groups of immigrants housed"), key: CauseKeys.ImmigrantsHoused, args: new[] { CauseKeys.Number(absorbed) }));
- var work = MaxWorkers(housed);
+ var work = MaxWorkers(s, housed);
if (housed.JobsDefault && work != housed.Employed)
{
why.Add(new Cause("city", x.Id, work - housed.Employed, FormattableString.Invariant($"{PlayerText.Settlement(c, x.Id)}: {work} groups in work"), key: CauseKeys.WorkersAssigned, args: new[] { CauseKeys.Number(work) }));
diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.cs
index 4a014da53..e39a0282a 100644
--- a/sim/Statecraft.Sim/Content.cs
+++ b/sim/Statecraft.Sim/Content.cs
@@ -739,6 +739,13 @@ namespace Statecraft.Sim
public string Requires { get; set; } = "";
/// <summary>Whether StartProject refuses this kind until an event option unlocks it (R-EFX-008). Default false.</summary>
public bool Locked { get; set; }
+ /// <summary>R-ARMS-004: the workshop worker slots the kind gives when built, 0 or 1 (an arms workshop's one worker,
+ /// gdd03-balance.yaml `arms_workshop.parts.worker_slots`). Default 0.</summary>
+ public int WorkerSlots { get; set; }
+ /// <summary>R-ARMS-004: the rulesets (eras.yaml `systems.ruleset`) whose games have the kind; empty for every GDD
+ /// ruleset. The loader leaves a kind out of the other rulesets' <see cref="Content.ProjectKinds"/>.</summary>
+ public List<string> Rulesets { get => rulesets; set => rulesets = value ?? new List<string>(); }
+ List<string> rulesets = new List<string>();
}
/// <summary>A designated site (sites.yaml; docs/GDD.md "Pioneer work": building is allowed only at designated spots, and a
@@ -1404,8 +1411,12 @@ namespace Statecraft.Sim
public List<StartingForce> StartingForces = new List<StartingForce>();
/// <summary>The GDD designated sites (sites.yaml), in file order. Empty in the legacy loop.</summary>
public List<Site> Sites = new List<Site>();
- /// <summary>The GDD city project kinds (projects.yaml), in file order. Empty in the legacy loop.</summary>
+ /// <summary>The GDD city project kinds (projects.yaml) this game's ruleset has (R-ARMS-004: a row's `rulesets`), in file
+ /// order. Empty in the legacy loop.</summary>
public List<ProjectKind> ProjectKinds = new List<ProjectKind>();
+ /// <summary>R-ARMS-004: the projects.yaml rows limited to other rulesets, in file order. Read and validated with the
+ /// rest, never startable or shown; kept so the Hebrew overlay (#1618) still names every row of the file.</summary>
+ public List<ProjectKind> ProjectKindsOfOtherRulesets = new List<ProjectKind>();
/// <summary>The corridors (corridors.yaml), in file order; empty in the legacy loop.</summary>
public List<CorridorDef> Corridors = new List<CorridorDef>();
/// <summary>The objectives (objectives.yaml), ordered by id. Read in both loops, since their cards are events; only the
diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.cs
index 4e8dfe945..bc21bfb71 100644
--- a/sim/Statecraft.Sim/ContentLoader.cs
+++ b/sim/Statecraft.Sim/ContentLoader.cs
@@ -431,7 +431,10 @@ namespace Statecraft.Sim
c.Cities = Read<CitiesFile>(readFile, "cities.yaml").Cities;
c.UnitTypes = Read<UnitTypesFile>(readFile, "unit_types.yaml").Types;
c.Sites = Read<SitesFile>(readFile, "sites.yaml").Sites; // sourced facts (Phase 1 PR 5)
- c.ProjectKinds = Read<ProjectsFile>(readFile, "projects.yaml").Projects; // design values (Phase 3 PR 4)
+ // Design values (Phase 3 PR 4). R-ARMS-004: a row limited to other rulesets is not this game's kind.
+ var kinds = Read<ProjectsFile>(readFile, "projects.yaml").Projects;
+ c.ProjectKinds = kinds.Where(k => k.Rulesets.Count == 0 || k.Rulesets.Contains(c.Ruleset)).ToList();
+ c.ProjectKindsOfOtherRulesets = kinds.Except(c.ProjectKinds).ToList();
c.Corridors = Read<CorridorsFile>(readFile, "corridors.yaml").Corridors; // sourced, hexes derived (Phase 4 PR 2)
ValidateGdd(c, settlementIds);
Gdd03Military.Validate(c); // after effective map overrides and role validation, only exact gdd-0.3
@@ -1544,8 +1547,9 @@ namespace Statecraft.Sim
static void ValidateProjects(Content c)
{
const string pf = "projects.yaml";
- Unique(pf, "projects", c.ProjectKinds.Select(x => x.Id));
- foreach (var x in c.ProjectKinds)
+ var all = c.ProjectKinds.Concat(c.ProjectKindsOfOtherRulesets).ToList(); // every row, whatever the ruleset
+ Unique(pf, "projects", all.Select(x => x.Id));
+ foreach (var x in all)
{
var at = $"projects[{x.Id}]";
if (string.IsNullOrWhiteSpace(x.Name)) throw new ContentException(pf, at + ".name", "is required");
@@ -1561,6 +1565,32 @@ namespace Statecraft.Sim
// R-PROJ-005: a kind whose resource no city has could never be built.
if (!string.IsNullOrEmpty(x.Requires) && !c.Cities.Any(k => k.Resources.Any(r => r.Id == x.Requires)))
throw new ContentException(pf, at + ".requires", $"no city in cities.yaml has the resource '{x.Requires}'");
+ ValidateWorkshopKind(c, x, pf, at);
+ }
+ }
+
+ /// <summary>R-ARMS-004: a kind's `rulesets` names GDD rulesets only, and `worker_slots` is 0 or 1. A kind with a worker
+ /// slot is an arms workshop: it adds no housing, condition or job slots (its worker holds no job), exists under
+ /// gdd-0.3 only, and under gdd-0.3 the arms_workshop row has the balance catalogue's worker slots.</summary>
+ static void ValidateWorkshopKind(Content c, ProjectKind x, string pf, string at)
+ {
+ foreach (var r in x.Rulesets)
+ if (r != SaveGame.GddRuleset && r != SaveGame.Gdd03Ruleset)
+ throw new ContentException(pf, at + ".rulesets", $"unknown ruleset '{r}' ({SaveGame.GddRuleset} or {SaveGame.Gdd03Ruleset})");
+ if (x.WorkerSlots < 0 || x.WorkerSlots > 1) throw new ContentException(pf, at + ".worker_slots", "must be 0 or 1");
+ if (x.WorkerSlots > 0)
+ {
+ if (x.JobSlots != 0) throw new ContentException(pf, at + ".job_slots", "must be 0 with worker_slots: a workshop worker holds no job");
+ if (x.Capacity != 0) throw new ContentException(pf, at + ".capacity", "must be 0 with worker_slots");
+ if (x.Condition != 0) throw new ContentException(pf, at + ".condition", "must be 0 with worker_slots");
+ if (!(x.Rulesets.Count == 1 && x.Rulesets[0] == SaveGame.Gdd03Ruleset))
+ throw new ContentException(pf, at + ".rulesets", $"a kind with worker_slots exists under {SaveGame.Gdd03Ruleset} only: rulesets: [{SaveGame.Gdd03Ruleset}]");
+ }
+ if (c.Ruleset == SaveGame.Gdd03Ruleset && x.Id == Workshops.ArmsWorkshop)
+ {
+ var slots = Gdd03ProjectCatalogue.Read(c).Projects.Single(p => p.Key == Workshops.ArmsWorkshop).Capacity!.Amount;
+ if (x.WorkerSlots != slots)
+ throw new ContentException(pf, at + ".worker_slots", FormattableString.Invariant($"must be {slots}, the gdd-0.3 balance catalogue's arms_workshop worker slots"));
}
}
diff --git a/sim/Statecraft.Sim/GameState.cs b/sim/Statecraft.Sim/GameState.cs
index 0d8f57a18..ea93ed84c 100644
--- a/sim/Statecraft.Sim/GameState.cs
+++ b/sim/Statecraft.Sim/GameState.cs
@@ -94,6 +94,9 @@ namespace Statecraft.Sim
public SortedDictionary<string, SiteWork> Sites = new SortedDictionary<string, SiteWork>(StringComparer.Ordinal);
/// <summary>The city projects being built or built, by id (R-PROJ-001). A cancelled project leaves.</summary>
public SortedList<int, CityProject> CityProjects = new SortedList<int, CityProject>();
+ /// <summary>R-ARMS-005, R-ARMS-006 (gdd-0.3 only): the built arms workshops ever staffed, by their city project's id. A
+ /// workshop never staffed has no record; one unstaffed keeps its record, its paid cost and its progress.</summary>
+ public SortedList<int, Workshop> Workshops = new SortedList<int, Workshop>();
/// <summary>The corridors with a segment being built or built, by corridor id (ordinal; R-COR-001). A corridor with no
/// started segment has no record.</summary>
public SortedDictionary<string, CorridorWork> Corridors = new SortedDictionary<string, CorridorWork>(StringComparer.Ordinal);
@@ -162,6 +165,7 @@ namespace Statecraft.Sim
c.Cohorts = new SortedList<int, Cohort>(Cohorts);
c.Sites = new SortedDictionary<string, SiteWork>(Sites, StringComparer.Ordinal);
c.CityProjects = new SortedList<int, CityProject>(CityProjects);
+ c.Workshops = new SortedList<int, Workshop>(Workshops);
c.Corridors = new SortedDictionary<string, CorridorWork>(Corridors, StringComparer.Ordinal);
c.UnlockedProjects = new SortedSet<string>(UnlockedProjects, StringComparer.Ordinal);
c.Objectives = new SortedDictionary<string, DateTime>(Objectives, StringComparer.Ordinal);
@@ -257,6 +261,7 @@ namespace Statecraft.Sim
if (Cohorts.Count > 0) Section("train", '[', ']', Cohorts.Values.Select(x => x.Canonical()));
if (Sites.Count > 0) Section("site", '{', '}', Sites.Values.Select(x => x.Canonical()));
if (CityProjects.Count > 0) Section("cproj", '[', ']', CityProjects.Values.Select(x => x.Canonical()));
+ if (Workshops.Count > 0) Section("wshop", '[', ']', Workshops.Values.Select(x => x.Canonical())); // R-ARMS-005, gdd-0.3 only
if (Corridors.Count > 0) Section("corr", '{', '}', Corridors.Values.Select(x => x.Canonical()));
if (UnlockedProjects.Count > 0) Section("unlocked", '[', ']', UnlockedProjects);
if (NextId != 0) { Sep(); Nl(); sb.Append("next=").Append(NextId.ToString(CultureInfo.InvariantCulture)); }
diff --git a/sim/Statecraft.Sim/GddState.cs b/sim/Statecraft.Sim/GddState.cs
index 19cf438b7..1dd916abb 100644
--- a/sim/Statecraft.Sim/GddState.cs
+++ b/sim/Statecraft.Sim/GddState.cs
@@ -334,6 +334,36 @@ namespace Statecraft.Sim
: TurnsLeft.ToString(CultureInfo.InvariantCulture) + (Progress == 0 ? "" : "," + BitConverter.DoubleToInt64Bits(Progress).ToString("X16", CultureInfo.InvariantCulture)));
}
+ /// <summary>R-ARMS-005, R-ARMS-006 (gdd-0.3 only): the cycle of the built arms workshop that is city project
+ /// <see cref="Project"/>. <see cref="Staffed"/>: whether one of its city's people without a job works it, priced at
+ /// <see cref="WorkerTier"/> (always Ordinary on the aggregate cities until the population ledger's tiers are live; #1701
+ /// OQ6). <see cref="PaidCost"/>: the Money paid for the cycle under way, null when none is; <see cref="Progress"/>: its
+ /// staffed months so far. Immutable; a change replaces the record.</summary>
+ public sealed class Workshop
+ {
+ public int Project { get; }
+ public bool Staffed { get; }
+ public SyntheticWorkshopTier WorkerTier { get; }
+ public decimal? PaidCost { get; }
+ public int Progress { get; }
+
+ public Workshop(int project, bool staffed, SyntheticWorkshopTier workerTier, decimal? paidCost = null, int progress = 0)
+ {
+ Project = project; Staffed = staffed; WorkerTier = workerTier; PaidCost = paidCost; Progress = progress;
+ }
+
+ /// <summary>The same workshop, staffed or not; its cycle is kept (a pause, not a loss: R-ARMS-007).</summary>
+ public Workshop WithStaffed(bool staffed) => new Workshop(Project, staffed, WorkerTier, PaidCost, Progress);
+
+ /// <summary>The same workshop with a cycle paid at <paramref name="cost"/> and <paramref name="progress"/> months done.</summary>
+ public Workshop WithCycle(decimal? cost, int progress) => new Workshop(Project, Staffed, WorkerTier, cost, progress);
+
+ /// <summary>The record as the state hash writes it: "PROJECT:on|off,TIER" and, while a cycle is under way,
+ /// "/COST,PROGRESS" (the cost as invariant decimal text).</summary>
+ public string Canonical() => string.Format(CultureInfo.InvariantCulture, "{0}:{1},{2}", Project, Staffed ? "on" : "off", WorkerTier)
+ + (PaidCost is decimal cost ? string.Format(CultureInfo.InvariantCulture, "/{0},{1}", cost, Progress) : "");
+ }
+
/// <summary>Work on one corridor segment (R-COR-001 to R-COR-003): <see cref="Unit"/> building it with
/// <see cref="Progress"/> turns of work done, or, once <see cref="BuiltOn"/> is set, built on that date. Immutable.</summary>
public sealed class SegmentWork
diff --git a/sim/Statecraft.Sim/HebrewOverlay.cs b/sim/Statecraft.Sim/HebrewOverlay.cs
index 025670d24..3b6544006 100644
--- a/sim/Statecraft.Sim/HebrewOverlay.cs
+++ b/sim/Statecraft.Sim/HebrewOverlay.cs
@@ -38,7 +38,7 @@ namespace Statecraft.Sim
Bind("legislatures.yaml", "legislatures", "body", c => c.Legislatures, nameof(Legislature.BodyHe), nameof(Legislature.BodyHeReview)),
Bind("governments.yaml", "governments", "name", c => c.Governments, nameof(Government.NameHe), nameof(Government.NameHeReview)),
Bind("map/locations_1948.yaml", "locations", "name", c => c.MapLocations, nameof(MapLocation.NameHe), nameof(MapLocation.NameHeReview)),
- Bind("projects.yaml", "projects", "name", c => c.ProjectKinds, nameof(ProjectKind.NameHe), nameof(ProjectKind.NameHeReview)),
+ Bind("projects.yaml", "projects", "name", c => c.ProjectKinds.Concat(c.ProjectKindsOfOtherRulesets), nameof(ProjectKind.NameHe), nameof(ProjectKind.NameHeReview)),
Bind("sites.yaml", "sites", "name", c => c.Sites, nameof(Site.NameHe), null),
Bind("corridors.yaml", "corridors", "name", c => c.Corridors, nameof(CorridorDef.NameHe), null),
Bind("objectives.yaml", "objectives", "name", c => c.Objectives, nameof(Objective.NameHe), nameof(Objective.NameHeReview)),
diff --git a/sim/Statecraft.Sim/Qualification.cs b/sim/Statecraft.Sim/Qualification.cs
index 9facbb4d0..b407bcc4d 100644
--- a/sim/Statecraft.Sim/Qualification.cs
+++ b/sim/Statecraft.Sim/Qualification.cs
@@ -142,7 +142,7 @@ namespace Statecraft.Sim
var name = PlayerText.Settlement(c, city);
var have = veteran ? x.Qualified.Veterans : x.Qualified.Halutzim.Count;
if (count > have) return FormattableString.Invariant($"{name} has {have} qualified {(veteran ? "veteran pioneers" : "halutzim")}");
- var idle = Training.Idle(x);
+ var idle = Training.Idle(s, x); // R-ARMS-005: a staffed workshop's worker is not idle
if (count > idle) return FormattableString.Invariant($"{name} has {idle} civilians without work");
var hex = c.SettlementHexes.First(h => h.Id == city); // every settlement has one (ValidateMap)
var q = x.Qualified;
diff --git a/sim/Statecraft.Sim/SyntheticWorkshopCycle.cs b/sim/Statecraft.Sim/SyntheticWorkshopCycle.cs
index bd7eced29..8055577ae 100644
--- a/sim/Statecraft.Sim/SyntheticWorkshopCycle.cs
+++ b/sim/Statecraft.Sim/SyntheticWorkshopCycle.cs
@@ -6,7 +6,8 @@ namespace Statecraft.Sim
// Pricing categories only, NOT an eligibility matrix or a profession/qualification mutation.
public enum SyntheticWorkshopTier { Ordinary, Novice, Apprentice, Expert }
- /// <summary>Explicit opt-in synthetic rules snapshot; no loader registration or game-loop caller.</summary>
+ /// <summary>The workshop rules snapshot from the gdd-0.3 catalogue: staffed turns per Arms and the price per worker tier.
+ /// Workshops.Produce reads it for the live cycle (R-ARMS-006); SyntheticWorkshopCycle below stays test-only.</summary>
public sealed class SyntheticWorkshopRules
{
public int StaffedTurns { get; }
diff --git a/sim/Statecraft.Sim/Training.cs b/sim/Statecraft.Sim/Training.cs
index a2fc301e7..952a9c376 100644
--- a/sim/Statecraft.Sim/Training.cs
+++ b/sim/Statecraft.Sim/Training.cs
@@ -74,6 +74,15 @@ namespace Statecraft.Sim
/// city's jobs first (R-CRAFT-002), so only the employed beyond its craftsmen are civilians in work.</summary>
public static int Idle(City city) => city.Civilians - Math.Max(0, city.Employed - city.Craftsmen);
+ /// <summary>R-TRAIN-001 with R-ARMS-005: <see cref="Idle(City)"/>, less the city's staffed arms workshops' workers, who
+ /// hold no job but are not idle (each one is a craftsman without a job first, then a civilian), as
+ /// <see cref="Cities.MaxWorkers(GameState, City)"/> takes them off the jobs. The same number where no workshop is
+ /// staffed (always, outside gdd-0.3).</summary>
+ public static int Idle(GameState s, City city) => Idle(city, city.Employed, Workshops.Staffed(s, city.Id));
+
+ static int Idle(City city, int employed, int staffed) =>
+ Math.Max(0, Math.Min(city.Civilians - Math.Max(0, employed - city.Craftsmen), city.Civilians + city.Craftsmen - employed - staffed));
+
/// <summary>The groups the Train, Reinforce, ReassignCraftsmen and ReassignPioneers orders in <paramref name="pending"/>
/// (this turn's queue) take from <paramref name="city"/>'s idle civilians, every track together (#1548; owner, 24 October
/// 2026: "Yes, count them").</summary>
@@ -83,15 +92,16 @@ namespace Statecraft.Sim
/// <summary>R-TRAIN-001 with R-CITY-001: the groups still free to train in <paramref name="city"/> once the orders in
/// <paramref name="pending"/> (this turn's queue) have run: <see cref="Idle"/>, less every track's Train order there
- /// and every queued reassignment (R-QUAL-004, R-QUAL-005), and less a pending AssignWorkers' rise in jobs. A count up to
+ /// and every queued reassignment (R-QUAL-004, R-QUAL-005), less a pending "job" AssignWorkers' rise in jobs, and less
+ /// a pending "workshop" AssignWorkers' rise in staffed arms workshops (R-ARMS-005). A count up to
/// it keeps every one of those orders accepted, whatever order they run in. A pending CancelTraining is not counted, since it may run after the Train.</summary>
public static int Available(GameState s, string city, IEnumerable<Command> pending)
{
var x = s.Cities[city];
var list = pending as IReadOnlyCollection<Command> ?? pending.ToList();
- var employed = Math.Max(x.Employed, list.OfType<AssignWorkers>().Where(w => w.City == city).Select(w => w.Count).DefaultIfEmpty(0).Max());
- var ordinaryEmployed = Math.Max(0, employed - x.Craftsmen);
- return Math.Max(0, x.Civilians - ordinaryEmployed - Ordered(city, list));
+ int Pending(string role, int now) =>
+ Math.Max(now, list.OfType<AssignWorkers>().Where(w => w.City == city && w.Role == role).Select(w => w.Count).DefaultIfEmpty(0).Max());
+ return Math.Max(0, Idle(x, Pending("job", x.Employed), Pending(Workshops.Role, Workshops.Staffed(s, city))) - Ordered(city, list));
}
/// <summary>R-TRAIN-001: <paramref name="count"/> of the city's civilians without work start training as
@@ -141,7 +151,7 @@ namespace Statecraft.Sim
if (count < 1) return RefusedCount;
var name = PlayerText.Settlement(c, city);
if (!HasFacility(c, s, city, type.Facility)) return Refused(type.Facility == "military_camp" ? RefusedNoCamp : type.Facility == Industry ? RefusedNoIndustry : RefusedNoHakhshara, name);
- var idle = Idle(x);
+ var idle = Idle(s, x);
if (count > idle) return Refused(RefusedIdle, name, idle);
// R-ARMS-003 (D-G6, Q-UNIT-3): a recruit group takes arms_per_recruit_group Arms when its training starts, a gun or
// armoured car crew its type's training_arms (R-UNIT-008, Q-ARTY-3); a short stock refuses the order. Pioneer
diff --git a/sim/Statecraft.Sim/TurnResolver.cs b/sim/Statecraft.Sim/TurnResolver.cs
index fba67e569..06f027e62 100644
--- a/sim/Statecraft.Sim/TurnResolver.cs
+++ b/sim/Statecraft.Sim/TurnResolver.cs
@@ -25,6 +25,7 @@ namespace Statecraft.Sim
Projects.Advance(c, s, next, why); // 5. construction
Projects.AdvanceCity(c, s, next, why); // and the city projects (R-PROJ-003)
Cities.Produce(c, s, r, yearFraction, why); // 6. production
+ Workshops.Produce(c, s, why); // and the arms workshops' cycles, gdd-0.3 only (R-ARMS-006)
Pools.Harvest(c, s, r, why); // and the plowed fields' Food (R-FIELD-002)
Pools.Consume(c, s, r, why); // 7. consumption: the nation eats, then imports (R-FOOD-002)
Prisoners.Upkeep(c, s, r, why); // then the prisoners eat, and the soldiers held are paid for (R-POW-002, R-POW-005)
diff --git a/sim/Statecraft.Sim/Workshops.cs b/sim/Statecraft.Sim/Workshops.cs
new file mode 100644
index 000000000..48d7c66e1
--- /dev/null
+++ b/sim/Statecraft.Sim/Workshops.cs
@@ -0,0 +1,122 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Statecraft.Sim
+{
+ /// <summary>#1701 (GDD 0.3 arms workshops) on the aggregate cities, under gdd-0.3 only: the arms_workshop project kind
+ /// (R-ARMS-004), its worker (R-ARMS-005) and its monthly cycle (R-ARMS-006, R-ARMS-007).</summary>
+ public static class Workshops
+ {
+ /// <summary>The projects.yaml id of the arms workshop (R-ARMS-004; gdd03-balance.yaml `arms_workshop`).</summary>
+ public const string ArmsWorkshop = "arms_workshop";
+
+ /// <summary>R-ARMS-005: the AssignWorkers role that staffs a city's arms workshops (gdd-0.3 only).</summary>
+ public const string Role = "workshop";
+
+ /// <summary>R-ARMS-006: why a staffed workshop did not work this month (CauseKeys.WorkshopPaused's argument): no person
+ /// of its city without a job was left for it, or paying for its next cycle would take the debt past mvp.debt_ceiling.</summary>
+ public const string NoWorker = "no_worker", DebtCeiling = "debt_ceiling";
+
+ /// <summary>R-ARMS-005: the city's built workshops (a project whose kind has a worker slot, R-ARMS-004), in ascending id.</summary>
+ static List<CityProject> BuiltIn(Content c, GameState s, string city) =>
+ s.CityProjects.Values.Where(p => p.City == city && p.BuiltOn != null && c.ProjectKinds.First(k => k.Id == p.Kind).WorkerSlots > 0).ToList();
+
+ /// <summary>R-ARMS-005: the city's staffed workshops, each worked by one of its people who holds no job. 0 outside gdd-0.3,
+ /// which has no workshop record.</summary>
+ public static int Staffed(GameState s, string city) =>
+ s.Workshops.Values.Count(w => w.Staffed && s.CityProjects[w.Project].City == city);
+
+ /// <summary>R-ARMS-005 (27M-13: "Any free civilian. The cost tier follows the worker"): AssignWorkers(city, "workshop",
+ /// count), a standing order: the city's first <paramref name="count"/> built workshops, in ascending id, are staffed and
+ /// the rest are not. A newly staffed workshop takes one of the city's civilians and craftsmen who hold no job (it stays
+ /// one of them, with no job, profession or qualification change: Q55), priced Ordinary on the aggregate cities (#1701
+ /// OQ6). An unstaffed workshop keeps its record, paid cost and progress (a pause, R-ARMS-007). Refused, state untouched,
+ /// for a negative count, more than the city's built workshops, or more newly staffed than its people without a job.</summary>
+ internal static string? Staff(Content c, GameState s, string city, int count, List<Cause> why)
+ {
+ PopulationLedger.RefuseAggregate(s);
+ if (count < 0) return "The number of workers cannot be negative";
+ var name = PlayerText.Settlement(c, city);
+ var built = BuiltIn(c, s, city);
+ if (count > built.Count)
+ return FormattableString.Invariant($"{name} has {built.Count} {(built.Count == 1 ? "arms workshop" : "arms workshops")}");
+ var x = s.Cities[city];
+ var staffed = Staffed(s, city);
+ // R-CITY-009: while the city's job default is on, a newly staffed workshop may take its worker from the default's
+ // jobs (the default then fills one job fewer, R-CITY-001); a number the player set is not lowered.
+ var free = x.Civilians + x.Craftsmen - (x.JobsDefault ? 0 : x.Employed) - staffed;
+ if (count - staffed > free)
+ return FormattableString.Invariant($"{name} has {Math.Max(0, free)} civilians and craftsmen{(x.JobsDefault ? "" : " without a job")}");
+ var employed = Math.Min(x.Employed, x.Civilians + x.Craftsmen - count);
+ if (employed != x.Employed)
+ {
+ s.Cities[city] = x.WithCounts(x.Civilians, employed, x.Refugees);
+ why.Add(new Cause("city", city, employed - x.Employed, FormattableString.Invariant($"{name}: {employed} groups in work"), key: CauseKeys.WorkersAssigned, args: new[] { CauseKeys.Number(employed) }));
+ }
+ for (int i = 0; i < built.Count; i++)
+ {
+ var on = i < count;
+ if (s.Workshops.TryGetValue(built[i].Id, out var w)) { if (w.Staffed != on) s.Workshops[w.Project] = w.WithStaffed(on); }
+ else if (on) s.Workshops.Add(built[i].Id, new Workshop(built[i].Id, true, SyntheticWorkshopTier.Ordinary));
+ }
+ why.Add(new Cause("city", city, count - staffed, FormattableString.Invariant($"{name}: arms workshops staffed: {count}"),
+ key: CauseKeys.WorkshopWorkers, args: new[] { CauseKeys.Number(count) }));
+ return null;
+ }
+
+ /// <summary>R-ARMS-006, step 6 of the turn after the cities' wages, gdd-0.3 only. In ascending project id, a staffed
+ /// workshop whose city the enemy does not hold (R-CITY-010) works this month when one of its city's people without a
+ /// job is left for it (each workshop of the city takes one). With no cycle under way it first pays for one at its
+ /// worker's tier (gdd03-balance.yaml workshop.cost: 27M-11, "At the monthly production step."), borrowing a short
+ /// Treasury's rest (R-MONEY-003; 27M-12, "paid like any GDD cost"), unless that would take the debt past
+ /// mvp.debt_ceiling (#1701 OQ4, owner 2 November 2026: "Refuse past the ceiling (Recommended)"): then the workshop
+ /// waits this month and the turn report says why. The month it is paid counts (#1701 OQ3); at workshop.staffed_turns
+ /// months the cycle adds 1 Arms (R-ARMS-001) and ends, and the next month starts the next by itself (27M-12,
+ /// "Automatic each month while the workshop is staffed"). An unstaffed workshop or one in a held city keeps its cycle
+ /// as it is (a pause, R-ARMS-007). Nobody's profession or qualification changes (Q55).</summary>
+ public static void Produce(Content c, GameState s, List<Cause> why)
+ {
+ if (c.Ruleset != SaveGame.Gdd03Ruleset || s.Workshops.Count == 0) return;
+ PopulationLedger.RefuseAggregate(s);
+ var rules = SyntheticWorkshopRules.FromCatalogue(c.Gdd03Balance!); // the loader requires it under gdd-0.3
+ var ceiling = c.RulesAt(s.Date).Mvp!.DebtCeiling!.Value;
+ var held = Cities.Held(c, s);
+ var working = new Dictionary<string, int>(StringComparer.Ordinal);
+ foreach (var w in s.Workshops.Values.ToList())
+ {
+ if (!w.Staffed) continue;
+ var city = s.CityProjects[w.Project].City;
+ if (held.Contains(city)) continue;
+ var name = PlayerText.Settlement(c, city);
+ var x = s.Cities[city];
+ working.TryGetValue(city, out var taken);
+ if (taken >= x.Civilians + x.Craftsmen - x.Employed)
+ {
+ why.Add(new Cause("city", city, 0, $"{name}: an arms workshop has no worker without a job this month", key: CauseKeys.WorkshopPaused, args: new[] { NoWorker }));
+ continue;
+ }
+ working[city] = taken + 1;
+ var cycle = w;
+ if (cycle.PaidCost == null)
+ {
+ var price = rules.Price(cycle.WorkerTier);
+ var left = s.Treasury - (double)price; // R-MONEY-003's debt after: the debt plus what the Treasury lacks
+ if (left < 0 && s.Debt - left > ceiling)
+ {
+ why.Add(new Cause("city", city, 0, $"{name}: an arms workshop's next cycle waits: paying for it would take the debt past its ceiling", key: CauseKeys.WorkshopPaused, args: new[] { DebtCeiling }));
+ continue;
+ }
+ EconomySystem.PayOrBorrow(c, s, (double)price, "for an arms workshop cycle", why, CauseKeys.Purpose.Workshop);
+ cycle = cycle.WithCycle(price, 0);
+ }
+ var progress = cycle.Progress + 1;
+ // A full stock (int.MaxValue) cannot take the Arms: the cycle stays complete and waits, still paid.
+ if (progress < rules.StaffedTurns || s.Arms == int.MaxValue) { s.Workshops[w.Project] = cycle.WithCycle(cycle.PaidCost, Math.Min(progress, rules.StaffedTurns)); continue; }
+ s.Arms += 1;
+ s.Workshops[w.Project] = cycle.WithCycle(null, 0);
+ why.Add(new Cause("city", city, 1, $"{name}: an arms workshop made 1 Arms", key: CauseKeys.WorkshopArms));
+ }
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/UI/CauseText.cs b/unity/Assets/Scripts/UI/CauseText.cs
index 5015ccace..5141e6cdb 100644
--- a/unity/Assets/Scripts/UI/CauseText.cs
+++ b/unity/Assets/Scripts/UI/CauseText.cs
@@ -87,7 +87,7 @@ namespace Statecraft.Game.UI
// #1682: these branches use captured ids, values and resident flags, never the live GameState.
static readonly HashSet<string> RemainingKeys = new HashSet<string>
{
- CauseKeys.WorkersAssigned, CauseKeys.WagesPaid, CauseKeys.ImmigrantsHoused, CauseKeys.HousingShortage, CauseKeys.ImmigrantsWaiting, CauseKeys.RecruitsVeteran, CauseKeys.CorridorStarted, CauseKeys.CorridorCancelled, CauseKeys.CorridorCompleted, CauseKeys.PioneersVeteran, CauseKeys.MapBorrowed, CauseKeys.MapBuilt, CauseKeys.LandWorkStarted, CauseKeys.SiteStarted, CauseKeys.SiteCancelled, CauseKeys.SiteCompleted, CauseKeys.ProjectStarted, CauseKeys.ProjectCancelled, CauseKeys.ProjectCompleted, CauseKeys.ArmsBought, CauseKeys.DollarsConverted, CauseKeys.FoodHarvest, CauseKeys.FoodShortage, CauseKeys.FoodWithoutImports, CauseKeys.PrisonerFood, CauseKeys.PrisonerFoodShortage, CauseKeys.CraftsmenReturned, CauseKeys.CraftsmenReassigned, CauseKeys.PioneerReturned, CauseKeys.PioneersReassigned, CauseKeys.TrainingStarted, CauseKeys.TrainingArms, CauseKeys.TrainingCancelled, CauseKeys.TrainingArmsReturned, CauseKeys.ReplacementsStopped, CauseKeys.ReplacementsJoined, CauseKeys.MilitaryTrained, CauseKeys.PioneersTrained, CauseKeys.CraftsmenTrained, CauseKeys.Appointed, CauseKeys.Reshuffle, CauseKeys.AppointmentsEnded, CauseKeys.ApprovalStability, CauseKeys.CoalitionCollapsed, CauseKeys.LegislatureConvened, CauseKeys.GovernmentTookOffice, CauseKeys.CoalitionChanged, CauseKeys.EraEnded, CauseKeys.AdvisoryPolicyRejected, CauseKeys.PolicyRejected, CauseKeys.PolicySet, CauseKeys.AdvisoryBudgetRejected, CauseKeys.BudgetRejected, CauseKeys.PlaceCaptured, CauseKeys.EnemyRegained, CauseKeys.PlaceAnnexed, CauseKeys.PlaceWithdrawn, CauseKeys.PlaceDeported, CauseKeys.DeportEffect, CauseKeys.DeportCost, CauseKeys.OccupationStarted, CauseKeys.PendingBecameRaid, CauseKeys.OccupationLostUnit, CauseKeys.OccupationCountdown, CauseKeys.DepopulationSupport
+ CauseKeys.WorkersAssigned, CauseKeys.WagesPaid, CauseKeys.ImmigrantsHoused, CauseKeys.HousingShortage, CauseKeys.ImmigrantsWaiting, CauseKeys.RecruitsVeteran, CauseKeys.CorridorStarted, CauseKeys.CorridorCancelled, CauseKeys.CorridorCompleted, CauseKeys.PioneersVeteran, CauseKeys.MapBorrowed, CauseKeys.MapBuilt, CauseKeys.LandWorkStarted, CauseKeys.SiteStarted, CauseKeys.SiteCancelled, CauseKeys.SiteCompleted, CauseKeys.ProjectStarted, CauseKeys.ProjectCancelled, CauseKeys.ProjectCompleted, CauseKeys.ArmsBought, CauseKeys.WorkshopWorkers, CauseKeys.WorkshopArms, CauseKeys.WorkshopPaused, CauseKeys.DollarsConverted, CauseKeys.FoodHarvest, CauseKeys.FoodShortage, CauseKeys.FoodWithoutImports, CauseKeys.PrisonerFood, CauseKeys.PrisonerFoodShortage, CauseKeys.CraftsmenReturned, CauseKeys.CraftsmenReassigned, CauseKeys.PioneerReturned, CauseKeys.PioneersReassigned, CauseKeys.TrainingStarted, CauseKeys.TrainingArms, CauseKeys.TrainingCancelled, CauseKeys.TrainingArmsReturned, CauseKeys.ReplacementsStopped, CauseKeys.ReplacementsJoined, CauseKeys.MilitaryTrained, CauseKeys.PioneersTrained, CauseKeys.CraftsmenTrained, CauseKeys.Appointed, CauseKeys.Reshuffle, CauseKeys.AppointmentsEnded, CauseKeys.ApprovalStability, CauseKeys.CoalitionCollapsed, CauseKeys.LegislatureConvened, CauseKeys.GovernmentTookOffice, CauseKeys.CoalitionChanged, CauseKeys.EraEnded, CauseKeys.AdvisoryPolicyRejected, CauseKeys.PolicyRejected, CauseKeys.PolicySet, CauseKeys.AdvisoryBudgetRejected, CauseKeys.BudgetRejected, CauseKeys.PlaceCaptured, CauseKeys.EnemyRegained, CauseKeys.PlaceAnnexed, CauseKeys.PlaceWithdrawn, CauseKeys.PlaceDeported, CauseKeys.DeportEffect, CauseKeys.DeportCost, CauseKeys.OccupationStarted, CauseKeys.PendingBecameRaid, CauseKeys.OccupationLostUnit, CauseKeys.OccupationCountdown, CauseKeys.DepopulationSupport
};
static string Remaining(Cause cause, Content c, UiText text, IReadOnlyDictionary<string, string>? namesHe)
@@ -152,6 +152,12 @@ namespace Statecraft.Game.UI
return text.Format(key, Settlement(cause.Target), ContentNames.Of(text, c.ProjectKinds.First(x => x.Id == A(0))));
case CauseKeys.ArmsBought:
return text.Format(key, cause.Delta, Money(c, "treasury", A(0)));
+ case CauseKeys.WorkshopWorkers: // R-ARMS-005 (#1701)
+ return text.Format(key, Settlement(cause.Target), A(0));
+ case CauseKeys.WorkshopArms: // R-ARMS-006
+ return text.Format(key, Settlement(cause.Target));
+ case CauseKeys.WorkshopPaused: // R-ARMS-006: why.cause.workshop_paused.<Workshops.NoWorker or .DebtCeiling>
+ return text.Format(key + "." + A(0), Settlement(cause.Target));
case CauseKeys.DollarsConverted:
return text.Format(key, Money(c, "fx_reserves", A(0)), PlayerText.MoneyChange(c, "treasury", cause.Delta));
case CauseKeys.FoodHarvest:
diff --git a/unity/Assets/Scripts/UI/TurnReportPresenter.cs b/unity/Assets/Scripts/UI/TurnReportPresenter.cs
index d2aa4e34a..66c2a3517 100644
--- a/unity/Assets/Scripts/UI/TurnReportPresenter.cs
+++ b/unity/Assets/Scripts/UI/TurnReportPresenter.cs
@@ -25,6 +25,8 @@ namespace Statecraft.Game.UI
public const string ElementName = "turn-report";
/// <summary>The id of the row after the meters' that lists the enemy's orders this turn (#1293).</summary>
public const string EnemyRow = "enemy";
+ /// <summary>The row after the stocks that lists the arms workshops' Arms and ceiling pauses this turn (#1701 A1).</summary>
+ public const string WorkshopRow = "workshops";
/// <summary>The units_1948.yaml rows, which name the enemy's units in that row (GameRoot sets them once the map has read
/// them); without a row a unit is named by its id (report.unit).</summary>
@@ -99,7 +101,7 @@ namespace Statecraft.Game.UI
/// <summary>The report's lines for the session's last turn: each top-bar meter whose shown change is not empty, in
/// the bar's order (the meters have different units, so no order by size is given without a rule); then national stocks; under
- /// <see cref="EnemyRow"/>, the enemy's orders (#1293).</summary>
+ /// <see cref="WorkshopRow"/>, the arms workshops' lines (#1701); under <see cref="EnemyRow"/>, the enemy's orders (#1293).</summary>
public static IReadOnlyList<Line> Lines(SimBridge bridge, UiText text, IReadOnlyList<UnitEntry>? units = null,
IReadOnlyDictionary<string, string>? townNamesHe = null)
{
@@ -113,6 +115,8 @@ namespace Statecraft.Game.UI
w => CauseText.Line(w, bridge.Content, units ?? Array.Empty<UnitEntry>(), text, townNamesHe))));
}
lines.AddRange(StockLines(bridge, text, units, townNamesHe));
+ var workshops = WorkshopLines(bridge, text, townNamesHe);
+ if (workshops.Count > 0) lines.Add(new Line(WorkshopRow, text["report.workshops"], workshops));
var enemy = EnemyOrders(bridge, text, units);
if (enemy.Count > 0) lines.Add(new Line(EnemyRow, text["report.enemy"], enemy));
return lines;
@@ -147,6 +151,32 @@ namespace Statecraft.Game.UI
.OrderByDescending(x => Math.Abs(x.w.Delta)).ThenBy(x => x.i)
.Take(HudModel.MaxCauses).Select(x => line(x.w)).ToList();
+ /// <summary>#1701 A1 (owner, 2 November 2026: "Yes, in the panel (Recommended)"): the arms workshops that made Arms and
+ /// those whose next cycle waits at the debt ceiling this turn, as the sim's causes say (CauseKeys.WorkshopArms;
+ /// CauseKeys.WorkshopPaused with Workshops.DebtCeiling; R-ARMS-006), the city in the player's language. Each city's
+ /// Arms are one line and its ceiling pauses another, with their count (owner, 2 November 2026: "Combine per city
+ /// (Recommended)", the option "'Workshops in Tel Aviv (6): +6 Arms'; pauses likewise combined with a count."), in the
+ /// order each first appears among the sim's causes; a city with one keeps A1's own line ("Workshop in Tel Aviv: +1
+ /// Arms"). The count is the number of those causes, each 1 Arms; nothing else is computed. A no-worker pause stays on
+ /// the Why screen. There is no ruleset check here: the sim gives these causes under gdd-0.3 only
+ /// (ArmsWorkshopTests.Gdd01RunsNoWorkshopCycle), and the report shows what the sim says.</summary>
+ static IReadOnlyList<string> WorkshopLines(SimBridge bridge, UiText text, IReadOnlyDictionary<string, string>? townNamesHe)
+ {
+ var turn = bridge.Session.Last;
+ if (turn == null) return Array.Empty<string>();
+ return turn.Why
+ .Where(w => w.Key == CauseKeys.WorkshopArms || (w.Key == CauseKeys.WorkshopPaused && w.Args.FirstOrDefault() == Workshops.DebtCeiling))
+ .GroupBy(w => (w.Key, City: w.Target)) // groups come in the order of their first cause
+ .Select(g =>
+ {
+ var made = g.Key.Key == CauseKeys.WorkshopArms;
+ var city = ContentNames.Settlement(text, bridge.Content, g.Key.City, townNamesHe);
+ var n = g.Count();
+ return n == 1 ? text.Format(made ? "report.workshop_arms" : "report.workshop_paused_debt", city)
+ : text.Format(made ? "report.workshop_arms_n" : "report.workshop_paused_debt_n", city, n);
+ }).ToList();
+ }
+
/// <summary>#1293: every order the enemy AI gave in the last turn, and every attack its units made, a standing one too
/// (#1297), as the sim names it on its cause (Cause.EnemyOrder, R-ENEMY-001), in the sim's order, in the player's
/// language: Message is English only. The unit is named by its row
diff --git a/unity/Assets/Tests/EditMode/CauseTextTests.cs b/unity/Assets/Tests/EditMode/CauseTextTests.cs
index 9a4b5ff4d..b92db72d3 100644
--- a/unity/Assets/Tests/EditMode/CauseTextTests.cs
+++ b/unity/Assets/Tests/EditMode/CauseTextTests.cs
@@ -153,6 +153,7 @@ public class CauseTextTests
(CauseKeys.Purpose.Deport, $"for the Deport of {placeName}", new[] { place }),
(CauseKeys.Purpose.Occupation, $"for the occupation of {placeName}", new[] { place }),
(CauseKeys.Purpose.Event, $"for {ev.Title}", new[] { ev.Id, ev.Title, "1" }),
+ (CauseKeys.Purpose.Workshop, "for an arms workshop cycle", new string[0]), // R-ARMS-006
};
// A map action borrows with its own key (CauseKeys.MapBorrowed): its purpose names only its Paid line (#2199).
CollectionAssert.AreEquivalent(CauseKeys.Purpose.All.Where(p => p != CauseKeys.Purpose.Deficit && p != CauseKeys.Purpose.MapAction),
@@ -195,6 +196,7 @@ public class CauseTextTests
(CauseKeys.Purpose.Project, "to build " + housing.Name, new[] { housing.Id }),
(CauseKeys.Purpose.Occupation, $"for the occupation of {placeName}", new[] { place }),
(CauseKeys.Purpose.MapAction, "to build " + PlayerText.MapAction(C, MapActions.Housing), new[] { MapActions.Housing }), // as MapActions.Apply
+ (CauseKeys.Purpose.Workshop, "for an arms workshop cycle", new string[0]), // R-ARMS-006
};
CollectionAssert.AreEquivalent(CauseKeys.Purpose.All.Except(new[] { CauseKeys.Purpose.Deficit, CauseKeys.Purpose.CivilianUpkeep,
CauseKeys.Purpose.MilitaryUpkeep, CauseKeys.Purpose.Deport, CauseKeys.Purpose.Event }), purposes.Select(p => p.Key), "every paying purpose");
@@ -414,6 +416,9 @@ public class CauseTextTests
new Cause("draft", "town", -1, "Town: Housing was cancelled; the Money spent is not returned", key: CauseKeys.ProjectCancelled, args: new[] { "housing" }),
new Cause("draft", "town", 1, "Town: Housing was finished", key: CauseKeys.ProjectCompleted, args: new[] { "housing" }),
new Cause("draft", "arms", 2000000000, "Bought 2000000000 Arms, cost IL 1.3m", key: CauseKeys.ArmsBought, args: new[] { "1.25" }),
+ new Cause("draft", "town", 2, "Town: arms workshops staffed: 2", key: CauseKeys.WorkshopWorkers, args: new[] { "2" }),
+ new Cause("draft", "town", 1, "Town: an arms workshop made 1 Arms", key: CauseKeys.WorkshopArms),
+ new Cause("draft", "town", 0, "Town: an arms workshop has no worker without a job this month", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.NoWorker }),
new Cause("draft", "treasury", 1.44, "Converted $4.0m of foreign currency into Money: IL +1.4m", key: CauseKeys.DollarsConverted, args: new[] { "4" }),
new Cause("draft", "food", 2000000000, "Site: the plowed land yielded 2000000000 units of Food", key: CauseKeys.FoodHarvest, args: new[] { "site" }),
new Cause("draft", "food", -2000000000, "Food ran out: 2000000000 of 2000000001 units of the month's need went unmet", key: CauseKeys.FoodShortage, args: new[] { "2000000001" }),
@@ -522,6 +527,7 @@ public class CauseTextTests
new Cause("draft", "town", -1, "Town: 1 group began armoured car training, cost IL 1.3m", key: CauseKeys.TrainingStarted, args: new[] { "1", "armour", "", "1.25" }),
new Cause("draft", "site", 1, "Site: a group of halutzim began draining the swamp, cost IL 1.3m", key: CauseKeys.LandWorkStarted, args: new[] { "drain", "1.25" }),
new Cause("draft", "site", 1, "Site: a group of halutzim began building a training camp, cost IL 1.3m", key: CauseKeys.SiteStarted, args: new[] { "camp", "1.25" }),
+ new Cause("draft", "town", 0, "Town: an arms workshop's next cycle waits: paying for it would take the debt past its ceiling", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.DebtCeiling }), // #1701 OQ4
};
// A renderer receives no live state: both resident variants must survive the settlement record's removal.
foreach (var row in rows)
@@ -539,6 +545,30 @@ public class CauseTextTests
}
}
+ /// <summary>#1701: the Why screen (WhyPresenter.Show) words every arms workshop cause from why.cause.&lt;key&gt; with the city
+ /// named, in both languages; a workshop key outside CauseText's remaining set fell to UnitNames.Line and threw on a
+ /// missing why.line.&lt;key&gt; (the coordinator's Unity run at 7cbd257b6).</summary>
+ [Test]
+ public void EveryWorkshopCauseIsWordedFromItsWhyCauseKeyOnTheWhyScreen()
+ {
+ var c = RemainingFixture(); var en = En; var he = He;
+ var names = new Dictionary<string, string> { ["town"] = "עיר" };
+ var rows = new (Cause cause, string key, string[] extra)[]
+ {
+ (new Cause("city", "town", 2, "Town: arms workshops staffed: 2", key: CauseKeys.WorkshopWorkers, args: new[] { "2" }), "why.cause.workshop_workers", new[] { "2" }),
+ (new Cause("city", "town", 1, "Town: an arms workshop made 1 Arms", key: CauseKeys.WorkshopArms), "why.cause.workshop_arms", new string[0]),
+ (new Cause("city", "town", 0, "Town: an arms workshop has no worker without a job this month", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.NoWorker }), "why.cause.workshop_paused.no_worker", new string[0]),
+ (new Cause("city", "town", 0, "Town: an arms workshop's next cycle waits: paying for it would take the debt past its ceiling", key: CauseKeys.WorkshopPaused, args: new[] { Workshops.DebtCeiling }), "why.cause.workshop_paused.debt_ceiling", new string[0]),
+ };
+ foreach (var (cause, key, extra) in rows)
+ foreach (var (text, town) in new[] { (en, "Town"), (he, "עיר") })
+ {
+ string line = "";
+ Assert.DoesNotThrow(() => line = CauseText.Line(cause, c, NoRows, text, names), key);
+ Assert.AreEqual(text.Format(key, new object[] { town }.Concat(extra).ToArray()), line, key);
+ }
+ }
+
[Test]
public void RemainingRowsPreserveTheWholeEnglishReportInBothLoops()
{
diff --git a/unity/Assets/Tests/EditMode/TurnReportTests.cs b/unity/Assets/Tests/EditMode/TurnReportTests.cs
index 58e11a878..f65fbec90 100644
--- a/unity/Assets/Tests/EditMode/TurnReportTests.cs
+++ b/unity/Assets/Tests/EditMode/TurnReportTests.cs
@@ -180,6 +180,95 @@ public class TurnReportTests
}
}
+ /// <summary>Each settlement's Hebrew name by id, from the map's own rows.</summary>
+ static Dictionary<string, string> NamesHe() => Statecraft.Game.Map.SettlementPlacer.Parse(
+ File.ReadAllText(Path.Combine(Paths.Content, "map", "settlements_1948.yaml"))).ToDictionary(s => s.Id, s => s.NameHe);
+
+ /// <summary>A kit whose opening turn runs as usual and whose result then gets <paramref name="added"/> through
+ /// Session.Last's private setter (as AnAttackThatNamesNoAttackersGivesNoLine does), before the report reads it. The real
+ /// content is gdd-0.1, which has no workshop, so the workshop causes are added; that the sim gives them under gdd-0.3 only
+ /// is ArmsWorkshopTests.Gdd01RunsNoWorkshopCycle's.</summary>
+ static Kit EndTurnWith(UiText text, IReadOnlyList<Cause> added, IReadOnlyDictionary<string, string> namesHe)
+ {
+ var k = new Kit(text, (g, cmds) =>
+ {
+ var r = g.EndTurn(cmds);
+ var result = new StepResult(r.State, r.Why.Concat(added).ToList(), r.Rejected);
+ typeof(GameSession).GetProperty(nameof(GameSession.Last))!.SetValue(g, result);
+ return result;
+ });
+ k.Report.TownNamesHe = namesHe;
+ k.Bridge.EndTurn();
+ return k;
+ }
+
+ static Cause Made(string city) => new Cause("city", city, 1, city + ": an arms workshop made 1 Arms", key: CauseKeys.WorkshopArms);
+ static Cause Paused(string city, string why) => new Cause("city", city, 0, city + ": an arms workshop waits", key: CauseKeys.WorkshopPaused, args: new[] { why });
+
+ /// <summary>#1701 A1 (owner, 2 November 2026: "Yes, in the panel (Recommended)"; the option: "The turn-report panel shows
+ /// 'Workshop in &lt;city&gt;: +1 Arms' and 'Workshop in &lt;city&gt; paused: debt ceiling'."): the sim's workshop causes
+ /// (R-ARMS-006) get their own row after the stocks, in the sim's order, the city named in the player's language. A city
+ /// with one such cause keeps the A1 wording. A no-worker pause is not one of the ruled lines and stays on the Why screen.
+ /// The expected lines are literals in both languages, not the keys formatted again.</summary>
+ [Test]
+ public void TheWorkshopsArmsAndCeilingPauseAreReportedInBothLanguages()
+ {
+ var namesHe = NamesHe();
+ var added = new[] { Made("tel_aviv"), Paused("haifa", Workshops.NoWorker), Paused("haifa", Workshops.DebtCeiling) };
+ foreach (var hebrew in new[] { false, true })
+ {
+ using var k = EndTurnWith(hebrew ? He : En, added, namesHe);
+ k.Q("turn-report-" + TurnReportPresenter.WorkshopRow); // asserts the row's own name, which the no-row test queries
+ Assert.AreEqual(hebrew ? "סדנאות נשק" : "Arms workshops", k.Ui.Q<Label>("turn-report-heading-" + TurnReportPresenter.WorkshopRow).text);
+ CollectionAssert.AreEqual(hebrew
+ ? new[] { "סדנת נשק (תל אביב): תוספת נשק: 1", "סדנת נשק (חיפה) בהמתנה: תקרת החוב" }
+ : new[] { "Workshop in Tel Aviv: +1 Arms", "Workshop in Haifa paused: debt ceiling" },
+ Causes(k.Ui, TurnReportPresenter.WorkshopRow), "the owner's ruled wording");
+ }
+ }
+
+ /// <summary>#1701 A1 follow-up (owner, 2 November 2026: "Combine per city (Recommended)"; the option: "'Workshops in Tel
+ /// Aviv (6): +6 Arms'; pauses likewise combined with a count."): a city's workshop Arms are one line with their count, and
+ /// so are its ceiling pauses, in the order each first appears among the sim's causes; a city with one keeps the A1 line.
+ /// The count is the number of the sim's causes, which each give 1 Arms (R-ARMS-006). Hebrew puts the count in brackets
+ /// after the city's name, as English does, and the Arms as "Label: N" (HE-04), each number between left-to-right marks
+ /// as UiText.Format puts it.</summary>
+ [Test]
+ public void AnotherWorkshopInTheSameCityJoinsItsLine()
+ {
+ var namesHe = NamesHe();
+ var added = new[]
+ {
+ Paused("haifa", Workshops.DebtCeiling), Made("tel_aviv"), Paused("haifa", Workshops.DebtCeiling), Made("haifa"),
+ Made("tel_aviv"), Made("tel_aviv"), Paused("haifa", Workshops.NoWorker),
+ };
+ foreach (var hebrew in new[] { false, true })
+ {
+ using var k = EndTurnWith(hebrew ? He : En, added, namesHe);
+ CollectionAssert.AreEqual(hebrew
+ ? new[]
+ {
+ "סדנאות נשק (חיפה) (‎2‎) בהמתנה: תקרת החוב",
+ "סדנאות נשק (תל אביב) (‎3‎): תוספת נשק: ‎3‎",
+ "סדנת נשק (חיפה): תוספת נשק: 1",
+ }
+ : new[] { "Workshops in Haifa (2) paused: debt ceiling", "Workshops in Tel Aviv (3): +3 Arms", "Workshop in Haifa: +1 Arms" },
+ Causes(k.Ui, TurnReportPresenter.WorkshopRow));
+ }
+ }
+
+ /// <summary>#1701 A1: a turn whose only workshop cause is a no-worker pause (on the Why screen only) has no workshop row,
+ /// so the filter, not the content, keeps the row out.</summary>
+ [Test]
+ public void ANoWorkerPauseAloneGivesNoWorkshopRow()
+ {
+ using var k = EndTurnWith(En, new[] { Paused("haifa", Workshops.NoWorker) }, NamesHe());
+ Assert.IsTrue(k.Bridge.Session.Last!.Why.Any(w => w.Key == CauseKeys.WorkshopPaused), "the pause is in the turn");
+ Assert.IsNotEmpty(k.Ui.Q<ScrollView>("turn-report-rows").Children().ToList(), "the report has its other rows");
+ Assert.IsNull(k.Ui.Root.Q("turn-report-" + TurnReportPresenter.WorkshopRow), "no workshop row");
+ Assert.IsNull(k.Ui.Root.Q("turn-report-heading-" + TurnReportPresenter.WorkshopRow), "no workshop heading");
+ }
+
/// <summary>#1297: a standing enemy attack (R-ENEMY-003) is reported on every turn it engages, not only on the turn it is
/// ordered. The opening turn is set up as a later one: the Arab Liberation Army already attacks Golani's hex, which it keeps
/// (no order is given this turn) and which engages in step 2 (R-COMBAT-002).</summary>
diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yaml
index 62de89c2c..854991b9c 100644
--- a/unity/Assets/UI/strings.en.yaml
+++ b/unity/Assets/UI/strings.en.yaml
@@ -418,6 +418,7 @@ why.cause.borrowed.project: "Borrowed {0} to build {1}"
why.cause.borrowed.deport: "Borrowed {0} for the Deport of {1}"
why.cause.borrowed.occupation: "Borrowed {0} for the occupation of {1}"
why.cause.borrowed.event: "Borrowed {0} for {1}"
+why.cause.borrowed.workshop: "Borrowed {0} for an arms workshop cycle"
why.cause.paid.corridor: "{0} {1} (to build a corridor segment)"
why.cause.paid.arms: "{0} {1} (for Arms)"
why.cause.paid.training: "{0} {1} (for training)"
@@ -429,6 +430,7 @@ why.cause.paid.yishuv: "{0} {1} (to build a yishuv)"
why.cause.paid.project: "{0} {1} (to build {2})"
why.cause.paid.occupation: "{0} {1} (for the occupation of {2})"
why.cause.paid.map_action: "{0} {1} (to build {2})"
+why.cause.paid.workshop: "{0} {1} (for an arms workshop cycle)"
# #2212: Money's Other line in the turn report and the meter tip, the causes left out after the two largest, summed.
why.cause.money_other: "{0} {1} (other causes)"
why.cause.fx_crisis_began: "Foreign currency reserves are exhausted"
@@ -494,6 +496,15 @@ report.enemy_move: "{0} moved to a new position"
report.enemy_attack: "{0} launched an attack on one of your units"
report.enemy_fortify: "{0} fortified its position"
report.unit: "Force {0}"
+# The arms workshops' lines (#1701 A1; owner, 2 November 2026: "Yes, in the panel (Recommended)", whose option gave both
+# lines' wording): {0} the city's name. A no-worker pause is on the Why screen only.
+report.workshops: "Arms workshops"
+report.workshop_arms: "Workshop in {0}: +1 Arms"
+report.workshop_paused_debt: "Workshop in {0} paused: debt ceiling"
+# A city's workshop lines combined, for two or more (owner, 2 November 2026: "Combine per city (Recommended)", the option
+# "'Workshops in Tel Aviv (6): +6 Arms'; pauses likewise combined with a count."): {0} the city's name, {1} how many.
+report.workshop_arms_n: "Workshops in {0} ({1}): +{1} Arms"
+report.workshop_paused_debt_n: "Workshops in {0} ({1}) paused: debt ceiling"
# The end screen (#812; D-H4): the sim's end report (EndReport.For, #810), formatted only. {0} the card's title, {1} the
# player's date, {2} the historical date; the population's {1} is the date of its CBS anchor and {2} the anchor's count.
end.title: "The game has ended"
@@ -1048,6 +1059,11 @@ why.cause.project_started: "{0}: {1} began, cost {2}"
why.cause.project_cancelled: "{0}: {1} was cancelled; the Money spent is not returned"
why.cause.project_completed: "{0}: {1} was finished"
why.cause.arms_bought: "Bought {0} Arms, cost {1}"
+# The gdd-0.3 arms workshops (#1701; R-ARMS-005, R-ARMS-006).
+why.cause.workshop_workers: "{0}: arms workshops staffed: {1}"
+why.cause.workshop_arms: "{0}: an arms workshop made 1 Arms"
+why.cause.workshop_paused.no_worker: "{0}: an arms workshop has no worker without a job this month"
+why.cause.workshop_paused.debt_ceiling: "{0}: an arms workshop's next cycle waits: paying for it would take the debt past its ceiling"
why.cause.food_harvest: "{0}: the plowed land yielded {1} units of Food"
why.cause.food_shortage: "Food ran out: {0} of {1} units of the month's need went unmet"
why.cause.food_without_imports: "No Food imported (foreign currency crisis): the stock fell to {0} units"
diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yaml
index 54cce168a..7838de3a3 100644
--- a/unity/Assets/UI/strings.he.yaml
+++ b/unity/Assets/UI/strings.he.yaml
@@ -454,6 +454,8 @@ why.cause.borrowed.project: "הלוואה של {0} לבניית {1}"
why.cause.borrowed.deport: "הלוואה של {0} לגירוש ({1})"
why.cause.borrowed.occupation: "הלוואה של {0} לעלות ההחזקה ({1})"
why.cause.borrowed.event: "הלוואה של {0} עבור {1}"
+# The gdd-0.3 arms workshop's cycle (#1701, R-ARMS-006). Agent-drafted Hebrew; native review pending (#564).
+why.cause.borrowed.workshop: "הלוואה של {0} למחזור עבודה בסדנת נשק"
# #2199: the why.cause.paid.* lines below are agent-drafted Hebrew, not part of #1642's owner review above. Each reuses
# its why.cause.borrowed.* purpose phrase, except paid.occupation, which is newly worded. Native review pending (#564).
why.cause.paid.corridor: "{0}: שינוי {1} (לבניית קטע של כביש או מסילה)"
@@ -469,6 +471,8 @@ why.cause.paid.occupation: "{0}: שינוי {1} (לעלות ההחזקה של {2
# A map action's cost (#2199); {2} is an info.map_action.* noun, as in why.cause.map_borrowed. Agent-drafted Hebrew;
# native review pending (#564).
why.cause.paid.map_action: "{0}: שינוי {1} (לבניית {2})"
+# The gdd-0.3 arms workshop's cycle (#1701, R-ARMS-006). Agent-drafted Hebrew; native review pending (#564).
+why.cause.paid.workshop: "{0}: שינוי {1} (למחזור עבודה בסדנת נשק)"
# #2212: Money's Other line in the turn report and the meter tip, the causes left out after the two largest, summed.
# Agent-drafted Hebrew, not part of #1642's owner review; native review pending (#564).
why.cause.money_other: "{0}: שינוי {1} (סיבות אחרות)"
@@ -542,6 +546,16 @@ report.enemy_move: "{0} עבר לעמדה חדשה"
report.enemy_attack: "{0} פתח בהתקפה על אחת היחידות שלכם"
report.enemy_fortify: "{0} התבצר בעמדתו"
report.unit: "כוח {0}"
+# The arms workshops' lines (#1701 A1), {0} the city's name, in brackets so no prefix joins a name that may fall back to
+# English (HE-07); the Arms count as "Label: N" (HE-04). Agent-drafted Hebrew; native review pending (#564).
+report.workshops: "סדנאות נשק"
+report.workshop_arms: "סדנת נשק ({0}): תוספת נשק: 1"
+report.workshop_paused_debt: "סדנת נשק ({0}) בהמתנה: תקרת החוב"
+# A city's workshop lines combined, for two or more ("Combine per city", #1701): {0} the city's name, {1} how many, in
+# brackets after the name as in the EN lines; the Arms count as "Label: N" (HE-04). Agent-drafted Hebrew; native review
+# pending (#564).
+report.workshop_arms_n: "סדנאות נשק ({0}) ({1}): תוספת נשק: {1}"
+report.workshop_paused_debt_n: "סדנאות נשק ({0}) ({1}) בהמתנה: תקרת החוב"
# The end screen (#812; D-H4): the sim's end report, formatted only. For the native reviewer (#564).
end.title: "המשחק הסתיים"
end.outcome.mvp_ended: "המשחק הגיע לתורו האחרון."
@@ -1167,6 +1181,11 @@ why.cause.project_started: "{0}: תחילת {1}, עלות {2}"
why.cause.project_cancelled: "{0}: ביטול {1}; הכסף שהוצא לא יוחזר"
why.cause.project_completed: "{0}: סיום {1}"
why.cause.arms_bought: "נשק שנרכש: {0}, עלות {1}"
+# The gdd-0.3 arms workshops (#1701; R-ARMS-005, R-ARMS-006). Agent-drafted Hebrew; native review pending (#564).
+why.cause.workshop_workers: "{0}: סדנאות נשק מאוישות: {1}"
+why.cause.workshop_arms: "{0}: נשק שייצרה סדנת נשק: 1"
+why.cause.workshop_paused.no_worker: "{0}: לסדנת נשק אין החודש עובד ללא משרה"
+why.cause.workshop_paused.debt_ceiling: "{0}: המחזור הבא של סדנת נשק ממתין: תשלומו היה מעלה את החוב מעבר לתקרה"
why.cause.food_harvest: "{0}: יחידות מזון שהניבה הקרקע החרושה: {1}"
why.cause.food_shortage: "המזון אזל: מחסור של {0} מתוך {1} יחידות שנדרשו החודש"
why.cause.food_without_imports: "לא יובא מזון (משבר מטבע חוץ): יחידות שנותרו במלאי: {0}"