Status: done (2026-10-30, 49c2a18)
Priority: 2
Size: S
Arch: food
Phase: implement
Design ref: People, households and family records (Mortality: Agreed; Life events).
Goal: deathRoll in src/sim/hunger.js returns ‘old age’ for every death not added by hunger, infants included, and the cause names live in the hunger module. Move the death roll and the causes into a module of their own, with causes by age.
Acceptance criteria:
src/sim/deaths.js (VB['sim/deaths'], @sys header, listed in src/manifest.json after sim/hunger): CAUSES, a table of cause keys with their life-event and log texts, and deathRoll(st, p), moved from sim/hunger. sim/hunger keeps only feeding and hunger.infancy (“Died in infancy”), 1–14 childhood (“Died of a childhood illness”), 15–59 illness (“Died of illness”), 60 and over oldAge (“Died of old age”). Added by hunger: hunger. Others: childbirth (from sim/births), starvation (VB-050), killed (the debug panel’s kill, today ‘died’).killPawn takes a cause key and writes the texts from CAUSES; no cause string is written anywhere else.tests/deaths.js is the test. The died life event also carries a cause key, which tools/sim.js and tests/health.js read. Golden entries changed (event texts only): cenv, events, pawns of founders 7 years 2-3, founders 42 year 3, heirs 7 and 42 years 1-3.