A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Comments: name gdd03-balance keys instead of line numbers (#2365)
Eyal Golanaa29a9b112b4
diff --git a/changelog.d/wT-cite-tidy.md b/changelog.d/wT-cite-tidy.mdnew file mode 100644index 000000000..5f50e7800--- /dev/null+++ b/changelog.d/wT-cite-tidy.md@@ -0,0 +1,4 @@+### Changed++- Sim and test comments that cited `content/gdd03-balance.yaml` by line number now name the balance keys instead, so+ they stay right when the file changes. No user-visible change.diff --git a/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.cs b/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.csindex f8a4d1b09..8513a08ec 100644--- a/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.cs+++ b/sim/Statecraft.Sim.Tests/ArmsWorkshopTests.cs@@ -399,7 +399,7 @@ public class ArmsWorkshopTests// ---- #1722 review (F1, C4): the hex panel's next-cycle price and cycle length come from the sim ----// R-ARMS-006: the price NextCyclePrice gives before a turn is the worker's tier price (gdd03-balance workshop.cost 5/4/3,- // content/gdd03-balance.yaml:306) and what that turn's production step charges and records, at every worker tier.+ // content/gdd03-balance.yaml) and what that turn's production step charges and records, at every worker tier.[Theory][InlineData(SyntheticWorkshopTier.Ordinary, 5)][InlineData(SyntheticWorkshopTier.Novice, 5)]diff --git a/sim/Statecraft.Sim.Tests/Gdd03CraftArithmeticTests.cs b/sim/Statecraft.Sim.Tests/Gdd03CraftArithmeticTests.csindex e7754cf8f..94a509a3e 100644--- a/sim/Statecraft.Sim.Tests/Gdd03CraftArithmeticTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03CraftArithmeticTests.cs@@ -7,7 +7,7 @@ public class Gdd03CraftArithmeticTestsstatic Gdd03BalanceCatalogue Catalogue() => ContentLoader.Load(RealContentTests.ContentRoot()).Gdd03Balance!;static Gdd03CraftArithmetic Arithmetic() => Gdd03CraftArithmetic.Read(Catalogue());- // R-CRAFT-001/002: expected values independently transcribed from gdd03-balance.yaml:138-185,190-193. The course is+ // R-CRAFT-001/002: expected values independently transcribed from gdd03-balance.yaml `industry.income`, `farmer.output`, `profession.*`, `pioneer.work_rate`, `craft.*` and `builder.work_rate`. The course is// 0.5 Money and 3 turns (owner ruling, 30 October 2026: "Keep the set values (Recommended)"; #2115), not Amir's 5 / 6.[Theory][InlineData("he-IL")]diff --git a/sim/Statecraft.Sim.Tests/Gdd03MilitaryCatalogueTests.cs b/sim/Statecraft.Sim.Tests/Gdd03MilitaryCatalogueTests.csindex eddb597f3..c5f0eac3c 100644--- a/sim/Statecraft.Sim.Tests/Gdd03MilitaryCatalogueTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03MilitaryCatalogueTests.cs@@ -14,7 +14,7 @@ public class Gdd03MilitaryCatalogueTests[Fact] public void ReadsEverySettledNonCombatTermAsAnImmutableSnapshot(){var c = Catalogue(); var terms = Gdd03MilitaryCatalogue.Read(c);- // content/gdd03-balance.yaml:307-354; #1668 balance.md:129-137 at 605277df.+ // content/gdd03-balance.yaml `military.camp_capacity` to `military.active_money`; #1668 balance.md:129-137 at 605277df.// camp_capacity: #1668's 5 places at 10,000 people a unit is 50 units at 1,000 a unit (owner, 1 November 2026:// "Main's base x 0.3's tiers (Recommended)"; #2112).Assert.Equal(50, terms.CampCapacity); Assert.Equal(3, terms.BasicTurns);diff --git a/sim/Statecraft.Sim.Tests/Gdd03ProjectCatalogueTests.cs b/sim/Statecraft.Sim.Tests/Gdd03ProjectCatalogueTests.csindex 951a8f076..f5559547f 100644--- a/sim/Statecraft.Sim.Tests/Gdd03ProjectCatalogueTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03ProjectCatalogueTests.cs@@ -28,7 +28,7 @@ public class Gdd03ProjectCatalogueTestsAssert.Equal(3m, c.BuilderSlots.Amount);Assert.Equal(1m, c.CityStarts.Amount);Assert.Equal(new[] { 1m, 1.5m, 3m }, new[] { c.OrdinaryOrNoviceRate.Amount, c.ApprenticeRate.Amount, c.ExpertRate.Amount });- // content/gdd03-balance.yaml:524-667; GDD balance.md:78-84 at 605277df.+ // content/gdd03-balance.yaml `maabara`, `permanent_housing`, `industry`, `reception_camp`, `training_centre`, `arms_workshop` and `military_camp`; GDD balance.md:78-84 at 605277df.var expected = new[] {("maabara", 5m, 1m, 0.10m), ("permanent_housing", 15m, 3m, 0.25m),("industry", 10m, 3m, 0.25m), ("reception_camp", 10m, 3m, 0.25m),diff --git a/sim/Statecraft.Sim.Tests/Gdd03ReceptionFixtureTests.cs b/sim/Statecraft.Sim.Tests/Gdd03ReceptionFixtureTests.csindex 50e275987..a9ff626b6 100644--- a/sim/Statecraft.Sim.Tests/Gdd03ReceptionFixtureTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03ReceptionFixtureTests.cs@@ -10,7 +10,7 @@ public class Gdd03ReceptionFixtureTestsstatic Content Catalogue(){var c = PopulationLedgerTests.Content();- // content/gdd03-balance.yaml:214-221 at the pinned base: Agreed 3 beds, 6 turns.+ // content/gdd03-balance.yaml `reception.capacity` and `reception.turns` at the pinned base: Agreed 3 beds, 6 turns.c.Gdd03Balance!.Values["reception.capacity"] = new Gdd03DesignValue {Basis = "Agreed", Values = new() { 3 }, Note = "Agreed catalogue reception.capacity" };return c;diff --git a/sim/Statecraft.Sim.Tests/Gdd03SyntheticAbsorptionBoundaryTests.cs b/sim/Statecraft.Sim.Tests/Gdd03SyntheticAbsorptionBoundaryTests.csindex c88d8748c..0784e79aa 100644--- a/sim/Statecraft.Sim.Tests/Gdd03SyntheticAbsorptionBoundaryTests.cs+++ b/sim/Statecraft.Sim.Tests/Gdd03SyntheticAbsorptionBoundaryTests.cs@@ -8,7 +8,7 @@ public class Gdd03SyntheticAbsorptionBoundaryTestsContentLoader.Load(RealContentTests.ContentRoot()).Gdd03Balance!;// All counts here are test-only synthetic settled facts, not population/region initialization.- // 100/101 follows the strict target/scale in gdd03-balance.yaml:46-49,512-515.+ // 100/101 follows the strict target/scale in gdd03-balance.yaml `population.people_per_unit` and `absorption.population_target`.[Theory][InlineData(100, false)][InlineData(101, true)]diff --git a/sim/Statecraft.Sim/Gdd03HousingFormula.cs b/sim/Statecraft.Sim/Gdd03HousingFormula.csindex ab050fc18..64a637ce2 100644--- a/sim/Statecraft.Sim/Gdd03HousingFormula.cs+++ b/sim/Statecraft.Sim/Gdd03HousingFormula.cs@@ -13,7 +13,7 @@ namespace Statecraft.SimGdd03HousingFormula(Gdd03BalanceCatalogue c){- // content/gdd03-balance.yaml:226-253; GDD balance.md:100-105 at 605277df.+ // content/gdd03-balance.yaml `housing.*`; GDD balance.md:100-105 at 605277df.conditionMax = Scalar(c, "housing.condition_max", true);moneyThreshold = Scalar(c, "housing.money_threshold", true);moneySlope = Scalar(c, "housing.money_slope", false);@@ -29,7 +29,7 @@ namespace Statecraft.Sim|| repair.Values.Count != 0 || !string.IsNullOrEmpty(repair.Expression)|| !repair.Parts.TryGetValue("condition_pp", out var effect))throw Invalid("housing_repair", "requires agreed repair condition part");- // content/gdd03-balance.yaml:683-687. No repair cost/work/availability policy here.+ // content/gdd03-balance.yaml `housing_repair.parts.condition_pp`. No repair cost/work/availability policy here.repairPp = Number(effect, "housing_repair.parts.condition_pp", false);}diff --git a/sim/Statecraft.Sim/Gdd03ImmigrationFixture.cs b/sim/Statecraft.Sim/Gdd03ImmigrationFixture.csindex a7b2fa2ed..de1f42445 100644--- a/sim/Statecraft.Sim/Gdd03ImmigrationFixture.cs+++ b/sim/Statecraft.Sim/Gdd03ImmigrationFixture.cs@@ -52,7 +52,7 @@ namespace Statecraft.Simforeach (var port in fixturePorts) { RequiredText(port, "fixture_port"); ports.Add(port); }if (!ports.Contains(doc.FixturePort!)) throw Error("fixture_port", "unknown synthetic fixture reference");- // R-CITY-003: M content/gdd03-balance.yaml:287-298. Preserve Agreed/Default; Deferred is never numeric.+ // R-CITY-003: M content/gdd03-balance.yaml `immigration.*`. Preserve Agreed/Default; Deferred is never numeric.var interval = Numbers(catalogue, "immigration.ship_interval", "Agreed", 1)[0];var average = Numbers(catalogue, "immigration.units_per_ship", "Agreed", 1)[0];var mix = Numbers(catalogue, "immigration.mix", "Default", 4);diff --git a/sim/Statecraft.Sim/Gdd03Military.cs b/sim/Statecraft.Sim/Gdd03Military.csindex 18f051bb3..06c5cf775 100644--- a/sim/Statecraft.Sim/Gdd03Military.cs+++ b/sim/Statecraft.Sim/Gdd03Military.cs@@ -73,7 +73,7 @@ namespace Statecraft.Simif (c.Gdd03Balance == null || c.Gdd03Balance.Ruleset != SaveGame.Gdd03Ruleset || c.Gdd03Balance.Values == null)throw Invalid("combat.draw_count", "requires the separate gdd-0.3 catalogue");var sources = new Dictionary<string, Gdd03CombatSource>(StringComparer.Ordinal);- // content/gdd03-balance.yaml:447-475; GDD 605277df docs/gdd/balance.md:172,180-185.+ // content/gdd03-balance.yaml `combat.draw_count`; GDD 605277df docs/gdd/balance.md:172,180-185.// The parent is Agreed (retained one draw); its thresholds, band and rows remain Default.Gdd03DesignValue Required(string key, string basis, string? part = null){@@ -131,7 +131,7 @@ namespace Statecraft.Simif (next != 100) throw Invalid("combat.draw_count.parts." + name, "bands must cover every draw through 99");rows[row] = result.AsReadOnly();}- // content/gdd03-balance.yaml:484-495; GDD docs/gdd/balance.md:175-177 at 605277df.+ // content/gdd03-balance.yaml `combat.armoured_factor`, `combat.artillery_range` and `combat.artillery_factor`; GDD docs/gdd/balance.md:175-177 at 605277df.decimal Role(string key){var n = List(Required(key, "Default"), key, 1)[0];diff --git a/sim/Statecraft.Sim/Gdd03MilitaryCatalogue.cs b/sim/Statecraft.Sim/Gdd03MilitaryCatalogue.csindex 2e3da8ccc..0d8f6f951 100644--- a/sim/Statecraft.Sim/Gdd03MilitaryCatalogue.cs+++ b/sim/Statecraft.Sim/Gdd03MilitaryCatalogue.cs@@ -3,7 +3,7 @@ using System;namespace Statecraft.Sim{/// <summary>Immutable catalogue contract for #1699; data only, never a live-loop switch.- /// Source: content/gdd03-balance.yaml:307-354 (#1668 balance.md:129-137 at 605277df).+ /// Source: content/gdd03-balance.yaml `military.camp_capacity` to `military.active_money` (#1668 balance.md:129-137 at 605277df)./// No commands, state mutations, combat terms or inferred defaults.</summary>public sealed class Gdd03MilitaryCatalogue{diff --git a/sim/Statecraft.Sim/Gdd03ReceptionFixture.cs b/sim/Statecraft.Sim/Gdd03ReceptionFixture.csindex f4cd30261..6bd2c1fe1 100644--- a/sim/Statecraft.Sim/Gdd03ReceptionFixture.cs+++ b/sim/Statecraft.Sim/Gdd03ReceptionFixture.cs@@ -62,7 +62,7 @@ namespace Statecraft.Simif (syntheticCamps == null) throw new ArgumentNullException(nameof(syntheticCamps));if (!content.UsesPopulationLedger || !opening.UsesPopulationLedger || !opening.PopulationLedger.IsInitialized)throw new InvalidOperationException("Reception requires an initialized exact-gdd-0.3 synthetic fixture.");- // M content/gdd03-balance.yaml:214-221: Agreed capacity 3 and duration 6; no fallback or duplicate constants.+ // M content/gdd03-balance.yaml `reception.capacity` and `reception.turns`: Agreed capacity 3 and duration 6; no fallback or duplicate constants.var capacity = content.RequirePopulationInteger("reception.capacity");var turns = MatchingReceptionTurns(content, opening.PopulationLedger);opening.PopulationLedger.Reconcile();diff --git a/sim/Statecraft.Sim/Gdd03SyntheticFields.cs b/sim/Statecraft.Sim/Gdd03SyntheticFields.csindex 91ac09fd4..ebeb2033e 100644--- a/sim/Statecraft.Sim/Gdd03SyntheticFields.cs+++ b/sim/Statecraft.Sim/Gdd03SyntheticFields.cs@@ -16,7 +16,7 @@ namespace Statecraft.SimnoviceFood = novice; trainedFood = trained; veteranFood = veteran; SlotsPerField = slots;}- // R-FIELD-002: content/gdd03-balance.yaml:142-145,198-201.+ // R-FIELD-002: content/gdd03-balance.yaml `farmer.output` and `field.slots`.public static Gdd03FieldRates FromCatalogue(Gdd03BalanceCatalogue catalogue){if (catalogue == null) throw new ArgumentNullException(nameof(catalogue));diff --git a/unity/Assets/Tests/EditMode/CityProjectPanelTests.cs b/unity/Assets/Tests/EditMode/CityProjectPanelTests.csindex 4dd73845b..02f7dd10a 100644--- a/unity/Assets/Tests/EditMode/CityProjectPanelTests.cs+++ b/unity/Assets/Tests/EditMode/CityProjectPanelTests.cs@@ -602,7 +602,7 @@ public class WorkshopPanelTestsvar (bridge, id) = Game(C03, t);Assert.IsFalse(bridge.State.Workshops.ContainsKey(id), "precondition: never staffed, no record");var next = Workshops.NextCyclePrice(C03, bridge.State, id);- Assert.AreEqual(5m, next, "gdd03-balance workshop.cost, ordinary (content/gdd03-balance.yaml:306)");+ Assert.AreEqual(5m, next, "gdd03-balance workshop.cost, ordinary (content/gdd03-balance.yaml)");using var panel = Panel(ui, bridge, t);var (q, r) = Hex(C03);panel.Show(q, r);