Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

sim: the release gate refuses settlement targets that are not sensitivity-reviewed (Fixes #1274) (#1280)

Beriaffc9ee7195d
diff --git a/changelog.d/1274.md b/changelog.d/1274.md
new file mode 100644
index 000000000..25f4aa8a6
--- /dev/null
+++ b/changelog.d/1274.md
@@ -0,0 +1,4 @@
+- The release gate refuses a settlement target that is not sensitivity-reviewed (Q-TGT-3 (b), #783; Fixes #1274):
+ `ReleaseGate.SettlementTargetsUnchecked` names every `content/settlement_targets.yaml` row whose status is not
+ `sensitivity-reviewed`, and both `Statecraft.Cli --release-gate` and a `-shareable` build refuse while it is not empty.
+ The list ships empty today, so nothing is refused yet.
diff --git a/docs/RELEASING.md b/docs/RELEASING.md
index d4b8096b1..5240b20db 100644
--- a/docs/RELEASING.md
+++ b/docs/RELEASING.md
@@ -15,8 +15,9 @@ macOS IL2CPP parity check is not an MVP release gate.
3. **Merge** the pull request (squash).
4. **Run the release gate** on the merged `main` (it refuses to run elsewhere): `bash scripts/oss/release_gate.sh`. It must print
`RELEASE GATE OK`. It refuses while an owner decision is open (including D10, history acknowledgement, and D11, the
- sensitivity review), while an asset row is `owner-verify`, while the sim's sensitivity gate refuses `content/`, or
- while the history scan shows an open secret-shape row.
+ sensitivity review), while an asset row is `owner-verify`, while the sim's sensitivity gate refuses `content/`
+ (including a `content/settlement_targets.yaml` row that is not `sensitivity-reviewed`, Q-TGT-3 (b)), or while the
+ history scan shows an open secret-shape row.
5. **Build and package** on the owner's machine, from the merged `main`:
Build both web zips from the merged release commit, never from a pre-merge candidate. The .NET SDK includes the
diff --git a/sim/Statecraft.Cli/Program.cs b/sim/Statecraft.Cli/Program.cs
index 80d42d0f6..153ee26ee 100644
--- a/sim/Statecraft.Cli/Program.cs
+++ b/sim/Statecraft.Cli/Program.cs
@@ -63,13 +63,15 @@ catch (ContentException e) { Console.Error.WriteLine($"Content error: {e.Message
// --release-gate: the sensitivity gate before a build is shared (spec 5.5; tools/package_release.py, Build -shareable).
// Exit 0 and "RELEASE GATE OK" when every sensitive event is sensitivity-reviewed and (R-ALT-011, Q-ALT-9) every
// consequence card and every event with variants has a person's reviewed_by, and (R-UNIT-006, Q-START-3) every
-// units_1948.yaml row a new game starts a unit from is fact-checked; else exit 3 naming them.
+// units_1948.yaml row a new game starts a unit from is fact-checked, and (Q-TGT-3 (b)) every settlement_targets.yaml row is
+// sensitivity-reviewed; else exit 3 naming them.
if (Array.IndexOf(args, "--release-gate") >= 0)
{
var open = ReleaseGate.SensitiveUnreviewed(content);
var unsigned = ReleaseGate.AlternateUnsigned(content);
var forces = ReleaseGate.StartingForcesUnchecked(content);
- if (open.Count == 0 && unsigned.Count == 0 && forces.Count == 0) { Console.WriteLine("RELEASE GATE OK"); return 0; }
+ var targets = ReleaseGate.SettlementTargetsUnchecked(content);
+ if (open.Count == 0 && unsigned.Count == 0 && forces.Count == 0 && targets.Count == 0) { Console.WriteLine("RELEASE GATE OK"); return 0; }
if (open.Count > 0)
Console.WriteLine("RELEASE GATE REFUSED: the owner's sensitivity review is missing for: " + string.Join(", ", open)
+ " (set status: sensitivity-reviewed in each event's YAML; see docs/m3-release.md)");
@@ -81,6 +83,9 @@ if (Array.IndexOf(args, "--release-gate") >= 0)
if (forces.Count > 0)
Console.WriteLine("RELEASE GATE REFUSED: these starting forces' rows are not fact-checked: " + string.Join(", ", forces)
+ " (status: fact-checked in content/map/units_1948.yaml; Q-START-3, #743)");
+ if (targets.Count > 0)
+ Console.WriteLine("RELEASE GATE REFUSED: these settlement targets are not sensitivity-reviewed: " + string.Join(", ", targets)
+ + " (status: sensitivity-reviewed in content/settlement_targets.yaml; Q-TGT-3, #783)");
return 3;
}
diff --git a/sim/Statecraft.Sim.Tests/ContentLoaderTests.cs b/sim/Statecraft.Sim.Tests/ContentLoaderTests.cs
index b32dba687..27f8eac2c 100644
--- a/sim/Statecraft.Sim.Tests/ContentLoaderTests.cs
+++ b/sim/Statecraft.Sim.Tests/ContentLoaderTests.cs
@@ -60,6 +60,15 @@ targets:
Assert.Equal("targets[town_a].id", ex.Field);
}
+ // Q-TGT-3 (b) (#783, #1274): a shareable build waits until every target row is sensitivity-reviewed.
+ [Fact]
+ public void TheReleaseGateWaitsForEverySettlementTargetToBeReviewed()
+ {
+ Assert.Empty(ReleaseGate.SettlementTargetsUnchecked(ContentLoader.Load(Fixture.Write(WithTargets(Target)))));
+ var draft = ContentLoader.Load(Fixture.Write(WithTargets(Target.Replace("status: sensitivity-reviewed", "status: draft"))));
+ Assert.Equal(new[] { "town_a" }, ReleaseGate.SettlementTargetsUnchecked(draft));
+ }
+
[Fact]
public void LoadsValidFixture()
{
diff --git a/sim/Statecraft.Sim/ReleaseGate.cs b/sim/Statecraft.Sim/ReleaseGate.cs
index c251983c8..6f8bd1fdc 100644
--- a/sim/Statecraft.Sim/ReleaseGate.cs
+++ b/sim/Statecraft.Sim/ReleaseGate.cs
@@ -32,5 +32,10 @@ namespace Statecraft.Sim
/// state, so a shareable build refuses while this is not empty.</summary>
public static IReadOnlyList<string> StartingForcesUnchecked(Content c) =>
c.StartingForces.Where(f => f.Status != "fact-checked").Select(f => f.Row).OrderBy(x => x, StringComparer.Ordinal).ToList();
+
+ /// <summary>R-CTRL-001, Q-TGT-3 (b) (owner, 18 October 2026; #783): the settlement_targets.yaml rows whose status is not
+ /// yet sensitivity-reviewed, in id order. A shareable build refuses while this is not empty (#1274).</summary>
+ public static IReadOnlyList<string> SettlementTargetsUnchecked(Content c) =>
+ c.SettlementTargets.Where(t => t.Status != ReviewedStatus).Select(t => t.Id).OrderBy(x => x, StringComparer.Ordinal).ToList();
}
}
diff --git a/unity/Assets/Editor/Build.cs b/unity/Assets/Editor/Build.cs
index a7950ffe1..928aa3e28 100644
--- a/unity/Assets/Editor/Build.cs
+++ b/unity/Assets/Editor/Build.cs
@@ -56,7 +56,8 @@ namespace Statecraft.Game.EditorTools
/// <summary>Why a shareable build may not be made, or null: every event with a sensitive tag needs the owner's
/// sensitivity review first (status sensitivity-reviewed; docs/m3-release.md, M3 final review I4), every row the
- /// starting forces come from must be fact-checked (ReleaseGate.StartingForcesUnchecked; R-UNIT-006), and so does every
+ /// starting forces come from must be fact-checked (ReleaseGate.StartingForcesUnchecked; R-UNIT-006), every settlement
+ /// target row sensitivity-reviewed (ReleaseGate.SettlementTargetsUnchecked; Q-TGT-3 (b)), and so does every
/// sensitive event photograph the build would carry (EventImageCatalog; docs/event-images.md), and every sensitive
/// illustration clip (<paramref name="clips"/>, event-videos.yaml; docs/event-videos.md). See
/// <see cref="EventImageRefusal"/> for <paramref name="catalogFileExists"/> and <paramref name="mapping"/>.</summary>
@@ -71,6 +72,10 @@ namespace Statecraft.Game.EditorTools
if (Statecraft.Sim.ReleaseGate.StartingForcesUnchecked(c) is { Count: > 0 } forces)
reasons.Add("a shareable build needs these starting forces' rows fact-checked: " + string.Join(", ", forces)
+ " (status: fact-checked in content/map/units_1948.yaml; see docs/units.md)");
+ // Q-TGT-3 (b) (#783): a settlement target row ships only after a person's sensitivity review.
+ if (Statecraft.Sim.ReleaseGate.SettlementTargetsUnchecked(c) is { Count: > 0 } targets)
+ reasons.Add("a shareable build needs these settlement targets sensitivity-reviewed: " + string.Join(", ", targets)
+ + " (status: sensitivity-reviewed in content/settlement_targets.yaml; see docs/gdd/settlement-control.md)");
if (EventImageRefusal(photos, catalogFileExists, mapping) is string pictures) reasons.Add(pictures);
if (clips != null && EventVideoMapping.SensitiveUnreviewed(clips) is { Count: > 0 } openClips)
reasons.Add("a shareable build needs the owner's sensitivity review of the illustration clips: " + string.Join(", ", openClips)
diff --git a/unity/Assets/Tests/EditMode/BuildGateTests.cs b/unity/Assets/Tests/EditMode/BuildGateTests.cs
index 3a5ec813b..6c0a6414e 100644
--- a/unity/Assets/Tests/EditMode/BuildGateTests.cs
+++ b/unity/Assets/Tests/EditMode/BuildGateTests.cs
@@ -39,6 +39,19 @@ public class BuildGateTests
Assert.IsNull(Refusal(ReviewedContent()));
}
+ /// <summary>Q-TGT-3 (b) (#783, #1274): a settlement target row that is not sensitivity-reviewed blocks a shareable build,
+ /// by name; a reviewed row does not.</summary>
+ [Test]
+ public void AShareableBuildWaitsForTheSettlementTargetsReview()
+ {
+ var c = ReviewedContent();
+ var target = new SettlementTarget { Id = "fixture_target", Status = "draft" };
+ c.SettlementTargets.Add(target);
+ StringAssert.Contains("fixture_target", Refusal(c));
+ target.Status = ReleaseGate.ReviewedStatus;
+ Assert.IsNull(Refusal(c));
+ }
+
[Test]
public void AShareableBuildWaitsForTheSensitivityReview()
{