A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Record the adopted same-job no-op in detached GDD assignments (#1989)
Eyal Golan920f19db980b
diff --git a/changelog.d/gdd03-same-slot-noop.md b/changelog.d/gdd03-same-slot-noop.mdnew file mode 100644index 000000000..b646c30a5--- /dev/null+++ b/changelog.d/gdd03-same-slot-noop.md@@ -0,0 +1,3 @@+### Changed++- The detached GDD 0.3 assignment fixture reports a same-job assignment as a no-op, matching the adopted owner ruling, instead of calling its already unchanged state Deferred.diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex 398c8df3d..d8931a43b 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -94,6 +94,8 @@ R-CITY-001: Under legacy/gdd-0.1, `AssignWorkers(city, role, n)` sets how many oR-CITY-002: Each turn every city's employed units add `employed * income_per_job_per_year * the turn's share of a year` to the Treasury (an employed craftsman earns more, R-CRAFT-002).+GDD 0.3 fixture clarification for R-CITY-001/002: the owner’s 28 October Q34 answer makes reassignment to the same job a no-op ([owner-relayed answer](https://github.com/eyalgolan/statecraft-israel/pull/1668#issuecomment-6465662174)). The detached generic Work fixture returns `NoOp` and preserves the complete state when given its current target; its different-target transition already applies immediately. This records the settled fixture result, without a production command or a new course, service or save policy.+R-CITY-003: Arrivals from the CBS series (`aliyah.yaml`) become refugees in the cities. Let `P(t)` be the people the series brings from `city_arrivals_from` to the date `t` (0 before it), summed over the origin groups in ordinal order. `city_arrivals_from` is 8 November 1948, the census day the cities' start values count: the census already holds the people who arrived from 15 May, so the cities take none before it (Q-ARRV-3, owner, 15 October 2026). The cities' arrived units by `t` are `U(t) = floor(P(t) / people_per_unit)`, and a turn from date `d` to date `e` adds `U(e) - U(d)` refugees over all cities. `people_per_unit` and `city_arrivals_from` are the same in every era (the loader refuses an era that changes either), so over any run of turns the refugees added are `U(end) - U(start)`: no unit is lost or counted twice. The units are split in proportion to the cities' census `people` (Q-ARRV-1): the first `U` units are handed out one at a time, unit `n` to the city with the largest remainder `n * people / total people - units it holds`, a tie to the lower city id (ordinal), and a turn gives each city its share of `U(e)` minus its share of `U(d)`. Building the split up one unit at a time keeps it cumulative: a fresh largest-remainder split of each total could take a unit back from a city as the total grows (the Alabama paradox; on the twelve cities it first happens at 7 units). The loader refuses a GDD game with no city.R-CITY-008: Under legacy/gdd-0.1, `GameState.Population` is the one record of the nation's people: it takes every arrival from 15 May 1948 and is the count the CBS anchors check. The cities are the part of it placed in towns, so their people (civilians, craftsmen, refugees, recruits and the groups in training, times `people_per_unit`) never exceed it (Q-ARRV-2, owner, 15 October 2026). No person is counted twice. In initialized gdd-0.3 fixtures, the own-population ledger is authoritative instead: profession, employment, training and captivity are attributes/statuses of the same ids (R-POP-001), never extra people. No old headcount is rounded into ledger records.diff --git a/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.cs b/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.csindex dc2c701ca..6c1c5333e 100644--- a/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03AssignmentFixtureTests.cs@@ -49,7 +49,7 @@ public class Gdd03AssignmentFixtureTestsvar before = s.Describe(); Assert.Throws<ArgumentException>(() => f.Assign(1, target)); Assert.Equal(before, s.Describe());}var same = s.Describe();- Assert.Equal(Gdd03FixtureAssignmentResult.DeferredSameSlot, f.Assign(0, Slots[0].Id)); Assert.Equal(same, s.Describe());+ Assert.Equal(Gdd03FixtureAssignmentResult.NoOp, f.Assign(0, Slots[0].Id)); Assert.Equal(same, s.Describe());s.PopulationLedger.Replace(s.PopulationLedger.Get(1).WithReception(0));same = s.Describe(); Assert.Throws<ArgumentException>(() => f.Assign(1, Slots[2].Id)); Assert.Equal(same, s.Describe());Assert.Throws<ArgumentException>(() => new Gdd03AssignmentFixture(c, s, Slots.Concat(new[] { Slots[0] })));@@ -66,7 +66,7 @@ public class Gdd03AssignmentFixtureTestsvar invalid = target == "missing" || (target != null && model.Where((_, i) => i != id).Contains(target));if (invalid) { Assert.Throws<ArgumentException>(() => f.Assign(id, target)); Assert.Equal(before, s.Describe()); }else if (target != null && model[id] == target) {- Assert.Equal(Gdd03FixtureAssignmentResult.DeferredSameSlot, f.Assign(id, target)); Assert.Equal(before, s.Describe());+ Assert.Equal(Gdd03FixtureAssignmentResult.NoOp, f.Assign(id, target)); Assert.Equal(before, s.Describe());} else { Assert.Equal(Gdd03FixtureAssignmentResult.Applied, f.Assign(id, target)); model[id] = target; }Assert.Equal(model, s.PopulationLedger.Units.Select(p => p.Assignment.Target).ToArray());Assert.Equal(new[] { 0, 1, 2 }, s.PopulationLedger.Units.Select(p => p.Id)); s.PopulationLedger.Reconcile();diff --git a/sim/Statecraft.Sim/Gdd03AssignmentFixture.cs b/sim/Statecraft.Sim/Gdd03AssignmentFixture.csindex aa5247a8d..163e4866f 100644--- a/sim/Statecraft.Sim/Gdd03AssignmentFixture.cs+++ b/sim/Statecraft.Sim/Gdd03AssignmentFixture.cs@@ -6,7 +6,7 @@ namespace Statecraft.Sim{// All entry points are internal. Only synthetic tests opt in; no command, loader or turn hookup.internal enum Gdd03FixtureWork { Industry, Builder, Farm, Workshop }- internal enum Gdd03FixtureAssignmentResult { Applied, DeferredSameSlot }+ internal enum Gdd03FixtureAssignmentResult { Applied, NoOp }internal sealed class Gdd03FixtureSlot{@@ -53,7 +53,7 @@ namespace Statecraft.Sim/// <summary>R-CITY-001/002: frozen synthetic capacity overlay, never a second population ledger./// Only explicit reception-complete free civilians moving among generic Work targets are supported.- /// Feature-owned course/teaching/service transitions and same-slot policy remain outside this fixture.+ /// Feature-owned course/teaching/service transitions remain outside this fixture. Reassigning the same Work slot is a no-op./// Single-threaded like the ledger; callers cannot reuse this overlay as a production authority.</summary>internal sealed class Gdd03AssignmentFixture{@@ -95,8 +95,8 @@ namespace Statecraft.Simif (target != null){if (!slots.TryGetValue(target, out var slot)) throw new ArgumentException("Unknown fixture slot.");- // This is a refusal/deferred result, not a chosen shipped idempotency policy.- if (person.Assignment.Target == target) return Gdd03FixtureAssignmentResult.DeferredSameSlot;+ // Owner, 28 October 2026 (#1668 Q34): assigning the same job is a no-op.+ if (person.Assignment.Target == target) return Gdd03FixtureAssignmentResult.NoOp;if (ledger.Units.Count(p => p.Assignment.Kind == PopulationAssignmentKind.Work && p.Assignment.Target == target) >= slot.Capacity)throw new ArgumentException("Fixture destination is full.");}