A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Refuse an Arms purchase that would borrow past the debt ceiling (#2198) (#2203)
Eyal Golan4396979fe91a
diff --git a/changelog.d/2198-arms-ceiling.md b/changelog.d/2198-arms-ceiling.mdnew file mode 100644index 000000000..9b99560c1--- /dev/null+++ b/changelog.d/2198-arms-ceiling.md@@ -0,0 +1,6 @@+### Changed++- An Arms purchase that would borrow past the IL 250m debt ceiling is now refused, with the reason "Buying that many+ Arms would take the debt past its ceiling", in English and Hebrew; the Defence screen shows it before End turn (Fixes #2198).+ Owner ruling, 2 November 2026: "Refuse buys over ceiling (Recommended)". A debt exactly at the ceiling is allowed, a+ purchase paid in full from the Treasury is never refused, and every other cost still borrows past the ceiling.diff --git a/docs/GDD.md b/docs/GDD.mdindex e8fa4bb6e..2417fb581 100644--- a/docs/GDD.md+++ b/docs/GDD.md@@ -351,7 +351,7 @@ On 1 November 2026 the owner approved an answer to every open GDD 0.3 question:**Other answers, by area** (all approved on 1 November 2026; the comment gives each one's reason):-- **Economy and Food.** Foreign currency stays the internal ledger under Money, so the sourced 1951 crisis still cuts the Food import (Q2) (owner 2 Nov, #813: the player may convert up to $4m a month of foreign currency into Money during the war, $100m in total, via one foreign-currency readout; note that a top-bar foreign-currency meter already existed on main, see #2204; [later rulings](#later-rulings-2-november-2026)). A bond or loan card adds its Money and the same principal to Debt, with no interest or schedule, and its figures must be sourced (Q5). Every deficit is borrowed (Q21, Q24). `debt_ceiling` (IL 250m) is only the "Money exhausted" threshold of the economic defeat; no order is refused at it (Q22) (except Arms purchases: refused past the ceiling, owner 2 Nov, #2198; [later rulings](#later-rulings-2-november-2026)). Debt starts at 0 and Money is IL 1m (Q23). The economic defeat is Debt at or above the ceiling and Food at 0 for `defeat_turns` (3) turn ends in a row (Q25), read before this turn's borrowing (Q26). Purchases and unaffordable courses borrow automatically (Q56, 27M-6). `food_supply` stays the 0-1 readout (Q6). A unit with strength 1 or more never counts below 1 after a modifier (Q7). `BuyArms` is a waiting order, editable or withdrawn at no cost until End turn and final after it; there are no player Food purchases in the MVP (Q45-Q47).+- **Economy and Food.** Foreign currency stays the internal ledger under Money, so the sourced 1951 crisis still cuts the Food import (Q2) (owner 2 Nov, #813: the player may convert up to $4m a month of foreign currency into Money during the war, $100m in total, via one foreign-currency readout; note that a top-bar foreign-currency meter already existed on main, see #2204; [later rulings](#later-rulings-2-november-2026)). A bond or loan card adds its Money and the same principal to Debt, with no interest or schedule, and its figures must be sourced (Q5). Every deficit is borrowed (Q21, Q24). `debt_ceiling` (IL 250m) is only the "Money exhausted" threshold of the economic defeat; no order is refused at it (Q22) (except Arms purchases: refused past the ceiling, owner 2 Nov, #2198, R-ARMS-002; [later rulings](#later-rulings-2-november-2026)). Debt starts at 0 and Money is IL 1m (Q23). The economic defeat is Debt at or above the ceiling and Food at 0 for `defeat_turns` (3) turn ends in a row (Q25), read before this turn's borrowing (Q26). Purchases and unaffordable courses borrow automatically (Q56, 27M-6). `food_supply` stays the 0-1 readout (Q6). A unit with strength 1 or more never counts below 1 after a modifier (Q7). `BuyArms` is a waiting order, editable or withdrawn at no cost until End turn and final after it; there are no player Food purchases in the MVP (Q45-Q47).- **Events and indicators.** The seven Attention, passive-budget and refill cards lose only their Attention effects under `gdd-0.3` (Q1). Rationing and ma'abarot cards stay indicator-only (Q3). Events may write Money, Arms, the Food stock, Social cohesion and International Support; housing condition and `food_supply` are readouts (Q4). `start.cohesion` and `start.support` are opening values only, and the rationing and security links stay (Q17, Q18). The #1716 snapshot lands before the indicator changes, with no regional workforce helper (Q19).- **Population and courses.** Commands on "N units" take ascending population ids; a returned captive keeps their id and military qualification, comes back unequipped and joins the nearest friendly city as a civilian (Q10, 27M-20). Event grants and arrivals take new ids as refugees in a city, and natural increase stays the national rate, 0.0169 a year ("Keep the national rate (Recommended)", Q11). A course occupies its people from its first turn (Q43(a)); they are released in the turn its last course turn counts and can be assigned from the next planning, or at once on cancellation, and work starts the turn after (Q43(b), Q43(c)). One veteran teacher and one pupil per centre, the teacher housed in the centre's city (Q42). A cancelled or slot-losing course is cancelled like `CancelTraining`, people return as civilians, Money and tools are not refunded and Arms return to the pool (Q44, Q52, 27M-3, 27M-4). Graduates join their city's civilians and may re-enrol at any time (27M-5). A course occupies the person for any other job, course, pioneer work or military order, without changing their housing (#1697 follow-up). The novice craftsman label starts with the craftsman course and ends on cancelling (#1698 follow-up). Workshop work by a novice changes no qualification (Q55). A draft withdrawn before End turn leaves nothing to settle (Q53).- **Work and fields.** A worker works in their own city and farmers live in the region they farm (Q27). Employed means civilians and craftsmen in job slots over civilians plus craftsmen, and `work_lifts_cohesion` stays (Q35). Starting fields are the authored list from the owner-approved per-region split of 27 October 2026, with no numeric threshold (Q36); the 20 farmer / 8 Industry split is symbolic and kept (MAN-1). Only an Israeli-held hex can be farmed (Q37). A retaken field resumes through the city's job default (27M-1). Farming counts whole months from the month's snapshot (27M-2). A workshop reserves its cycle at the monthly production step, repeats automatically each month while staffed ("Automatic monthly (Recommended)"), takes any free civilian at the worker's cost tier, and loses progress and paid Money on cancellation (27M-11 to 27M-14). New housing and repairs follow the Money-plus-work rule for city projects, and repairs wait for #1700 (#1703 follow-ups a and b).diff --git a/docs/gdd/balance.md b/docs/gdd/balance.mdindex 4a85392c1..0cc58e7d7 100644--- a/docs/gdd/balance.md+++ b/docs/gdd/balance.md@@ -119,7 +119,7 @@ The proposed immigration mix and ship schedule are non-operative [S1]. Retained| Key | Value | Unit / meaning | Basis || --- | --- | --- | --- |-| `money.debt_ceiling` | `250` | IL millions of debt at which Money is exhausted | Retained `debt_ceiling` value [S10]; only the threshold of the economic defeat, not a credit cap: no order is refused or part-funded at it (owner, 1 November 2026, Q22) [S12] |+| `money.debt_ceiling` | `250` | IL millions of debt at which Money is exhausted | Retained `debt_ceiling` value [S10]; only the threshold of the economic defeat, not a credit cap: no order is refused or part-funded at it (owner, 1 November 2026, Q22) [S12], except an Arms purchase whose borrowing would take Debt past it, which is refused (owner, 2 November 2026, #2198: "Refuse buys over ceiling (Recommended)", https://github.com/eyalgolan/statecraft-israel/issues/2198#issuecomment-6564721486) || starting Debt | `0` | IL millions | Owner, 1 November 2026, Q23 [S12]: main has no start key, and Money is IL 1m a unit (`money.il_millions`) || `defeat_turns` | `3` | turn ends in a row with Money and Food exhausted | Retained `R-END-002` value [S10]; owner, 1 November 2026, Q25 [S12] |diff --git a/docs/gdd/cutover-resource-layer.md b/docs/gdd/cutover-resource-layer.mdindex 0ac3d29d9..5b858b1b7 100644--- a/docs/gdd/cutover-resource-layer.md+++ b/docs/gdd/cutover-resource-layer.md@@ -41,7 +41,7 @@ The proposed non-housing-first payment and regional housing-proration rule is paThe proposed regional housing-upkeep formula and its settlement ordering are part of that declined proposal and are non-operative.-Money and Food exhaustion remain defeat triggers under [the retained end rules](ministers-events-end.md#rules). For Amir's proposal to limit unpaid Money to housing effects, the owner's 30 October 2026 conflict review did not rule on this [S1]; borrowing under `R-MONEY-003` (`docs/rules/mvp.md:399`) stays operative for every category (owner, 1 November 2026, D1, Q21 and Q24) [S12]. `debt_ceiling` is only the economic-defeat threshold, not a credit cap (Q22), and Debt starts at 0 (Q23) [S12]. (unitless)+Money and Food exhaustion remain defeat triggers under [the retained end rules](ministers-events-end.md#rules). For Amir's proposal to limit unpaid Money to housing effects, the owner's 30 October 2026 conflict review did not rule on this [S1]; borrowing under `R-MONEY-003` (`docs/rules/mvp.md:399`) stays operative for every category (owner, 1 November 2026, D1, Q21 and Q24) [S12]. `debt_ceiling` is only the economic-defeat threshold, not a credit cap (Q22), except that an Arms purchase whose borrowing would take Debt past it is refused (owner, 2 November 2026, #2198: "Refuse buys over ceiling (Recommended)", https://github.com/eyalgolan/statecraft-israel/issues/2198#issuecomment-6564721486), and Debt starts at 0 (Q23) [S12]. (unitless)### Fooddiff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex 9eceb6d09..fa52f8baf 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -418,7 +418,7 @@ The national Arms pool (D-G6, decided 15 October 2026: "From events (sourced armR-ARMS-001: Arms is a national stock of whole units (`GameState.Arms`, hashed as `arms=` only when not 0); one Arms is the equipment package for one recruit group of `people_per_unit` (1,000) people. A new game starts the stock at `arms_start` (12). It never goes below 0. `arms_start`, `arms_price` and `arms_per_recruit_group` are required in the GDD loop (`rules.yaml` `mvp:`); a missing or negative value is a load error.-R-ARMS-002: `BuyArms(count)` adds `count` units to the stock at once, with no delivery delay, and the Treasury pays `count * arms_price` (IL 1m an Arms), borrowing what it lacks (R-MONEY-003). It is refused, state and Attention unchanged, for fewer than one unit or a stock that would pass a whole number's range; the legacy loop refuses it before charging Attention. Its Attention cost is `attention_cost.buy_arms` (1), whatever the count.+R-ARMS-002: `BuyArms(count)` adds `count` units to the stock at once, with no delivery delay, and the Treasury pays `count * arms_price` (IL 1m an Arms), borrowing what it lacks (R-MONEY-003). It is refused, state and Attention unchanged, for fewer than one unit, a stock that would pass a whole number's range, or a purchase whose borrowing would take the debt past `debt_ceiling` (#2198; owner, 2 November 2026: "Refuse buys over ceiling (Recommended)", https://github.com/eyalgolan/statecraft-israel/issues/2198#issuecomment-6564721486), with the reason "Buying that many Arms would take the debt past its ceiling"; the legacy loop refuses it before charging Attention. The debt after is R-MONEY-003's: the debt plus what the Treasury lacks (`Debt + max(0, cost - Treasury)`). A debt exactly at the ceiling is allowed, and a purchase the Treasury pays in full borrows nothing and is never refused at it, even with the debt already past it. This overrides Q22 for Arms purchases only; every other cost still borrows past the ceiling (R-MONEY-003). The Defence screen shows the same reason before End turn when the amount would be refused at the current Treasury and debt. Its Attention cost is `attention_cost.buy_arms` (1), whatever the count.R-ARMS-003: Recruit training (R-TRAIN-001) takes `arms_per_recruit_group` (1) Arms for each group when it starts, after its other checks and before it pays. A stock short of that refuses the order with a reason naming the need and the stock, state and Attention unchanged (Q-UNIT-3). A gun or armoured car crew takes its type's `training_arms` a group instead, by the same rule (R-UNIT-008). Pioneer training takes no Arms. The cohort keeps the Arms it took, and the state hash writes them with it; cancelling the cohort (R-TRAIN-002) returns them to the pool, up to the most the stock can hold, although the Money stays paid (owner, 18 October 2026, #1047: "Refund on cancel"). Replacement groups (R-TRAIN-004) take their course's Arms by the same rule (owner, 23 October 2026, #1510: "Replacements cost Arms").diff --git a/sim/Statecraft.Sim.Tests/PoolsTests.cs b/sim/Statecraft.Sim.Tests/PoolsTests.csindex d8130f884..02baf7dc8 100644--- a/sim/Statecraft.Sim.Tests/PoolsTests.cs+++ b/sim/Statecraft.Sim.Tests/PoolsTests.cs@@ -289,6 +289,82 @@ public class PoolsTestsAssert.Equal(s.Hash(), after.Hash());}+ // #2198, owner 2 Nov 2026 "Refuse buys over ceiling (Recommended)": a purchase whose borrowing would take the debt past+ // mvp.debt_ceiling is refused, the state untouched. The debt after is PayOrBorrow's: the debt plus what the Treasury+ // lacks (the fixture's ceiling is 10, its price 0.25 an Arms).+ [Fact]+ public void APurchaseThatWouldBorrowPastTheDebtCeilingIsRefused()+ {+ var c = Gdd();+ Assert.Equal(10.0, c.Rules.Mvp!.DebtCeiling);+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ s.Treasury = 0.5;+ s.Debt = 8;+ var after = s.Clone();+ var why = new List<Cause>();+ // 11 Arms cost 2.75: 0.5 from the Treasury, 2.25 borrowed, debt 10.25 > 10.+ Assert.Equal("Buying that many Arms would take the debt past its ceiling", Pools.BuyArms(c, after, 11, why));+ Assert.Equal((0.5, 8.0, 20), (after.Treasury, after.Debt, after.Arms));+ Assert.Equal(s.Hash(), after.Hash());+ Assert.Empty(why);+ }++ // #2198: debt landing exactly on the ceiling is allowed (the ceiling is not passed); one unit more is refused.+ [Fact]+ public void APurchaseThatBorrowsExactlyToTheCeilingIsAllowed()+ {+ var c = Gdd();+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ s.Treasury = 0.5;+ s.Debt = 8;+ var more = s.Clone();+ // 10 Arms cost 2.5: 0.5 from the Treasury, 2.0 borrowed, debt exactly 10.+ Assert.Null(Pools.BuyArms(c, s, 10, new List<Cause>()));+ Assert.Equal((0.0, 10.0, 30), (s.Treasury, s.Debt, s.Arms));+ Assert.NotNull(Pools.BuyArms(c, more, 11, new List<Cause>()));+ Assert.Equal((0.5, 8.0, 20), (more.Treasury, more.Debt, more.Arms));+ }++ // #2198: a purchase the Treasury pays in full borrows nothing, so the ceiling never refuses it, even with the debt+ // already past the ceiling.+ [Fact]+ public void APurchasePaidFromTheTreasuryIgnoresTheCeiling()+ {+ var c = Gdd();+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ s.Treasury = 3;+ s.Debt = 12;+ Assert.Null(Pools.BuyArms(c, s, 12, new List<Cause>()));+ Assert.Equal((0.0, 12.0, 32), (s.Treasury, s.Debt, s.Arms));+ }++ // #2198 changes only Arms: every other cost still borrows past the ceiling (R-MONEY-003; Q22 stands for them).+ [Fact]+ public void OtherBorrowingStillPassesTheCeiling()+ {+ var c = Gdd();+ var s = Simulation.NewGame(c, 1, Mode.Historical);+ s.Treasury = 0;+ s.Debt = 10;+ var why = new List<Cause>();+ EconomySystem.PayOrBorrow(c, s, 5, "for training", why, CauseKeys.Purpose.Arms);+ Assert.Equal((0.0, 15.0), (s.Treasury, s.Debt));+ var t = Simulation.Step(c, s, Array.Empty<Command>()).State;+ Assert.True(t.Debt > s.Debt, $"the turn's own borrowing still adds to a debt past the ceiling ({s.Debt} -> {t.Debt})");+ }++ // #2198, the reported case: on the real content, 999 Arms on the first turn (IL 979m borrowed, debt IL 985m against the+ // IL 250m ceiling) is refused, and the turn is the turn with no order (the Attention refunded too).+ [Fact]+ public void TheReportedFirstTurnPurchaseOf999ArmsIsRefused()+ {+ var s = Simulation.NewGame(Real, GoldenRun.Seed, Mode.Historical);+ var r = Simulation.Step(Real, s, new Command[] { new BuyArms(999) });+ Assert.Equal("Buying that many Arms would take the debt past its ceiling", Assert.Single(r.Rejected).Reason);+ Assert.Equal(Step(Real, s).Hash(), r.State.Hash());+ Assert.Equal(s.Arms, r.State.Arms);+ }+// R-ARMS-001 to R-ARMS-003: missing or negative values are load errors, never a default.[Theory][InlineData(" arms_start: 20\n", " arms_start: -1\n", "mvp.arms_start", ">= 0")]diff --git a/sim/Statecraft.Sim/Pools.cs b/sim/Statecraft.Sim/Pools.csindex 5b4c466d9..a99b78921 100644--- a/sim/Statecraft.Sim/Pools.cs+++ b/sim/Statecraft.Sim/Pools.cs@@ -36,14 +36,21 @@ namespace Statecraft.Sims.Arms = r.ArmsStart!.Value; // R-ARMS-001; the loader requires it in the GDD loop}+ /// <summary>R-ARMS-002's refusal at the debt ceiling (#2198); SimBridge.ReasonKeys gives it the UI's words.</summary>+ public const string RefusedDebtCeiling = "Buying that many Arms would take the debt past its ceiling";+/// <summary>R-ARMS-002 (D-G6): <paramref name="count"/> Arms join the stock at once, and the Treasury pays- /// count * arms_price, borrowing what it lacks (R-MONEY-003). Refused, state untouched, for fewer than one unit or a- /// stock that would pass a whole number's range. Step has already refused it in the legacy loop.</summary>+ /// count * arms_price, borrowing what it lacks (R-MONEY-003). Refused, state untouched, for fewer than one unit, a+ /// stock that would pass a whole number's range, or borrowing that would take the debt past mvp.debt_ceiling (#2198,+ /// owner 2 Nov 2026: "Refuse buys over ceiling (Recommended)"; the debt after is PayOrBorrow's, the debt plus what the+ /// Treasury lacks, and exactly at the ceiling is allowed). A purchase the Treasury pays in full borrows nothing and is+ /// never refused at the ceiling. Step has already refused it in the legacy loop.</summary>public static string? BuyArms(Content c, GameState s, int count, List<Cause> why){PopulationLedger.RefuseAggregate(s);if (count < 1) return "Buy at least 1 Arms";if ((long)s.Arms + count > int.MaxValue) return "That is more Arms than the stock can hold";+ if (BorrowsPastDebtCeiling(c, s, count)) return RefusedDebtCeiling;var cost = count * c.RulesAt(s.Date).Mvp!.ArmsPrice!.Value;EconomySystem.PayOrBorrow(c, s, cost, "for Arms", why, CauseKeys.Purpose.Arms);s.Arms += count;@@ -51,6 +58,16 @@ namespace Statecraft.Simreturn null;}+ /// <summary>#2198: true when paying for <paramref name="count"/> Arms now would borrow (PayOrBorrow: the Treasury stops at 0+ /// and the rest goes to Debt) and take the debt past mvp.debt_ceiling. Exactly at the ceiling is not past it. BuyArms+ /// refuses on it, and the Defence screen says so before End turn.</summary>+ public static bool BorrowsPastDebtCeiling(Content c, GameState s, int count)+ {+ var r = c.RulesAt(s.Date).Mvp!;+ var left = s.Treasury - count * r.ArmsPrice!.Value;+ return left < 0 && s.Debt - left > r.DebtCeiling!.Value; // the loader requires both in the GDD loop+ }+/// <summary>The nation's need for one turn: its head count in population units, rounded half away from zero.</summary>static int Need(GameState s, MvpRules r) => (int)Math.Round(s.TotalPopulation / r.PeoplePerUnit, MidpointRounding.AwayFromZero);diff --git a/unity/Assets/Scripts/UI/ArmsPurchasePresenter.cs b/unity/Assets/Scripts/UI/ArmsPurchasePresenter.csindex ef7d03adc..9c166046e 100644--- a/unity/Assets/Scripts/UI/ArmsPurchasePresenter.cs+++ b/unity/Assets/Scripts/UI/ArmsPurchasePresenter.cs@@ -29,7 +29,8 @@ namespace Statecraft.Game.UI{var reason = bridge.Queue(new BuyArms(count.value));Render();- panel.Q<Label>("arms-refusal").text = reason ?? "";+ // Only Queue's own refusal replaces Render's line: an accepted order keeps its warning (the debt ceiling, #2198).+ if (reason != null) panel.Q<Label>("arms-refusal").text = reason;};presses = new PressSource(panel);onWithdraw = () =>@@ -69,7 +70,9 @@ namespace Statecraft.Game.UIwithdraw.SetEnabled(s.GameOver == null && queued != null);panel.Q<Label>("arms-refusal").text = s.GameOver != null ? text["order.game_over"]: count.value < 1 ? text["arms.minimum"]- : !bridge.CanPay(order) ? text["arms.no_attention"] : "";+ : !bridge.CanPay(order) ? text["arms.no_attention"]+ // #2198: the sim refuses this amount at End turn if the state stays as it is now (Pools.BuyArms).+ : Pools.BorrowsPastDebtCeiling(c, s, count.value) ? text["arms.refused_debt_ceiling"] : "";}public void Dispose()diff --git a/unity/Assets/Scripts/UI/SimBridge.cs b/unity/Assets/Scripts/UI/SimBridge.csindex ade65f914..3ea78a20a 100644--- a/unity/Assets/Scripts/UI/SimBridge.cs+++ b/unity/Assets/Scripts/UI/SimBridge.cs@@ -201,7 +201,7 @@ namespace Statecraft.Game.UIreturn Unknown("city_project", p.ProjectKind, Content.ProjectKinds.Select(x => x.Id)) ?? Unknown("city", p.City, Content.Cities.Select(x => x.Id));case CancelProject x:return Unknown("city_project", x.Project.ToString(System.Globalization.CultureInfo.InvariantCulture), State.CityProjects.Keys.Select(k => k.ToString(System.Globalization.CultureInfo.InvariantCulture)));- // Buying Arms (#781): no ids; the sim refuses a count below one itself.+ // Buying Arms (#781): no ids; the sim refuses a count below one, and borrowing past the debt ceiling (#2198), itself.case BuyArms _: return null;// Answering a capture (#797): the sim refuses a place not awaiting the choice, or an outcome not built yet, with// its own reason and never throws on the id. The capture dialog is PR 10.@@ -212,7 +212,8 @@ namespace Statecraft.Game.UI}}- /// <summary>The sim's English refusals that have a UI string: Movement's artillery refusal and Orders.Check's (#2045).+ /// <summary>The sim's English refusals that have a UI string: Movement's artillery refusal, Orders.Check's (#2045) and+ /// the Arms purchase refused at the debt ceiling (#2198)./// Keyed on the English, so the same words from another check (Movement, Combat, Training, Demobilization give "That/// unit is not yours", "There is no such unit" too) read in the UI's language as well.</summary>static readonly Dictionary<string, string> ReasonKeys = new Dictionary<string, string>@@ -233,6 +234,7 @@ namespace Statecraft.Game.UI[Training.RefusedNoCity] = "unit.reinforce_refused.no_city",[Training.RefusedNoTraining] = "unit.reinforce_refused.no_training",[Training.RefusedCount] = "unit.reinforce_refused.count",+ [Pools.RefusedDebtCeiling] = "arms.refused_debt_ceiling",};/// <summary>The sim's refusals that carry values (#2072: Combat.Check's Arms, Training.Reinforce's unit, settlement,diff --git a/unity/Assets/Tests/EditMode/FoodArmsHudTests.cs b/unity/Assets/Tests/EditMode/FoodArmsHudTests.csindex b0b33b9e7..990650397 100644--- a/unity/Assets/Tests/EditMode/FoodArmsHudTests.cs+++ b/unity/Assets/Tests/EditMode/FoodArmsHudTests.cs@@ -221,6 +221,34 @@ public class FoodArmsHudTestsAssert.AreEqual(t["order.game_over"], ui.Q<Label>("arms-refusal").text);}+ // #2198: the panel says ahead of End turn when the amount would borrow past the debt ceiling, in the sim's own check;+ // exactly at the ceiling says nothing. Buy stays available, and the sim decides when the turn runs.+ [TestCase(false, false)] [TestCase(false, true)]+ [TestCase(true, false)] [TestCase(true, true)]+ public void TheAmountThatWouldBorrowPastTheDebtCeilingIsExplained(bool modern, bool he)+ {+ var b = Bridge(modern, he); var t = Text(he);+ using var ui = new UiTestKit();+ using var defence = new DefencePresenter(ui.Root, b, t);+ var r = b.Content.RulesAt(b.State.Date).Mvp!;+ b.State.Treasury = 0;+ b.State.Debt = r.DebtCeiling!.Value - r.ArmsPrice!.Value;+ var count = ui.Q<IntegerField>("arms-count");+ count.value = 1;+ Assert.IsEmpty(ui.Q<Label>("arms-refusal").text, "exactly at the ceiling is allowed");+ count.value = 2;+ Assert.AreEqual(t["arms.refused_debt_ceiling"], ui.Q<Label>("arms-refusal").text);+ Assert.IsTrue(ui.Q<Button>("buy-arms").enabledSelf, "a refusal remains explainable");+ // Pressing Buy queues the order (the sim decides at End turn) and keeps the warning on screen (review of #2203).+ ui.Press("buy-arms");+ Assert.AreEqual(2, ((BuyArms)b.Queued.Single()).Count);+ Assert.AreEqual(t["arms.refused_debt_ceiling"], ui.Q<Label>("arms-refusal").text, "Buy does not clear the warning");+ ui.Press("withdraw-arms");+ b.State.Treasury = 2 * r.ArmsPrice!.Value;+ count.value = 1; count.value = 2;+ Assert.IsEmpty(ui.Q<Label>("arms-refusal").text, "paid from the Treasury, nothing is borrowed");+ }+[Test]public void PoolCausesIgnoreTheSupplyIndicatorAndKeepTheSimTieOrder(){diff --git a/unity/Assets/Tests/EditMode/HebrewUiTests.cs b/unity/Assets/Tests/EditMode/HebrewUiTests.csindex fefdb157e..c1abd7ff3 100644--- a/unity/Assets/Tests/EditMode/HebrewUiTests.cs+++ b/unity/Assets/Tests/EditMode/HebrewUiTests.cs@@ -90,6 +90,18 @@ public class HebrewUiTests}}+ // #2198: the Arms purchase refused at the debt ceiling reaches the end-of-turn toast (ReasonText) in both languages.+ [Test]+ public void TheArmsDebtCeilingRefusalHasAStringInBothLanguages()+ {+ var reason = Statecraft.Sim.Pools.RefusedDebtCeiling;+ Assert.AreEqual(reason, SimBridge.ReasonText(En, reason), "the English string is the sim's own");+ var he = SimBridge.ReasonText(He, reason);+ Assert.AreNotEqual(reason, he, "no Hebrew string for: " + reason);+ StringAssert.IsMatch("[א-ת]", he, reason);+ StringAssert.DoesNotMatch("[A-Za-z]", he, reason);+ }+// #2072: every Combat.Check and Training.Reinforce refusal (their Refused* constants) has a string in both files. Each// format is filled with distinct values as the sim fills it (a multi-word town, a real course, different numbers) and read// with content: the English is the sim's own text, the Hebrew is its line with the Hebrew town and course in their slots,diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 82df039fa..296fa0196 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -953,6 +953,9 @@ arms.attention: "Attention cost: {0:0.0} · Left: {1:0.0}"arms.queued: "Arms ordered: {0:N0}, at End turn"arms.minimum: "Buy at least 1 Arms. Enter a larger amount."arms.no_attention: "Not enough Attention for this purchase. Withdraw another order or wait until next turn."+# #2198 (owner, 2 Nov 2026: "Refuse buys over ceiling (Recommended)"): Pools.BuyArms's refusal, word for word, shown in the+# end-of-turn toast.+arms.refused_debt_ceiling: "Buying that many Arms would take the debt past its ceiling"# #731 stock summaries in the report and Why.report.stock_line: "{0}: {1}"diff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 5e16e1651..7d5ae8186 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -1059,6 +1059,8 @@ arms.attention: "עלות תשומת לב: {0:0.0} · נותר: {1:0.0}"arms.queued: "נשק שהוזמן: {0:N0}, בסיום התור"arms.minimum: "יש לרכוש לפחות יחידת נשק אחת. יש להזין כמות גדולה יותר."arms.no_attention: "אין די תשומת לב לרכישה. יש לבטל הוראה אחרת או להמתין לתור הבא."+# #2198: agent-drafted Hebrew; native review: owner, 2 Nov 2026, "Hebrew is right (Recommended)".+arms.refused_debt_ceiling: "רכישת כמות כזאת של נשק תעלה את החוב מעל התקרה"# #731 stock summaries in the report and Why.# native-review-pending