VB-022: Daily meals that always happen (unblocks VB-009)
Status: done (2026-10-30, 375899a)
Priority: 2
Size: M
Arch: food
Phase: implement
Design ref: Economy and jobs, Goods and the farming year (Meals: Decided, 30 Oct); Long work and processing (Milling at home).
Goal: Make the daily cook job reliable, so that moving food from grain to rations (VB-009) does not create hungry days. In the founders runs the cook job is missed on the first days of spring (cookDay stays -1 for days 0-4), because everyone is busy with sowing work.
Acceptance criteria:
Households hold rations (@state documented): food cooked and ready to eat. Daily food is eaten from rations at midnight; a household that has grain but no rations eats grain (above the seed reserve, VB-049, if it is done) at 1:1, so no household goes hungry because a cook was missed.
Starting rations: every household starts with 2 days of rations for its members, in every scenario.
The cook makes the next day’s food: the cook job turns grain (above the seed reserve) into rations at 1:1, enough for the next day’s need of the household’s members, and is posted from 14:00 while the household has less than that.
Cook may interrupt: from 14:00, if the household has less than the next day’s rations, its member with the highest cook priority who is at work stops their job (its progress is kept, as at the end of the day) and goes home to cook.
Founders runs over 3 years at seeds 7, 42, 3 and 11 have no more hungry days than before this task; report the numbers.
A test: a household whose cook was busy all day still eats; with no grain and no rations it is short.
Re-record the golden file and list the changed entries in the PR.
Notes / questions:
Kim, 2026-10-30: all three fixes: starting rations, cooking for the next day, and the cook may interrupt other work after 14:00. Rations are cooked from grain here; VB-009 adds flour from the quern.
Hungry days, founders, small map, 3 years, seeds 7/42/3/11: before 77/65/45/45 (232), after 54/61/53/70 (238). Seeds 7 and 42 improve, 3 and 11 worsen; over 12 seeds the totals are 716 before and 707 after, so the change is noise-level overall. With the 14:00 interrupt switched off the four seeds give 67/37/16/62 (182): the interrupt pulls the best cook off sowing and hoeing in spring, which costs some harvest. Kim may want to weigh that (e.g. interrupt only outside the sowing window).
Tests: tests/meals.js (in npm test); tests/hunger.js zeroes starting rations. Golden file re-recorded (every household has rations, so all later entries shift).