Status: done (2026-11-08)
Priority: 1
Size: M
Arch: kin-help
Phase: implement
Design ref: Exchange, goodwill and obligations (The gift: Lumps and occasions, Decided 8 Nov); Goods, production and animals (Help in hunger: once a season, until the harvest, Kim 8 Nov); QUESTION_ARCHIVE.md, “VB-217”, questions 5, 6 and 8.
Goal: Help in hunger is a trickle: a household under 3 days’ food asks for 12 days and may ask again within days, so it gets 2.3 to 3.1 gifts a year from 1.4 to 1.8 givers, of about 20 rations each (populous 7 small, 40 years). At year 40 that is 4,664 gift events in the record (649 KB), 582 KB in the pawns’ events and 2,170 ledger entries (199 KB). Kim (8 Nov): make gifts rarer and more substantial, by the principle Lumps and occasions; help is its first occasion. At most once a season, a household short of food asks for enough to reach the next harvest.
Acceptance criteria:
sim/help, shareFood): a household whose spare grain covers fewer than HELP.askBelow (3) days, and that has not asked this season, asks for enough to reach the next harvest, the start of autumn, and at least a season’s need (HELP.askDays, 12 days); in autumn, a season’s need. That is from 12 days (summer’s end, autumn) to 36 (winter’s start). Kin first, closest first, each giving what lies above its floor and reserve (VB-216), then the village store. If the gifts fall short, it does not ask again until the next season.household.askedIn, the season (Math.floor(st.t / (SEASON_DAYS * DAY))) of its last ask, or absent; owned by sim/help (src/owners.json, an @state line), saved, with an invariant in checkState (an integer no later than this season).tests/help.js updated for the new rule (one ask a season; the amount until the harvest; the store covers the rest; a second shortfall in the same season asks nothing), in npm test.tools/balance.js --scenario populous --seeds 3,7,11,42 --map small --years 15 (rations by source against need); tools/sim.js (founders 7 small, 10 years; populous 7 small, 15 years) yearly lines (deaths by cause, hungry household-days); and, over 40 years of populous 7 small, as measured for this task’s goal: gifts a year and per living pawn, their median size, gifts and givers per receiving household, the record’s gift events and the ledgers’ gift entries, goodwill pairs and their bytes in the save. Say whether households, not only averages, are better or worse off: hungry household-days and deaths from hunger by household, not only in total.QUESTIONS.md), rather than tuning on your own.npm run verify passes.
Notes:askedIn goes on the household, not the holder, since help is the household’s ask; a new household starts without one.c142b7f (the rule, household.askedIn, tests), 2f1d964 (a crash fix found while measuring; below).askDaysAt(st): in autumn HELP.askDays (12); otherwise the days to the start of autumn, at least 12: 24 at spring’s start, 13 at
summer’s day 11, 36 at winter’s start, 25 at its end. seasonOf(t) numbers seasons from the start of the run; askedIn is set when a
household asks, before its kin give, so a shortfall waits for the next season.tests/counters.json re-recorded with no difference). The golden file changed throughout, as a behaviour
change does: all 12 entries of founders and heirs at seeds 7 and 42, years 1 to 3 (most keys of each).feedHousehold could take a negative amount (-4e-16) when the larder’s pieces summed
past what was asked by a rounding error, and Stores.take threw. It is on main (a35a3b4): populous 3, small, stepped a year at a time
as tools/balance.js steps, crashes in year 15. Clamped at 0; tests/meals.js builds the case and failed before the fix; the golden
state was unchanged by it. The “before” runs below have the fix applied, since without it seed 3 does not finish.npm run verify: 91 scripts passed in 214.2 s; npm test: 78.
Before is cc5546b (VB-217 done) with the fix; after is c142b7f. One run a seed, so differences of a few households are noise.
Sim.advance of 15 years each), totals: gift events in the record 4,097 to 2,898
(-29%); median gift 16-20 to 24-28 rations; givers per receiving household about the same (2.6-3.1 to 2.6-2.9); store gifts kept
504 to 390; deaths from hunger and starvation 13 to 8 (seed 3: 8 to 3), households with such a death 6 to 7; hungry household-days
1,785 to 2,082 (+17%), households ever hungry 202 to 216; the hungriest tenth’s share of hungry days 0.59-0.74 to 0.55-0.72.tools/balance.js --scenario populous --seeds 3,7,11,42 --map small --years 15 (stepped a year at a time, so other runs), by household
size: hungry days a household-year fell or held at every size (one person 0.9 to 0.7; two 0.5 to 0.3; six 0.5 to 0.2); the share of
household-years with any hunger fell for one person (22% to 17%) and for five or more (8 people: 6% to 2%), and rose for two to four
(9% to 11%, 3% to 7%, 2% to 5%). Made over need is about the same.