Status: done (2026-11-11)
Priority: 2
Size: M
Arch: year
Phase: implement
Design ref: design.md, Households short of people (Taken in before it starves; Proposed, VB-283); Goods and the farming year (Help in hunger); backlog/VB-283.md (the survey)
Goal: A household with at most one member of 18 or more and fields (a lone adult, or a minor holder with one grown housemate) is hungry over 0.3 of its days in 56 of the 225 household-years over 0.3 on the ten full runs (34 households; VB-283’s replay at 38b920d). Today only a household with no adult gets a guardian (daily), and only a holder who lives alone gets a servant (yearly, at the moving round, from st.demand with 2 hands kept). Take such a household in when its seasonal ask for help falls short: a free relative comes first, else a servant, at once.
Acceptance criteria:
shareFood (src/sim/help.js), when a household’s ask leaves it short of askDaysAt days of food after the kin and the village store have given, and at most one of its members is 18 or more, and it holds fields, it is noted short of people (VB-323’s queue or a call to sim/service; sim/help writes nothing of membership). Help itself is unchanged.sim/service): the household’s nearest relative in st.demand (kinship over 0, then the oldest, as careForOrphans chooses a guardian) who is fit to serve (unfit null: unmarried, 18 to 50, free) and whose household keeps a member of 18 or more without them, within the village or the service reach (SERVICE.reach, or VB-290’s hours if it has landed), moves in as a member (not a servant), with a spouse and minor children if a later rule lets married kin come. An event and a log line (atHousehold) name the relative and the farm.takeServants’ choice for this one household (village first, then the nearest village within reach, SERVICE.keepHands, the pawn’s serve wish), through the serve command, now and not only at the moving round. The moving round’s rule is unchanged.src/owners.json unchanged for land). Nobody comes: nothing happens until VB-309 (Kim).docs/bench/lone-households.js on the ten full runs, or populous small at seeds 3, 7, 11, 42 for 30 years and heirs 7 and 42 when time is short): household-years over 0.3 of households short of people (56 at 38b920d, populous 3: 38, heirs 42: 9) fall by at least 10; none left of those that had a relative in st.demand or a servant within reach on their first short ask; relatives and servants moved a year; the households they left (none left short of people by it; their hungry share the next year); the bands’ hungry-households and hunger-deaths, marriages a year and population at year 30 on populous 7 and 42, households and not only averages.tests/golden.json and tests/counters.json re-recorded (left to the orchestrator, night-run rule; see the notes), changed entries listed; a test on a constructed village (a lone holder with 3 fields and an empty larder, a sister unmarried at her parents’ farm with a brother at home): after the first short ask the sister lives on the farm.
Cost (Rules for cost, 4 and 9): no new loop over households or days. The check rides on help’s ask, which a household makes at most once a season, and only when its spare grain covers fewer than 3 days; the grown count is over its members. Only a household short of people searches: st.demand once with a kinship memo (as careForOrphans), then takeServants’ list for one household. The replay has about 2 such household-years a run-year on populous small; at medium-ref, at most a few searches a season. Measured with --report perf on small-y40 before and after.
Order: after VB-323. Before VB-309 (Kim). One at a time with VB-090 (service where labour is short, the same sim/service and the same placement: village first, then within reach; whichever lands second shares the other’s helper) and VB-290 (the reach in walking hours). Independent of VB-034.
Notes:shareFood (src/sim/help.js) now counts what the village store gave against the ask and returns the ids of the
households whose ask still fell short and that are short of people (shortOfPeople: fields, and at most one living member of 18 or more); help
itself is unchanged and writes no membership. endOfDay (src/sim/clock.js) hands that list back to onHour, which, after dailyLife and only
with a culture (as the guardian rule), calls takeIn (src/sim/service.js) the same midnight; the list is a local of the step, never state, so a
save and load between steps cannot drift. takeIn re-checks each household, then: kin first, the holder’s relative in st.demand with kinship over 0,
then the oldest (as careForOrphans), unfit null, within SERVICE.reach steps, whose household keeps two grown members without them or holds no
fields; they move in as a member (moveTo, with the minor children living with them, familyOf), with a moved life event and a log line
(atHousehold) naming them, their farm and the farm they come to. Else servantFor (now shared with takeServants, whose choice and the round’s
rule are unchanged): the serve command, source help; enterService’s log says “which was short of hands” when the household was not one person.
Land, holder, owner and fields are untouched; with nobody to come nothing happens (VB-309). New work counter takeInWeighed (pawns of st.demand
and of the servants’ list weighed); tests/counters.js and tests/scaling.js exempt it as they do occasionAsked, tests/takenin.js exercises it.
No new state field, no change to src/owners.json. docs/architecture/modules.md names the rule.tests/takenin.js (in npm test): a lone holder with 3 or more fields and empty larders, her sister unmarried at their parents’ farm with
a brother at home: after the first short ask (a day of Sim.advance) the sister lives on the farm as a member, the brother stays, holder, fields and
owner unchanged, a moved event names the farm, invariants hold; with the holder kinless, the same woman comes as a servant through serve; a
household of two grown members is not named; a sister whose going would leave her home with one grown member stays.
npm test: all scripts pass but tests/counters.js (the new key takeInWeighed, expected: re-record adds that one entry, no other counter moved).
node tests/golden.js: matches (no take-in on the golden runs; nothing to re-record). tests/record.js’s anchor unchanged.docs/bench/lone-households.js, the ten full runs, before at this branch’s base 85bfc19, after at this commit; “short of people” as the
replay reads it, at most one member of 16 or more and fields, on the first hungry day). The base has moved since 38b920d (56 rows): at 85bfc19
it is 102. Household-years over 0.3 of households short of people: 102 (65 households) before, 92 (54) after; all rows over 0.3: 364, 334.
By run, before/after: populous 3 46/31 (households 26/20), populous 7 3/0, populous 11 14/24 (11/10), populous 42 13/11 (10/9); founders 3, 7, 11, 42
and heirs 7, 42 unchanged (6, 0, 2, 8, 3, 7: no take-in happens on them; their free kin are not in st.demand and no servant is in reach).
Populous 11 rises by divergence: its first take-in (a servant, year 17) changes the run after it; the households hungry after are others.
Take-ins on populous small, 30 years: seed 3, 4 servants (years 2, 23, 23, 24); seed 7, 1 servant (year 15); seed 11, 1 kin and 2 servants;
seed 42, 6 servants (years 18 to 29). From 0.03 to 0.2 a run-year.
None left that had someone to come: instrumented at every short ask on populous 11 (with the first, looser rule; the property holds by
construction), takeIn found no relative or servant fit by the rule when it ran;
the replay’s “free relative in reach” rows that remain (25 of 92) are of relatives not in st.demand (heirs at home, or not wanting land; on
populous 11, st.demand holds 9 people at year 23, 7 of them with a plot coming or keeping a ward), as VB-283’s note said (an upper bound).
The households they left (populous 3, 7, 11, 42): none left short of people (grown members left behind 2 to 4); their hungry share over the next
48 days 0 in 8 of 12, 0.10, 0.21, 0.27 and 0.29; the households taken in, 0 to 0.52 over the same days (median 0.17).
Bands, populous small 30 years (before/after): seed 7, hungry-households 0.0170/0.0079 (46/22 of 2,711/2,773 household-years), hunger-deaths
0.056/0.033, marriages 5.70/5.80 a year, population at year 30 563/548, households 136/143; seed 42, 0.0211/0.0223 (65/68 of 3,080/3,050),
0.082/0.062, 6.27/6.37, 696/708, households 162/160. Both are within run-to-run divergence of one take-in; no band moves out by the change.
Cost: --report counts on small-y40 (this commit’s fixture): takeInWeighed 498 a year (10 a game day; walkDaily is 3,989 a day). --report perf
at small-y40, before 325 ms/day, after 358 (another fixture each, as the key changes; the machine was shared by five agents, so timings are noise;
takeIn is not among the systems, its work is the counter’s).familyOf); the task’s “unmarried” is read as “no living spouse”.serve wish (it is not service, and the guardian’s coming does not read it); the servant path reads it.dailyLife, and only with a culture (st.cenv), as the guardian rule.st.demand (those who want land), not from every adult: an heir in line at home is not pulled away. The replay’s 14 rows with a free relative in reach counted every unmarried landless adult of 18 to 50, so it is an upper bound.