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.

docs: revise the chapters design after staff review (#53)

eyalgolan93ee1f5eafed
diff --git a/docs/superpowers/specs/2026-10-10-chapters-architecture-design.md b/docs/superpowers/specs/2026-10-10-chapters-architecture-design.md
index c4bc8fe95..03fc92010 100644
--- a/docs/superpowers/specs/2026-10-10-chapters-architecture-design.md
+++ b/docs/superpowers/specs/2026-10-10-chapters-architecture-design.md
@@ -1,6 +1,6 @@
# Chapters architecture: how eras chain without resets
-- **Date:** 2026-10-10
+- **Date:** 2026-10-10 (revised after staff review the same day)
- **Status: PROPOSED — owner review needed for the decisions listed in §Decisions**
- **Issue:** #53 (roadmap tracker). Era epics that depend on it: #49 (Yishuv), #50 (1957–1977), #51 (1977–1993), #52 (1993–2026).
- **Parent spec:** [2026-10-09-statecraft-israel-design.md](2026-10-09-statecraft-israel-design.md) (§2 "Eras as chapters, not resets"; §3 saves; §5 content; §7 saves; §8 testing; §9–§11)
@@ -18,51 +18,61 @@ stated default.
| # | Decision | Recommended default |
|---|---|---|
-| D1 | How numbers carry across a boundary (§4.3) | **Deviation carry:** the next chapter starts from its sourced start values, moved by how far the player's game ended from the previous chapter's historical reference run. Not absolute carry, not a reset |
-| D2 | Can a player start at a later chapter without playing the earlier ones? (§6) | **Yes.** Every chapter has a sourced start and can be started fresh; playing straight through is the main mode |
-| D3 | Chapter dates (§3.1) | **Founding = 15 May 1948 to 1 January 1957.** Later boundaries are set in #49–#52 with one rule: a boundary is a date, and the last turn before it is shortened to end on it |
-| D4 | Saves across chapters (§7) | **A checkpoint at each boundary.** A save stores the state at the start of the current chapter, so a content update to an earlier chapter does not change a game that is already past it |
-| D5 | Money on screen (§11) | **Each period's own currency**, converted at sourced redenomination dates; the sim converts its stored amounts on that date |
-| D6 | Browser build: what it downloads (§9) | **One chapter at a time:** shared data plus the current chapter's content pack at boot, the next pack fetched in the background. Budget: 1 MB compressed per chapter pack |
+| D1 | How the game carries across a boundary (§4.3) | **Deviation carry:** the next chapter starts from its sourced start, moved by how far the player's game ended from the previous chapter's historical reference run. This applies to money, population, and the policy levels and indicator shifts the next chapter's calibration reads. Everything else persists as it is. Not absolute carry, not a reset |
+| D2 | Can a player start at a later chapter without playing the earlier ones? (§6) | **Yes.** Every chapter has a sourced start and can be started fresh. Playing straight through is the main mode |
+| D3 | Chapter dates and the end of the game (§3.1, §4.5) | **Founding = 15 May 1948 to 1 January 1957.** Later boundaries are set in #49–#52. A boundary is a date, and the turn grid is adjusted to land on it. Reaching the last era's end ends the game after the legacy report |
+| D4 | Saves across chapters (§7) | **A checkpoint at each boundary.** A save keeps the state at the start of the current chapter, so a content update to an earlier chapter does not change a game that is already past it |
+| D5 | Money on screen (§11) | **Display only:** the sim keeps one internal unit for each money account in every era. The UI shows each period's currency, converted by sourced redenomination dates and factors |
+| D6 | Browser build: how content is shipped (§9) | **One content pack for all eras, loaded at boot.** Loading one era at a time is built only if a measured IL2CPP WebGL boot time goes over budget |
## 1. The rules this design keeps
-1. **No reset.** Player choices made in one chapter still matter in the next: money, population, policies, the
- map, standing, and which options were chosen in past events.
+1. **No reset.** Choices made in one chapter still matter in the next: money, population, policies, the map,
+ standing, and which options were chosen in past events.
2. **Each chapter is calibrated on its own.** A chapter's calibration test does not depend on how well an earlier
- chapter was calibrated (issue #53: "one tolerance set per era").
-3. **Existing goldens do not move.** `GoldenRun.Hash1950` and `GoldenRun.Hash1952` (`sim/Statecraft.Sim/GoldenRun.cs`,
+ chapter was calibrated (issue #53: "one tolerance set per era"). A looser check covers games that arrive by
+ playing through (§12).
+3. **Existing goldens do not move.** `GoldenRun.Hash1950`, `GoldenRun.Hash1952` (`sim/Statecraft.Sim/GoldenRun.cs`,
`docs/determinism.md`) and the browser `SMOKE OK 5 turns` value stay the same through every item in §15. Each item
says how.
4. **Data decides, code implements.** Eras, dates and which systems are on are content. Code holds one implementation
of each system and reads the switches.
5. **The content rules apply in every era** (spec §1, §5): Israeli-perspective narration, one sourced value per fact,
real names, no invented quotes, nothing that rewards an atrocity, the Holocaust reacted to and never played, and
- living people out of release builds until legal review.
+ living people out of release builds until legal review. §13 turns the last two into checks.
+6. **Build machinery when content needs it.** Items whose only user would be a second era are written down here and
+ deferred until #49 or #50 content exists (§15).
## 2. What exists today (checked against the code)
| Area | Today | Gap for chapters |
|---|---|---|
| Game start | `Simulation.NewGame` starts at `Rules.Start` (`content/rules.yaml`: 1948-05-15) | One start only |
+| Game end | No end date: a game steps on until it ends by collapse; `GoldenRun` stops at 1000 turns and saves at 2000 | No end of content |
| Dated content | Events have `from`/`to`; people have dated office terms; legislatures and governments have `from`/`to`; offices have `until` only (`Content.cs`) | Indicators, policies, effects, situations, voter groups and actors have no dates; offices have no `from` |
| Model in state | `EffectsSystem.Init` puts **every** indicator, policy and effect in the state, and `Apply` loops over all of them | Adding any later-era policy or effect to `model.yaml` today **moves both goldens** (new keys in the hashed `pol{}` and `eff{}` maps) |
+| Lookups by id | `SetPolicy` checks the id against all of `c.Policies` (`Simulation.cs`); event conditions, effects, `EffectsSystem.Shift` and voter-group weights read `s.Indicators[id]` directly | Once records have windows, an inactive id must be refused or never referenced |
| Rules | One `Rules` object for the whole game; economy values are calibrated to 1950–51 | No per-era values |
| Switches by date | `Offices.Legislature(date)` picks the sitting body; `Legislature.BudgetApproval` sets whether the budget is voted; `Rules.MapActionsFrom` | These already are "systems switched by data"; nothing else is |
+| Time counting | `SecuritySystem.Apply` takes whole weeks per turn length (13, 4 or 1) off the ceasefire clock | A shortened turn needs real days |
| State | `GameState` (`sim/Statecraft.Sim/GameState.cs`) has no era field; `Hash()` covers every field | A new field changes the hash text, so it moves the goldens |
| Saves | `SaveGame` schema 1: content hash, seed, mode, command log, end hash; replay from the seed; `MaxTurns = 2000` | No chapter, no checkpoint; one content hash for everything |
-| Content loading | `ContentLoader.Load` reads every file; WebGL fetches every file in `manifest.json` in parallel (`GameInputs.FetchAsync`, `ContentManifest`) | One HTTP request per event file; itch.io allows 1,000 files per upload (`docs/m3-release.md`) |
+| Content hash | `ContentLoader.HashOf` hashes each file's relative path, length and text | Moving a file changes `Content.Hash` (saves then warn once) |
+| Content loading | `ContentLoader.Load` reads every file; WebGL fetches every file in `manifest.json` in parallel (`GameInputs.FetchAsync`, `ContentManifest`); the manifest has paths only | One HTTP request per file; itch.io allows 1,000 files per upload and the build has 51 (`docs/m3-release.md`) |
| Validation cost | The office-overlap check compares every pair of terms (`ContentLoader.Validate`) | Quadratic in the number of terms |
-| Settlements | `content/map/settlements_1948.yaml` (25 places) with `founded` as a year; `settlement_hexes.yaml` built from it; the Unity map reads the 1948 file by name (`SettlementPlacer.DefaultFileName`) | No dates in use; no end dates or renames |
+| Release gate | `ReleaseGate` checks only that sensitive-tagged events are `sensitivity-reviewed` | No check for living people; no gate on sensitive map data |
+| Settlements | `content/map/settlements_1948.yaml` (25 places): `founded` is a year, or `null` with `pre_modern: true`; `settlement_hexes.yaml` is built from it; the Unity map reads the 1948 file by name (`SettlementPlacer.DefaultFileName`) | The dates are not used; no end dates or renames |
| Water | `tools/terrain_bake.py` derives sea and lakes from the modern DEM into one `coast.png` (86 KB) | Modern water only (#16) |
| Money display | `model.yaml money` gives one prefix per account (`IL `, `$`) | One currency for all time |
| Office titles | One `title` per office | Titles that change with time |
| UI text | `unity/Assets/UI/strings.en.yaml`; but `Game.uxml` has "Loading the map of 1948…" | Era words in the UI |
-**Measured (2026-10-10, .NET 10, Release, this worktree):** loading today's content (31 events) takes 142 ms
-including JIT start-up; loading the same content plus 3,000 copies of `hula_drainage.yaml` takes 711 ms; the golden
-run to 1952 (43 turns) plays in 5–10 ms with either. Event text is about 4 KB per event and compresses about five
-times with gzip. The sim's per-turn cost is not the problem; download size, request count and load time in WebGL are.
+**Measured (2026-10-10, .NET 10, Release, this worktree):** today's 31 event files hold 44,357 bytes (about 1.4 KB per
+event); gzip -9 of them together is 12,020 bytes. Loading today's content takes 142 ms including JIT start-up; loading
+it plus 3,000 copies of `hula_drainage.yaml` takes 711 ms. The golden run to 1952 (43 turns) plays in 5–10 ms with
+either. At 3,000 events the event text would be about 4.3 MB raw and about 1.2 MB gzipped, about half the 8 MB
+heightmap. The binding limit is the number of files, not their size, and the sim's per-turn cost is not a problem.
+IL2CPP WebGL load time is not measured yet.
## 3. What an era is in data
@@ -75,32 +85,33 @@ eras:
- id: founding
name: The Founding # the chapter name the player sees
from: 1948-05-15 # = rules.yaml start today
- to: 1957-01-01 # exclusive, like every other window
+ to: 1957-01-01 # exclusive, like every other window; the last era's `to` ends the game (§4.5)
systems: # switches for code that exists (§5); strict keys
- statehood: true
legislature: state # state | assembly (a consent body without force of law)
- war_mode: true
map_actions: [transit_camp, housing]
- start: start/founding.yaml # sourced start values for a fresh start (§6)
- carry: carry/founding.yaml # how the previous era's state maps into this one (§4)
+ start: start/founding.yaml # sourced start values for a fresh start (§6); absent for founding (rules.yaml holds them)
+ carry: carry/founding.yaml # how the previous era's state maps into this one (§4); absent for the first era
```
-- `id` is the key used by saves, packs, goldens and file folders.
-- The loader checks that eras are contiguous and non-overlapping, that every dated content record falls in the range
- of the eras, and that `systems` uses only known keys.
-- Today the file has one era, `founding`. The first era's `carry` is absent.
+- `id` is the key used by saves, goldens and file folders.
+- The loader checks that eras are contiguous and non-overlapping, that every dated content record falls inside the
+ eras' range, and that `systems` uses only known keys.
+- Today the file has one era, `founding`.
**D3:** the founding era runs from 15 May 1948 (the current start) to 1 January 1957, the spec's "Q2 1948 to
-Q4 1956". The Yishuv era (#49) would end on 15 May 1948. Each later epic sets its own `to` by the same rule.
+Q4 1956". Suez (October–November 1956) and the withdrawal that followed straddle that date. An event may not span a
+boundary (§9), so events after the war fall in the next era. If the owner prefers, the founding era can end after the
+withdrawal instead. That date would need a source. The Yishuv era (#49) would end on 15 May 1948. Each later epic sets
+its own `to` by the same rule.
### 3.2 Dated content (content windows)
Every content record that can begin or end gets an optional `from`/`to` window, half-open like events. A record
-without a window is active in every era. This is the same rule events, terms and legislatures already follow.
+without a window is active in every era. Events, terms and legislatures already follow this rule.
| File | Records that gain `from`/`to` |
|---|---|
-| `model.yaml` | indicators, policies, effects, situations, voter groups, actors (money is dated in `currency.yaml`, §11) |
+| `model.yaml` | indicators, policies, effects, situations, voter groups, actors (money display is dated in `currency.yaml`, §11) |
| `offices.yaml` | `from` (created), next to the existing `until`; plus `successor` (§4.2) and dated `titles` (§11) |
| `aliyah.yaml` | regions (the series is already dated) |
| `rules.yaml` map actions | each action |
@@ -108,32 +119,43 @@ without a window is active in every era. This is the same rule events, terms and
Records that are already dated keep their fields. People span eras (one person's office terms can fall in two or
more chapters), so `people.yaml` stays one file.
-The sim reads "what is active on this date" through one view per window state, not by filtering on every call:
-`Content.At(date)` returns the active indicators, policies, effects, situations, voter groups and actors. It is cached,
-because windows change only on a few dates. `EffectsSystem`, `PoliticsSystem`, `HistoricalAI` and the UI presenters
-read the view instead of the raw lists.
+**The active view.** The loader computes the window segments once: a sorted, immutable array of the dates on which
+any record begins or ends, and the active lists for each segment. `Content.At(date)` finds the segment by binary
+search. It is not a lazy cache, so tests that run in parallel share nothing mutable. `EffectsSystem`,
+`PoliticsSystem`, `HistoricalAI` and the UI presenters read the view instead of the raw lists.
**State follows the windows.** When a turn ends past a record's `from`, the record is added to the state as `Init`
-would add it (indicator at `base` with shift 0, policy at `default`, effect contribution 0). When it ends past a
-record's `to`, the record is removed. This is done in one place, `ContentWindows.Update(c, s, turnStart)`, called in
-`Simulation.Step` after the date moves. **Golden safety:** every existing record has no window, so the state of the
-1948–52 runs holds the same keys as today.
+would add it: an indicator at `base` with shift 0, a policy at `default`, an effect's contribution at 0. When the turn
+ends past a record's `to`, the record is removed. Records are added and removed in ordinal id order. This is done in
+one place, `ContentWindows.Update(c, s, turnStart)`, called in `Simulation.Step` after the date moves.
+
+**Nothing may reach an inactive record:**
+- Commands are checked against `Content.At(s.Date)`. `SetPolicy` for a policy outside its window is refused with a
+ reason, like an unknown policy today.
+- The loader refuses content that could reference an inactive record. Every reference must be to a record that is
+ active for the whole window of the record that uses it. That covers event conditions, option effect targets,
+ `set_policy`, effect sources and targets, situations' indicators, voter-group weights and policy offices.
+- A test for each reference kind, on a fixture.
+
+**Golden safety:** every existing record has no window, so the state of the 1948–52 runs holds the same keys as
+today.
### 3.3 Rules per era
`rules.yaml` stays the base. An era may add `rules/<era>.yaml` with only the keys it changes. The loader merges at
the YAML-node level (base mapping, then the era's keys), then reads the result with the same strict `Rules` type, so a
-typo in an era file still fails. Systems ask `Content.RulesAt(date)` instead of `Content.Rules`.
+typo in an era file still fails. Systems ask `Content.RulesAt(date)` instead of `Content.Rules`. Rules change only at
+boundaries. Nothing inside an era changes the unit of money (§11).
The founding era has no override file, so its rules are exactly today's. The economy values in `rules.yaml` are
-calibrated to 1950–51 (`EconomyCalibrationTests`); a later era sets its own in its own file and its own calibration
+calibrated to 1950–51 (`EconomyCalibrationTests`). A later era sets its own in its own file, with its own calibration
test.
**Alternatives considered for era-specific content:**
| Option | How | For | Against |
|---|---|---|---|
-| A. Dated records in the existing files (recommended) | `from`/`to` on records, `eras.yaml`, partial `rules/<era>.yaml` | One rule everywhere (windows); people and parties that span eras stay single; no moves of existing files except events (§9) | `model.yaml` grows long; needs the active view |
+| A. Dated records in the existing files (recommended) | `from`/`to` on records, `eras.yaml`, partial `rules/<era>.yaml` | One rule everywhere (windows); people and parties that span eras stay single | `model.yaml` grows long; needs the active view |
| B. A folder per era with full copies | `content/eras/<id>/model.yaml`, `rules.yaml`, ... | Each era is self-contained | Records that span eras are duplicated and drift apart; a policy that lives 1948–1990 is written three times |
| C. Era code modules | A C# class per era registers its systems | Full freedom | Rules move out of data; contributors must write code to add an era |
@@ -141,14 +163,21 @@ test.
### 4.1 The boundary turn
-The turn grid does not land on boundary dates by itself (quarters from 15 May fall on the 15th; war months and weeks
-shift it). So the last turn of an era is **shortened to end exactly on the next era's `from`**:
-`next = min(SimTime.Advance(date, len), nextEra.From)`. The year fraction of a shortened turn is its days over 365;
-whole turns keep today's fixed fractions.
+The turn grid does not land on boundary dates by itself. Quarters from 15 May fall on the 15th, and war months and
+weeks shift the grid. So the turn that would pass the next era's `from` is adjusted to end exactly on it:
-This makes a game that played into a chapter and a game that started fresh at it share the same calendar from the
-boundary on, so per-era goldens and event windows line up. **Golden safety:** there is no boundary inside 1948–1957,
-so no turn of the existing runs changes.
+- If the turn would cross the boundary, it ends on the boundary (`next = nextEra.From`).
+- If the turn after that would be shorter than 14 days, the current turn is lengthened to the boundary instead. The
+ player never gets a turn of a few days with a full turn of attention, events, votes and map actions.
+- Systems that count time use the turn's real days for an adjusted turn. The year fraction is days / 365. The
+ ceasefire clock takes `days / 7` whole weeks (integer division). Whole turns keep today's fixed values (13, 4 or 1
+ weeks; 0.25, 1/12 or 7/365 of a year).
+- Attention, the event cap per turn and the map-action cap are per turn as today. The 14-day rule keeps an adjusted
+ turn between 14 days and a quarter plus 14 days.
+
+With these rules, a game that played into a chapter and a game that started fresh at it share the same calendar from
+the boundary on, so per-era goldens and event windows line up. **Golden safety:** there is no boundary inside
+1948–1957, so no turn of the existing runs changes.
Order inside `Simulation.Step` when a turn ends on a boundary:
@@ -165,20 +194,20 @@ game.
| Field | At a boundary | Notes |
|---|---|---|
-| `Date`, `Turn`, `RngState`, `Mode` | persist | one RNG stream for the whole game |
+| `Date`, `Turn`, `RngState`, `Mode` | persist | one RNG stream for the whole game; `EraSystem.Cross` draws nothing from it |
| `Indicators` | recomputed | level = base + effects + shift, as today |
-| `IndicatorShifts` | persist where the indicator continues | the player's lasting marks on morale, housing and so on |
+| `IndicatorShifts` | deviation carry for indicators the next era's start lists (additive, clamped so the level stays 0–1); persist for the others | the player's lasting marks on morale, housing and so on |
| `EffectContributions` | persist where the effect continues | dropped for effects whose window ended |
-| `Policies` | persist where the policy continues; mapped where the carry file names a successor | a new policy starts at its default |
-| `ActiveSituations` | persist where the situation continues | hysteresis state is kept |
+| `Policies` | deviation carry for policies the next era's start lists (additive, clamped 0–1); persist for the others; mapped where the carry file names a successor | a new policy starts at its default |
+| `ActiveSituations` | persist where the situation continues | the hysteresis state is kept |
| `Budget` | mapped through office successors, then rescaled to sum to 1 | e.g. a Yishuv institution's line passes to its state ministry |
-| `Treasury`, `Debt`, `FxReserves` | **re-based by deviation** (D1) and converted by any currency factor | §4.3 |
-| `Population` | groups mapped by the carry file, then **re-based by deviation** (ratio) | §4.3 |
+| `Treasury`, `Debt`, `FxReserves` | deviation carry (additive) | in the sim's internal unit; no currency conversion (D5) |
+| `Population` | groups mapped by the carry file, then deviation carry (ratio) | §4.3 |
| `Rung`, `CeasefireWeeksLeft`, `Mobilization` | persist | the ladder is always on; 1948 opens at war |
| `CoalitionStability` | persist | its meaning follows the sitting body (assembly or Knesset) |
| `Attention` | refilled | as every turn |
| `FiredEvents`, `ChosenOptions` | persist | later events may `require` earlier choices |
-| `PendingEvents` | persist | the events raised on the boundary turn are answered in the new chapter's first turn; an era pack is kept loaded while any of its events is pending |
+| `PendingEvents` | persist | events raised on the boundary turn are answered in the new chapter's first turn |
| `Appointments`, `AppointedUnder` | persist | `Cabinet.ExpireOnGovernmentChange` ends them when the government changes, at a boundary or not |
| `Placements`, `MapActionsTurnDate`, `MapActionsThisTurn` | persist | what the player built stays on the map |
| `GameOver` | — | a game that ended does not cross |
@@ -187,47 +216,71 @@ game.
`eras.yaml`. If a later item does need a field, it is written into `Hash()` only when it differs from its default, so
the existing hash text does not change. That convention is documented in `docs/determinism.md` with the field.
-### 4.3 How numbers carry (D1)
+### 4.3 How the game carries (D1)
-Each era has a sourced start (§6): treasury, debt, reserves, population by group, budget shares and start rung on its
-`from` date. The question is how a game that played the previous chapter enters it.
+Each era has a sourced start (§6). It holds treasury, debt, reserves, population by group, budget shares and start
+rung on its `from` date, plus the policy levels and indicator shifts its calibration test reads. The question is how
+a game that played the previous chapter enters it.
| Option | Rule at the boundary | For | Against |
|---|---|---|---|
| A. Absolute carry | new value = the player's value, mapped | Simplest; no reference data | Every chapter's calibration error adds up: a small 1948 economy error is still there in 2026. A later chapter cannot be calibrated alone |
-| **B. Deviation carry (recommended)** | additive: `start + (player − reference)`; ratio (population): `start × player / reference`, where *reference* is the previous chapter's historical run at the boundary | A historical playthrough enters the next chapter exactly at its sourced start; a player who did better or worse carries the difference. Each chapter is calibrated alone | Needs a pinned reference file per boundary, regenerated when the earlier chapter changes |
+| **B. Deviation carry (recommended)** | additive: `start + (player − reference)`; ratio (population): `start * (player / reference)`. *Reference* is the previous chapter's historical run at the boundary | A historical playthrough enters the next chapter at its sourced start; a player who did better or worse carries the difference. Each chapter is calibrated alone | Needs a pinned reference file per boundary, regenerated when the earlier chapter changes |
| C. Reset to sourced values | new value = start | Simplest for balance | It is the Civ VII reset the spec rejects (§2) |
-**Reference file.** `content/carry/<era>.reference.yaml` holds, for the boundary into `<era>`, the carried quantities
-of `GoldenRun.Play` of the previous chapter (golden seed, Historical mode) on the boundary date. A tool writes it and a
-test regenerates it and compares, as the goldens are checked today. A change to the earlier chapter that moves its
-golden also changes this file, in the same commit.
+**Exact arithmetic.** The carry must be bit-for-bit deterministic and must return the sourced start exactly for the
+historical run:
+- Ratio carry is computed as `start * (player / reference)`. When `player == reference` the quotient is exactly 1.0,
+ so the result is exactly `start`. Additive carry is `start + (player - reference)`, which is exactly `start` when
+ the difference is 0.0.
+- If a mapped group's reference is zero or absent, that group falls back to additive carry.
+- Quantities are processed in ordinal key order. The rebuilt `Population` dictionary is filled in ordinal key order.
+ So is every other dictionary the carry rebuilds, because sums over `Population.Values` follow insertion order
+ (`GameState.TotalPopulation`).
+- `EraSystem.Cross` uses no RNG and no trigonometry; only `+ - * /`, `Math.Min` and `Math.Max`.
+- A test at the golden seed asserts bit equality between a historical chain's carried values and the sourced start.
+
+**Reference file.** `content/carry/<era>.reference.yaml` holds the carried quantities of the previous chapter's
+golden run (golden seed, Historical mode) on the boundary date. Doubles are written as IEEE bit patterns in hex, as
+saves write them. A tool writes the file, and a test regenerates it and compares, as the goldens are checked today. A
+change to the earlier chapter that moves its golden also changes this file, in the same commit. The reference is
+"the historical path in this game": the sim's own run, not the historical record.
**Rules that keep it sane:**
-- The carry file lists only quantities that have a sourced start in the next era; everything else in §4.2 persists.
-- A ratio carry needs a reference above zero; additive carry is used for money because it can be negative.
-- Each carried quantity has a sourced floor and ceiling in the carry file, so an extreme game cannot enter the next
- chapter with an impossible value (for example negative population). A clamp is reported in the Why panel.
-- With another seed, a historical run ends near, not exactly at, the reference. That small difference carries. This is
- wanted: it is the effect of the random draws in that game.
+- The carry file lists only quantities that have a sourced start in the next era. Everything else in §4.2 persists.
+- Each carried quantity has a floor and a ceiling in the carry file, so an extreme game cannot enter the next chapter
+ with an impossible value (for example negative population). A clamp is reported in the Why panel.
+- With another seed, a historical run ends near the reference, not exactly at it. That small difference carries,
+ which is wanted: it is the effect of that game's random draws.
+- **Explained to the player:** the chapter card lists each carried quantity as "your game: X; the historical path in
+ this game: Y; the new chapter starts at Z + (X − Y)". The legacy report (#19) uses the same reference run.
+- Later, if additive money carry proves wrong across a large change in the economy's scale (for example into the
+ 1980s), the carry file can name a scale quantity and carry money as a share of it. This is not needed now.
### 4.4 Worked example: Yishuv institutions become state institutions (1948)
-This is how #49 would hand over to the founding chapter without a reset. Office ids and dates here are examples;
-the real mapping is #49's research and needs sources.
+This is how #49 would hand over to the founding chapter without a reset. Office ids and dates here are examples; the
+real mapping is #49's research and needs sources.
| Yishuv-era thing | At the 15 May 1948 boundary | Mechanism |
|---|---|---|
| Jewish Agency Executive and Vaad Leumi offices (e.g. the chair of the Jewish Agency Executive) | end; their budget lines and policies pass to state offices (e.g. Prime Minister) | `offices.yaml`: `until` plus `successor: prime_minister`; `carry/founding.yaml` maps budget lines |
| The people who held them | continue in their new offices on the sourced term dates | `people.yaml` terms; nothing moves |
-| The Assembly of Representatives / People's Council | gives way to the Provisional State Council | `legislatures.yaml` periods with `kind: assembly` or `kind: state` |
-| National funds (treasury in the Yishuv) | become the state treasury, re-based by deviation and converted by a sourced currency factor | `carry/founding.yaml` + `currency.yaml` (§11) |
-| Population groups (e.g. by aliyah wave) | map to the founding chapter's groups (all pre-state residents become `veterans`), then re-based by ratio | `carry/founding.yaml` group map |
+| The Assembly of Representatives / People's Council | gives way to the Provisional State Council | `legislatures.yaml` periods; the era switch `legislature: assembly` or `state` |
+| National funds (treasury in the Yishuv) | become the state treasury by deviation carry | `carry/founding.yaml`; the display currency is §11's business |
+| Population groups (e.g. by aliyah wave) | map to the founding chapter's groups (all pre-state residents become `veterans`), then ratio carry | `carry/founding.yaml` group map |
| The Haganah as a policy-led force | the IDF is founded inside the chapter (the existing `idf_founding` event, window 22 May to 1 June 1948); mobilisation and rung persist | Defence state persists |
| Settlements the player founded (e.g. tower-and-stockade) | stay on the map and count as settlements for later map actions | `Placements` persist |
| The British Mandate as an AI actor | its window ends; the United Kingdom actor continues | actor `to` date |
| Choices in Yishuv events | stay in `ChosenOptions`; founding events may `require` them | event `requires` across eras |
+### 4.5 The end of the last era
+
+Reaching the last era's `to` ends the game. The turn that reaches it is adjusted as in §4.1. The legacy report (#19)
+is shown, then `GameOver` is set to "The chapter has ended" (player-facing text, not an id). Commands after that are
+refused as for any ended game. Today the last era is `founding`, so a game ends on 1 January 1957. When the next era
+is added, the same date becomes a boundary instead. **Golden safety:** the golden runs end in 1950 and 1952.
+
## 5. Era-specific systems
Systems are switched on and off by data, in `eras.yaml systems`, and by dated records. Code implements each system
@@ -243,13 +296,14 @@ Rules for switches:
- A key is added to `systems` only in the same change that adds the code behind it, with a test for both values.
The loader refuses unknown keys, as it does everywhere.
- What is already dated stays dated: the sitting legislature, `budget_approval`, office existence, map-action dates.
- A switch is for a whole-era difference: no state (no tax law, no army), a consent assembly instead of a parliament,
- an outside ruler that sets immigration quotas (the Mandate's certificates), whether war mode is available.
+ A switch is for a whole-era difference. Examples: no state (no tax law, no army); a consent assembly instead of a
+ parliament; an outside ruler that sets immigration quotas (the Mandate's certificates); whether war mode is
+ available.
- The budget-approval question (#3) stays a field on each legislature record, which is already era-keyed.
## 6. Starting at a chapter (D2)
-`Simulation.NewGame(content, seed, mode, era)`; the existing three-argument form means `founding`, so the goldens and
+`Simulation.NewGame(content, seed, mode, era)`. The existing three-argument form means `founding`, so the goldens and
all existing callers keep their behaviour.
A fresh start:
@@ -258,20 +312,24 @@ A fresh start:
(`start`, `start_rung`, `treasury_start`, `fx_start`, `initial_population`, `budget_start`), which stay where they
are, so nothing moves;
- marks as resolved, with their historical option, exactly the earlier-era events that this era's content `requires`.
- A later chapter's opening therefore does not depend on unrelated edits to earlier chapters.
+ A later chapter's opening therefore does not depend on unrelated edits to earlier chapters. With one pack for all
+ eras (D6) the earlier events are loaded, so their historical options can be read directly. If per-era loading is
+ ever built, a tool writes the `(event, historical option)` pairs into `start/<era>.yaml` instead, checked by a test.
-**Invariant, tested:** a historical playthrough of chapter N, carried into N+1, has the same carried quantities as a
-fresh start of N+1. The turn number, RNG state and event history differ, which is expected.
+**Invariant, tested:** a historical playthrough of chapter N, carried into N+1, equals a fresh start of N+1 bit for
+bit on every carried quantity (§4.3). The turn number, RNG state and event history differ, which is expected.
## 7. Saves across chapters (D4)
-Today a save is the seed and every command from the start; loading replays all of it, and a content change warns and
-may diverge (`GameSession.Load`).
+Today a save is the seed and every command from the start. Loading replays all of it; a content change warns and may
+make the game diverge (`GameSession.Load`). Replay time is not the issue (43 turns play in 5–10 ms). The issue is
+content updates. Over a long release history, earlier chapters will be patched, and every patch would change the
+replay of every game already past them.
| Option | For | Against |
|---|---|---|
-| A. Replay from the start, as today | One source of truth; no new format | A game in 1975 replays from 1948 on every load; any patch to 1948 content changes the replay of every later game (the warning fires and the game drifts) |
-| **B. A checkpoint at each boundary (recommended)** | Load replays only the current chapter; earlier chapters are frozen, so content patches to them do not change a game past them | Needs a lossless state text and a second check (the checkpoint's hash) |
+| A. Replay from the start, as today | One source of truth; no new format | Any patch to 1948 content changes every later game on load (the warning fires and the game drifts) |
+| **B. A checkpoint at each boundary (recommended)** | Earlier chapters are frozen; load replays only the current chapter | Needs a lossless state text, and the checkpoint is hostile input that must be validated |
**Schema 2** (`SaveGame.SchemaVersion = 2`):
@@ -280,24 +338,36 @@ statecraft-save 2
chapter founding era the game started in
seed 1948
mode Historical
-content core <hash> shared files
-content founding <hash> one line per era pack used
-checkpoint 1957 <hash> optional: the state on the boundary into era '1957'
+content <hash> Content.Hash of the content it was played with, as today
+checkpoint <era-id> <hash> optional: the state on the boundary into that era; only the latest is kept
state <key> <value> ... lossless state lines (doubles as IEEE bit patterns, as today)
turn the current chapter's turns, as today
<command> ...
end <hash>
```
-- **Lossless state text.** `GameState` gains `Write`/`Read` built on the same canonical form `Hash()` uses. A test
- checks, for every turn of the golden runs, that `Read(Write(s)).Hash() == s.Hash()` and that stepping the restored
- state gives the same next hash.
-- **Loading.** With a checkpoint: read the state, check its hash, replay the turns after it. Without one: replay from
- the seed, as today. A content-hash mismatch on the current chapter's pack warns as today; mismatches on earlier packs
- do not matter once a checkpoint exists.
-- **Migration.** Schema 1 saves load as `chapter founding`, one content hash, no checkpoint. A test keeps a schema 1
- save fixture and checks it loads to the same hash. Older builds refuse a schema 2 save with the existing "newer than
- this game" message.
+- **Lossless state text.** `GameState` gains `Write`/`Read`. Dictionaries are written **in insertion order**, not in
+ the hash's sorted order. `TotalPopulation` sums `Population.Values` in insertion order, so a restored state with
+ another order can differ in the last bit and diverge later. (Making every dictionary reduction iterate in ordinal
+ key order would remove the risk. It is a deliberate rebaseline, done separately if ever.)
+- **Test:** for every turn of both golden runs, restore from `Write`, then play **to the end** and compare the final
+ hash with the uninterrupted run.
+- **A checkpoint is hostile input.** Today a save cannot contain an impossible state, because it is replayed. A
+ checkpoint's lines are parsed directly, and its hash is the save's own, so after `Read` the loader validates:
+ - every id exists and is active on the checkpoint date;
+ - every number is finite and inside the rules' ranges;
+ - placements are on land hexes;
+ - pending events exist in the content.
+
+ It then reconciles with `ContentWindows` (adds records the current content has, drops ones it does not) and warns if
+ that changed the hash. Each rejection has a test, as in `SaveGameTests`.
+- **Loading.** With a checkpoint: read, validate and reconcile it, then replay the turns after it. Without one: replay
+ from the seed, as today.
+- **History.** Checkpoints drop earlier chapters' command logs. Anything that needs whole-game history (a legacy
+ report across chapters, a timeline) must be summarised into the checkpoint.
+- **Migration.** Schema 1 saves load as `chapter founding` with no checkpoint. A test keeps a schema 1 save fixture and
+ checks it loads to the same hash. Older builds refuse a schema 2 save with the existing "newer than this game"
+ message. Re-run the save check across two itch.io uploads (#43) after this lands.
- **Length.** `MaxTurns` applies per chapter, not per game.
- **Golden safety:** the save format is not hashed; state hashes do not change.
@@ -309,20 +379,19 @@ three places.
**Golden-safe checklist** (each item in §15 shows it holds):
1. Records without windows behave as today; new records have windows outside 1948–1952 or no state effect there.
2. No era override file for `founding`.
-3. No boundary inside the existing runs.
+3. No boundary and no era end inside the existing runs.
4. No new hashed state text unless it is omitted at its default.
-5. Moving event files does not change `Content.Events` order (all of today's files move into the same folder, which
- keeps their ordinal order) and nothing in the sim depends on that order (`EventSystem.Trigger` sorts by `from`,
- then id).
+5. Nothing in the sim depends on the order of `Content.Events` (`EventSystem.Trigger` sorts by `from`, then id). A
+ test checks that results do not depend on how content is split into files or packs (§9).
**New goldens per era.** `GoldenRun.PlayChapter(content, era, until)` plays a fresh start of an era with the golden
seed and `HistoricalAI`. Each era pins at least one constant, named by era and end year (for example
-`Hash1957_1960`), in the same three places. A **chain golden** pins a run that crosses each boundary (for example
-founding into 1957). The founding era's goldens are today's `Hash1950` and `Hash1952`, unchanged.
+`Hash_<era>_1960`), in the same three places. The Unity golden check prints one `GOLDEN OK` line per pinned run. A
+**chain golden** pins a run that crosses each boundary. The founding era's goldens are today's `Hash1950` and
+`Hash1952`, unchanged.
-**Rebaselines stay local.** Because a fresh start reads sourced values, a change to the 1950 events moves the founding
-goldens, the chain goldens and the carry reference file for 1957, and nothing else. The 1957 fresh-start golden
-stays.
+**Rebaselines stay local.** A fresh start reads sourced values. So a change to the 1950 events moves only the founding
+goldens, the chain goldens and the carry reference file for the next era. The next era's fresh-start golden stays.
## 9. Content at scale (D6)
@@ -330,35 +399,42 @@ The spec's full span could hold thousands of events and hundreds of people. The
| Limit | Today | At 3,000 events | Design answer |
|---|---|---|---|
-| Files per upload (itch.io) | 51 files | over 3,000 | one pack file per era |
-| HTTP requests at boot | one per content file | over 3,000 | core + current pack, next pack in the background |
-| Event text | 124 KB raw, 24 KB gzip (31 events) | about 12 MB raw, 2.4 MB gzip | 1 MB compressed per era pack (budget, D6) |
-| Load time (.NET) | 142 ms | 711 ms | measure IL2CPP WebGL; load one era |
+| Files per upload (itch.io) | 51 files | over 3,000 | one content pack file |
+| HTTP requests at boot | one per content file | over 3,000 | one request for the pack |
+| Event text | 44 KB raw, 12 KB gzip (31 events) | about 4.3 MB raw, about 1.2 MB gzip | one gzipped pack |
+| Load time (.NET) | 142 ms | 711 ms | measure IL2CPP WebGL before building anything more |
| Office-overlap check | pairwise over all terms | quadratic | sort terms by office and compare neighbours |
-| Portraits | 30 in the build, 628 KB | hundreds | load per era (follow-up with #30, #44) |
-
-**Layout.** Events move to `content/events/<era>/` (today's 31 files go to `content/events/founding/`). The loader
-checks that an event's window lies inside its folder's era. An event may not span a boundary; it is split. Shared
-files (`people.yaml`, `parties.yaml`, `offices.yaml`, `legislatures.yaml`, `governments.yaml`, `model.yaml`,
-`rules.yaml`, `eras.yaml`, the map) are the **core**.
-
-**Packs.** The Unity build step (`ContentSync`) writes one `packs/<era>.pack` per era: the era's files joined, each
-with its relative path and length, the same framing `ContentLoader.HashOf` already hashes. `manifest.json` lists the
-core files and the packs. The pack is transport only: `Content.Hash` stays defined over logical files, so packing
-does not change it. A save records the hash of the core and of each pack it used (§7).
+| Portraits | 30 in the build, 628 KB | hundreds | a follow-up with #30 and #44 |
+
+**Layout.** Events move to `content/events/<era>/`; today's 31 files would go to `content/events/founding/`. The
+loader checks that an event's window lies inside its folder's era. An event may not span a boundary; it is split.
+`ContentLoader.Load(dir)` and `ContentManifest.Collect` become recursive under `events/`. **The move changes
+`Content.Hash`**, because `HashOf` hashes each file's path. Every existing save then shows the "different game
+content" warning once and replays the same game, since the move changes no state. Do the move in one quiet commit
+(no event PRs open, as #5 and #28 are writing event files), with a `CHANGELOG.md` line that explains the one-time
+warning. Keeping the old paths in the hash would hide a real difference, so the hash is not patched around.
+
+**The pack.** The Unity build step (`ContentSync`) writes one `content.pack.gz`. It holds every content file, each
+with its relative path and length, in the framing `ContentLoader.HashOf` already uses, and is gzip-compressed at build
+time. StreamingAssets are served as is, outside Unity's Brotli (`docs/m3-release.md`), so the build must compress the
+pack itself. The client decompresses with `GZipStream`, which must be verified in an IL2CPP WebGL build. The manifest
+gives the pack's file name, size and SHA-256. The client checks both after the fetch, so a cached or truncated pack
+fails with a clear message instead of a parse error mid-game. `Content.Hash` stays defined over logical files, so
+packing does not change it.
**Loading.**
| Option | For | Against |
|---|---|---|
-| A. Load everything at boot | One code path; simplest | Boot time and download grow with every chapter; worst on low-end machines (#44) |
-| **B. Core + current era, next era prefetched (recommended)** | Boot cost stays about one chapter's worth | `Content` grows during a session; cross-era references must resolve without the old event objects |
+| **A. One pack for all eras, loaded at boot (recommended)** | One request; one code path; a fresh start or a replay can see any era; `Content` never changes during a session | Boot parse time grows with every chapter |
+| B. Core + current era, next era prefetched | Boot cost stays about one chapter's worth | `Content` grows during a session; fresh starts and replays need data from packs that are not loaded; more to test |
| C. Precompiled binary content | Fastest parse | A second format to keep in step with YAML |
-With B, the sim only needs events of the current era (and of the previous one while any of its events is pending):
-`requires` checks `ChosenOptions` by id and needs no event object. Whole-content validation (cross-era `requires`,
-coverage, placeholders) runs in `dotnet test` over all eras; the player runs the per-file checks only. `dotnet test`
-and the CLI keep loading everything.
+Option B is built only if a measured IL2CPP WebGL boot time with a 3,000-event synthetic pack goes over the boot
+budget in `docs/visual-v1.md`.
+
+**Test, for any packing:** the golden runs and a two-era fixture chain give the same hash on every turn whether
+content is read from files, from one pack, or split into several packs.
## 10. Map eras
@@ -366,9 +442,9 @@ One heightmap (the modern Copernicus DEM, 8 MB) serves every era. What changes b
| Layer | Data | Change |
|---|---|---|
-| Settlements | One `content/map/settlements.yaml` replacing `settlements_1948.yaml`: `founded` as a date (a year alone means 1 January), optional `until` (abandoned or merged) and dated `names` for renames | Unity places what exists on the current date; `MapActions.Check` counts only settlements that exist on the turn's date; `tools/settlement_hexes.py` hexes every row. This answers #27's "agree the file shape first" |
-| Water | `content/map/water.yaml`: water bodies (Lake Hula, the Hula swamps, the Dead Sea's southern basin) with `from`/`to`, levels and sources | `tools/terrain_bake.py` bakes one `coast` mask per water epoch (86 KB each); Unity swaps the mask on the epoch's date. Builds on #16 |
-| Borders and lines | `content/map/lines.yaml`: dated polylines (armistice lines, later lines), with Israeli-perspective names | drawn as overlays; hex cells keep no political meaning (spec §3) |
+| Settlements | One `content/map/settlements.yaml` replacing `settlements_1948.yaml`: `founded` as a date or a year (a year alone means 1 January), or `null` with `pre_modern: true` (exists on every date); optional `until` (abandoned, depopulated or merged) and dated `names` for renames | Unity places what exists on the current date; `MapActions.Check` counts only settlements that exist on the turn's date; `tools/settlement_hexes.py` hexes every row. This answers #27's "agree the file shape first". `until` and renames are sensitive (§13) |
+| Water | dated water bodies, levels and sources; one `coast` mask per water epoch (86 KB each) | Built under #16, which already proposes the data file and the bake. Water is **visual only**: `MapActions.Check` keeps using the static `Land` flag in `hexes.json`, so the sim does not change. Dated land flags would be hashed and are left out until a rule needs them |
+| Lines | `content/map/lines.yaml`: dated polylines (the 1949 armistice lines, later lines), with Israeli-perspective names and sources | Drawn as overlays; hex cells keep no political meaning (spec §3). Sensitive (§13) |
| Option for water | For | Against |
|---|---|---|
@@ -376,24 +452,24 @@ One heightmap (the modern Copernicus DEM, 8 MB) serves every era. What changes b
| B. A heightmap per era | Exact relief | 8 MB each; the download budget (#44) cannot carry it |
| C. Water polygons drawn at runtime | No bake step | A second water renderer next to the shader's coast mask |
-The map changes on its own dates, not only at boundaries: #16 dates the Hula drainage 1951–1958, inside the founding
-chapter. A water
-epoch may follow an event's outcome later; first version: dates only.
+The map changes on its own dates, not only at boundaries. #16 dates the Hula drainage 1951–1958, inside the founding
+chapter.
## 11. UI per era (D5)
| Item | Change |
|---|---|
| Office titles | `offices.yaml titles: [{ from, title }]` next to `title`; `PlayerText.OfficeTitle(c, id, date)` |
-| Money | `content/currency.yaml`: dated currencies, each with display prefix, `per_previous` factor and sources. On a redenomination date the sim divides stored amounts of that currency by the factor (a dated transform like §4, applied in `EraSystem`). `PlayerText.Money` takes the date. Factor 1 changes only the display. Which currencies and which dates (the pound/lira, the shekel, the new shekel) is content to source; this design only provides the mechanism |
+| Money | `content/currency.yaml`: dated currencies, each with a display prefix, a cumulative factor from the sim's internal unit, and sources. `PlayerText.Money(c, id, amount, date)` divides by the factor and adds the prefix. **The sim never converts**: its stored amounts, rules and hashes are in one unit forever. Which currencies and which dates (the pound/lira, the shekel, the new shekel) is content to source. Inflation is a calibration question for #51, not a currency mechanism |
| Units | Land in dunams and population in people stay; amounts stay in millions; the reserves stay in US dollars |
| UI strings | `strings.en.yaml` keys may have era variants, `key@<era>`, used when present; the loading line in `Game.uxml` becomes a string with the chapter's name |
-| Chapter name | shown in the top bar and on a chapter card at each boundary, next to the legacy report (#19) |
+| Chapter name | shown in the top bar, and on a chapter card at each boundary next to the legacy report (#19); the card explains the carry (§4.3) |
| Option for money (D5) | For | Against |
|---|---|---|
-| **A. Each period's currency, converted on its dates (recommended)** | Historically right; numbers read like the sources | Stored amounts jump on conversion dates; every era's economy values are in its own currency |
-| B. One unit throughout (e.g. 1948 pounds) | No conversions | Numbers stop matching any source after 1980 |
+| **A. Display-only conversion (recommended)** | Numbers read like the period's currency; no jump in hashed state; no per-date rules | The internal unit is an abstraction the player never sees |
+| B. Convert stored amounts on redenomination dates | The internal numbers match the sources | Redenominations in 1980 and 1985 fall inside #51's era. Every money-valued rule would be off by 10 and then 10,000 times, unless rules changed by date inside an era |
+| C. One currency shown throughout (e.g. 1948 pounds) | No conversion at all | Numbers stop matching any source after 1980 |
## 12. Testing
@@ -401,45 +477,69 @@ epoch may follow an event's outcome later; first version: dates only.
|---|---|
| `DeterminismTests` | today's `Hash1950` and `Hash1952`, unchanged through every item in §15; plus each era's fresh-start golden and the chain goldens |
| Carry reference test | regenerates `carry/<era>.reference.yaml` from the previous era's golden run and compares |
-| Carry invariant | a historical chain into era N+1 equals a fresh start of N+1 on the carried quantities |
-| Era content tests | eras contiguous; every dated record inside the eras' range; event windows inside their folder's era; `requires` only backwards in time; strict `systems` keys |
-| Window tests | a record that begins or ends mid-game enters and leaves the state as `Init` would add it |
-| Boundary tests | on a two-era test fixture (`sim/Statecraft.Sim.Tests/fixtures/`): the shortened turn, successor mapping, group mapping, clamps, Why lines |
-| Save tests | schema 1 fixture still loads; schema 2 checkpoint round-trips; loading after a patch to an earlier pack gives the same game |
+| Carry invariant | a historical chain into era N+1 equals a fresh start of N+1, bit for bit, on the carried quantities |
+| Era content tests | eras contiguous; every dated record inside the eras' range; event windows inside their folder's era; references only to active records (§3.2); `requires` only backwards in time; strict `systems` keys |
+| Window tests | a record that begins or ends mid-game enters and leaves the state as `Init` would add it; `Content.At` segments are computed once at load |
+| Boundary tests | on a two-era fixture built with the existing `Fixture.cs` pattern: the adjusted turn and the 14-day rule, the ceasefire clock by days, successor mapping, group mapping, clamps, the zero-reference fallback, Why lines |
+| End-of-game test | reaching the last era's `to` ends the game with the player-facing reason |
+| Packing test | the same hashes whether content comes from files, one pack or several (§9) |
+| Save tests | schema 1 fixture still loads; schema 2 round-trips from every golden turn to the end; hostile checkpoints are refused |
| `SliceSmokeTests` per era | the existing smoke, parameterised by era: a fresh start through the era, and a chain across each boundary, each under a minute |
-| Calibration per era | one tolerance set per era (`<Era>CalibrationTests`), as `EconomyCalibrationTests` is for 1950–51 |
-| Unity | `SimSmokeTests` and `web_check.py` print one `GOLDEN OK` line per pinned run; the pack loader is tested in edit mode |
+| Calibration per era | one tolerance set per era (`<Era>CalibrationTests`), as `EconomyCalibrationTests` is for 1950–51, run on a fresh start; plus a looser check on a historical chain into the era, so players who play through also see a calibrated chapter |
+| Release gates | §13 |
+| Unity | `SimSmokeTests` and `web_check.py` print one `GOLDEN OK` line per pinned run |
## 13. Perspective and review across eras
-The rules do not change by era; the load gets heavier. The sensitive tags and the "no reward" check apply to every
-pack. `ReleaseGate` and `--release-gate` check every pack that ships. Living people (most of #52) stay out of release
-builds until legal review, which a pack-level check enforces. Holocaust content in #49 is an event the player reacts
-to, never a playable scenario.
+The rules do not change by era, but more content is sensitive. Today's `ReleaseGate` checks only sensitive-tagged
+events. Chapters add these gates, enforced by `ReleaseGate`, `Statecraft.Cli --release-gate`, the `-shareable` build
+and `tools/package_release.py`:
+
+- **Living people.** A person with `living: true` blocks a shareable build until a legal review is recorded on the
+ record (spec §5). This is new code: no such check exists today. It matters most for #52.
+- **Sensitive map data.** A settlement row with `until` (for example Arab towns and villages depopulated in 1948;
+ `type: arab_town` rows already exist) or a rename, and every `lines.yaml` entry, needs `status: sensitivity-reviewed`
+ before a shareable build. The rows are submitted as `fact-checked`; the owner sets the reviewed status, as for
+ events.
+- **Holocaust content** in #49 is an event the player reacts to, never a playable scenario. The existing tag rules
+ cover it.
## 14. Out of scope
- The content of any era (#49–#52) and their dates beyond the founding era.
-- Diplomacy state and actor standing in `GameState` (#11); when it lands, it follows §4.2 (persist, actors by window).
+- Diplomacy state and actor standing in `GameState` (#11). When it lands, it follows §4.2 (persist; actors by window).
- Open mode (#10); nothing here depends on the mode.
- Hebrew content (#55); era variants of strings would follow #12's keys.
- Coastline changes from ports and land reclamation.
+- Water that changes what the sim allows (§10).
## 15. Work items
-Each is buildable on its own, in this order, and keeps the existing goldens. Drafted as separate issues.
+The first group has users now (the founding era, #27, release builds) and is built in order. The second group is
+built when the first second-era content lands (#49 or #50); until then its issues are marked deferred.
+
+**Build now**
| # | Item | Needs |
|---|---|---|
-| 1 | `eras.yaml` and era lookup | — |
-| 2 | Content windows for the model and offices | 1 |
+| 1 | `eras.yaml`, the era lookup and the end of the last era | — |
+| 2 | Content windows for the model and offices, with reference checks | 1 |
| 3 | Rules and system switches per era | 1 |
-| 4 | Boundary crossing: shortened turn and carry rules | 2, 3 |
-| 5 | Fresh chapter starts and per-era goldens | 4 |
-| 6 | Save schema 2 with chapter checkpoints | 5 |
-| 7 | Event folders per era and content packs | 1 |
-| 8 | Era loading in the browser build and the size budget | 7 |
-| 9 | Dated settlements on the map | 1 |
-| 10 | Water epochs on one heightmap | 9, #16 |
-| 11 | Era-aware UI text, office titles and currency | 3 |
-| 12 | Per-era smoke and calibration harness | 5 |
+| 4 | Boundary crossing: the adjusted turn and carry rules | 2, 3, D1 |
+| 5 | Fresh chapter starts and per-era goldens | 4, D2 |
+| 6 | Dated settlements on the map | 1 |
+| 7 | Release gates: living people and sensitive map data | — (map rows from 6, 8) |
+| 8 | Dated lines on the map (`lines.yaml`) | 7 |
+
+Water epochs are not a separate item: they are folded into #16 (dated water bodies, one mask per epoch, visual only).
+
+**Deferred: build when #49 or #50 content exists**
+
+| # | Item | Needs |
+|---|---|---|
+| 9 | Save schema 2 with chapter checkpoints | 5, D4 |
+| 10 | Event folders per era and one content pack; measure IL2CPP boot time | 1, D6 |
+| 11 | Era-aware UI text, office titles and display currency | 1, 3, D5 |
+| 12 | Per-era smoke and chain calibration | 5 |
+
+Items 1–5 unblock #49: with them, a Yishuv era can be added as data and chained into the founding era.