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 start, PR 3 (teacher part): the Haifa veteran pioneer teacher in the Historical ledger (Refs #1725, Refs #1689) (#2941)
Eyal Golan89d33c46ded6
diff --git a/changelog.d/1689-opening-pioneer-teacher.md b/changelog.d/1689-opening-pioneer-teacher.mdnew file mode 100644index 000000000..d605e686e--- /dev/null+++ b/changelog.d/1689-opening-pioneer-teacher.md@@ -0,0 +1,6 @@+- GDD 0.3 starting population (Refs #1689, Refs #1725): in the inactive Historical ledger, the training centre's one+ veteran pioneer teacher is now one of Haifa's census units, so no person is added (owner, 7 November 2026: "Yes to+ all three (Recommended)"). It is the last Haifa record (a maintainer call by the coordinator, 7 November 2026), a+ veteran pioneer with no work experience (owner, relayed: "0 (Recommended)") and no job or pupil at the start. Jobs+ and training may take it, but last (owner, relayed: "Takeable, but last (Recommended)"). No new-game wiring, so+ there is no change in the game.diff --git a/docs/population-ledger.md b/docs/population-ledger.mdindex ae771fda2..0f54c1ba6 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. 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. 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. 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.mdindex b0a32921f..3a956c35e 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -607,7 +607,7 @@ R-POP-002: A ledger record has exactly one typed status and assignment, validateR-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"); the inventory does not hold them until they are wired in. 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. 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 and the opening field farmers (fields, #1691/#1717; the owner's 1:2:1 novice/trained/veteran ratio then 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)). 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"); the inventory does not hold them until they are wired in. 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 and the opening field farmers (fields, #1691/#1717; the owner's 1:2:1 novice/trained/veteran ratio then 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)). 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`)").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/HistoricalPioneerTeacherTests.cs b/sim/Statecraft.Sim.Tests/HistoricalPioneerTeacherTests.csnew file mode 100644index 000000000..7ea2eae6a--- /dev/null+++ b/sim/Statecraft.Sim.Tests/HistoricalPioneerTeacherTests.cs@@ -0,0 +1,141 @@+using Statecraft.Sim;++/// <summary>#1725 PR 3, the teacher part (Refs #1689): the training centre's one veteran pioneer teacher in the Historical+/// ledger. Owner, 7 November 2026 (#1689 comment 6704565066), "Yes to all three (Recommended)": "the training centre's one+/// veteran pioneer teacher is a Haifa census unit". Owner, 7 November 2026, relayed by the coordinator (no comment link):+/// starting veterans' work XP "0 (Recommended)"; the teacher "Takeable, but last (Recommended)". Maintainer call (the+/// coordinator, eyalgolan-30, 7 November 2026): the teacher is the last census/haifa ordinal.</summary>+public class HistoricalPioneerTeacherTests+{+ const string Haifa = "census/haifa";++ static (Content C, IReadOnlyList<HistoricalPopulationRow> Inventory, IReadOnlyList<PopulationUnit> Units) Start()+ {+ var c = HistoricalPopulationTests.Real(true);+ return (c, HistoricalPopulation.Inventory(c), HistoricalPopulation.LedgerFixture(c).PopulationLedger.Units);+ }++ static List<(HistoricalPopulationRow Row, PopulationUnit Unit)> Census((Content C, IReadOnlyList<HistoricalPopulationRow> Inventory, IReadOnlyList<PopulationUnit> Units) s)+ => s.Inventory.Select((r, i) => (r, s.Units[i])).Where(x => x.r.Source.StartsWith(HistoricalPopulation.CensusPrefix, StringComparison.Ordinal)).ToList();++ // The ruling: one veteran pioneer teacher, a Haifa census unit, "included in population total" (content/gdd03-balance.yaml+ // start.pioneer_teachers, 1, Agreed; docs/gdd/training.md:48, "The starting centre and veteran pioneer teacher belong to+ // the initial population inventory, not additional people."). So exactly one census record has a profession, it is a+ // census/haifa record, and no record is added: the census still counts each city's R-CITY-007 start units.+ [Fact]+ public void OneCensusRecordIsTheTeacherAndItIsAHaifaCensusUnit()+ {+ var s = Start();+ var census = Census(s);+ Assert.Equal(s.C.Cities.Sum(city => city.Civilians), census.Count);+ Assert.Equal(1, s.C.RequirePopulationInteger("start.pioneer_teachers"));+ var teachers = census.Where(x => x.Unit.Profession != CivilianProfession.None).ToList();+ Assert.Single(teachers);+ Assert.Equal(Haifa, teachers[0].Row.Source);+ }++ // Maintainer call (the coordinator, 7 November 2026): the teacher is the LAST census/haifa ordinal, derived from content as+ // Haifa's start units minus 1, never a hard-coded number.+ [Fact]+ public void TheTeacherIsTheLastHaifaCensusOrdinal()+ {+ var s = Start();+ var haifaUnits = s.C.Cities.Single(city => city.Id == "haifa").Civilians;+ Assert.True(haifaUnits > 1);+ var teacher = Census(s).Single(x => x.Unit.Profession != CivilianProfession.None);+ Assert.Equal(haifaUnits - 1, teacher.Row.Ordinal);+ Assert.Equal(s.Inventory.Where(r => r.Source == Haifa).Max(r => r.Ordinal), teacher.Row.Ordinal);+ }++ // R-TRAIN-005: "The teacher is a free civilian, a veteran of the matching profession" (a pioneer, for the ruling's+ // "veteran pioneer teacher"); the ledger's pioneer tiers are novice, trained or veteran (PopulationLedger.Validate).+ // Owner, 7 November 2026, relayed: starting veterans' work XP "0 (Recommended)". R-TRAIN-008: "a teaching teacher with no+ // pupil (an invalid inventory)" is refused, and the start has no pupil, so the teacher holds no assignment: one of+ // Haifa's jobless. Everything else is as for any census record (R-POP-004): in Haifa, reception done, no military+ // qualification, no combat XP, no equipment.+ [Fact]+ public void TheTeacherIsAnUnassignedVeteranPioneerWithNoWorkXp()+ {+ var s = Start();+ var t = Census(s).Single(x => x.Unit.Profession != CivilianProfession.None).Unit;+ Assert.Equal(CivilianProfession.Pioneer, t.Profession);+ Assert.Equal(CivilianTier.Veteran, t.Tier);+ Assert.Equal(0, t.WorkXp);+ Assert.Equal(PopulationStatus.FreeCivilian, t.Status);+ Assert.Equal(PopulationAssignmentKind.Unassigned, t.Assignment.Kind);+ Assert.Equal("haifa", t.Location!.City);+ Assert.Equal(s.C.PlayerRegions.AtLocation("haifa")!.Id, t.Location.Region);+ Assert.Equal(s.C.RequirePopulationInteger("reception.turns"), t.ReceptionTicks);+ Assert.Equal("", t.Qualification);+ Assert.Equal(0, t.CombatXp);+ Assert.Same(PopulationEquipment.None, t.Equipment);+ }++ // R-TRAIN-008 (a teaching teacher with no pupil is an invalid inventory): no record starts teaching or on a course, and a+ // training centre fixture in Haifa's region accepts the opening ledger as it is. The teacher meets Start's teacher test:+ // a free civilian, a veteran farmer or pioneer (Gdd03TrainingCentreFixture.Start).+ [Fact]+ public void ATrainingCentreInHaifaAcceptsTheOpeningLedger()+ {+ var c = HistoricalPopulationTests.Real(true);+ var state = HistoricalPopulation.LedgerFixture(c);+ Assert.DoesNotContain(state.PopulationLedger.Units, u => u.Assignment.Kind == PopulationAssignmentKind.Teaching+ || u.Assignment.Kind == PopulationAssignmentKind.Course);+ var before = state.Hash();+ _ = new Gdd03TrainingCentreFixture(c, state, new[] {+ new Gdd03FixtureTrainingCentre("centre/haifa", c.PlayerRegions.AtLocation("haifa")!.Id, operating: true) });+ Assert.Equal(before, state.Hash());+ var t = state.PopulationLedger.Units.Single(u => u.Profession != CivilianProfession.None);+ Assert.True(Gdd03ReceptionFixture.CanStartCivilianActivity(c, state.PopulationLedger, t));+ }++ // Owner, 7 November 2026, relayed: the teacher "Takeable, but last (Recommended)". No guard: the teacher is an ordinary+ // jobless free civilian (it passes the same civilian-activity test as the others, above). "Last" comes from the rules+ // that exist: "N units" commands take ascending population ids (R-POP-004, Q10), and the job default gains or loses the+ // Industry assignment in ascending population id (#1692, owner answer of 3 November 2026). The teacher has the highest id+ // of Haifa's census records, so taking Haifa's first k records by ascending id reaches it only when k is all of them.+ // At the start Haifa's employed are fewer than its records less one, so a default up to its employed never reaches it.+ // No ledger producer runs the job default or Train yet (#1725 PR 6 and PR 7); this pins the order they will read.+ [Fact]+ public void TheTeacherIsTakenLastByAscendingId()+ {+ var s = Start();+ var haifa = Census(s).Where(x => x.Row.Source == Haifa).Select(x => x.Unit).OrderBy(u => u.Id).ToList();+ var teacher = haifa.Single(u => u.Profession != CivilianProfession.None);+ Assert.Equal(haifa.Max(u => u.Id), teacher.Id);+ var jobless = haifa.Where(u => u.Status == PopulationStatus.FreeCivilian && u.Assignment.Kind == PopulationAssignmentKind.Unassigned).ToList();+ Assert.Equal(haifa.Count, jobless.Count);+ for (int k = 1; k <= jobless.Count; k++)+ Assert.Equal(k == jobless.Count, jobless.Take(k).Any(u => u.Id == teacher.Id));+ var employed = s.C.Cities.Single(city => city.Id == "haifa").Employed;+ Assert.True(employed < haifa.Count - 1);+ Assert.DoesNotContain(jobless.Take(employed), u => u.Id == teacher.Id);+ }++ // The count is content's start.pioneer_teachers (1, Agreed), which the ruling's "one" matches. No ruling places a second+ // teacher, so any other value is refused, all or nothing, and no value is invented.+ [Fact]+ public void AnotherTeacherCountIsRefused()+ {+ var root = RealContentTests.ContentRoot();+ var c = ContentLoader.Load(rel =>+ {+ var text = File.Exists(Path.Combine(root, rel)) ? File.ReadAllText(Path.Combine(root, rel)) : null;+ if (rel == "eras.yaml") return text!.Replace("loop: gdd", "loop: gdd, ruleset: gdd-0.3");+ if (rel == Gdd03BalanceCatalogue.FileName)+ {+ var row = "\"start.pioneer_teachers\":";+ var at = text!.IndexOf(row, StringComparison.Ordinal);+ var values = text.IndexOf("\"values\": [1]", at, StringComparison.Ordinal);+ Assert.True(at >= 0 && values > at);+ return text.Substring(0, values) + "\"values\": [2]" + text.Substring(values + "\"values\": [1]".Length);+ }+ return text;+ }, Directory.GetFiles(Path.Combine(root, "events"), "*.yaml").Select(p => "events/" + Path.GetFileName(p)));+ Assert.Equal(2, c.RequirePopulationInteger("start.pioneer_teachers"));+ var s = new GameState(c) { Mode = Mode.Historical };+ var ex = Assert.Throws<InvalidOperationException>(() => HistoricalPopulation.Initialize(c, s));+ Assert.Contains("start.pioneer_teachers", ex.Message);+ Assert.False(s.PopulationLedger.IsInitialized);+ }+}diff --git a/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs b/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.csindex c1ce5866d..a6aec07ef 100644--- a/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs+++ b/sim/Statecraft.Sim.Tests/HistoricalPopulationTests.cs@@ -463,15 +463,18 @@ public class HistoricalPopulationTests// R-POP-004 (owner, 7 November 2026): row 4 approved no farmer identities, the farmers come on top of the census, and// row 3's Industry start is not wired in, so a census record stays a plain free civilian: no profession, no tier and no- // Work assignment.+ // Work assignment. The one exception is the training centre's veteran pioneer teacher, the last census/haifa ordinal+ // (owner, 7 November 2026, #1689 comment 6704565066; HistoricalPioneerTeacherTests), left out here by its row.[Fact]- public void CensusRecordsHaveNoProfessionTierOrWork()+ public void CensusRecordsButTheTeacherHaveNoProfessionTierOrWork(){var c = Real(true);var inventory = HistoricalPopulation.Inventory(c);var units = HistoricalPopulation.LedgerFixture(c).PopulationLedger.Units;- var census = units.Where((u, i) => inventory[i].Source.StartsWith(HistoricalPopulation.CensusPrefix, StringComparison.Ordinal)).ToList();- Assert.NotEmpty(census);+ var lastHaifa = inventory.Where(r => r.Source == "census/haifa").Max(r => r.Ordinal);+ var census = units.Where((u, i) => inventory[i].Source.StartsWith(HistoricalPopulation.CensusPrefix, StringComparison.Ordinal)+ && !(inventory[i].Source == "census/haifa" && inventory[i].Ordinal == lastHaifa)).ToList();+ Assert.Equal(c.Cities.Sum(city => city.Civilians) - 1, census.Count);Assert.All(census, u =>{Assert.Equal(CivilianProfession.None, u.Profession);diff --git a/sim/Statecraft.Sim/HistoricalPopulation.cs b/sim/Statecraft.Sim/HistoricalPopulation.csindex 345b3f1a0..ad45817d8 100644--- a/sim/Statecraft.Sim/HistoricalPopulation.cs+++ b/sim/Statecraft.Sim/HistoricalPopulation.cs@@ -31,6 +31,9 @@ namespace Statecraft.Sim{internal const string CensusPrefix = "census/";internal const string FormationPrefix = "units_1948/";+ /// <summary>The census city of the training centre's one veteran pioneer teacher (owner, 7 November 2026, #1689+ /// comment 6704565066: "the training centre's one veteran pioneer teacher is a Haifa census unit").</summary>+ internal const string TeacherCity = "haifa";/// <summary>The own opening formations, the one predicate for them (review S2-2): the map/units_1948.yaml rows that/// give the start inventory soldiers, Israeli, in the start (no dated arrival), with a strength. The inventory, the@@ -62,7 +65,7 @@ namespace Statecraft.Sim/// record takes the region of its starting anchor hex (AtHex): the owner's ruling on #1689's open question 1/// (3 November 2026: "Its anchor hex's region (Recommended)"). A source with no region is refused; no region is invented. Records/// are free civilians with no assignment and their reception done (reception.turns), and soldiers serving in their own- /// formation, with no profession, tier or qualification (#1717 and #1692 add those). Each soldier carries one issued military item, id+ /// formation, with no profession, tier or qualification (#1717 and #1692 add those), but for the training centre's veteran pioneer teacher, the last census/haifa record (#1689). Each soldier carries one issued military item, id/// <c>units_1948/<row>/<ordinal></c>, owned and recorded as paid, apart from the spare Arms (#1717, 27M-24)./// mode Historical gives #2299's 1,000-a-record scale (D2). Fixture-only: the public NewGame does not call it (R-POP-002).</summary>internal static GameState LedgerFixture(Content c)@@ -118,11 +121,27 @@ namespace Statecraft.Sim// reception.turns is the reception before free-civilian status (docs/gdd/balance.md:91), so a census free civilian// starts with it done: R-VET-001 gives work XP only to a received free civilian. Soldiers keep 0 (not ruled).var received = c.RequirePopulationInteger("reception.turns");+ // #1725 PR 3, the teacher part. Owner, 7 November 2026 (#1689 comment 6704565066), "Yes to all three+ // (Recommended)": "the training centre's one veteran pioneer teacher is a Haifa census unit"; the count is+ // start.pioneer_teachers (1, Agreed, "included in population total"), so no record is added and no other count+ // has a ruling. Maintainer call (the coordinator, eyalgolan-30, 7 November 2026): the last census/haifa ordinal.+ // R-TRAIN-005: a free civilian, a veteran of the matching profession (pioneer). Owner, 7 November 2026, relayed+ // by the coordinator: work XP "0 (Recommended)". R-TRAIN-008 refuses a teaching teacher with no pupil, so the+ // teacher starts unassigned. Owner, 7 November 2026, relayed: "Takeable, but last (Recommended)": no guard; the+ // ascending-id rules (R-POP-004's Q10 "N units", #1692's job default) reach the last ordinal last.+ var teachers = c.RequirePopulationInteger("start.pioneer_teachers");+ if (teachers != 1)+ throw new InvalidOperationException("start.pioneer_teachers is " + teachers.ToString(CultureInfo.InvariantCulture)+ + "; the ruling places one veteran pioneer teacher in Haifa's census and no other (#1689).");+ var teacherSource = CensusPrefix + TeacherCity;+ var teacher = inventory.Where(r => r.Source == teacherSource).OrderBy(r => r.Ordinal).LastOrDefault()+ ?? throw new InvalidOperationException("No " + teacherSource + " record for the veteran pioneer teacher (#1689).");+ bool IsTeacher(HistoricalPopulationRow r) => ReferenceEquals(r, teacher);var rows = inventory.Select(r => new PopulationInventoryRow(r.Source, r.Ordinal, new PopulationUnit(0, r.Status,r.Status == PopulationStatus.FreeCivilian ? received : 0,placed[r.Source], r.Status == PopulationStatus.ActiveSoldier? new PopulationAssignment(PopulationAssignmentKind.ActiveService, r.Source) : PopulationAssignment.Unassigned,- CivilianProfession.None, CivilianTier.None, 0,+ IsTeacher(r) ? CivilianProfession.Pioneer : CivilianProfession.None, IsTeacher(r) ? CivilianTier.Veteran : CivilianTier.None, 0,r.Status == PopulationStatus.ActiveSoldier ? soldier[r.Source].Qualification : "",r.Status == PopulationStatus.ActiveSoldier ? soldier[r.Source].CombatXp : 0, r.Status == PopulationStatus.ActiveSoldier? new PopulationEquipment(militaryId: r.Source + "/" + r.Ordinal.ToString(CultureInfo.InvariantCulture), militaryPaid: true)