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.

43.9 KB
Raw Blame

Writing an event

An event is one YAML file in content/events/. The game shows it as a card with one or more options; each option moves some numbers. This guide takes you from an empty file to a passing test run. Everything here was checked against the loader (sim/Statecraft.Sim/ContentLoader.cs, EventRules.cs, Content.cs, ReleaseGate.cs); if the code and this page disagree, the code wins and the page has a bug (please open an issue).

Read docs/CONTENT_POLICY.md first. It is the contract for sources, quotes and sensitive topics. The worked example below is content/events/hula_drainage.yaml.

The shortest path

  1. Find your sources and write down, for each fact, a URL and the date you opened it.
  2. Copy hula_drainage.yaml to content/events/<your_id>.yaml and edit it. The file name is free, but use the id.
  3. Run dotnet test sim/Statecraft.sln (see "Running the tests").
  4. Add a line to CHANGELOG.md under ## [Unreleased], and open a pull request.

Fields

The loader is strict. An unknown key is an error, so a typo such as titel: fails loudly instead of being ignored. A key written with no value (tags:) is an error for lists.

Editor help: the first line of every event file, people.yaml, offices.yaml and parties.yaml is a # yaml-language-server: $schema=... comment. With the YAML extension (Red Hat YAML, in VS Code and others) a wrong field name or a missing sources: gets a red line as you type. The schemas are in content/schema/. They are written by hand, and SchemaTests keeps them equal to the loader types. If you add a field to a content type, add it to the schema too, or that test fails. Keep the comment when you copy a file.

