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: scenario goldens with scripted player choices (fixes #296) (#311)

agamrafaeli-instinct225f9efe322f
diff --git a/docs/determinism.md b/docs/determinism.md
index b5f92a0ad..fe41c9ad0 100644
--- a/docs/determinism.md
+++ b/docs/determinism.md
@@ -48,6 +48,16 @@ never take a hash from the run without the variable, so a second plain run is th
hash), add a row to the rebaseline history, and say why in the commit message. The snapshot test also fails if a snapshot is
stale while the hash is unchanged.
+**Scenario goldens.** The two hash goldens follow `HistoricalAI`, the path history took. A scenario is a path a player might take
+instead: `sim/Statecraft.Sim.Tests/scenarios/<name>.yaml` lists commands by date (`on:`), the runner (`Scenario`, in the tests) plays
+them from a seed (default 1948) in Historical mode until `until:`, and `ScenarioTests` checks the final hash against the manifest line
+`scenario-<name>` and the snapshot `golden/scenario-<name>.txt`. The file's header comment lists the command kinds. A turn with no
+scripted command passes. A command the sim rejects fails the test with the date, the order and the reason, and a step that never runs
+fails too. To add one: write the file, run `STATECRAFT_UPDATE_GOLDEN=1 dotnet test sim/Statecraft.sln --filter ScenarioTests` (it adds the
+manifest line and the snapshot), then run the tests plain. A scenario that moves is re-pinned with the hash goldens by the same
+command; its snapshot diff in the PR shows what moved, and the commit message says why. Two ship: `cautious` and `reckless`. They stay in 1948, before any change a
+later era makes, so they move only when a 1948 rule or event does.
+
**Invariants.** A hash says something changed; `sim/Statecraft.Sim.Tests/golden/invariants.yaml` says whether it is
still plausible. Each entry names a golden run (`1950` or `1952`), a value (an indicator id, or `treasury`, `debt`,
`fx`, `population`, `stability`), when it is read (`end`, `always`, or a date: the first state on or after it), a `min`
diff --git a/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs b/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs
index c08fde25b..af66ea17c 100644
--- a/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs
+++ b/sim/Statecraft.Sim.Tests/GoldenManifestTests.cs
@@ -14,7 +14,9 @@ public class GoldenManifestTests
public void TheManifestHoldsExactlyTheKnownGoldens()
{
var m = GoldenManifest.Read();
- Assert.Equal(new[] { "hash1950", "hash1952", "smoke5" }, m.Keys.OrderBy(k => k).ToArray());
+ var scenarios = System.IO.Directory.GetFiles(Scenario.Dir(), "*.yaml").Select(f => "scenario-" + System.IO.Path.GetFileNameWithoutExtension(f));
+ var known = new[] { "hash1950", "hash1952", "smoke5" }.Concat(scenarios).OrderBy(k => k, StringComparer.Ordinal).ToArray(); // one line per scenario file (#296)
+ Assert.Equal(known, m.Keys.OrderBy(k => k, StringComparer.Ordinal).ToArray());
Assert.All(m.Values, h => Assert.Matches("^[0-9a-f]{64}$", h));
}
diff --git a/sim/Statecraft.Sim.Tests/Scenario.cs b/sim/Statecraft.Sim.Tests/Scenario.cs
new file mode 100644
index 000000000..202ebc91c
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/Scenario.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using Statecraft.Sim;
+using YamlDotNet.Serialization;
+using YamlDotNet.Serialization.NamingConventions;
+
+/// <summary>A golden playthrough with scripted player choices (#296). The two hash goldens use HistoricalAI, so they cover
+/// the path history took; a scenario covers a path a player might take instead. File: sim/Statecraft.Sim.Tests/scenarios/&lt;name&gt;.yaml.
+/// <code>
+/// name: reckless
+/// seed: 1948 # optional, default GoldenRun.Seed
+/// until: 1949-01-01 # the run stops when the date reaches it
+/// steps:
+/// - on: 1948-05-15 # the commands go in on the first turn that starts on or after this date, once
+/// commands:
+/// - { kind: set_policy, policy: rationing, level: 1.0 }
+/// </code>
+/// Kinds: set_policy (policy, level), allocate_budget (shares: {office: share}), choose_event_option (event, option),
+/// set_mobilization (level), security_order (delta), appoint (office, person), map_action (action, q, r). A turn with no
+/// scripted command passes; events nobody answered are delegated, as in the game. A command the sim rejects fails the run.</summary>
+public sealed class Scenario
+{
+ public string Name { get; set; } = "";
+ public ulong? Seed { get; set; }
+ public string Until { get; set; } = "";
+ public List<ScenarioStep> Steps { get; set; } = new List<ScenarioStep>();
+
+ public static string Dir() =>
+ Path.Combine(Directory.GetParent(RealContentTests.ContentRoot())!.FullName, "sim", "Statecraft.Sim.Tests", "scenarios");
+
+ public static Scenario Parse(string yaml)
+ {
+ var d = new DeserializerBuilder().WithNamingConvention(UnderscoredNamingConvention.Instance).Build();
+ var s = d.Deserialize<Scenario>(yaml) ?? throw new InvalidDataException("the scenario file is empty");
+ if (string.IsNullOrWhiteSpace(s.Name)) throw new InvalidDataException("a scenario needs a name");
+ s.UntilDate = Date(s.Until, "until");
+ foreach (var step in s.Steps)
+ {
+ step.OnDate = Date(step.On, "on");
+ foreach (var c in step.Commands) step.Built.Add(Build(c));
+ }
+ return s;
+ }
+
+ [YamlIgnore] public DateTime UntilDate { get; private set; }
+
+ static DateTime Date(string text, string field) =>
+ DateTime.TryParseExact(text, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var d) ? d
+ : throw new InvalidDataException($"'{field}' must be yyyy-MM-dd, got '{text}'");
+
+ static string Str(Dictionary<string, object> c, string key) =>
+ c.TryGetValue(key, out var v) && v != null ? Convert.ToString(v, CultureInfo.InvariantCulture)! : throw new InvalidDataException($"command '{c["kind"]}' needs '{key}'");
+ static double Num(Dictionary<string, object> c, string key) =>
+ double.TryParse(Str(c, key), NumberStyles.Float, CultureInfo.InvariantCulture, out var d) ? d : throw new InvalidDataException($"command '{c["kind"]}': '{key}' must be a number");
+
+ static Command Build(Dictionary<string, object> c)
+ {
+ if (!c.ContainsKey("kind")) throw new InvalidDataException("a command needs 'kind'");
+ var kind = Str(c, "kind");
+ var allowed = new Dictionary<string, string[]>
+ {
+ ["set_policy"] = new[] { "policy", "level" }, ["allocate_budget"] = new[] { "shares" },
+ ["choose_event_option"] = new[] { "event", "option" }, ["set_mobilization"] = new[] { "level" },
+ ["security_order"] = new[] { "delta" }, ["appoint"] = new[] { "office", "person" },
+ ["map_action"] = new[] { "action", "q", "r" },
+ };
+ if (!allowed.TryGetValue(kind, out var keys)) throw new InvalidDataException($"unknown command kind '{kind}' (known: {string.Join(", ", allowed.Keys)})");
+ var extra = c.Keys.Where(k => k != "kind" && !keys.Contains(k)).ToList();
+ if (extra.Count > 0) throw new InvalidDataException($"command '{kind}' has unknown field '{extra[0]}'");
+ switch (kind)
+ {
+ case "set_policy": return new SetPolicy(Str(c, "policy"), Num(c, "level"));
+ case "allocate_budget":
+ if (!(c.TryGetValue("shares", out var sh) && sh is Dictionary<object, object> map)) throw new InvalidDataException("allocate_budget needs 'shares' as a map");
+ return new AllocateBudget(map.ToDictionary(kv => Convert.ToString(kv.Key, CultureInfo.InvariantCulture)!, kv => double.Parse(Convert.ToString(kv.Value, CultureInfo.InvariantCulture)!, CultureInfo.InvariantCulture)));
+ case "choose_event_option": return new ChooseEventOption(Str(c, "event"), Str(c, "option"));
+ case "set_mobilization": return new SetMobilization(Num(c, "level"));
+ case "security_order": return new SecurityOrder((int)Num(c, "delta"));
+ case "appoint": return new Appoint(Str(c, "office"), Str(c, "person"));
+ default: return new MapAction(Str(c, "action"), (int)Num(c, "q"), (int)Num(c, "r"));
+ }
+ }
+
+ /// <summary>Plays the scenario and returns the final state. Fails with the date, the order and the sim's reason when a command is rejected.</summary>
+ public GameState Play(Content c)
+ {
+ var s = Simulation.NewGame(c, Seed ?? GoldenRun.Seed, Mode.Historical);
+ var pending = Steps.OrderBy(x => x.OnDate).ToList();
+ for (int turn = 0; turn < 1000 && s.Date < UntilDate && s.GameOver == null; turn++)
+ {
+ var now = new List<Command>();
+ while (pending.Count > 0 && pending[0].OnDate <= s.Date) { now.AddRange(pending[0].Built); pending.RemoveAt(0); }
+ var r = Simulation.Step(c, s, now);
+ if (r.Rejected.Count > 0)
+ {
+ var x = r.Rejected[0];
+ throw new InvalidOperationException($"scenario '{Name}': on {s.Date:yyyy-MM-dd} the sim rejected {x.Command.Kind} ({Describe(x.Command)}): {x.Reason}");
+ }
+ s = r.State;
+ }
+ if (pending.Count > 0) throw new InvalidOperationException($"scenario '{Name}': the step on {pending[0].On} never ran (the run ends {s.Date:yyyy-MM-dd})");
+ return s;
+ }
+
+ static string Describe(Command c) => c switch
+ {
+ SetPolicy p => $"{p.Policy} {p.Level}", ChooseEventOption e => $"{e.EventId}/{e.OptionId}", SetMobilization m => m.Level.ToString(CultureInfo.InvariantCulture),
+ SecurityOrder o => o.Delta.ToString(CultureInfo.InvariantCulture), Appoint a => $"{a.Office} {a.Person}", MapAction m => $"{m.Action} {m.Q},{m.R}", _ => c.Kind,
+ };
+}
+
+public sealed class ScenarioStep
+{
+ public string On { get; set; } = "";
+ public List<Dictionary<string, object>> Commands { get; set; } = new List<Dictionary<string, object>>();
+ [YamlIgnore] public DateTime OnDate { get; set; }
+ [YamlIgnore] public List<Command> Built { get; } = new List<Command>();
+}
diff --git a/sim/Statecraft.Sim.Tests/ScenarioTests.cs b/sim/Statecraft.Sim.Tests/ScenarioTests.cs
new file mode 100644
index 000000000..6e818401b
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/ScenarioTests.cs
@@ -0,0 +1,73 @@
+using System;
+using System.IO;
+using System.Linq;
+using Statecraft.Sim;
+
+/// <summary>Scenario goldens (#296): every file in scenarios/ is played from its seed and checked against the manifest
+/// (name "scenario-&lt;name&gt;") and a committed snapshot, like the hash goldens (docs/determinism.md).</summary>
+public class ScenarioTests
+{
+ static readonly Content C = ContentLoader.Load(RealContentTests.ContentRoot());
+
+ public static System.Collections.Generic.IEnumerable<object[]> Files() =>
+ Directory.GetFiles(Scenario.Dir(), "*.yaml").OrderBy(f => f, StringComparer.Ordinal).Select(f => new object[] { Path.GetFileNameWithoutExtension(f) });
+
+ [Theory]
+ [MemberData(nameof(Files))]
+ public void ScenarioMatchesItsGolden(string file)
+ {
+ var sc = Scenario.Parse(File.ReadAllText(Path.Combine(Scenario.Dir(), file + ".yaml")));
+ Assert.Equal(file, sc.Name);
+ var s = sc.Play(C);
+ var name = "scenario-" + sc.Name;
+ // A new scenario has no manifest line yet: the blessing run (STATECRAFT_UPDATE_GOLDEN=1) adds it with its snapshot.
+ var expected = GoldenManifest.UpdateRequested ? GoldenManifest.Read().GetValueOrDefault(name, "") : GoldenManifest.Expected(name);
+ GoldenSnapshot.Check(name, s, expected);
+ }
+
+ [Fact]
+ public void EachScenarioEndsElsewhereThanTheSameRunWithoutItsChoicesAndThanEveryOtherScenario()
+ {
+ var scenarios = Directory.GetFiles(Scenario.Dir(), "*.yaml").OrderBy(f => f, StringComparer.Ordinal).Select(f => Scenario.Parse(File.ReadAllText(f))).ToList();
+ Assert.True(scenarios.Count >= 2);
+ var hashes = scenarios.Select(sc => sc.Play(C).Hash()).ToList();
+ Assert.Equal(hashes.Count, hashes.Distinct().Count());
+ foreach (var (sc, hash) in scenarios.Zip(hashes, (sc, h) => (sc, h)))
+ {
+ var bare = Scenario.Parse($"name: {sc.Name}\nuntil: {sc.Until}\n" + (sc.Seed.HasValue ? $"seed: {sc.Seed}\n" : ""));
+ Assert.True(bare.Play(C).Hash() != hash, $"scenario '{sc.Name}' ends where the same run with no scripted command ends: its choices change nothing");
+ }
+ }
+
+ const string Head = "name: t\nuntil: 1948-08-01\nsteps:\n - on: 1948-05-15\n commands:\n";
+
+ [Fact]
+ public void ARejectedCommandFailsTheRunWithTheDateAndTheReason()
+ {
+ var sc = Scenario.Parse(Head + " - { kind: set_policy, policy: no_such_policy, level: 1.0 }\n");
+ var e = Assert.Throws<InvalidOperationException>(() => sc.Play(C));
+ Assert.Contains("1948-05-15", e.Message);
+ Assert.Contains("set_policy", e.Message);
+ Assert.Contains("no_such_policy", e.Message);
+ }
+
+ [Fact]
+ public void AStepAfterTheRunEndsFailsInsteadOfBeingSkipped()
+ {
+ var sc = Scenario.Parse("name: t\nuntil: 1948-06-01\nsteps:\n - on: 1949-01-01\n commands:\n - { kind: set_mobilization, level: 0.5 }\n");
+ Assert.Contains("never ran", Assert.Throws<InvalidOperationException>(() => sc.Play(C)).Message);
+ }
+
+ [Theory]
+ [InlineData(" - { kind: fly_to_moon }\n", "unknown command kind 'fly_to_moon'")]
+ [InlineData(" - { kind: set_policy, policy: rationing }\n", "needs 'level'")]
+ [InlineData(" - { kind: set_policy, policy: rationing, level: 1, extra: 2 }\n", "unknown field 'extra'")]
+ [InlineData(" - { policy: rationing }\n", "needs 'kind'")]
+ [InlineData(" - { kind: set_policy, policy: rationing, level: lots }\n", "must be a number")]
+ public void AMalformedCommandIsRefusedWithTheProblemNamed(string command, string expected) =>
+ Assert.Contains(expected, Assert.Throws<InvalidDataException>(() => Scenario.Parse(Head + command)).Message);
+
+ [Fact]
+ public void ABadDateIsRefused() =>
+ Assert.Contains("yyyy-MM-dd", Assert.Throws<InvalidDataException>(() => Scenario.Parse("name: t\nuntil: soon\n")).Message);
+}
diff --git a/sim/Statecraft.Sim.Tests/golden/manifest.txt b/sim/Statecraft.Sim.Tests/golden/manifest.txt
index 32184a549..7dbc1dbf7 100644
--- a/sim/Statecraft.Sim.Tests/golden/manifest.txt
+++ b/sim/Statecraft.Sim.Tests/golden/manifest.txt
@@ -5,3 +5,5 @@
hash1950 71e9904d0ee48083db9bbba281f3f046136482ba83ee056e48d57b62e76a5b07
hash1952 62f8ec61a14acff4eab503381994a7c94d7a2f786dcfde5c4c19439ac8b4c5e8
smoke5 d3fdd459ddb876bd8d775c20edd1202cf56ca7134a8ad06f873d4d92034aa5b6
+scenario-reckless c0bd12bc481a9f2dbeea19aebc981d5347caa1e1cf2e6fd5a5acdf107f2f9045
+scenario-cautious 1d5b8d7126160021963537f2a198e377b27d478f522e8c6be63babe9e1b8f482
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt
new file mode 100644
index 000000000..bee9cc037
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-cautious.txt
@@ -0,0 +1,83 @@
+1949-01-02;11400714819323200433;Historical;23;
+ind{
+ food_supply=0.47999999046325686 [3FDEB851E147AE15]
+ housing=0.430217536794174 [3FDB88AF22AC95FB]
+ intl_standing=0.53 [3FE0F5C28F5C28F6]
+ morale=0.555200085089712 [3FE1C432F8064B9D]
+ security=0.5123899107074246 [3FE0657F86A93D6E]
+pol{
+ border_settlement=0.2 [3FC999999999999A]
+ housing_construction=0.3 [3FD3333333333333]
+ maabarot=0 [0000000000000000]
+ rationing=0.4 [3FD999999999999A]
+eff{
+ border_villages_secure=0.03738991070742455 [3FA324C53760A3AA]
+ building_houses=0.08021753679417404 [3FB48922F118BE54]
+ homes_lift_morale=0.06451650621608743 [3FB084275C40121A]
+ rationing_feeds=0.07999999046325684 [3FB47AE11EB851EC]
+ rationing_grates=-0.06 [BFAEB851EB851EB8]
+ safety_lifts_morale=0.050683578873624506 [3FA9F332B369B44F]
+shift{
+ food_supply=0 [0000000000000000]
+ housing=0 [0000000000000000]
+ intl_standing=0.030000000000000027 [3F9EB851EB851EC0]
+ morale=-0.050000000000000044 [BFA99999999999A0]
+ security=0.1750000000000001 [3FC666666666666A]
+bud{
+ agriculture_minister=0.07 [3FB1EB851EB851EC]
+ defense_minister=0.45 [3FDCCCCCCCCCCCCD]
+ education_minister=0.06 [3FAEB851EB851EB8]
+ finance_minister=0.05 [3FA999999999999A]
+ health_minister=0.07 [3FB1EB851EB851EC]
+ interior_minister=0.05 [3FA999999999999A]
+ labour_minister=0.1 [3FB999999999999A]
+ prime_minister=0.15 [3FC3333333333333]
+pop{
+ africa=8340.568207442666 [40C04A48BB057FCC]
+ america_oceania=484.295801166699 [407E44BB9A011174]
+ asia=4959.100106786725 [40B35F19A0992F17]
+ europe=77272.50246069893 [40F2DD880A143AD7]
+ unknown=11940.192924328829 [40C75218B1BE9176]
+ veterans=656387.9680859144 [41240807EFA8F4FC]
+sit[
+treasury=0 [0000000000000000]
+debt=27.683596350238787 [403BAF002B9FF0C8]
+fx=79.89481110412456 [4053F94495CB1402]
+rung=5;cf=41;
+mob=0.8 [3FE999999999999A]
+stab=0.6261214277961791 [3FE4092FCDF6B386]
+att=4 [4010000000000000]
+fired[
+ altalena
+ bernadotte_assassination
+ first_truce
+ idf_founding
+ jerusalem_ceasefire
+ jerusalem_military_government
+ latrun_proposal
+ operation_hiram
+ operation_horev
+ operation_yoav
+ second_truce
+ sinai_withdrawal
+ ten_days
+pending[
+ sinai_withdrawal
+chosen{
+ altalena=enforce
+ bernadotte_assassination=outlaw
+ first_truce=accept
+ idf_founding=one_army
+ jerusalem_ceasefire=sign
+ jerusalem_military_government=military_government
+ latrun_proposal=accept_vote
+ operation_hiram=launch
+ operation_horev=launch
+ operation_yoav=stop_at_ceasefire
+ second_truce=comply
+ ten_days=central_front
+appt{
+under=;
+map[
+mapturn=0001-01-01:0;
+over=
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt
new file mode 100644
index 000000000..8281080a1
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/golden/scenario-reckless.txt
@@ -0,0 +1,81 @@
+1949-01-02;11400714819323200433;Historical;23;
+ind{
+ food_supply=0.5999999761581422 [3FE3333326666667]
+ housing=0.430217536794174 [3FDB88AF22AC95FB]
+ intl_standing=0.41999999999999993 [3FDAE147AE147AE0]
+ morale=0.4307001251440333 [3FDB909741F81C59]
+ security=0.46738991070742464 [3FDDE9B75F3DFFFC]
+pol{
+ border_settlement=0.2 [3FC999999999999A]
+ housing_construction=0.3 [3FD3333333333333]
+ maabarot=0 [0000000000000000]
+ rationing=1 [3FF0000000000000]
+eff{
+ border_villages_secure=0.03738991070742455 [3FA324C53760A3AA]
+ building_houses=0.08021753679417404 [3FB48922F118BE54]
+ homes_lift_morale=0.06451650621608743 [3FB084275C40121A]
+ rationing_feeds=0.1999999761581421 [3FC9999966666667]
+ rationing_grates=-0.15 [BFC3333333333333]
+ safety_lifts_morale=0.0461836189279458 [3FA7A56119D01AB6]
+shift{
+ food_supply=0 [0000000000000000]
+ housing=0 [0000000000000000]
+ intl_standing=-0.08000000000000007 [BFB47AE147AE1480]
+ morale=-0.08000000000000002 [BFB47AE147AE147C]
+ security=0.13000000000000012 [3FC0A3D70A3D70A8]
+bud{
+ agriculture_minister=0.07 [3FB1EB851EB851EC]
+ defense_minister=0.45 [3FDCCCCCCCCCCCCD]
+ education_minister=0.06 [3FAEB851EB851EB8]
+ finance_minister=0.05 [3FA999999999999A]
+ health_minister=0.07 [3FB1EB851EB851EC]
+ interior_minister=0.05 [3FA999999999999A]
+ labour_minister=0.1 [3FB999999999999A]
+ prime_minister=0.15 [3FC3333333333333]
+pop{
+ africa=8340.568207442666 [40C04A48BB057FCC]
+ america_oceania=484.295801166699 [407E44BB9A011174]
+ asia=4959.100106786725 [40B35F19A0992F17]
+ europe=77272.50246069893 [40F2DD880A143AD7]
+ unknown=11940.192924328829 [40C75218B1BE9176]
+ veterans=656387.9680859144 [41240807EFA8F4FC]
+sit[
+treasury=0 [0000000000000000]
+debt=35.286336076266196 [4041A4A6A9199D38]
+fx=79.89481110412456 [4053F94495CB1402]
+rung=5;cf=41;
+mob=1 [3FF0000000000000]
+stab=0.5910920160052443 [3FE2EA39CDB56A5B]
+att=4 [4010000000000000]
+fired[
+ altalena
+ bernadotte_assassination
+ first_truce
+ idf_founding
+ jerusalem_ceasefire
+ jerusalem_military_government
+ latrun_proposal
+ operation_hiram
+ operation_horev
+ operation_yoav
+ second_truce
+ sinai_withdrawal
+pending[
+ sinai_withdrawal
+chosen{
+ altalena=enforce
+ bernadotte_assassination=outlaw
+ first_truce=refuse
+ idf_founding=one_army
+ jerusalem_ceasefire=sign
+ jerusalem_military_government=military_government
+ latrun_proposal=accept_vote
+ operation_hiram=launch
+ operation_horev=launch
+ operation_yoav=stop_at_ceasefire
+ second_truce=comply
+appt{
+under=;
+map[
+mapturn=0001-01-01:0;
+over=
\ No newline at end of file
diff --git a/sim/Statecraft.Sim.Tests/scenarios/cautious.yaml b/sim/Statecraft.Sim.Tests/scenarios/cautious.yaml
new file mode 100644
index 000000000..f3a2772dd
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/scenarios/cautious.yaml
@@ -0,0 +1,11 @@
+# A cautious player: modest rationing from the start, and accepts the First Truce (the historical answer, written out so the
+# scenario does not lean on delegation).
+name: cautious
+until: 1949-01-01
+steps:
+ - on: 1948-05-15
+ commands:
+ - { kind: set_policy, policy: rationing, level: 0.4 }
+ - on: 1948-06-01
+ commands:
+ - { kind: choose_event_option, event: first_truce, option: accept }
diff --git a/sim/Statecraft.Sim.Tests/scenarios/reckless.yaml b/sim/Statecraft.Sim.Tests/scenarios/reckless.yaml
new file mode 100644
index 000000000..c185fdb73
--- /dev/null
+++ b/sim/Statecraft.Sim.Tests/scenarios/reckless.yaml
@@ -0,0 +1,11 @@
+# A reckless player: full rationing from the first turn, refuses the First Truce, and mobilises everyone.
+name: reckless
+until: 1949-01-01
+steps:
+ - on: 1948-05-15
+ commands:
+ - { kind: set_policy, policy: rationing, level: 1.0 }
+ - { kind: set_mobilization, level: 1.0 }
+ - on: 1948-06-01
+ commands:
+ - { kind: choose_event_option, event: first_truce, option: refuse }