VB-1549: A household with no food seeks it before work whose payoff is months away
Status: done (2026-11-23)
Priority: 1
Size: S
Design ref: backlog/VB-1546.md; src/sim/hunger.js spareUrgency; design.md, Food from the wild
Goal: a household out of food gets food before work whose payoff is months away
Acceptance criteria:
The cause reproduced on founders small seed 7 (VB-1546’s 21 hungry days): for the hungry household, the food-getting work open to it, its fit against what its hands did instead, and why (ranks, urgencies); the same seen on two more seeds.
A general rule, not a case for one kind, one role or a household of one: the urgency of the work that brings food in (the kinds that read the household’s spare food) rises, as its food runs out, above the work whose payoff is months away, read where urgencies are read; a continuous signal (days of food), or a categorical one only through hysteresis. Cost named.
design.md’s row Food from the wild states the rule (Kim, 24 November: fix the inversion; the particulars Proposed), with a changelog row.
A check on a small constructed state (tests/tiny.js), registered in tests/suites.js: a household with no food ranks fishing above ploughing; with food in store, below.
One confirming run on founders small seed 7: the formerly hungry household now goes for food.
Measured before and after on founders small 7, 3, 42 (4 y), solo small 7, 42 (4 y), populous small 7, 3, 42 (3 y): hungry and dry days, deaths and causes, health, grain at year ends, hours by kind of the households that were hungry, to the next harvest. Measurement skipped at Kim’s word, 24 November.
Notes
Kim, 24 November: fix the priority inversion (VB-1546’s hungry days, 3 -> 21 on founders 7).
Cause (founders 7, household 4, a lone farmer of 19 with no grain from day 47): spareUrgency topped at fishLean 2; times his foraging rank 3 (4 standing in for the mistress) fish 5.7, hunt 5.8, gather 7.8, under wood 13.6-20.7, plow 12-17, clear 9.8, meadow 9.3, drove 8.3, fetchHay 8.1. Founders 3 and 42: the same household shape (hh 4, alone, grain 0, hungry 9 and 13).
Built: MATCH.urgency need 8, needDays 3; spareUrgency is max(the lean line, need x (1 - d / needDays)) under needDays. Continuous in days of food: no hysteresis needed. Cost: none new (the urgency is already memoised per allotment; a few flops).
Close call: the need only beats ploughing late in its window by a hair (24 vs 23.8) and stays under a cold house’s wood for a son (9 x 3) and the water late; needDays 3, so a catch lifts a household of one past it and the day’s other work keeps its hours.
After (founders 7, 4 y, at b3736736): hungry 21 -> 9, deaths 0 -> 0; household 4 fishes first at 23.7 on spare 0 (days 50, 54, 58, 62); its grain y2 58 -> 67, y3 268 -> 304. Left: days 48-49 (no food work open: fishing from spring day 2) and days with 3 days of fish in hand still short: the catch beyond FOODS.fish.keeps goes to the rack (sim/drying toRack) and raw fish feeds short; not traced.
Tests altered: tests/fish.js and tests/forage.js expected urgency 2 at none; now MATCH.urgency.need (the rule changed, not draws).