A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Units: a person-checked row's card says so, not "Draft" (Refs #2918, P2) (#3053)
Eyal Golanc310a0c420d2
diff --git a/changelog.d/2918-p2-checked-note.md b/changelog.d/2918-p2-checked-note.mdnew file mode 100644index 000000000..67bea1b14--- /dev/null+++ b/changelog.d/2918-p2-checked-note.md@@ -0,0 +1,6 @@+### Changed++- A unit's card no longer calls a row a person has checked against its sources a draft: its note now reads "Checked by a+ person against its sources; not yet by a historian", also where the position's own sources are Wikipedia only (the+ footer still lists them). A row with a source checked after the person's check, and every draft row, keeps the draft+ note (Refs #2918).diff --git a/unity/Assets/Scripts/Map/Units/UnitData.cs b/unity/Assets/Scripts/Map/Units/UnitData.csindex cfd3688ae..b9620c836 100644--- a/unity/Assets/Scripts/Map/Units/UnitData.cs+++ b/unity/Assets/Scripts/Map/Units/UnitData.cs@@ -179,7 +179,7 @@ namespace Statecraft.Game.Map.Units[YamlIgnore] public bool ReviewedOnGiven { get; private set; }string? reviewedOn;/// <summary>A fact-checked row's day of its person check (#2722). The sim's StartingForces reads it for the release- /// gate; the map does not.</summary>+ /// gate, and the card's person-checked note (<see cref="UnitData.IsPersonChecked"/>, #2918 P2) by the same rule.</summary>public string? CheckedOn { get; set; }/// <summary>Why the map does not draw the unit (the sources name it but do not place it), or null.</summary>public string? Hidden { get; set; }@@ -478,5 +478,23 @@ namespace Statecraft.Game.Map.Units}return any;}++ /// <summary>True when a person has checked the row against its sources (status fact-checked) and no source of its+ /// strength, an anchor or an order target was checked after its checked_on: the release gate's rule+ /// (ReleaseGate.StartingForcesUnchecked, #2722), so a field sourced after the check is not called checked. The+ /// card's person-checked note (#2918 P2; owner, 10 November 2026).</summary>+ public static bool IsPersonChecked(UnitEntry u)+ {+ if (u.Status != "fact-checked" || string.IsNullOrEmpty(u.CheckedOn)) return false;+ bool Later(List<UnitSource>? sources)+ {+ if (sources != null) foreach (var s in sources) if (string.CompareOrdinal(s.Checked, u.CheckedOn) > 0) return true;+ return false;+ }+ if (u.Strength != null && Later(u.Strength.Sources)) return false;+ foreach (var a in u.Anchors) if (Later(a.Sources)) return false;+ if (u.OrderTargets != null) foreach (var a in u.OrderTargets) if (Later(a.Sources)) return false;+ return true;+ }}}diff --git a/unity/Assets/Scripts/UI/UnitCard.cs b/unity/Assets/Scripts/UI/UnitCard.csindex c2d86bd5c..773ed586d 100644--- a/unity/Assets/Scripts/UI/UnitCard.cs+++ b/unity/Assets/Scripts/UI/UnitCard.cs@@ -15,8 +15,9 @@ namespace Statecraft.Game.UI/// never the game's first day: review I1); its formation and first commander where sourced; the sector in the/// source's words; on Israel's units, the national values its token reflects (legacy loop: the reserve call-up sets an/// army token's figures, the security level whether the aircraft fly; GDD loop: the unit's strength sets the figures,- /// Q-UI-3, so only the squadron's card keeps a line, the security level); and its sources, with a draft note that says- /// "Wikipedia only" when the position's own sources are (review M8).</summary>+ /// Q-UI-3, so only the squadron's card keeps a line, the security level); and its sources, with a note: that a person+ /// has checked the row against its sources (<see cref="UnitData.IsPersonChecked"/>, #2918 P2), else a draft note that+ /// says "Wikipedia only" when the position's own sources are (review M8).</summary>public sealed class UnitCard{public string Title = "", Subtitle = "", Body = "", Footer = "", Note = "";@@ -125,7 +126,10 @@ namespace Statecraft.Game.UIBody = string.Join("\n", lines),Footer = t.Raised ? "" : (national == "" ? "" : national + "\n")+ text.Format("unit.sources", string.Join(", ", hosts)),- Note = t.Raised ? "" : (sourced ? UnitData.IsWikipediaOnly(a.Sources) : UnitData.IsWikipediaOnly(u)) ? text["unit.draft_wikipedia"] : text["unit.draft"],+ // A person-checked row says so, on a Wikipedia-only position too (owner, 10 November 2026, #2918 P2: "Your check+ // wins"; the footer still names the hosts); any other row keeps the draft note.+ Note = t.Raised ? "" : UnitData.IsPersonChecked(u) ? text["unit.fact_checked"]+ : (sourced ? UnitData.IsWikipediaOnly(a.Sources) : UnitData.IsWikipediaOnly(u)) ? text["unit.draft_wikipedia"] : text["unit.draft"],};}}diff --git a/unity/Assets/Tests/EditMode/UnitsFromStateTests.cs b/unity/Assets/Tests/EditMode/UnitsFromStateTests.csindex c62fcb0c0..0570ace5d 100644--- a/unity/Assets/Tests/EditMode/UnitsFromStateTests.cs+++ b/unity/Assets/Tests/EditMode/UnitsFromStateTests.cs@@ -162,7 +162,10 @@ public class UnitsFromStateTestsCollectionAssert.Contains(home.Body.Split('\n'), position, "on its starting anchor the card names the place");CollectionAssert.DoesNotContain(card.Body.Split('\n'), position, "no position line for a hex no source names");foreach (var host in t.Unit.AllSources().Select(x => new Uri(x.Url).Host)) StringAssert.Contains(host, card.Footer);- Assert.AreEqual(UnitData.IsWikipediaOnly(t.Unit) ? text["unit.draft_wikipedia"] : text["unit.draft"], card.Note);+ // #2918 P2: a fact-checked row says a person checked it (no starting row has a source checked after its checked_on:+ // ReleaseGate.StartingForcesUnchecked, #2722); any other row keeps the draft note, by the row's sources off a sourced hex.+ Assert.AreEqual(t.Unit.Status == "fact-checked" ? text["unit.fact_checked"]+ : UnitData.IsWikipediaOnly(t.Unit) ? text["unit.draft_wikipedia"] : text["unit.draft"], card.Note, row);}static Unit Raise(GameState s, string type = "recruit", int strength = 2)diff --git a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs b/unity/Assets/Tests/EditMode/UnitsInPlayTests.csindex 0d7cd12fa..27667ca47 100644--- a/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs+++ b/unity/Assets/Tests/EditMode/UnitsInPlayTests.cs@@ -1408,7 +1408,9 @@ public class UnitsInPlayTestsStringAssert.Contains("At Hulda (headquarters for the Latrun attacks) since 24 May 1948", UnitCard.For(Token("brigade_7", latrun), latrun, text).Body);var ship = UnitCard.For(Token("ins_haganah", start), start, text);StringAssert.Contains("commissioned 1948", ship.Subtitle);- StringAssert.Contains("Wikipedia only", UnitCard.For(Token("golani", start), start, text).Note, "Golani is still Wikipedia only; Kiryati cites the Haganah lexicon (P66)");+ // Golani's start (Yavne'el) is still Wikipedia only, but the row is person-checked, and that note wins (#2918 P2,+ // owner, 10 November 2026): CheckedRowsSayAPersonCheckedThemEvenOnAWikipediaOnlyPosition.+ Assert.AreEqual(text["unit.fact_checked"], UnitCard.For(Token("golani", start), start, text).Note);var hatzor = StateAt(new DateTime(1948, 12, 1), 5, 0.8);StringAssert.DoesNotContain(text["unit.draft_wikipedia"], UnitCard.For(Token("squadron_101", hatzor), hatzor, text).Note,"Hatzor's position cites Eduard (review M8: the note is per position)");@@ -1416,6 +1418,108 @@ public class UnitsInPlayTestsStringAssert.Contains("Wikipedia only", UnitCard.For(Token("squadron_101", july), july, text).Note, "Herzliya's position is Wikipedia only");}+ // ---- The person-checked note (#2918 P2; owner, 10 November 2026: "Show checked status", "Person-checked", "Your check+ // wins"; the #2722 date clause, coordinator) ------------------------------------------------------------------------+ // Test-only fixtures: the rows below are synthetic ("Test Place", example.org), not a real unit or source.++ static PlacedToken RowToken(string id, GameState s) => new PlacedToken(UnitRoster.Build(Units, C, s).Single(t => t.Unit.Id == id), default);++ /// <summary>A one-unit fact-checked row checked on <paramref name="checkedOn"/>, with one non-Wikipedia anchor source+ /// checked on <paramref name="anchorChecked"/>, and any of a strength or order target (<paramref name="more"/>).</summary>+ static UnitEntry CheckedRow(string checkedOn, string anchorChecked, string more = "")+ => UnitData.Parse("units:\n- {id: a, name: A, number: '1', service: army, side: israel, sector: Test sector, status: fact-checked, "+ + "checked_on: '" + checkedOn + "', wikipedia_only: false, " + more + "anchors: [{place: Test Place, "+ + "lon: 34.8, lat: 32.0, from: '1948-05-15', to: '1948-06-01', end_basis: source, end_note: n, "+ + "sources: [{url: 'https://www.example.org/history', checked: '" + anchorChecked + "'}]}]}", "u.yaml")[0];++ /// <summary>(a) A row a person has checked against its sources (units_1948.yaml status: fact-checked, "a person has+ /// checked the row against its sources") whose sources were none of them checked after its checked_on says so, in+ /// English and Hebrew, instead of "Draft". Kiryati's start (Tel Aviv) cites the Haganah lexicon, so it said unit.draft.</summary>+ [Test]+ public void APersonCheckedRowSaysSoInBothLanguages()+ {+ var start = StateAt(C.Rules.Start, 5, 0.8);+ var kiryati = RowToken("kiryati", start);+ Assert.AreEqual("fact-checked", kiryati.Token.Unit.Status, "precondition");+ Assert.IsFalse(UnitData.IsWikipediaOnly(kiryati.Token.Anchor.Sources), "precondition: its start cites more than Wikipedia");+ Assert.AreEqual(Text["unit.fact_checked"], UnitCard.For(kiryati, start, Text).Note);+ Assert.AreEqual(He["unit.fact_checked"], UnitCard.For(kiryati, start, He).Note);+ Assert.AreEqual("Checked by a person against its sources; not yet by a historian", Text["unit.fact_checked"], "owner, 10 November 2026");+ // A source checked on the row's own checked_on day is not later (#2722 compares the days, later only).+ var same = CheckedRow("2026-10-11", "2026-10-11");+ Assert.AreEqual(Text["unit.fact_checked"], ProseCard(same, Text).Note);+ Assert.AreEqual(He["unit.fact_checked"], ProseCard(same, He).Note);+ }++ /// <summary>(b) #2722: a field of a fact-checked row whose sources were checked after the row's checked_on is not+ /// person-checked, as ReleaseGate.StartingForcesUnchecked counts it, so the card keeps the draft note. The gate's+ /// fields: the strength, every anchor and every order target.</summary>+ [TestCase("", "2026-10-11")]+ [TestCase("strength: {value: 10, as_of: '1948-05-15', sources: [{url: 'https://www.example.org/s', checked: '2026-10-11'}]}, ", "2026-10-01")]+ [TestCase("order_targets: [{place: Test Target, lon: 34.9, lat: 32.1, from: '1948-05-20', to: '1948-06-01', end_basis: source, end_note: n, "+ + "sources: [{url: 'https://www.example.org/t', checked: '2026-10-11'}]}], ", "2026-10-01")]+ public void ALaterSourceKeepsTheDraftNote(string more, string anchorChecked)+ {+ var u = CheckedRow("2026-10-10", anchorChecked, more);+ Assert.AreEqual(Text["unit.draft"], ProseCard(u, Text).Note);+ Assert.AreEqual(He["unit.draft"], ProseCard(u, He).Note);+ }++ /// <summary>(c) "Your check wins" (owner, 10 November 2026): a person-checked row says so on a position whose own+ /// sources are all Wikipedia too (Golani at Yavne'el, the 7th Brigade at Hulda), and the footer still lists the hosts.</summary>+ [Test]+ public void CheckedRowsSayAPersonCheckedThemEvenOnAWikipediaOnlyPosition()+ {+ var start = StateAt(C.Rules.Start, 5, 0.8);+ var latrun = StateAt(new DateTime(1948, 5, 29), 5, 0.8);+ foreach (var (id, s) in new[] { ("golani", start), ("brigade_7", latrun) })+ {+ var token = RowToken(id, s);+ Assert.AreEqual("fact-checked", token.Token.Unit.Status, id + ": precondition");+ Assert.IsTrue(UnitData.IsWikipediaOnly(token.Token.Anchor.Sources), id + ": precondition, a Wikipedia-only position");+ var english = UnitCard.For(token, s, Text);+ Assert.AreEqual(Text["unit.fact_checked"], english.Note, id);+ Assert.AreEqual(He["unit.fact_checked"], UnitCard.For(token, s, He).Note, id);+ StringAssert.Contains("wikipedia.org", english.Footer, id + ": the footer still names the hosts");+ }+ }++ /// <summary>(d) Every drawn row that is not fact-checked (draft, to_verify) keeps today's note: "Wikipedia only" where+ /// the position's own sources are, else "Draft: not yet checked by a historian" (the ruling: "the others keep" it).</summary>+ [Test]+ public void ARowNoPersonHasCheckedKeepsTheDraftNote()+ {+ // The draft and to_verify rows stand on the map at different days: the ships from the start, the squadron at Herzliya,+ // Yiftach at Lydda, the squadron at Hatzor (a sourced position).+ var seen = new HashSet<string>();+ foreach (var day in new[] { C.Rules.Start, new DateTime(1948, 7, 1), new DateTime(1948, 7, 15), new DateTime(1948, 12, 1) })+ {+ var s = StateAt(day, 5, 0.8);+ foreach (var t in UnitRoster.Build(Units, C, s).Where(x => x.Unit.Status != "fact-checked"))+ {+ seen.Add(t.Unit.Id);+ foreach (var text in new[] { Text, He })+ Assert.AreEqual(UnitData.IsWikipediaOnly(t.Anchor.Sources) ? text["unit.draft_wikipedia"] : text["unit.draft"],+ UnitCard.For(new PlacedToken(t, default), s, text).Note, $"{t.Unit.Id} on {day:yyyy-MM-dd}");+ }+ }+ CollectionAssert.IsSupersetOf(seen, new[] { "yiftach", "squadron_101", "ins_haganah" }, "precondition: a to_verify row and two draft rows are drawn");+ var hatzor = StateAt(new DateTime(1948, 12, 1), 5, 0.8);+ Assert.AreEqual(Text["unit.draft"], UnitCard.For(RowToken("squadron_101", hatzor), hatzor, Text).Note, "a draft row on a sourced position");+ Assert.AreEqual(He["unit.draft_wikipedia"], ProseCard(ProseUnit(), He).Note, "a draft row on a Wikipedia-only position");+ }++ /// <summary>(e) A raised unit has no note, even when its token's row is person-checked.</summary>+ [Test]+ public void ARaisedUnitHasNoNote()+ {+ var start = StateAt(C.Rules.Start, 5, 0.8);+ var golani = RowToken("golani", start).Token;+ var raised = new PlacedToken(new UnitToken(golani.Unit, golani.Anchor, 3, golani.ArtType, false, raised: true), default);+ Assert.AreEqual("", UnitCard.For(raised, start, Text).Note);+ Assert.AreEqual("", UnitCard.For(raised, start, He).Note);+ }+[Test]public void ClickingAUnitSelectsItWithOneHighlightAndTheCardLinksToDefence(){@@ -1450,7 +1554,8 @@ public class UnitsInPlayTestsAssert.AreEqual("Golani Brigade", ui.Q<Label>("info-title").text);Assert.IsTrue(words.Any(w => w.Contains("At Yavne'el since February 1948")), string.Join(" | ", words));Assert.IsFalse(words.Any(w => w.Contains("Reserve call-up")), "the GDD loop: the call-up no longer sets the figures (#1205) | " + string.Join(" | ", words));- Assert.IsTrue(words.Any(w => w.Contains("Wikipedia only")), "a Wikipedia-only position says it is a draft");+ // Golani's start is Wikipedia only, but the row is person-checked and that note wins (#2918 P2, owner, 10 November 2026).+ Assert.IsTrue(words.Any(w => w.Contains(Text["unit.fact_checked"])), "a person-checked row says so | " + string.Join(" | ", words));Assert.AreEqual(DisplayStyle.None, ui.Q<Button>("build-camp").style.display.value, "no orders on a unit");var defence = ui.Q<Button>("info-defence");Assert.AreEqual(DisplayStyle.Flex, defence.style.display.value);diff --git a/unity/Assets/UI/strings.en.yaml b/unity/Assets/UI/strings.en.yamlindex 1d7d876e8..206f5c8bf 100644--- a/unity/Assets/UI/strings.en.yaml+++ b/unity/Assets/UI/strings.en.yaml@@ -779,6 +779,9 @@ unit.security: "Security level {0} of 5"unit.sources: "Sources: {0}"unit.draft_wikipedia: "Draft: from Wikipedia only, not yet checked against a published history"unit.draft: "Draft: not yet checked by a historian"+# A unit row a person has checked against its sources (units_1948.yaml status: fact-checked, no source checked after its+# checked_on, #2722), shown instead of either draft note (#2918 P2; owner, 10 November 2026).+unit.fact_checked: "Checked by a person against its sources; not yet by a historian"unit.defence: "Open the Defence screen"unit.raised_name: "{0}, {1}"# A unit raised in play, named as one formation in the Why lines and toasts ({0} of unit.raised_name): singular, as thediff --git a/unity/Assets/UI/strings.he.yaml b/unity/Assets/UI/strings.he.yamlindex 3121312ac..697144b51 100644--- a/unity/Assets/UI/strings.he.yaml+++ b/unity/Assets/UI/strings.he.yaml@@ -915,6 +915,9 @@ unit.security: "רמת ביטחון {0} מתוך 5"unit.sources: "מקורות: {0}"unit.draft_wikipedia: "טיוטה: מוויקיפדיה בלבד, טרם נבדק מול מחקר שפורסם"unit.draft: "טיוטה: טרם נבדק בידי היסטוריון"+# unit.fact_checked (#2918 P2): agent-drafted; native review: owner, 10 Nov 2026: "Approve as is". The impersonal "נבדק"+# and "טרם נבדק בידי היסטוריון" of unit.draft, without its "טיוטה:" (a checked row is not called a draft).+unit.fact_checked: "נבדק בידי אדם מול המקורות; טרם נבדק בידי היסטוריון"unit.defence: "פתיחת מסך הביטחון"# Hebrew draft for a raised unit's type and home city (#1399); native review: owner,# 3 Nov 2026 (HE batch 4: "Approve all as they are").