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.

feat(sim): a dated brigade arrives as soldier records on a Historical ledger game (#1725 PR 7, producer 08) (#2962)

Eyal Golanbe906bfc909f
diff --git a/changelog.d/1725-pr7-brigade-arrivals.md b/changelog.d/1725-pr7-brigade-arrivals.md
new file mode 100644
index 000000000..cbdcabcde
--- /dev/null
+++ b/changelog.d/1725-pr7-brigade-arrivals.md
@@ -0,0 +1,3 @@
+- GDD 0.3 starting population (Refs #1725, Refs #1689): on the inactive dark start's Historical ledger, the 7th Brigade,
+ which arrives on 24 May 1948, brings its 2 units as 2 new soldier records of the brigade, with combat experience 1 and
+ equipment apart from the Arms stock. No new-game wiring, so there is no change in the game.
diff --git a/content/gdd03-start.yaml b/content/gdd03-start.yaml
index 6e794db3b..90b858779 100644
--- a/content/gdd03-start.yaml
+++ b/content/gdd03-start.yaml
@@ -23,5 +23,8 @@ formation_combat_xp:
- { row: kiryati, combat_xp: 1 } # DESIGN VALUE: owner-set, not a historical figure (#1689 row 7)
- { row: givati, combat_xp: 1 } # DESIGN VALUE: owner-set, not a historical figure (#1689 row 7)
- { row: etzioni, combat_xp: 1 } # DESIGN VALUE: owner-set, not a historical figure (#1689 row 7)
+ # #1725 PR 7, producer 08: the 7th Brigade arrives on 24 May 1948 (R-UNIT-009) as soldier records, so it is named too.
+ # Owner, 8 November 2026: "1, like the others" (not the recommended option, which was a labelled stand-in of 0).
+ - { row: brigade_7, combat_xp: 1 } # DESIGN VALUE: owner-set, not a historical figure (#1725 producer 08)
- { row: harel, combat_xp: 1 } # DESIGN VALUE: owner-set, not a historical figure (#1689 row 7)
- { row: negev, combat_xp: 0 } # DESIGN VALUE: owner's labelled stand-in, no dated fight found (#1689 row 8)
diff --git a/docs/population-ledger.md b/docs/population-ledger.md
index a132348ad..c26bd7575 100644
--- a/docs/population-ledger.md
+++ b/docs/population-ledger.md
@@ -14,4 +14,4 @@ No save/reload round trip for population identity is claimed. The existing seed/
## Historical start inventory (R-POP-004)
-`HistoricalPopulation.Inventory` is internal and reads the shipped content under exact `gdd-0.3`: one free-civilian row per census city start unit (R-CITY-007) and one active-soldier row per population unit of each Israeli starting formation of `map/units_1948.yaml` (R-UNIT-006), at `rules.yaml`'s 1,000 people a unit (owner, 1 November 2026, D2). Rows carry a source key (`census/<city id>`, `units_1948/<row id>`) and a within-source ordinal, in R-POP-001's order. Enemy formations and dated arrivals (R-UNIT-009) are not in it. It builds no `PopulationUnit` itself. `HistoricalPopulation.LedgerFixture` (internal, fixture-only) turns it into an initialized Historical ledger and binds each record to a region of `content/regions.yaml`: a census record takes the region whose `member_locations` hold its city, and its location names that city (`PopulationLocation.City`), a formation record the region whose member hexes hold its starting anchor hex (R-POP-004); a source with no region is refused. Census records start with their reception done (`reception.turns`), so R-VET-001's received-free-civilian work XP can apply to them. One census record, the last `census/haifa` ordinal, is the training centre's veteran pioneer teacher (#1689, `start.pioneer_teachers` 1): a pioneer at the veteran tier with work XP 0 and no assignment, since a teaching teacher with no pupil is refused (R-TRAIN-008); see R-POP-004. The 20 opening field farmers (#1725 PR 4) are records too, on top of the census: source `field/<label>`, ordinal 0, each a free civilian farmer working its field from turn 1 and living in the field's host, split 1:2:1 per host (`HistoricalPopulation.FieldFarmerHosts`; 1 / 18 / 1 in all), work XP 0 and reception done; the dark start adds one housing place per farmer in a census host (18 of 20; Nir Am and Nirim have no city record); see R-POP-004. Each formation record carries one issued military item (`units_1948/<row id>/<ordinal>`, recorded as paid), apart from the spare Arms (#1717). A formation record's military qualification is its type's `unit_types.yaml` class, and its combat XP is `gdd03-start.yaml`'s `formation_combat_xp` (#1689 rows 5 to 8, R-POP-004). The public `NewGame` does not call it, because an initialized ledger refuses the aggregate systems a `gdd-0.3` game still runs (R-POP-002). The dark start, `NewGame`'s internal fixture-only overload (#1725 PR 5), initializes the same ledger in place (`HistoricalPopulation.Initialize`, all or nothing) before `Pools.Init`, which then starts Food at `cover_months` of the ledger's rations; it places the starting forces against the ledger's soldiers and fires no opening event, since `EventSystem.Trigger` still refuses a ledger. The test `HistoricalPopulationTests` checks it, city by city and formation by formation, against the aggregate start of the same content.
+`HistoricalPopulation.Inventory` is internal and reads the shipped content under exact `gdd-0.3`: one free-civilian row per census city start unit (R-CITY-007) and one active-soldier row per population unit of each Israeli starting formation of `map/units_1948.yaml` (R-UNIT-006), at `rules.yaml`'s 1,000 people a unit (owner, 1 November 2026, D2). Rows carry a source key (`census/<city id>`, `units_1948/<row id>`) and a within-source ordinal, in R-POP-001's order. Enemy formations and dated arrivals (R-UNIT-009) are not in it: an own dated brigade is bound at the start with no record and arrives on its day as new active-soldier records (`StartingForces.Arrive`, #1725 PR 7, producer 08; see R-UNIT-009). It builds no `PopulationUnit` itself. `HistoricalPopulation.LedgerFixture` (internal, fixture-only) turns it into an initialized Historical ledger and binds each record to a region of `content/regions.yaml`: a census record takes the region whose `member_locations` hold its city, and its location names that city (`PopulationLocation.City`), a formation record the region whose member hexes hold its starting anchor hex (R-POP-004); a source with no region is refused. Census records start with their reception done (`reception.turns`), so R-VET-001's received-free-civilian work XP can apply to them. One census record, the last `census/haifa` ordinal, is the training centre's veteran pioneer teacher (#1689, `start.pioneer_teachers` 1): a pioneer at the veteran tier with work XP 0 and no assignment, since a teaching teacher with no pupil is refused (R-TRAIN-008); see R-POP-004. The 20 opening field farmers (#1725 PR 4) are records too, on top of the census: source `field/<label>`, ordinal 0, each a free civilian farmer working its field from turn 1 and living in the field's host, split 1:2:1 per host (`HistoricalPopulation.FieldFarmerHosts`; 1 / 18 / 1 in all), work XP 0 and reception done; the dark start adds one housing place per farmer in a census host (18 of 20; Nir Am and Nirim have no city record); see R-POP-004. Each formation record carries one issued military item (`units_1948/<row id>/<ordinal>`, recorded as paid), apart from the spare Arms (#1717). A formation record's military qualification is its type's `unit_types.yaml` class, and its combat XP is `gdd03-start.yaml`'s `formation_combat_xp` (#1689 rows 5 to 8, R-POP-004). The public `NewGame` does not call it, because an initialized ledger refuses the aggregate systems a `gdd-0.3` game still runs (R-POP-002). The dark start, `NewGame`'s internal fixture-only overload (#1725 PR 5), initializes the same ledger in place (`HistoricalPopulation.Initialize`, all or nothing) before `Pools.Init`, which then starts Food at `cover_months` of the ledger's rations; it places the starting forces against the ledger's soldiers and fires no opening event, since `EventSystem.Trigger` still refuses a ledger. The test `HistoricalPopulationTests` checks it, city by city and formation by formation, against the aggregate start of the same content.
diff --git a/docs/rules/mvp.md b/docs/rules/mvp.md
index 683e4d6bf..bd1fd29c5 100644
--- a/docs/rules/mvp.md
+++ b/docs/rules/mvp.md
@@ -276,7 +276,7 @@ R-UNIT-007: Open mode starts no forces (Q-START-2, owner, 15 October 2026); `Sim
R-UNIT-008: Artillery and the armoured car are acquired by training at a military camp (Q-ARTY-3, owner, 15 October 2026, #375: "Take all recommendations"; Phase 5 PR 9, part 2, #748). Each is a `Train` track (R-TRAIN-001 to R-TRAIN-003): `Train(city, artillery, n)` takes n groups of the city's civilians without work as the crew, pays n times the type's `training_cost` in Money and takes n times its `training_arms` in Arms when it starts, refused for a short stock and returned on cancel as R-ARMS-003 says for recruits. A finished cohort becomes one formation of its type at the city's settlement hex, its strength the cohort's count, housed in that city (R-UNIT-003, R-HOUSE-003, Q-HOUSE-5). It is not a recruit, so service never promotes it (R-UNIT-004); it pays the military upkeep (R-UNIT-010). The loader requires `training_arms` (at least 1) on a trained military type other than the recruit, whose Arms stay `mvp.arms_per_recruit_group`, and refuses it on any other type. The values are agent defaults proposed on #748 for the owner to set or accept (https://github.com/eyalgolan/statecraft-israel/issues/748#issuecomment-6341182392): 3 turns, IL 1.0m a group, and 3 Arms a group for the guns, 2 for the armoured car. Event grants of either type stay with Phase 7 (D-H2, R-EFX-003).
-R-UNIT-009: A row of `map/units_1948.yaml` that meets R-UNIT-006 except that its `strength`'s `as_of` is after the start day arrives on that day (#1241, owner, 21 October 2026, answer 1(a): "enters the game on that date with its sourced strength, read from its row as a dated arrival"): in the GDD loop's resolution (step 9, after the immigrants' arrivals) of the turn that starts before that day and ends on or after it, once, on the hex of the anchor whose window covers that day, with that strength in population units and its side's type, as a starting force. Such rows follow the starting rows in `Content.StartingForces`, and their unit ids are reserved when the game starts, so unit i is still row i and the release gate names them too. An arrival ignores the stack limit and the hex's other units, as a starting force does. A row whose `as_of` is before the start starts nothing; the loader refuses an `as_of` that is not a `YYYY-MM-DD` date, naming the file and the row. Only a player-side (`side: israel`) row arrives: the loader refuses an enemy-side row whose `as_of` is after the start, naming the file and the row, and the resolver refuses to add one (R-ENEMY-004). Today the 7th Brigade arrives: 1,650 on 24 May 1948 at Hulda, 2 units from the 15 June 1948 turn.
+R-UNIT-009: A row of `map/units_1948.yaml` that meets R-UNIT-006 except that its `strength`'s `as_of` is after the start day arrives on that day (#1241, owner, 21 October 2026, answer 1(a): "enters the game on that date with its sourced strength, read from its row as a dated arrival"): in the GDD loop's resolution (step 9, after the immigrants' arrivals) of the turn that starts before that day and ends on or after it, once, on the hex of the anchor whose window covers that day, with that strength in population units and its side's type, as a starting force. Such rows follow the starting rows in `Content.StartingForces`, and their unit ids are reserved when the game starts, so unit i is still row i and the release gate names them too. An arrival ignores the stack limit and the hex's other units, as a starting force does. A row whose `as_of` is before the start starts nothing; the loader refuses an `as_of` that is not a `YYYY-MM-DD` date, naming the file and the row. Only a player-side (`side: israel`) row arrives: the loader refuses an enemy-side row whose `as_of` is after the start, naming the file and the row, and the resolver refuses to add one (R-ENEMY-004). Today the 7th Brigade arrives: 1,650 on 24 May 1948 at Hulda, 2 units from the 15 June 1948 turn. Under exact `gdd-0.3` it also runs on a game with an initialized Historical ledger (R-POP-002, R-POP-004; #1725 PR 7, producer 08), where the arriving brigade's people are ledger records (owner, 8 November 2026, answers to the coordinator): "Soldiers of brigade (Recommended)", so each is an active soldier whose ActiveService target is the brigade (`units_1948/<row id>`); "New people (Recommended)", so the brigade brings new records, one per strength unit at the ledger's 1,000 people a record (the 7th Brigade's 1,650 men are 2 units, so 2 records), with new ids, none taken from the civilians; "1, like the others", so the 7th Brigade's soldiers start with combat XP 1, its `content/gdd03-start.yaml` `formation_combat_xp` row, as the starting brigades' do, and the qualification of its type's class (`infantry`), as theirs; "Apart from Arms (Recommended)", so each carries one issued military item, `units_1948/<row id>/<ordinal>`, owned and recorded as paid, and the Arms stock is untouched, as at the start. Coordinator calls, 8 November 2026 (not owner rulings): the dark start binds each own dated brigade at the start (its service target and arrival region, with no record), so the arrival only registers its records; the records are located in the region of the arrival anchor's hex, region-only, as a starting formation's (the 7th Brigade's Hulda hex is in `central_plain`); and a brigade whose records are already registered adds nothing, so a replay of the turn adds nobody twice. Its records are registered all or nothing before its unit is added; its reception is 0 and it has no profession, as a starting soldier. Its unit is the aggregate game's, with combat XP 0. A synthetic or Open ledger is still refused.
R-UNIT-010: In step 7, after production, Food consumption/imports and civilian upkeep, and before housing, each Israeli military formation pays `military_upkeep_per_turn` Money, including a formation that graduated this turn. The owner-accepted initial rate is IL 0.05m per formation per turn, independent of strength and turn length, a labelled design value under Q-GEN-1 (19 October 2026, https://github.com/eyalgolan/statecraft-israel/pull/1130#issuecomment-6269103829). Civilian, enemy and default records without a military side pay none. R-MONEY-003 borrows a shortfall; no strength is removed or Arms consumed for upkeep (Q-UNIT-3; owner, 15 October 2026). The loader requires a finite rate >= 0. R-ARMS-003 remains the training/refund rule; the Phase 5 plan's suggested reuse of that id is obsolete.
@@ -609,7 +609,7 @@ R-POP-002: A ledger record has exactly one typed status and assignment, validate
R-POP-003: Clone copies all ledger containers; immutable records and frozen bindings may be shared. The canonical writer emits a gdd-0.3-only section ordered by numeric population id, with fixed field order, stable machine tokens, invariant integer formatting and length-prefixed reference strings. It covers every record/assignment/equipment/reference field, binding, creation/loss provenance and allocator even after the last combat loss. Legacy/gdd-0.1 emit no ledger section or allocator marker. A location's optional city (a `regions.yaml` member location of its region that is a census city of `cities.yaml` or one of that region's field hosts, where R-POP-004 houses own people: a settlement hosts only F19 and F20, owner, 7 November 2026, #1689: "These two only (Recommended)"; any other, including a locality, a `sites.yaml` id or a map location, is refused when a fixture is created, naming the city and the region, R-POP-002) is written after its other fields as `|city=` with a length-prefixed id, only when set, as R-UNIT-002's `|home=` is, so a location without a city keeps its canonical text and hash. R-SAVE-001/002 still govern identity mismatch refusal and replay: no ledger snapshot or new command syntax is added in this foundation, and fixture injection is not replay evidence. Existing unpublished schema-4 draft hashes change; no migration promise is made.
-R-POP-004: The Historical start inventory under exact `gdd-0.3` (#1689; owner, 1 November 2026, D2: "Approve all six (Recommended)", and D4). It is read from the same content as the aggregate start: each census city (R-CITY-006) gives its R-CITY-007 start units as free civilians, and each Israeli starting formation of `map/units_1948.yaml` (R-UNIT-006) gives its strength as active soldiers. The 20 farmer units are added to the census total (owner, 7 November 2026: "On top, change the rule (Recommended)", which reverses this rule's earlier "no more and no less"), one a field, with source key `field/<label>` (F01 to F20 of `regions.yaml` `field_hexes`) and ordinal 0 (maintainer call, the coordinator, 7 November 2026, so the key stays if a host changes); see the farmers below. Enemy formations are not own population, and a dated arrival (R-UNIT-009) is not in the start inventory: it takes new ids when it arrives (Q11). Counts use `rules.yaml`'s `people_per_unit` (1,000, D2), as R-CITY-007 and R-UNIT-006 do; the `gdd-0.3` catalogue's `population.people_per_unit` (10,000) is Open mode's (D2). A city's records have source key `census/<city id>` and a formation's `units_1948/<row id>`, each with within-source ordinals from 0, so R-POP-001's order (source key by ordinal string comparison, then ordinal) gives the ascending population ids that Q10's "N units" commands take. Legacy and `gdd-0.1` content refuse it. It reads no RNG and changes no state. It is not yet wired into the public `Simulation.NewGame` (only the internal dark start of R-POP-002 calls it): an initialized ledger refuses every aggregate system (R-POP-002), so a new `gdd-0.3` game keeps the aggregate start until the producers are integrated. A fixture builder (`HistoricalPopulation.LedgerFixture`, internal, fixture-only) turns the inventory into an initialized Historical ledger with mode Historical (R-POP-001's 1,000 a record), each record in a region of `content/regions.yaml` (#1691): a census record takes the region whose `member_locations` hold its city (`census/tel_aviv` is `tel_aviv_jaffa`; Jaffa gets no records), and its location names that city, and a formation record takes the region whose member hexes hold the formation's starting anchor hex (owner, 3 November 2026, #1689 open question 1: "Its anchor hex's region (Recommended)"). A source with no region is refused; no region is invented. Census records are free civilians with no assignment and their reception done: they start at `reception.turns`, the "actual reception turns before free-civilian status" (`docs/gdd/balance.md:91`), the ledger's cap (R-POP-002), since R-VET-001 gives work XP only to a received free civilian (an agent reading of `balance.md:91`, not an owner ruling); formation records keep 0, which no ruling sets. Formation records are active soldiers whose service target is their own formation. Each formation record carries one issued military item, id `units_1948/<row id>/<ordinal>`, owned and recorded as paid; census records carry none. One census record is the training centre's veteran pioneer teacher (owner, 7 November 2026, [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704565066): "Yes to all three (Recommended)", whose third part reads "the training centre's one veteran pioneer teacher is a Haifa census unit"): `content/gdd03-balance.yaml`'s `start.pioneer_teachers` (1, Agreed, "included in population total") gives the count, so no record is added, and the fixture refuses any other value, since no ruling places a second teacher. It is the last `census/haifa` ordinal (maintainer call, the coordinator eyalgolan-30, 7 November 2026), a free civilian pioneer at the veteran tier (R-TRAIN-005: "a veteran of the matching profession"), with work XP 0 (owner, 7 November 2026, relayed by the coordinator: "0 (Recommended)"), and no assignment, since R-TRAIN-008 refuses a teaching teacher with no pupil; otherwise it is like any other census record. It is "Takeable, but last (Recommended)" (owner, 7 November 2026, relayed by the coordinator): there is no guard, and as the highest `census/haifa` id it is the last record that Q10's "N units" commands and #1692's job default reach. No ledger producer runs the job default or a Train order yet. Issued items are apart from the spare Arms: the fixture leaves the Arms stock untouched, and a new game still starts with `arms_start`'s 12 (#1717, 27M-24: "The starting formations are equipped, and the Arms stock starts at 12"). Still not in the inventory or the fixture: the work assignments of the employed share. The opening field farmers are (#1725 PR 4; the owner's 1:2:1 novice/trained/veteran ratio applies per host, which gives 1 / 18 / 1 nationally: owner, 7 November 2026, "Per host, 1/18/1 (Recommended)", [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704985642)). `HistoricalPopulation.FieldFarmerHosts` (internal) gives each `regions.yaml` `field_hexes` host its fields' farmers, one a field (owner, 3 November 2026, #1694: "One farmer per field (Recommended)"), split 1:2:1 per host by `Gdd03FarmerTierSplit` in field-label order; the 20 match `start.prepared_fields` (Agreed), and any other total, or a field with no host, is refused. Each farmer is a free civilian farmer staffed on its field from turn 1 (owner, 7 November 2026, [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704565066): "Yes to all three (Recommended)"): its assignment is Work on the field's target (`field/<q>,<r>`, as `Gdd03FieldFixture`), its location the field's region with its host as the city (Nir Am and Nirim for F19 and F20, R-POP-003). Tiberias hosts six fields, F03 novice, F04 to F07 trained and F08 veteran (owner, 7 November 2026, relayed by the coordinator: "F08 veteran, F03 novice (Recommended)"); every other host has one or two, all trained. Work XP is 0 for every tier (owner, relayed by the coordinator: "0 for all (Recommended)"; veterans "0 (Recommended)", [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6710877137)). Reception is done (`reception.turns`), as for the census (maintainer call, the coordinator, 7 November 2026). No tools: post-MVP (#1693, owner, 3 November 2026, answer 1: "Tools in the MVP: no."). `field/` rows, like `census/` and `units_1948/` rows, are refused outside a Historical ledger (R-POP-001). Farmers hold a field, not a job, so they are not among a city's employed (R-CITY-007) or civilians, not in R-OBJ-004's sums, and not among the people without a job a `Train` order takes (R-TRAIN-001): the dark start's aggregate cities keep the census's counts. The dark start adds one housing place per farmer to each census host's housing capacity (same ruling); Nir Am and Nirim have no `cities.yaml` record and get none for now (owner, relayed by the coordinator: "None for those two for now (Recommended)"), so 18 of the 20 places exist until the housing producer (#1725 PR 7). The public `NewGame` is unchanged. The formations' rows 5 to 8 are in the fixture (owner, 7 November 2026, #1689 comment 6704389240: "Veteran for all 8 (Recommended)" and "1 each, Negev 0 (Recommended)", Negev's 0 a labelled stand-in). The veteran level lives on the formation, a `veteran_soldier` (R-UNIT-006) that is each soldier's ActiveService target, so a formation record's military qualification is its type's `unit_types.yaml` class (`infantry`), the source basic-training graduates use, with no new level field (maintainer call, eyalgolan-30's coordinator, 7 November 2026). Its combat XP is `content/gdd03-start.yaml`'s `formation_combat_xp`: 1 for Golani, Carmeli, Alexandroni, Kiryati, Givati, Etzioni and Harel, 0 for Negev. The loader requires the list, refuses a row that is not an own opening formation, a duplicate, a missing formation or a value outside 0 to `military.combat_xp_full`, and the fixture refuses without it (no fallback). Only the ledger fixture reads it: the units `NewGame` starts with keep 0 combat XP (same maintainer call); a `veteran_soldier` gains none (R-UNIT-011). The paragraphs below record the owner's decision on each. The ledger scale for this start is no longer Deferred: a Historical ledger fixture counts each record at `rules.yaml`'s `people_per_unit` for the start day, 1,000 people (R-POP-001; D2: "The Historical MVP keeps main's start: census cities at 1,000 people a unit (`R-CITY-007`)").
+R-POP-004: The Historical start inventory under exact `gdd-0.3` (#1689; owner, 1 November 2026, D2: "Approve all six (Recommended)", and D4). It is read from the same content as the aggregate start: each census city (R-CITY-006) gives its R-CITY-007 start units as free civilians, and each Israeli starting formation of `map/units_1948.yaml` (R-UNIT-006) gives its strength as active soldiers. The 20 farmer units are added to the census total (owner, 7 November 2026: "On top, change the rule (Recommended)", which reverses this rule's earlier "no more and no less"), one a field, with source key `field/<label>` (F01 to F20 of `regions.yaml` `field_hexes`) and ordinal 0 (maintainer call, the coordinator, 7 November 2026, so the key stays if a host changes); see the farmers below. Enemy formations are not own population, and a dated arrival (R-UNIT-009) is not in the start inventory: it takes new ids when it arrives (Q11), as R-UNIT-009 records; its service target and region are bound at the start with no record (coordinator call, 8 November 2026). Counts use `rules.yaml`'s `people_per_unit` (1,000, D2), as R-CITY-007 and R-UNIT-006 do; the `gdd-0.3` catalogue's `population.people_per_unit` (10,000) is Open mode's (D2). A city's records have source key `census/<city id>` and a formation's `units_1948/<row id>`, each with within-source ordinals from 0, so R-POP-001's order (source key by ordinal string comparison, then ordinal) gives the ascending population ids that Q10's "N units" commands take. Legacy and `gdd-0.1` content refuse it. It reads no RNG and changes no state. It is not yet wired into the public `Simulation.NewGame` (only the internal dark start of R-POP-002 calls it): an initialized ledger refuses every aggregate system (R-POP-002), so a new `gdd-0.3` game keeps the aggregate start until the producers are integrated. A fixture builder (`HistoricalPopulation.LedgerFixture`, internal, fixture-only) turns the inventory into an initialized Historical ledger with mode Historical (R-POP-001's 1,000 a record), each record in a region of `content/regions.yaml` (#1691): a census record takes the region whose `member_locations` hold its city (`census/tel_aviv` is `tel_aviv_jaffa`; Jaffa gets no records), and its location names that city, and a formation record takes the region whose member hexes hold the formation's starting anchor hex (owner, 3 November 2026, #1689 open question 1: "Its anchor hex's region (Recommended)"). A source with no region is refused; no region is invented. Census records are free civilians with no assignment and their reception done: they start at `reception.turns`, the "actual reception turns before free-civilian status" (`docs/gdd/balance.md:91`), the ledger's cap (R-POP-002), since R-VET-001 gives work XP only to a received free civilian (an agent reading of `balance.md:91`, not an owner ruling); formation records keep 0, which no ruling sets. Formation records are active soldiers whose service target is their own formation. Each formation record carries one issued military item, id `units_1948/<row id>/<ordinal>`, owned and recorded as paid; census records carry none. One census record is the training centre's veteran pioneer teacher (owner, 7 November 2026, [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704565066): "Yes to all three (Recommended)", whose third part reads "the training centre's one veteran pioneer teacher is a Haifa census unit"): `content/gdd03-balance.yaml`'s `start.pioneer_teachers` (1, Agreed, "included in population total") gives the count, so no record is added, and the fixture refuses any other value, since no ruling places a second teacher. It is the last `census/haifa` ordinal (maintainer call, the coordinator eyalgolan-30, 7 November 2026), a free civilian pioneer at the veteran tier (R-TRAIN-005: "a veteran of the matching profession"), with work XP 0 (owner, 7 November 2026, relayed by the coordinator: "0 (Recommended)"), and no assignment, since R-TRAIN-008 refuses a teaching teacher with no pupil; otherwise it is like any other census record. It is "Takeable, but last (Recommended)" (owner, 7 November 2026, relayed by the coordinator): there is no guard, and as the highest `census/haifa` id it is the last record that Q10's "N units" commands and #1692's job default reach. No ledger producer runs the job default or a Train order yet. Issued items are apart from the spare Arms: the fixture leaves the Arms stock untouched, and a new game still starts with `arms_start`'s 12 (#1717, 27M-24: "The starting formations are equipped, and the Arms stock starts at 12"). Still not in the inventory or the fixture: the work assignments of the employed share. The opening field farmers are (#1725 PR 4; the owner's 1:2:1 novice/trained/veteran ratio applies per host, which gives 1 / 18 / 1 nationally: owner, 7 November 2026, "Per host, 1/18/1 (Recommended)", [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704985642)). `HistoricalPopulation.FieldFarmerHosts` (internal) gives each `regions.yaml` `field_hexes` host its fields' farmers, one a field (owner, 3 November 2026, #1694: "One farmer per field (Recommended)"), split 1:2:1 per host by `Gdd03FarmerTierSplit` in field-label order; the 20 match `start.prepared_fields` (Agreed), and any other total, or a field with no host, is refused. Each farmer is a free civilian farmer staffed on its field from turn 1 (owner, 7 November 2026, [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6704565066): "Yes to all three (Recommended)"): its assignment is Work on the field's target (`field/<q>,<r>`, as `Gdd03FieldFixture`), its location the field's region with its host as the city (Nir Am and Nirim for F19 and F20, R-POP-003). Tiberias hosts six fields, F03 novice, F04 to F07 trained and F08 veteran (owner, 7 November 2026, relayed by the coordinator: "F08 veteran, F03 novice (Recommended)"); every other host has one or two, all trained. Work XP is 0 for every tier (owner, relayed by the coordinator: "0 for all (Recommended)"; veterans "0 (Recommended)", [#1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6710877137)). Reception is done (`reception.turns`), as for the census (maintainer call, the coordinator, 7 November 2026). No tools: post-MVP (#1693, owner, 3 November 2026, answer 1: "Tools in the MVP: no."). `field/` rows, like `census/` and `units_1948/` rows, are refused outside a Historical ledger (R-POP-001). Farmers hold a field, not a job, so they are not among a city's employed (R-CITY-007) or civilians, not in R-OBJ-004's sums, and not among the people without a job a `Train` order takes (R-TRAIN-001): the dark start's aggregate cities keep the census's counts. The dark start adds one housing place per farmer to each census host's housing capacity (same ruling); Nir Am and Nirim have no `cities.yaml` record and get none for now (owner, relayed by the coordinator: "None for those two for now (Recommended)"), so 18 of the 20 places exist until the housing producer (#1725 PR 7). The public `NewGame` is unchanged. The formations' rows 5 to 8 are in the fixture (owner, 7 November 2026, #1689 comment 6704389240: "Veteran for all 8 (Recommended)" and "1 each, Negev 0 (Recommended)", Negev's 0 a labelled stand-in). The veteran level lives on the formation, a `veteran_soldier` (R-UNIT-006) that is each soldier's ActiveService target, so a formation record's military qualification is its type's `unit_types.yaml` class (`infantry`), the source basic-training graduates use, with no new level field (maintainer call, eyalgolan-30's coordinator, 7 November 2026). Its combat XP is `content/gdd03-start.yaml`'s `formation_combat_xp`: 1 for Golani, Carmeli, Alexandroni, Kiryati, Givati, Etzioni and Harel, 0 for Negev. The list also names each own brigade dated after the start (R-UNIT-009): 1 for the 7th Brigade (owner, 8 November 2026: "1, like the others"). The loader requires the list, refuses a row that is not an own opening or dated formation, a duplicate, a missing formation or a value outside 0 to `military.combat_xp_full`, and the fixture refuses without it (no fallback). Only the ledger fixture reads it: the units `NewGame` starts with keep 0 combat XP (same maintainer call); a `veteran_soldier` gains none (R-UNIT-011). The paragraphs below record the owner's decision on each. The ledger scale for this start is no longer Deferred: a Historical ledger fixture counts each record at `rules.yaml`'s `people_per_unit` for the start day, 1,000 people (R-POP-001; D2: "The Historical MVP keeps main's start: census cities at 1,000 people a unit (`R-CITY-007`)").
The four opening-ledger values were Deferred pending a separate sourced draft for owner approval (4 November 2026, Q24; the coordinator asked: "How should the four deferred opening-ledger values be approved before Historical NewGame initializes the ledger?"; the owner answered: "do the recommended for all"; the chosen option read: "Request and approve a separate sourced draft for employed assignments, farmer identities, formation qualifications and combat XP before wiring NewGame"; [recorded on #1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6623135448)). Farmer home cities needed a source-backed city-by-field proposal for owner approval (4 November 2026, Q26; the coordinator asked: "How should the census-city home of each opening field’s farmer be selected when its region contains several cities?"; the owner answered: "do the recommended for all"; the chosen option read: "Have an agent prepare a source-backed city-by-field proposal for owner approval"; [recorded on #1717](https://github.com/eyalgolan/statecraft-israel/issues/1717#issuecomment-6623136302)).
Owner decision on both drafts, 7 November 2026: "all reccomended in "Decisions for the owner: the GDD 0.3 starting population (#1689) and where the field farmers live (#1717)" - approved" ([recorded on #1689](https://github.com/eyalgolan/statecraft-israel/issues/1689#issuecomment-6703676150)). This wires nothing into `Simulation.NewGame`.
diff --git a/sim/Statecraft.Sim.Tests/Gdd03StartFacilitiesTests.cs b/sim/Statecraft.Sim.Tests/Gdd03StartFacilitiesTests.cs
index c1827e6c0..159da88a6 100644
--- a/sim/Statecraft.Sim.Tests/Gdd03StartFacilitiesTests.cs
+++ b/sim/Statecraft.Sim.Tests/Gdd03StartFacilitiesTests.cs
@@ -128,8 +128,8 @@ public class Gdd03StartFacilitiesTests
public static IEnumerable<object[]> InvalidOverlays()
{
- yield return Case("ruleset: gdd-0.1\nmilitary_camps: []\n" + Formations(AllEight()), "ruleset", "must be gdd-0.3");
- yield return Case("ruleset: gdd-0.3\n" + Formations(AllEight()), "military_camps", "must be a list");
+ yield return Case("ruleset: gdd-0.1\nmilitary_camps: []\n" + Formations(AllOwn()), "ruleset", "must be gdd-0.3");
+ yield return Case("ruleset: gdd-0.3\n" + Formations(AllOwn()), "military_camps", "must be a list");
yield return Case(One("missing", "military_schneller"), "military_camps[0].city", "must name an existing city");
yield return Case(Two(("tel_aviv", "military_tel_litvinsky"), ("tel_aviv", "military_schneller")),
"military_camps[1].city", "duplicate city");
@@ -140,21 +140,23 @@ public class Gdd03StartFacilitiesTests
yield return Case(One("tel_aviv", "military_tel_litvinsky"), "military_camps",
"effective military-camp city count 1 must equal start.military_camps 2");
// #1689 PR 2: formation_combat_xp is required, like every list the loader reads, and names each own opening formation
- // once, with 0 to military.combat_xp_full (5).
+ // once, with 0 to military.combat_xp_full (5). #1725 PR 7, producer 08: and each own dated brigade (R-UNIT-009), the
+ // 7th Brigade (owner, 8 November 2026: "1, like the others").
yield return Case(Camps(("tel_aviv", "military_tel_litvinsky"), ("jerusalem", "military_schneller")),
"formation_combat_xp", "must be a list");
const string full = "an integer from 0 to military.combat_xp_full 5";
yield return Case(Xp(("golani", "1"), ("golani", "1")), "formation_combat_xp[1].row", "duplicate formation");
- yield return Case(Xp(("yiftach", "1")), "formation_combat_xp[0].row", "must name an own opening formation of map/units_1948.yaml");
- yield return Case(Xp(("arab_legion", "1")), "formation_combat_xp[0].row", "must name an own opening formation of map/units_1948.yaml");
+ yield return Case(Xp(("yiftach", "1")), "formation_combat_xp[0].row", "must name an own opening or dated formation of map/units_1948.yaml");
+ yield return Case(Xp(("arab_legion", "1")), "formation_combat_xp[0].row", "must name an own opening or dated formation of map/units_1948.yaml");
yield return Case(Xp(("golani", "-1")), "formation_combat_xp[0].combat_xp", "required: " + full);
yield return Case(Xp(("golani", "6")), "formation_combat_xp[0].combat_xp", "required: " + full);
yield return Case(Xp(("golani", "null")), "formation_combat_xp[0].combat_xp", "required: " + full);
- yield return Case(Xp(AllEight().Where(x => x.Row != "negev").ToArray()), "formation_combat_xp", "missing opening formation negev");
+ yield return Case(Xp(AllOwn().Where(x => x.Row != "negev").ToArray()), "formation_combat_xp", "missing own formation negev");
+ yield return Case(Xp(AllOwn().Where(x => x.Row != "brigade_7").ToArray()), "formation_combat_xp", "missing own formation brigade_7");
}
- static (string Row, string Xp)[] AllEight() => new[] { "golani", "carmeli", "alexandroni", "kiryati", "givati", "etzioni",
- "harel", "negev" }.Select(r => (r, r == "negev" ? "0" : "1")).ToArray();
+ static (string Row, string Xp)[] AllOwn() => new[] { "golani", "carmeli", "alexandroni", "kiryati", "givati", "etzioni",
+ "brigade_7", "harel", "negev" }.Select(r => (r, r == "negev" ? "0" : "1")).ToArray();
static string Xp(params (string Row, string Xp)[] rows) =>
Camps(("tel_aviv", "military_tel_litvinsky"), ("jerusalem", "military_schneller")) + Formations(rows);
@@ -170,7 +172,7 @@ public class Gdd03StartFacilitiesTests
static object[] Case(string yaml, string field, string reason) => new object[] { yaml, field, reason };
static string One(string city, string location) => Two((city, location));
- static string Two(params (string City, string Location)[] rows) => Camps(rows) + Formations(AllEight());
+ static string Two(params (string City, string Location)[] rows) => Camps(rows) + Formations(AllOwn());
static string Camps(params (string City, string Location)[] rows) =>
"ruleset: gdd-0.3\nmilitary_camps:\n" + string.Concat(rows.Select(x => $" - {{ city: {x.City}, location: {x.Location} }}\n"));
static string Formations((string Row, string Xp)[] rows) =>
diff --git a/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs b/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs
index b481b862b..dbcebd4e3 100644
--- a/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs
+++ b/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs
@@ -101,7 +101,11 @@ public class HistoricalPopulationTests
.Where(x => x.StartsWith(HistoricalPopulation.FormationPrefix, StringComparison.Ordinal))
.Select(x => x.Substring(HistoricalPopulation.FormationPrefix.Length)).Distinct(StringComparer.Ordinal).OrderBy(r => r, StringComparer.Ordinal);
Assert.Equal(opening, sources);
- Assert.Equal(opening, c.Gdd03FormationCombatXp!.Keys);
+ // #1725 PR 7, producer 08: formation_combat_xp also names each own dated brigade (R-UNIT-009), and only those.
+ var dated = HistoricalPopulation.DatedFormations(c).Select(f => f.Row).ToList();
+ Assert.Equal(new[] { "brigade_7" }, dated);
+ Assert.All(HistoricalPopulation.DatedFormations(c), f => Assert.True(f.Side == Movement.PlayerSide && f.Arrives != null && f.Strength > 0));
+ Assert.Equal(opening.Concat(dated).OrderBy(r => r, StringComparer.Ordinal), c.Gdd03FormationCombatXp!.Keys);
Assert.Equal(opening, HistoricalPopulation.OpeningFormationRows(c).OrderBy(r => r, StringComparer.Ordinal));
}
@@ -529,13 +533,14 @@ public class HistoricalPopulationTests
Assert.All(s.Units.Values, u => Assert.Equal(0, u.CombatXp));
}
- // The shipped gdd03-start.yaml names each own opening formation once, with the owner's values.
+ // The shipped gdd03-start.yaml names each own opening formation once, with the owner's values, and the 7th Brigade, which
+ // arrives later (R-UNIT-009), with 1 (owner, 8 November 2026: "1, like the others").
[Fact]
public void ShippedStartGivesEachOpeningFormationItsCombatXp()
{
var c = Real(true);
- Assert.Equal(new[] { ("alexandroni", 1), ("carmeli", 1), ("etzioni", 1), ("givati", 1), ("golani", 1), ("harel", 1),
- ("kiryati", 1), ("negev", 0) }, c.Gdd03FormationCombatXp!.Select(x => (x.Key, x.Value)));
+ Assert.Equal(new[] { ("alexandroni", 1), ("brigade_7", 1), ("carmeli", 1), ("etzioni", 1), ("givati", 1), ("golani", 1),
+ ("harel", 1), ("kiryati", 1), ("negev", 0) }, c.Gdd03FormationCombatXp!.Select(x => (x.Key, x.Value)));
}
// R-POP-004, 27M-24: the issued items are distinct, one per population unit of each own starting formation, so their
diff --git a/sim/Statecraft.Sim.Tests/LedgerBrigadeArrivalTests.cs b/sim/Statecraft.Sim.Tests/LedgerBrigadeArrivalTests.cs
new file mode 100644
index 000000000..3879c8464
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/LedgerBrigadeArrivalTests.cs
@@ -0,0 +1,192 @@
+using System.Globalization;
+using Statecraft.Sim;
+
+/// <summary>#1725 PR 7, producer draft 08 (R-UNIT-009 on the ledger): on a game with an initialized Historical ledger, a
+/// map/units_1948.yaml brigade dated after the start (today the 7th Brigade) arrives as its unit, as in the aggregate game,
+/// and as one active-soldier record per strength unit serving in it. Owner, 8 November 2026: "Soldiers of brigade
+/// (Recommended)", "1, like the others", "New people (Recommended)" and "Apart from Arms (Recommended)". Coordinator calls,
+/// 8 November 2026 (not owner rulings): the dated brigade is bound at the start, its records are in its anchor hex's
+/// region, and a replay adds nobody.</summary>
+public class LedgerBrigadeArrivalTests
+{
+ static Content Gdd03() => HistoricalPopulationTests.Real(true);
+
+ const string Row = "brigade_7";
+ static readonly string Target = HistoricalPopulation.FormationPrefix + Row;
+ // R-UNIT-009: "Today the 7th Brigade arrives: 1,650 on 24 May 1948 at Hulda, 2 units from the 15 June 1948 turn."
+ static readonly DateTime Next = new DateTime(1948, 6, 15);
+
+ static GameState Dark(Content c) => Simulation.NewGame(c, 1, Mode.Historical, darkStart: true);
+
+ static List<PopulationUnit> Serving(GameState s) => s.PopulationLedger.Units
+ .Where(p => p.Assignment.Target == Target).ToList();
+
+ static int Index(Content c) => c.StartingForces.FindIndex(f => f.Row == Row);
+
+ // R-UNIT-009, R-UNIT-006, R-POP-004: the 7th Brigade's sourced 1,650 men are its strength in population units, the
+ // nearest unit with a half up (2 at rules.yaml's people_per_unit 1,000), as for a starting brigade, and the ledger
+ // counts each record at the same 1,000.
+ [Fact]
+ public void TheSeventhBrigadeIsTwoUnitsOfOneThousandFromItsSourcedStrength()
+ {
+ var c = Gdd03();
+ var f = c.StartingForces[Index(c)];
+ var ppu = c.RulesAt(c.Rules.Start).Mvp!.PeoplePerUnit;
+ Assert.Equal(1000, ppu);
+ Assert.Equal(new DateTime(1948, 5, 24), f.Arrives);
+ Assert.Equal(Movement.PlayerSide, f.Side);
+ Assert.Equal(Cities.StartUnits(1650m, ppu), f.Strength);
+ Assert.Equal(2, f.Strength);
+ Assert.Equal(ppu, Dark(c).PopulationLedger.PeoplePerUnit);
+ }
+
+ // Owner, 8 November 2026: "Soldiers of brigade (Recommended)", "1, like the others", "New people (Recommended)",
+ // "Apart from Arms (Recommended)". Coordinator call (Q6 (a)): the records are in the region of the arrival anchor's hex.
+ [Fact]
+ public void TheSeventhBrigadeArrivesAsNewSoldierRecordsOfItsBrigade()
+ {
+ var c = Gdd03();
+ var s = Dark(c);
+ var i = Index(c);
+ var f = c.StartingForces[i];
+ var twin = Simulation.NewGame(c, 1, Mode.Historical);
+ var next = s.PopulationLedger.NextPopulationId;
+ var count = s.PopulationLedger.Units.Count;
+ var total = s.TotalPopulation;
+ var arms = s.Arms;
+ var civilians = s.PopulationLedger.Units.Where(p => p.Status != PopulationStatus.ActiveSoldier).Select(p => p.Canonical()).ToList();
+ Assert.Empty(Serving(s));
+ Assert.False(s.Units.ContainsKey(i));
+
+ StartingForces.Arrive(c, s, Next);
+ StartingForces.Arrive(c, twin, Next);
+
+ // The unit is the aggregate game's: id i, its type, hex and strength, combat XP 0 (R-POP-004: units keep 0).
+ Assert.Equal(twin.Units[i].Canonical(), s.Units[i].Canonical());
+ Assert.Equal(f.Strength, s.Units[i].Strength);
+ Assert.Equal(0, s.Units[i].CombatXp);
+ var serving = Serving(s);
+ Assert.Equal(f.Strength, serving.Count);
+ Assert.Equal(Enumerable.Range(next, f.Strength), serving.Select(p => p.Id)); // new people, new ids
+ Assert.Equal(count + f.Strength, s.PopulationLedger.Units.Count);
+ Assert.Equal(civilians, s.PopulationLedger.Units.Where(p => p.Status != PopulationStatus.ActiveSoldier).Select(p => p.Canonical()));
+ var cls = c.UnitTypes.Single(t => t.Id == f.Type).Class;
+ var region = c.PlayerRegions.AtHex(f.Q, f.R)!.Id;
+ Assert.Equal("central_plain", region); // Hulda's hex (-4, 25), regions.yaml central_plain member_hexes
+ for (int k = 0; k < serving.Count; k++)
+ {
+ var p = serving[k];
+ Assert.Equal(PopulationStatus.ActiveSoldier, p.Status);
+ Assert.Equal(PopulationAssignmentKind.ActiveService, p.Assignment.Kind);
+ Assert.Equal(cls, p.Qualification);
+ Assert.Equal(1, p.CombatXp); // owner, 8 November 2026: "1, like the others"
+ Assert.Equal(region, p.Location!.Region);
+ Assert.Null(p.Location.City);
+ Assert.Equal(0, p.ReceptionTicks);
+ Assert.Equal(CivilianProfession.None, p.Profession);
+ Assert.Equal(Target + "/" + k.ToString(CultureInfo.InvariantCulture), p.Equipment.MilitaryId);
+ Assert.True(p.Equipment.MilitaryPaid);
+ Assert.True(s.PopulationLedger.HasArrived(Target, k));
+ }
+ Assert.Equal(arms, s.Arms); // "Apart from Arms (Recommended)"
+ Assert.Equal(twin.Arms, s.Arms);
+ Assert.Equal(total + f.Strength * s.PopulationLedger.PeoplePerUnit, s.TotalPopulation);
+ s.PopulationLedger.Reconcile();
+ }
+
+ // R-UNIT-009: only the turn that starts before the day and ends on or after it brings the brigade.
+ [Fact]
+ public void ATurnThatEndsBeforeItsDayAddsNobody()
+ {
+ var c = Gdd03();
+ var s = Dark(c);
+ var hash = s.Hash();
+ StartingForces.Arrive(c, s, new DateTime(1948, 5, 23));
+ Assert.Equal(hash, s.Hash());
+ Assert.Empty(Serving(s));
+ }
+
+ // Coordinator call (Q7 (a)), as #2954's arrivals: a replay of the turn on the state it produced adds nobody and leaves
+ // the state as it was; the same turn from the same start gives the same state.
+ [Fact]
+ public void AReplayAddsNobodyTwice()
+ {
+ var c = Gdd03();
+ var s = Dark(c);
+ var again = Dark(c);
+ StartingForces.Arrive(c, s, Next);
+ StartingForces.Arrive(c, again, Next);
+ Assert.Equal(s.Hash(), again.Hash());
+ var hash = s.Hash();
+ StartingForces.Arrive(c, s, Next);
+ Assert.Equal(hash, s.Hash());
+ Assert.Equal(c.StartingForces[Index(c)].Strength, Serving(s).Count);
+ s.PopulationLedger.Reconcile();
+ }
+
+ // Coordinator call (Q5 (a)): the dark start binds every own dated brigade's service target in its arrival region, with
+ // no record, so the arrival is a plain registration; the start inventory still has no record of it (R-POP-004).
+ [Fact]
+ public void TheDatedBrigadeIsBoundAtTheStartWithNoRecord()
+ {
+ var c = Gdd03();
+ var s = Dark(c);
+ Assert.Empty(Serving(s));
+ Assert.Contains(s.PopulationLedger.Canonical(), line => line.StartsWith(PopulationText.Fields("target") + "|", StringComparison.Ordinal)
+ && line.Contains(Target, StringComparison.Ordinal) && line.Contains("central_plain", StringComparison.Ordinal));
+ Assert.DoesNotContain(HistoricalPopulation.Inventory(c), r => r.Source == Target);
+ }
+
+ // R-UNIT-009: a dated brigade whose unit id is already in the game is refused before its records are registered, so
+ // the records and the unit arrive all or nothing: the ledger, the units and the state are unchanged.
+ [Fact]
+ public void ADatedBrigadeWhoseUnitIdIsTakenIsRefusedWithTheLedgerUnchanged()
+ {
+ var c = Gdd03();
+ var s = Dark(c);
+ var i = Index(c);
+ var f = c.StartingForces[i];
+ s.Units[i] = new Unit(i, f.Type, f.Q, f.R, side: f.Side, strength: f.Strength);
+ var ledger = s.PopulationLedger.Canonical().ToList();
+ var next = s.PopulationLedger.NextPopulationId;
+ var hash = s.Hash();
+ var e = Assert.Throws<InvalidOperationException>(() => StartingForces.Arrive(c, s, Next));
+ Assert.Equal($"Unit {i} of starting force '{Row}' is already in the game (R-UNIT-009)", e.Message);
+ Assert.Equal(ledger, s.PopulationLedger.Canonical());
+ Assert.Equal(next, s.PopulationLedger.NextPopulationId);
+ Assert.Equal(hash, s.Hash());
+ Assert.Empty(Serving(s));
+ Assert.False(s.PopulationLedger.HasArrived(Target, 0));
+ }
+
+ // R-ENEMY-004: an enemy force that bypassed the loader is still refused before anything is added, ledger included.
+ [Fact]
+ public void AnEnemyArrivalIsStillRefusedWithTheLedgerUnchanged()
+ {
+ var c = Gdd03();
+ var s = Dark(c);
+ c.StartingForces.Add(new StartingForce
+ {
+ Row = "late_enemy", Type = c.StartingForces.First(f => f.Side != Movement.PlayerSide).Type, Side = "egypt",
+ Strength = 2, Q = 0, R = 0, Arrives = new DateTime(1948, 6, 1),
+ });
+ var hash = s.Hash();
+ Assert.Throws<InvalidOperationException>(() => StartingForces.Arrive(c, s, Next));
+ Assert.Equal(hash, s.Hash());
+ Assert.Empty(Serving(s));
+ }
+
+ // R-POP-002: a synthetic or Open ledger is still refused, with the state unchanged.
+ [Theory]
+ [InlineData(null)]
+ [InlineData(Mode.Open)]
+ public void ASyntheticOrOpenLedgerIsStillRefused(Mode? mode)
+ {
+ var c = PopulationLedgerTests.Content();
+ var s = PopulationLedger.CreateFixture(c, PopulationLedgerTests.Bindings(), new[] {
+ new PopulationInventoryRow("fixture", 0, PopulationLedgerTests.Person()) }, mode: mode);
+ var hash = s.Hash();
+ Assert.Throws<NotSupportedException>(() => StartingForces.Arrive(c, s, s.Date.AddMonths(1)));
+ Assert.Equal(hash, s.Hash());
+ }
+}
diff --git a/sim/Statecraft.Sim/Content.cs b/sim/Statecraft.Sim/Content.cs
index e517d7ba8..ef95472f9 100644
--- a/sim/Statecraft.Sim/Content.cs
+++ b/sim/Statecraft.Sim/Content.cs
@@ -1517,7 +1517,8 @@ namespace Statecraft.Sim
/// of a new game is the i-th. Empty in the legacy loop.</summary>
public List<StartingForce> StartingForces = new List<StartingForce>();
/// <summary>Exact gdd-0.3 only: gdd03-start.yaml's formation_combat_xp, each own opening formation's combat XP in the
- /// Historical ledger fixture (#1689 rows 7 and 8), by row id. Null when the file or the list is absent.</summary>
+ /// Historical ledger fixture (#1689 rows 7 and 8), and each own dated brigade's (#1725 PR 7, producer 08), by row id.
+ /// Null when the file or the list is absent.</summary>
public SortedDictionary<string, int>? Gdd03FormationCombatXp { get; internal set; }
/// <summary>Every anchor's hex of map/unit_anchor_hexes.yaml by (row id, anchor index), the only hexes an operation
/// card may order a row's unit to (R-ENEMY-005). Empty in the legacy loop.</summary>
diff --git a/sim/Statecraft.Sim/ContentLoader.cs b/sim/Statecraft.Sim/ContentLoader.cs
index c69d9b51e..b41f795a5 100644
--- a/sim/Statecraft.Sim/ContentLoader.cs
+++ b/sim/Statecraft.Sim/ContentLoader.cs
@@ -563,26 +563,29 @@ namespace Statecraft.Sim
/// <summary>#1689 rows 7 and 8 (owner, 7 November 2026, comment 6704389240: "1 each, Negev 0 (Recommended)"): each own
/// opening formation's combat XP in the Historical ledger fixture, once each, from 0 to military.combat_xp_full. Read
/// after the starting forces. An absent list leaves the value unset; the ledger fixture then refuses (no fallback).
- /// Ledger fixture only (maintainer call, eyalgolan-30's coordinator, 7 November 2026): NewGame's units keep 0.</summary>
+ /// Ledger fixture only (maintainer call, eyalgolan-30's coordinator, 7 November 2026): NewGame's units keep 0.
+ /// #1725 PR 7, producer 08: each own dated brigade (R-UNIT-009) is named too, since it arrives as soldier records
+ /// (owner, 8 November 2026, for the 7th Brigade: "1, like the others").</summary>
static void ApplyGdd03FormationCombatXp(List<StartFormationCombatXp> rows, Content c)
{
const string file = "gdd03-start.yaml";
var full = Gdd03Military.Scalar(c, "military.combat_xp_full");
- var opening = new HashSet<string>(HistoricalPopulation.OpeningFormationRows(c), StringComparer.Ordinal);
+ var own = new HashSet<string>(HistoricalPopulation.OpeningFormationRows(c)
+ .Concat(HistoricalPopulation.DatedFormations(c).Select(f => f.Row)), StringComparer.Ordinal);
var xp = new SortedDictionary<string, int>(StringComparer.Ordinal);
for (int i = 0; i < rows.Count; i++)
{
var row = rows[i];
var at = FormattableString.Invariant($"formation_combat_xp[{i}]");
- if (row == null || !opening.Contains(row.Row))
- throw new ContentException(file, at + ".row", "must name an own opening formation of map/units_1948.yaml");
+ if (row == null || !own.Contains(row.Row))
+ throw new ContentException(file, at + ".row", "must name an own opening or dated formation of map/units_1948.yaml");
if (xp.ContainsKey(row.Row)) throw new ContentException(file, at + ".row", "duplicate formation");
if (!(row.CombatXp is int value) || value < 0 || value > full)
throw new ContentException(file, at + ".combat_xp", FormattableString.Invariant($"required: an integer from 0 to military.combat_xp_full {full}"));
xp.Add(row.Row, value);
}
- var missing = opening.Where(r => !xp.ContainsKey(r)).OrderBy(r => r, StringComparer.Ordinal).ToList();
- if (missing.Count > 0) throw new ContentException(file, "formation_combat_xp", "missing opening formation " + string.Join(", ", missing));
+ var missing = own.Where(r => !xp.ContainsKey(r)).OrderBy(r => r, StringComparer.Ordinal).ToList();
+ if (missing.Count > 0) throw new ContentException(file, "formation_combat_xp", "missing own formation " + string.Join(", ", missing));
c.Gdd03FormationCombatXp = xp;
}
diff --git a/sim/Statecraft.Sim/HistoricalPopulation.cs b/sim/Statecraft.Sim/HistoricalPopulation.cs
index ec6031285..03fb77aa4 100644
--- a/sim/Statecraft.Sim/HistoricalPopulation.cs
+++ b/sim/Statecraft.Sim/HistoricalPopulation.cs
@@ -72,6 +72,12 @@ namespace Statecraft.Sim
internal static IEnumerable<StartingForce> OpeningFormations(Content c) => c.StartingForces
.Where(f => f.Side == Movement.PlayerSide && f.Arrives == null && f.Strength > 0);
+ /// <summary>#1725 PR 7, producer 08: the own brigades dated after the start (R-UNIT-009), Israeli, with a strength, in
+ /// <c>Content.StartingForces</c>' order (today the 7th Brigade). Not in the start inventory (R-POP-004): each arrives
+ /// on its day as new soldier records (owner, 8 November 2026: "Soldiers of brigade (Recommended)").</summary>
+ internal static IEnumerable<StartingForce> DatedFormations(Content c) => c.StartingForces
+ .Where(f => f.Side == Movement.PlayerSide && f.Arrives != null && f.Strength > 0);
+
/// <summary>The row ids of <see cref="OpeningFormations"/>.</summary>
internal static IEnumerable<string> OpeningFormationRows(Content c) => OpeningFormations(c).Select(f => f.Row);
@@ -172,11 +178,16 @@ namespace Statecraft.Sim
var inventory = Inventory(c);
if (s.Mode != Mode.Historical) throw new InvalidOperationException("The Historical ledger needs a Historical game (R-POP-004).");
var sources = new HashSet<string>(inventory.Select(r => r.Source), StringComparer.Ordinal); // only sources with records
+ // #1725 PR 7, producer 08. Coordinator call, 8 November 2026 (Q5 (a)): each own dated brigade (R-UNIT-009) is bound
+ // at the start, its service target in its arrival region and its soldiers' qualification, with no record, as its
+ // unit id is reserved at the start; StartingForces.Arrive then only registers its records.
+ var dated = new HashSet<string>(DatedFormations(c).Select(f => FormationPrefix + f.Row), StringComparer.Ordinal);
+ bool Bound(StartingForce f) => sources.Contains(FormationPrefix + f.Row) || dated.Contains(FormationPrefix + f.Row);
var regions = new SortedDictionary<string, string>(StringComparer.Ordinal);
foreach (var city in c.Cities)
if (sources.Contains(CensusPrefix + city.Id)) regions[CensusPrefix + city.Id] = c.PlayerRegions.AtLocation(city.Id)?.Id ?? "";
foreach (var f in c.StartingForces)
- if (sources.Contains(FormationPrefix + f.Row)) regions[FormationPrefix + f.Row] = c.PlayerRegions.AtHex(f.Q, f.R)?.Id ?? "";
+ if (Bound(f)) regions[FormationPrefix + f.Row] = c.PlayerRegions.AtHex(f.Q, f.R)?.Id ?? "";
// #1725 PR 4: a farmer lives in its field's host, a member location of the field's region (Q27).
var farmer = new Dictionary<string, (string Host, string Field, CivilianTier Tier)>(StringComparer.Ordinal);
foreach (var h in FieldFarmerHosts(c))
@@ -198,23 +209,9 @@ namespace Statecraft.Sim
.Select(x => new PopulationTarget(x.Key, PopulationAssignmentKind.ActiveService, x.Value))
// A field is its farmer's Work target in the field's region (Gdd03FieldFixture.Targets' ids, field/q,r).
.Concat(farmer.Select(x => new PopulationTarget(x.Value.Field, PopulationAssignmentKind.Work, regions[x.Key])));
- // #1689 rows 5 to 8. Owner, 7 November 2026 (comment 6704389240): "Veteran for all 8 (Recommended)" and "1 each,
- // Negev 0 (Recommended)", Negev's 0 a labelled stand-in. Maintainer call, eyalgolan-30's coordinator, 7 November
- // 2026: the veteran level lives on the formation (a veteran_soldier, R-UNIT-006, each soldier's ActiveService
- // target), so a soldier's qualification is its formation type's unit_types.yaml class, the source
- // Gdd03BasicTrainingFixture's graduates use; its combat XP is gdd03-start.yaml's formation_combat_xp, no fallback.
- var xp = c.Gdd03FormationCombatXp
- ?? throw new InvalidOperationException("The Historical ledger fixture needs gdd03-start.yaml's formation_combat_xp; no fallback (#1689).");
+ // #1689 rows 5 to 8 and the 7th Brigade's combat XP: see SoldierValues.
var soldier = new Dictionary<string, (string Qualification, int CombatXp)>(StringComparer.Ordinal);
- foreach (var f in c.StartingForces.Where(f => sources.Contains(FormationPrefix + f.Row)))
- {
- var cls = c.UnitTypes.FirstOrDefault(t => string.Equals(t.Id, f.Type, StringComparison.Ordinal))?.Class;
- if (string.IsNullOrWhiteSpace(cls))
- throw new InvalidOperationException("No unit_types.yaml class for formation " + f.Row + "'s type " + f.Type + " (#1689).");
- if (!xp.TryGetValue(f.Row, out var combatXp))
- throw new InvalidOperationException("No gdd03-start.yaml formation_combat_xp for formation " + f.Row + "; no fallback (#1689).");
- soldier[FormationPrefix + f.Row] = (cls!, combatXp);
- }
+ foreach (var f in c.StartingForces.Where(Bound)) soldier[FormationPrefix + f.Row] = SoldierValues(c, f);
var bindings = new PopulationBindings(locations.Values.Concat(placed.Values.Where(l => l.City != null)
.GroupBy(l => l.Canonical(), StringComparer.Ordinal).Select(g => g.First())), targets,
Array.Empty<string>(), soldier.Values.Select(x => x.Qualification).Distinct(StringComparer.Ordinal));
@@ -259,5 +256,48 @@ namespace Statecraft.Sim
: PopulationEquipment.None)));
s.PopulationLedger.Initialize(c, bindings, rows, 0, Mode.Historical);
}
+
+ /// <summary>#1689 rows 5 to 8. Owner, 7 November 2026 (comment 6704389240): "Veteran for all 8 (Recommended)" and "1
+ /// each, Negev 0 (Recommended)", Negev's 0 a labelled stand-in; for the 7th Brigade, which arrives later (R-UNIT-009),
+ /// owner, 8 November 2026: "1, like the others". Maintainer call, eyalgolan-30's coordinator, 7 November 2026: the
+ /// veteran level lives on the formation (a veteran_soldier, R-UNIT-006, each soldier's ActiveService target), so a
+ /// soldier's qualification is its formation type's unit_types.yaml class, the source Gdd03BasicTrainingFixture's
+ /// graduates use; its combat XP is gdd03-start.yaml's formation_combat_xp, no fallback.</summary>
+ static (string Qualification, int CombatXp) SoldierValues(Content c, StartingForce f)
+ {
+ var xp = c.Gdd03FormationCombatXp
+ ?? throw new InvalidOperationException("The Historical ledger fixture needs gdd03-start.yaml's formation_combat_xp; no fallback (#1689).");
+ var cls = c.UnitTypes.FirstOrDefault(t => string.Equals(t.Id, f.Type, StringComparison.Ordinal))?.Class;
+ if (string.IsNullOrWhiteSpace(cls))
+ throw new InvalidOperationException("No unit_types.yaml class for formation " + f.Row + "'s type " + f.Type + " (#1689).");
+ if (!xp.TryGetValue(f.Row, out var combatXp))
+ throw new InvalidOperationException("No gdd03-start.yaml formation_combat_xp for formation " + f.Row + "; no fallback (#1689).");
+ return (cls!, combatXp);
+ }
+
+ /// <summary>#1725 PR 7, producer 08 (R-UNIT-009 on the ledger): the records an own dated brigade brings when it arrives,
+ /// one per strength unit, as a starting formation's soldiers are (R-POP-004). Owner, 8 November 2026: "Soldiers of
+ /// brigade (Recommended)": each is an active soldier serving in the brigade (source key <see cref="FormationPrefix"/>
+ /// plus its row, ordinals from 0), with its type's class and its formation_combat_xp ("1, like the others"); "New
+ /// people (Recommended)": new records, none taken from the civilians; "Apart from Arms (Recommended)": one issued
+ /// military item each, <c>units_1948/&lt;row&gt;/&lt;ordinal&gt;</c>, owned and recorded as paid, as at the start, with
+ /// the Arms stock untouched. Coordinator call, 8 November 2026 (Q6 (a)): located in the region of its arrival anchor's
+ /// hex, region-only, as a starting formation's records are. Reception 0 and no profession, as a starting soldier.</summary>
+ internal static IReadOnlyList<PopulationInventoryRow> ArrivalRows(Content c, StartingForce f)
+ {
+ if (!(f.Side == Movement.PlayerSide && f.Arrives != null && f.Strength > 0))
+ throw new InvalidOperationException("Formation " + f.Row + " is not an own brigade dated after the start (R-UNIT-009).");
+ var region = c.PlayerRegions.AtHex(f.Q, f.R)?.Id
+ ?? throw new InvalidOperationException("No region in regions.yaml for " + FormationPrefix + f.Row + " (R-POP-004).");
+ var v = SoldierValues(c, f);
+ var source = FormationPrefix + f.Row;
+ var rows = new List<PopulationInventoryRow>();
+ for (int i = 0; i < f.Strength; i++)
+ rows.Add(new PopulationInventoryRow(source, i, new PopulationUnit(0, PopulationStatus.ActiveSoldier, 0,
+ new PopulationLocation(region), new PopulationAssignment(PopulationAssignmentKind.ActiveService, source),
+ CivilianProfession.None, CivilianTier.None, 0, v.Qualification, v.CombatXp,
+ new PopulationEquipment(militaryId: source + "/" + i.ToString(CultureInfo.InvariantCulture), militaryPaid: true))));
+ return rows.AsReadOnly();
+ }
}
}
diff --git a/sim/Statecraft.Sim/StartingForces.cs b/sim/Statecraft.Sim/StartingForces.cs
index 9927e5ef0..f556735d9 100644
--- a/sim/Statecraft.Sim/StartingForces.cs
+++ b/sim/Statecraft.Sim/StartingForces.cs
@@ -183,19 +183,44 @@ namespace Statecraft.Sim
/// <summary>R-UNIT-009 (#1241, owner, 21 October 2026, answer 1(a)): resolver step 9b. A row dated after the start
/// arrives in the resolution of the turn from s.Date to <paramref name="next"/> that reaches its day, once, as unit
/// <c>c.StartingForces[i]</c>'s id i, on its anchor's hex with its strength. Like a starting force it ignores the stack
- /// limit and what else stands on the hex.</summary>
+ /// limit and what else stands on the hex.
+ /// With an initialized Historical ledger (#1725 PR 7, producer 08) the brigade also brings its strength as new
+ /// active-soldier records serving in it (<see cref="HistoricalPopulation.ArrivalRows"/>; owner, 8 November 2026:
+ /// "Soldiers of brigade (Recommended)", "New people (Recommended)"), registered all or nothing before its unit is added.
+ /// A brigade whose records are already registered adds nothing, so a replay of the turn adds nobody twice (coordinator
+ /// call, 8 November 2026, Q7 (a)); its records are registered together, so its first ordinal marks the arrival. A
+ /// synthetic or Open ledger is still refused (R-POP-002).</summary>
public static void Arrive(Content c, GameState s, DateTime next)
{
- PopulationLedger.RefuseAggregate(s);
+ PopulationLedger.RefuseUnlessHistorical(s); // #1725 PR 7: a Historical ledger's records are then the soldiers
bool Due(StartingForce f) => f.Arrives is DateTime day && s.Date < day && day <= next;
// Every due force is checked before any is added, so a refusal leaves the state unchanged.
foreach (var f in c.StartingForces)
if (Due(f) && f.Side != Movement.PlayerSide)
throw new InvalidOperationException($"Enemy-side starting force '{f.Row}' may not arrive after the game starts (R-ENEMY-004)");
+ var ledger = s.PopulationLedger.IsInitialized ? s.PopulationLedger : null;
+ var arriving = new List<int>();
+ var rows = new List<PopulationInventoryRow>();
for (int i = 0; i < c.StartingForces.Count; i++)
{
var f = c.StartingForces[i];
- if (Due(f)) s.Units.Add(i, new Unit(i, f.Type, f.Q, f.R, side: f.Side, strength: f.Strength));
+ if (!Due(f)) continue;
+ if (ledger != null)
+ {
+ if (ledger.HasArrived(HistoricalPopulation.FormationPrefix + f.Row, 0)) continue;
+ rows.AddRange(HistoricalPopulation.ArrivalRows(c, f));
+ }
+ arriving.Add(i);
+ }
+ // All or nothing: an id already taken would refuse at Add, so it is refused before the records are registered.
+ foreach (var i in arriving)
+ if (s.Units.ContainsKey(i))
+ throw new InvalidOperationException($"Unit {i} of starting force '{c.StartingForces[i].Row}' is already in the game (R-UNIT-009)");
+ if (ledger != null && rows.Count > 0) ledger.RegisterArrivals(rows);
+ foreach (var i in arriving)
+ {
+ var f = c.StartingForces[i];
+ s.Units.Add(i, new Unit(i, f.Type, f.Q, f.R, side: f.Side, strength: f.Strength));
}
}