Field Required What it is
id yes Unique across all events. Lowercase letters, digits and underscores, starting with a letter.
title yes The card title. May contain office placeholders.
text yes The card body. May contain office placeholders.
title_he no The title in Hebrew (#1064), shown in the Hebrew UI; the English shows where a Hebrew field is missing. An event has title_he, text_he and every option's text_he, or none, all in Hebrew letters, with the same placeholders as the English. Beside them text_he_review: agent-checked until a native speaker, or an AI-assisted contributor who discloses it, has read the Hebrew; remove it once they have (#564; owner, 4 November 2026: "AI-assisted can clear it").
text_he no The body in Hebrew (#1064). See title_he.
anchor no (default soft) hard or soft. See below.
tags no A list of free-form labels. Five are sensitive. See below.
office no The office id of the minister the event goes to when the player does not answer it.
from yes First day of the window, YYYY-MM-DD.
to no Day the window ends (exclusive). Must be after from. Leave it out for an open window.
order no (default 0) A whole number. Cards that fire on the same turn come in this order: an early armistice card, then the consequence cards, then from, then the card's objective by its position in objectives.yaml (cards with no objective first), then order (a lower one first), then the id (R-EVT-006; EventSystem.Trigger). Leave it out unless one card must come after another: degania_defence has order: 1, so One Army opens the game (owner, 24 October 2026, #1568).
conditions no Indicator bounds that must hold when it fires. See below.
kind no (default historical) consequence for a card that exists only on a road not taken; reconvergence for an outside event with course-specific text. See below.
requires no Fires only after every listed requirement holds. See below.
variants no kind: reconvergence only. Course-specific title and text, each with when, text, optional title and sources (R-ALT-010). See "kind".
objective no Makes the event the completion card of an objective in objectives.yaml, which must name this event as its card. It fires only once the objective is completed (GDD loop only), and has exactly one option. See docs/gdd/objective-card.md.
site no A swamp site in sites.yaml whose works the event is about. In the GDD loop it fires only while that site is being worked (R-SWAMP-002); the legacy loop ignores it. See docs/gdd/fields-and-swamps.md.
prisoners no Makes the event a front's prisoner-exchange card: egypt, jordan (which also returns the Iraqi prisoners), lebanon or syria. It fires only while that front holds prisoners or the player's soldiers (GDD loop only), has exactly one option, and returns them and scores when it resolves (R-POW-004).
deported no Makes the event Deport's follow-up card for a settlement target whose residents stayed: it fires only once the player's Deport has depopulated that place, carries the displacement tag and has exactly one option (R-EVT-007). See "deported".
front_quiet no On a front's armistice card only (armistice_<front>, one of egypt, jordan, lebanon, syria). Under gdd-0.3 the card may also come before its from, and again after a refusal, once that front has been quiet long enough; it then takes the first soft slot (R-WAR-008, R-EVT-002). Shown before its from, it shows its early_text when it has one.
armistice_front no On an operation card or a follows card only: a front (egypt, jordan, lebanon, syria) whose signed armistice ends the card. A pending operation lapses once it is signed, and waits while that front's armistice card is pending; the card never first fires after the signature (R-ENEMY-007).
follows no true on a card with requires, under the GDD loop: once its requires are met it fires on the turn after, even when its own window has closed, so a late operation still brings it (R-ENEMY-007).
late_text no On a following card or an operation card only, with a to: the card's text when it is shown after its own window has closed (a late follow-up, or an operation shown again while it waits), with no dates that would mislead (R-ENEMY-007).
late_text_he with late_text, when the card has Hebrew late_text in Hebrew, required exactly when the card's text is in Hebrew.
early_text no On a front_quiet armistice card only: the card's text when it is shown before its from (the early path), saying the talks came sooner than in history, with no date. The card then shows the "Alternative course" banner, and a shareable build refuses until a person has signed the card off (reviewed_by, R-ALT-011). Its office placeholders need a holder from 15 December 1948, the first early offer. A card shown on or after its from, on either path, shows its text (R-WAR-008).
early_text_he with early_text, when the card has Hebrew early_text in Hebrew, required exactly when the card's text is in Hebrew.
options yes One or more options. See below.
sources no by the loader, yes by the rules A list of { url, checked }. See below.
status no (default draft) The review status. See below.

id, title, text and placeholders

Never type the name of a game office's holder into title, text or an option's text. Write the office id in braces, such as {prime_minister}, and the game replaces it with whoever holds that office on the day the event fires (and with the player's own appointment, if the player changed the cabinet). In the example, {prime_minister} must decide. becomes the name of the Prime Minister on the day. Office ids are in content/offices.yaml; who held them is in content/people.yaml.

Naming a historical figure who holds no game office during the card's window is fine (Count Folke Bernadotte in bernadotte_assassination, for example). Check their terms in content/people.yaml first: the loader does not check names, only placeholders.

Rules the loader enforces:

  • Placeholders may use only lowercase letters, digits and underscores, and must name a real office.
  • Any other { or } is an error (no braces for emphasis).
  • The office must have a holder on every day of the window (from up to to). If the office is vacant for even a day, or the window is open-ended and the last holder's term ends, loading fails and the message gives the date.
  • If the window has already closed when the event reaches the player (it can fire late), the names are filled in for the last day of the window.

Write plain description. Do not put words in anyone's mouth: no invented quotes (CONTENT_POLICY.md, section 2).

anchor

  • soft: an event that may or may not fire. At most 3 non-hard events fire per turn (filled in the order of the order row above: early armistice cards, consequence cards, then from, objective, order, id), so a soft event can wait for a later turn inside its window.
  • hard: an event that must happen. Every eligible hard event fires. It needs one option marked historical: true; in Historical mode, if the player leaves it unanswered it resolves to that option.

tags and the sensitive review

Tags are free-form, but these five are sensitive (checked without regard to case): holocaust, terror, massacre, war-casualties, displacement. An event with any of them:

  • cannot give a positive delta to any resource in any option: treasury, fx_reserves, food, arms, food_supply, morale (standing for Social cohesion) or intl_standing (standing for International Support). The loader refuses: it would reward the atrocity. Owner decision of 15 October 2026 (Q-EFX-2, "Extend it"); until then the rule covered money only;
  • needs status: sensitivity-reviewed before any build is shared. That status is set by the maintainer, not by you. Submit it as fact-checked. Statecraft.Cli --release-gate, the -shareable build and tools/package_release.py refuse to release while any sensitive event is not sensitivity-reviewed, and a test requires every sensitive event in content/ to carry exactly that status once reviewed.

For displacement, the no-gain rule has no exception: no option may raise Money, Food, Arms, Social cohesion, International Support or score (R-EFX-007). Score is not an event-effect target yet, so the loader already refuses it as unknown; do not add it to an event. The rule applies when that target exists. The events that use displacement are Deport's follow-up cards (see "deported").

The other tag used so far is security. It has no rule attached.

office

The office id (for example defense_minister) of the minister who answers the event if the player does not. The minister picks the option marked recommended with a probability equal to their competence divided by 10, and otherwise picks at random. With no office, a middling competence of 5 is used. An unknown office is an error.

from and to

The window is half-open: the event can fire from from up to, not including, to. It fires on the first turn that overlaps the window. Turns are a month long and end on the 15th (15 June 1948, 15 July 1948, and so on, to the game's end on 15 January 1952), so a window shorter than a turn can still fire, late. For a decision card, open the window on the 15th on or before the historical decision, so the card reaches the player on the turn before it (R-TURN-002; EventRetimingTests pins each card's turn). Put a comment above from saying why you chose the date, as the example does. The loader requires from. When to is present, it must be later than from. An event may not span an era boundary; split its window at the boundary. An open window with no to is allowed only in the last era.

conditions

Optional bounds on indicators (morale, food_supply, housing, security, intl_standing, the ids in content/model.yaml), each a value from 0 to 1:

conditions:
  - { indicator: morale, max: 0.4 }

min and max are both optional, and min must not exceed max. Not every event needs this; the example has none.

kind

Every event on the record is historical, the default; leave the key out. A consequence card, kind: consequence, exists only because the player took a road that did not happen (R-ALT-005 to R-ALT-008):

id: after_the_road
kind: consequence
anchor: soft                  # always soft
title: ...
text: '...'                   # only what was threatened, promised or recorded as feared at the time; office placeholders
from: 1948-07-15              # absolute dates, opening after the parent's window closes
to: 1948-09-15
requires: [{ event: parent_event, option: road_not_taken }]   # or { event: parent_event, diverged: true }
options:
  - id: hold
    text: ...
    rejoin: parent_event        # optional: this answer returns later cards to the recorded course
    alternative: { basis: debated, by: ..., date: ..., sources: [...] }   # every option carries one

The loader refuses a consequence card that:

  • is hard, or has an option marked historical: true;
  • has no requirement on a road not taken (an option that did not happen, diverged: true, or an option of another consequence card);
  • has an option without an alternative record;
  • follows a road nobody is recorded proposing (the Ferguson test, R-ALT-006, owner's answer Q-ALT-3): the option it follows must have alternative.basis proposed or debated. With diverged: true, every option that did not happen must;
  • does not carry each sensitive tag of every event it requires (R-ALT-007). The no-gain rule then covers it too;
  • has an objective, or is required by an event that is not itself a consequence card;
  • lies more than 2 cards deep from the record (EventRules.MaxConsequenceDepth, a design value, Q-ALT-5).

Consequence cards take a turn's soft slots before the other soft events (R-ALT-008). They never fire in the historical run (R-ALT-012), so EventRetimingTests counts only the other events.

An option on a consequence card may rejoin the event whose alternative road the card follows, provided that event has a historical option (R-ALT-009). Choosing it makes requirements on that historical option hold again, but only later cards whose absolute windows are still open can fire. It does not erase the option the player actually chose: a diverged: true requirement on the same event remains true. The loader refuses rejoin on any other kind of event, an unknown or self target, or a target whose alternative road the card does not follow.

A reconvergence event, kind: reconvergence, is a real outside event that happened regardless of the player's course. It has a historical option and may bend only its title and text to a road not taken (R-ALT-010):

kind: reconvergence
title: The outside event
text: It happened regardless.
from: 1948-07-01
to: 1948-08-01
variants:
  - when: [{ event: parent_event, diverged: true }]
    title: The outside event, on your course
    text: It happened regardless; the earlier decision went the other way.
    sources: [{ url: https://example.org/source, checked: 2026-10-18 }]

Variants are tested in file order; the first whose every when entry holds supplies the text and, when present, the title. Options and effects never vary. Each variant needs a source and at least one requirement on a road not taken. Every road it names must have a window that closes on or before the reconvergence event opens, so wording cannot change while the card is shown. A variant that names an event's historical option also needs every consequence card that can rejoin that event (R-ALT-009) to close by then, since a rejoin makes that option hold. Variant title and text use the same checked office placeholders as the event itself. Only a reconvergence event may carry variants.

deported

deported: acre
tags: [displacement]

Deport's follow-up card for a settlement target (settlement_targets.yaml, GDD Phase 6 PR 9, #801). It fires only once the player's Deport has depopulated that place, at the event step of that turn, and never after Raid or Occupy (R-EVT-007). It takes no soft slot, so a full turn does not delay it; a Deport on the turn that ends the game raises no card, since on that turn only the unfired cards of recorded objectives fire (endingTurn), and a Deport card is not one, so the end screen shows that card instead (owner, 2 November 2026, #2197). The loader refuses a card whose target is unknown or whose residents fled (Deport is refused there, so the card could never fire), one without the displacement tag, one with more than one option, and one with to or prisoners, one that is not soft or opens after the game's start, one with conditions, requires, site, objective, another kind or variants, and a second card for the same place. Leave out to. Left unanswered, it resolves to its one option without a draw. State the in-game consequence and one sourced line of the place's history (Q-CARD-1 (c)); a Deport in play may differ from 1948, so do not say the player's Deport is what happened.

requires

requires: [{ event: other_event_id, option: other_option_id }]

A list: the event waits until every entry holds (R-ALT-001). An entry holds when that event was resolved (chosen or delegated) with that option. An entry can instead say diverged: true:

requires: [{ event: other_event_id, diverged: true }]

which holds when that event was resolved with any option except its historical one (R-ALT-002). The loader checks that every named event exists, that an entry gives an option or diverged: true (not both, not neither), that the option exists, that a diverged event has a historical option, that no event is named twice in one list, that an event does not require itself, and that requirements do not form a cycle.

options

Each option has:

Field Required What it is
id yes Unique within the event. Same shape as an event id.
text yes in practice What the player reads on the button. May use placeholders.
text_he with the event's title_he The button's text in Hebrew (#1064).
historical no (default false) true on the option that matches what really happened. At most one per event.
recommended no (default false) The option a competent minister picks when the event is delegated.
effects no A list of { target, delta }.
set_rung no Sets the security rung, 1 to 5.
set_policy no A map of policy id to a level from 0 to 1.
grant_units no GDD loop only. A list of { type, n, at }: see "grant_units and city_effects".
city_effects no GDD loop only. A list of { city, field, delta }: see "grant_units and city_effects".
unlock_projects no GDD loop only. A list of projects.yaml ids: see "grant_units and city_effects".
unit_orders no GDD loop, both GDD identities. A list of { unit, order, q, r } (order: go_to, the default, or attack): see "unit_orders".
requires_unit_regions with unit_orders A non-empty list of existing regions.yaml ids in any one of which every ordered unit must stand: see "unit_orders".
debt_dollars no Applied under gdd-0.3 only. US$ millions, more than 0, that the option also adds to Debt, in IL at the mvp.il_per_dollar rate in force on the event's date (R-EFX-009).
alternative on every option that did not happen, in an event with a historical option Who put it forward, on what record. See below.
rejoin no Consequence cards only. The id of the event whose road the card follows; choosing this option returns later cards to the recorded course (R-ALT-009). See "kind".

An event needs at least one option. historical is a statement of fact and needs a source; recommended is a game design choice and does not.

alternative

An option that did not happen can say who put it forward, and on what record (R-ALT-003):

  - id: road
    text: The road not taken
    alternative:
      basis: debated            # proposed, debated or design
      by: the Provisional State Council
      date: 1948-06-20
      sources: [{ url: "https://example.org/minutes", checked: 2026-10-17 }]
  • proposed or debated: by names the body or office in words, never a person and never a {placeholder}; date is the day it was put forward; sources (at least one, https://, with checked) support both.
  • design: nobody is recorded proposing it. It is a design assumption (GDD "Events and consequences"), so it has no by and no date. Sources are optional.
  • The historical option carries none. In an event that has a historical option, every other option must carry one (R-ALT-004): the loader refuses an option that did not happen and says nothing about who proposed it. Copy the record from the checked note (research_notes/Alternate timelines/roads-checked.md), or write { basis: design } when nobody is recorded proposing it.

effects

target is one of:

  • an indicator id from content/model.yaml: morale, food_supply, housing, security, intl_standing. These live between 0 and 1, so a delta of 0.03 is three points of the scale. Keep deltas small, as the example does;
  • treasury or fx_reserves, in game money;
  • food, the national Food stock, in whole units (one unit is one population unit's food for a month). The delta rounds to whole units and the stock never drops below 0, so a larger cut than the stock takes what is there. Note that the monthly import (R-FOOD-002) refills the stock to cover_months of the need unless the foreign-currency crisis is on, so outside a crisis a cut only matters if it leaves less than one month's need; a gain stays;
  • arms, the national Arms stock, in whole units (one unit is one 1,000-person recruit group's equipment, R-ARMS-001). The delta rounds and the stock clamps at 0 exactly as food does. Arms has no monthly import refill: purchases (R-ARMS-002), event gains and equipment returned when recruit training is cancelled (R-ARMS-003) can raise the stock.

delta must be a finite number. Any other target is an error. Policy ids (rationing, ...) are not effect targets; use set_policy for those.

grant_units and city_effects

These act on the GDD records, so only content whose eras.yaml sets systems.loop: gdd may use them. Under gdd-0.3 the loader refuses grant_units, city_effects and unlock_projects altogether. They apply after effects: grants, then city effects, then project unlocks, each list in its own order (R-EFX-006).

  • grant_units: [{ type: halutz, n: 2, at: tel_aviv }] adds n units of a unit_types.yaml type of kind unit whose side is empty (the loader refuses a type with a side and says to use recruit training instead). A grant is free: put what the deal cost in effects. Leave out at and the units stand at the city with the military camp; set it to a cities.yaml id to place them there (R-EFX-003). A sites.yaml id is refused until sites carry a date, because a target must exist on the event's date (R-EFX-006).

  • city_effects: [{ city: haifa, field: housing_capacity, delta: 5 }] changes one city's housing_capacity or job_slots by a whole, non-zero number. Capacity never drops below 0 and job slots never below the city's employed (R-EFX-004).

  • city_effects: [{ city: haifa, field: condition, delta: -0.1 }] moves the city's housing condition (0 to 1, R-HOUSE-001) by a non-zero number from -1 to 1. It stays from 0 to 1, so a cut larger than the condition stops at 0.

  • unlock_projects: [industry] makes a projects.yaml kind marked locked: true available to StartProject for the rest of the game (R-EFX-008). Naming a kind that is not locked is an error, since it would do nothing.

An event with a sensitive tag may carry no grant, no positive city_effects delta and no unlock; a cut is allowed (R-EFX-005).

unit_orders

  • unit_orders: [{ unit: golani, q: -7, r: 24 }] gives the unit of a map/units_1948.yaml row a go-to order toward hex (q, r) when the option is chosen or delegated (R-ENEMY-005). The hex must be one of that row's own anchor hexes or order targets (order_targets in map/units_1948.yaml, hexes in map/unit_anchor_hexes.yaml), so a card never sends a unit where no source puts it; cite the anchor's line in a comment. The order goes through the player's own go-to: one the player could not give changes nothing, and the player is told so. The order ends on the to date of the anchor, or of the order target (the loader refuses a hex with none), and its march goes round every enemy-held place but its hex.
  • { unit: golani, order: attack, q: -7, r: 24 } makes the row's unit attack hex (q, r) when the option is decided (R-ENEMY-008); order is go_to when left out. The hex is again one of the row's anchors or order targets, so add an attack only where a source states it (cite it), never from the card's prose. It needs no to date. The attack is the player's own: from where the unit stands after the rows before it (a row may move and then attack, once each), with its checks; one the player could not make changes nothing, and the rows after it still run.
  • Two cards never send one row to the same hex: the operation a unit is in is found from its go-to, and a player's order that takes a unit off it cancels the rest of that operation's orders (R-ENEMY-009).
  • Every option with unit_orders also has requires_unit_regions. The required units are exactly the distinct rows in unit_orders; before the option resolves, each row's starting unit must be on the board and on a hex in any listed region (R-ENEMY-007). Cite the operation objective or target supporting every region in the option's comment.
  • A direct choice with a missing unit is refused unchanged. Delegation postpones an unmet drawn operation, explains the required moves, rolls back that draw and redraws on later consideration; a still-pending card lapses when its event window closes. The orders and placement rule apply under gdd-0.1 and gdd-0.3; legacy ignores them.

sources

sources:
  - { url: "https://history.state.gov/historicaldocuments/frus1951v05/d288", checked: 2026-10-10 }

The loader reads sources but does not check it. The tests do: every event in content/ must have at least one, each URL must start with https://, and checked must be on or after 2026-10-09 (the date of the content check). Use the day you actually opened the page. A source must support the claim it is attached to (CONTENT_POLICY.md, section 2). Paraphrase; do not quote unless you give the quote verbatim.

status

One of draft, fact-checked, historian-reviewed, sensitivity-reviewed; anything else is an error.

  • draft: a work in progress. A pull request for content/ should not stay at this.
  • fact-checked: a person checked every claim against its sources. This is what you submit. The content tests require fact-checked on every non-sensitive event in content/, except three that stay draft by name: first_new_yishuv, jerusalem_demilitarisation_guard and rafah_force_pressure.
  • historian-reviewed: planned for M4, not a gate yet. How a review is done and recorded until then: HISTORIAN_REVIEW.md.
  • sensitivity-reviewed: set by the maintainer for events with a sensitive tag (see above).

If AI helped draft the text, you still check every claim yourself before using fact-checked (CONTENT_POLICY.md, section 2, rule 6).

Hebrew display names in the other content files (name_he, title_he, title_he_f, body_he) have a separate flag: *_review: agent-checked while only an AI agent has checked the name against its sources. A native speaker removes the line once they have reviewed the name (#564), or an AI-assisted contributor does when the pull request discloses the AI help and names the strings read (asked whether an AI-assisted contributor's Hebrew read can clear an agent-checked string or still needs a native Hebrew speaker, the owner answered "AI-assisted can clear it" (4 November 2026)); a blank value is an error, not a review. It does not change the row's status.

reviewed_by and reviewed_on

A person's sign-off beside status: reviewed_by is the reviewer's GitHub handle (never an email), reviewed_on the day, YYYY-MM-DD. Both or neither; the loader refuses a blank or malformed value. Only the reviewer writes them, in a commit of their own: never add, change or remove them yourself on someone's behalf, and an AI agent never does (scripts/oss/reviewed_by_guard.py fails such a pull request; owner, 15 October 2026, #375), unless the pull request's "AI assistance" section discloses the AI help: then an AI-assisted contributor's check counts as the sign-off (it may add or change the two lines, never remove them), and the section should say which sources they opened and what they checked (asked whether an AI-assisted contributor's source check counts as the reviewed_by sign-off, the owner answered "Yes, it counts" (4 November 2026)). CI checks only that the section exists, is not a "no" and names a check; the reviewer reads what was checked and how. An agent may not edit any field of a signed row either, until a person (or a disclosed AI-assisted contributor) signs it again ("Block it in CI", owner, 15 October 2026). See HISTORIAN_REVIEW.md.

What the loader rejects

Errors are printed as file: field: message. These are the messages you are most likely to see:

Message contains Cause
Property 'x' not found on type 'Statecraft.Sim.GameEvent' A key the loader does not know (usually a typo). Not a field of the event.
must be lowercase letters, digits and underscores, starting with a letter An event or option id of the wrong shape (for example Continue-Works).
duplicate event id Another file already uses this id.
duplicate option id Two options share an id.
unknown anchor anchor is not hard or soft.
unknown status status is not one of the four values.
must be after from to is on or before from.
unknown office ' office is not an office id.
unknown office placeholder {something} is not an office id.
stray '{' or '}' outside an {office_id} placeholder A brace that is not a placeholder.
has no holder on A placeholder office is vacant on a day inside the window.
unknown indicator A conditions entry names an indicator that does not exist.
at least one option required options is empty.
at most one option can be historical Two options have historical: true.
hard anchor needs a historical option anchor: hard and no option is historical.
unknown target An effect target is neither an indicator nor treasury, fx_reserves, food or arms.
sensitive events cannot reward A sensitive-tagged event with a positive treasury, fx_reserves, food, arms, food_supply, morale or intl_standing delta.
must be 1-5 set_rung outside 1 to 5.
unknown policy set_policy names a policy that does not exist.
needs the GDD loop grant_units, city_effects or unlock_projects in content that runs the legacy loop.
unknown unit type A grant's type is not in unit_types.yaml.
is not a unit type A grant's type is a population type.
must be at least 1 A grant's n is 0 or negative.
sites cannot be grant targets A grant's at names a site.
no single city has the military camp A grant leaves out at when no single city has the camp.
unknown city A grant's at or a city_effects entry names no city.
unknown field A city_effects field other than housing_capacity, job_slots or condition.
must not be 0 A city_effects delta of 0.
must be a whole number A housing_capacity or job_slots delta with a fraction, or beyond the int range.
must be a number from -1 to 1 A condition delta outside -1 to 1.
unknown city project An unlock_projects entry is not in projects.yaml.
is not locked An unlock_projects entry names a kind without locked: true.
sensitive events cannot reward units A sensitive-tagged event with a grant. A positive city_effects delta gives the same message with the field's name, and an unlock says a project unlock.
unknown objective objective names an objective that is not in objectives.yaml.
has another card objective names an objective whose card is a different event.
an objective's card has exactly one option An objective's card has more than one option.
unknown site site names a site that is not in sites.yaml (GDD loop).
is not a swamp site site names a site whose kinds do not include swamp (GDD loop).
must be a list A list field (such as tags:) written with no value.
an event cannot require itself requires[n].event is the event's own id.
requirements form a cycle Event A needs B and B needs A, directly or through others.
unknown event ' requires[n].event names an event that does not exist.
needs an option or diverged: true A requires entry names neither an option nor diverged: true.
not both A requires entry names an option and diverged: true.
has no historical option, so it cannot diverge diverged: true on an event with no historical option.
the historical option is the record, not an alternative An alternative on the option marked historical: true.
must be proposed, debated or design alternative.basis is another word.
names who put it forward A proposed or debated alternative with no by.
words only, no placeholder alternative.by has a { or }.
needs the date it was put forward A proposed or debated alternative with no date.
a design alternative names nobody and no date A design alternative with a by or a date.
needs at least one source A proposed or debated alternative with no sources.
needs an https url and a checked date An alternative source without https:// or without checked.
a consequence card is soft kind: consequence with anchor: hard.
a consequence card has no historical option A consequence card's option is marked historical: true.
a consequence card follows a road not taken A consequence card with no requirement on an option that did not happen.
every option of a consequence card says who proposed it A consequence card's option has no alternative.
which nobody is recorded proposing The road it follows has basis: design, or no record (R-ALT-006).
must carry ' A consequence card lacks a sensitive tag of the event it follows (R-ALT-007).
cards deep; the most is A chain of consequence cards longer than EventRules.MaxConsequenceDepth, 2 (Q-ALT-5).
only a consequence card may follow a consequence card A historical event requires a consequence card.
a consequence card is not an objective's card A consequence card has objective:.
must be historical, consequence or reconvergence kind is another word.
only a consequence card rejoins the record An option of another kind of event has rejoin.
rejoins only an event whose road this card follows rejoin names an event the card does not follow on a road not taken, or one with no historical option.
only a reconvergence event carries variants An event with another kind has variants.
a reconvergence event happened A reconvergence event has no historical option.
a variant follows a road not taken A variant has no when requirement on a non-historical road.
can still be open when this card opens A variant names a road whose window has not closed by this event's from.
while this card is open A variant names an event's historical option, and a consequence card that rejoins that event can still be open when this card opens.
a variant has text A variant's text is empty.
is already required Two requires entries name the same event (they could never both hold, or one is redundant).

A full message looks like this (an effect target misspelled securty):

Content error: events/hula_drainage.yaml: events[hula_drainage].options[continue_works].effects.securty: unknown target

Running the tests

From the repository root, with the .NET SDK installed (dev-setup.md):

dotnet test sim/Statecraft.sln

This loads all of content/, so any error above shows up here, and it must finish with 0 warnings. To run only the checks on real content: dotnet test sim/Statecraft.sln --filter RealContentTests. To check the sensitive-review gate by hand:

dotnet run --project sim/Statecraft.Cli -- --release-gate

To see every road not taken (each non-historical option of an event that has a historical one), with who proposed it (basis, - when the option has no alternative record), the consequence cards that follow it, the events whose variants name it, and the record's cards it suppresses (breaks, the events that require the historical option):

dotnet run --project sim/Statecraft.Cli -- --timeline-report

The Python checks (uv run --with pytest==9.1.1 --with pyyaml==6.0.3 pytest scripts/oss/tests -q, and uv run scripts/oss/check_repo.py) cover repository policy. They include a test that keeps this guide's field table in line with the loader.

A golden-hash change

docs/determinism.md pins two hashes of complete playthroughs (the "golden runs", to 1950-01-01 and to 1952-01-01). They are computed from the real content/, so an event whose window falls inside a golden run changes the hash, and the determinism tests then fail with the old and new value. That is expected, not a bug in your event. An event that opens after 1952-01-01 does not move them.

How to tell:

  • The failing test is GoldenPlaythroughHashIsFixed or GoldenPlaythroughTo1952HashIsFixed (in DeterminismTests), it shows two 64-character hashes, and nothing else fails: your event moved the golden. Say so in your pull request, and do not edit the hash constants yourself.
  • If other tests fail, or a hash moves when you changed no event window, effect or option, that is a real problem; fix it first.

The maintainer rebaselines: they update GoldenRun.cs, DeterminismTests.cs and docs/determinism.md together, and add a row to its "Rebaseline history". Contributors do not.

Checklist

  • id unique and lowercase; title and text use {office} placeholders, no hard-coded names
  • from has a comment explaining the date; to is after it
  • every fact has a https:// source with the day you checked it
  • at most one historical option; hard events have one
  • no invented quotes; sensitive tags only where they apply, status: fact-checked
  • dotnet test sim/Statecraft.sln passes
  • a line in CHANGELOG.md

Historical-only titles

An office with historical_only: true records a dated title without adding a playable Cabinet seat. Its terms in people.yaml can be used in text placeholders such as {deputy_title} when the event window has a holder throughout. It cannot own a policy, effect, budget line or an event's office: delegation. Use the responsible senior minister for those gameplay fields. Existing offices default to historical_only: false. A historical-only title ignores player appointments, including entries carried in an older save.

Dated offices

from (the day an office was established) and until (the day it was abolished) limit when an office is a Cabinet seat and can be filled. Terms in people.yaml must fall between them. A budget line may run before from: the Budget screen then names the date the ministry begins instead of calling it vacant.

Budget lines owned by office and date

A line in rules.yaml budget_start is keyed by its own id. With no budget_owners entry, the office with that id owns it for the whole era (and must not be abolished). A line can have a dated list of owners instead:

budget_start:
  prime_minister: 0.15       # the Immigration line; its id stays as it was, the owner changes
budget_owners:
  prime_minister:
    - { from: 1948-05-15, office: immigration_minister }
    - { from: 1951-10-08, office: prime_minister }

The first owner starts on the first day of the era (no gap). Each from is inside the era and after the one before. Each owner's office must exist from its from to the next from (or the end of the era), and one office may own only one line on any day. The loader refuses anything else. Offices.BudgetOwner(content, line, date) and Offices.BudgetLineOf(content, office, date) are the only readers. Lines that change across an era boundary are the carry rules' job (#59).

GDD 0.3 first-slice availability (#1718)

Legacy and gdd-0.1 continue to load every shared event file, with their existing effects. Their content identity is unchanged except for israel_bonds, whose source pin changed when it gained debt_dollars (#2457); its effects outside gdd-0.3 did not change. Only the gdd-0.3 identity reads and hashes content/gdd03-events.yaml. It must contain ruleset: gdd-0.3 and an explicit exclusions list of { id, reason } entries. Its schema is content/schema/gdd03-events.schema.json. Missing/null manifests, unknown/duplicate ids, blank reasons, and references from active requirements, variants, rejoin options or objective cards to excluded ids are content errors. Every source file still parses strictly; the remaining catalogue receives the usual cross-reference, effect and sensitivity validation.

The approved first slice excluded exactly austerity_1949, clothing_rationing_1950, forex_crisis_1951, iraqi_exodus, israel_bonds, maabarot_policy, reparations_claim and reparations_vote, including all their options (reparations_vote joined with #1575, for the same reason as reparations_claim). Six of these were hard anchors. Since then #2224 restored clothing_rationing_1950, reparations_claim and reparations_vote, israel_bonds came back with its equal Debt (#2457, R-EFX-009), and #2483 (owner, 4 November 2026) turned on austerity_1949, forex_crisis_1951, iraqi_exodus and maabarot_policy; no card is excluded in 0.3. Shared records, Hebrew, tags, status and human sign-offs remain unchanged and available to review tools, except that israel_bonds gained debt_dollars (its source pin changed; its text, Hebrew, sources and status did not). Removing an exclusion requires a reviewed follow-up with approved accounting and authored values; it does not itself approve a replacement or transfer a sign-off. There is no automatic review promotion, and all existing release gates still apply.

R-EFX-001 rejects 0.3 writes to Attention and defeat commands even if authored as compatibility indicators. Reserved target spellings are attention/attention_*, defeat, city_loss_defeat and any_city_loss. Since #2483 (owner, 4 November 2026) 0.3 events write food_supply and housing, and the rationing/maabarot policy, as in 0.1 (maintainer reading: the policy writes come with the cards, #2483). Under D1 (owner, 1 November 2026) the passive budget, the monthly Food refill and foreign currency stay: fx_reserves and the budget*, passive_budget*, food_refill and automatic_food_refill spellings load in 0.3 as in 0.1. Other unknown targets remain errors. No new alias or conversion is provided. grant_units, city_effects and unlock_projects await an approved 0.3 accounting contract and are rejected. Explicit food, arms, treasury and approved indicator effects retain the existing application and no-gain checks (R-EFX-002/005/007). Treasury costs still borrow (R-MONEY-003): the owner's 26 October 2026 ruling on #1718 supersedes the proposal's prohibition. Do not invent FX-to-Money rates, debt principal, arrivals, Food quantities, facilities or replacement values. Missing replacements remain Deferred in the #1742 workflow.