Status: done (2026-11-12)
Priority: 2
Size: M
Arch: year
Phase: implement
Design ref: Economy and jobs (Goods and the farming year: Mixed meals, Meals; Long work and processing: Milling at home). Job review, second pass, 30 Oct 2026: rations made from several food sources are more nutritious, combined with the flour mechanism (VB-009).
Goal: Fish and gathered food only matter if they change what a household needs. A ration is the unit and the cook makes meals from foods (Kim, 10 November; VB-259): a pot of several foods goes further, which rewards a household that fishes and gathers beside its fields; fresh food spoils, which keeps a summer’s catch from feeding a winter; and a household with nothing cooked eats its grain raw, at a loss.
Decided (Kim, 10 November; QUESTION_ARCHIVE.md, “VB-119”): variety is judged in the pot, at cooking; uncooked grain at a penalty.
Acceptance criteria:
FOODS (VB-259): fish (VB-117) and gathered food (VB-118) with a shelf life of 3 days, each its own source; grain and flour one source; milk and meat as their rows say.hh.fresh, @state, invariants; at most 4 batches a food, since older ones are lost); a batch older than its shelf life is lost and noted in the ledger, through sim/stores with a reason. No daily pass over every household to spoil: a batch’s loss is read from its day when the store is next touched, or falls due in the due-queue (Rules for cost, 3 and 4).ECON.rawGrain; the number is the agent’s starting value, to be confirmed in the PR). Fresh food that is marked eaten uncooked in FOODS (gathered food) is eaten before raw grain, at no penalty.FOODS; nothing of it is built here.docs/roadmap.md, section 3.3; the slices Decided by Kim): moved to slice 3, arch year (from food). blocked until the slice’s plan (VB-164) confirms, rewrites or closes it; its questions in QUESTIONS.md wait for that plan, which may reframe them.QUESTIONS.md (VB-117 to VB-119).tests/counters.json and the anchor of tests/record.js are left for the orchestrator
to re-record after the merge (night-run rules); the populous criterion stays open until then. Expected to move: every golden entry (from
seed: ECON gains pot, potShare, rawGrain, and each household fresh; every year after), the record anchor (heirs 7 at 2.5 years:
73 events on its pawns became 81, and its hash), and the counter routeRefresh (0.99 to 1.29 a pawn-day at the counters’ probe, out against
its baseline; a target: more cooks walking home, now that fish and gathered food must be cooked; the other 28 counters in).Implementation notes (11 Nov 2026):
FOODS (src/sim/rules.js): rows fish (keeps 3, source fish, cooked) and gathered (keeps 3, source gathered, raw: eaten as they
are on a day without meals), and a new column held (grain, larder or fresh: where a household keeps the food); raw now means “may
be eaten uncooked at no penalty”. Grain is one source (flour will be a row with source grain, VB-009); milk and meat stay larder foods
eaten as they are, as their rows say, and are not put in the pot. Tunables in ECON: pot: [1, 1, 0.9, 0.8] (the food a pot of k sources
needs), potShare: 0.2, rawGrain: 1.25.src/sim/stores.js): hh.fresh, batches {food, day, qty} by day (@state; owner sim/stores in src/owners.json;
fresh[] in the household’s @state of sim/scenarios); putFresh (a day’s trips merge into one batch; past FRESH_CAP, 4 batches of a
food, the oldest is lost), takeFresh (oldest first), freshHeld (reads only; a batch past its day does not count), settle (drops the
batches older than their food’s keeps, each noted as spoilage of its food in the yearly totals). No pass over households: the store is
settled when it is touched (the catch, the pot, the day’s meal), and freshHeld reads a stale batch as gone before then. The batch’s
amount is qty, not n: a resolved write to fresh[].n made n a state field’s name to tools/writes.js, which then listed four older
writes of .n on scratch records as unplaced. tools/writes.js gets a hint, units in sim/stores is a local (the pot’s scratch).Stores.pot): the cook job (src/sim/kinds.js) cooks the meals still missing for the coming day; fresh food goes in oldest
first, then grain above the seed reserve. The cook fills the smallest pot that makes the meals wanted: it tries a pot of 3 sources (0.8 of
the want), then of 2 (0.9), then a full pot of any; short of food it puts in all there is. A food is a source at a fifth of the pot’s
rations. cookWanted is true with fresh food and no spare grain too. Stores.cook (one food, 1 to 1) is kept for its test.src/sim/hunger.js feedHousehold): larder food about to spoil, then meals, then (no meals) gathered food as it is, then
grain above the seed reserve uncooked at rawGrain (a new routine reason raw, so the yearly totals count the days and the grain), then
the rest of the larder, then the seed, uncooked too; on a short day all of it goes by the feed order. foodHeld (the need rule),
sourceHeld (a food the pot lacks) and fishing’s and gathering’s spareDays count fresh food. The catch and the baskets go into hh.fresh
(reasons catch and gathering).Stores.openFresh). Invariants (tests/lib/invariants.js): batches of
fresh foods only, amount above 0, day an integer not after today, in day order, at most FRESH_CAP a food; larder lots are of held:
'larder' foods; ledger and totals goods include fish and gathered.tests/pot.js (in npm test): the table; grain only against grain with fish at a quarter of the pot over 12 days (12 days of
need against 0.9 of it); 3 sources at 0.8; a food under a fifth is no source; batches merge by day, the oldest goes first, a batch is good on
its third day, read as gone on its fourth and noted when the meal touches the store; the cap of 4; 3 days without cooking use 1.25 times
the grain, and cooked again 1 to 1; gathered food eaten before raw grain, fish not eaten uncooked; a short day; 36 days of founders 7 with
mixed pots and the invariants. tests/meals.js (a missed cook eats grain at 1.25), tests/fish.js and tests/forage.js (the catch and
the baskets are fresh food) follow.Validation notes (11 Nov 2026): populous, small map, 5 years, seeds 3, 7, 11 and 42, ordinary weather; before (the merged base: fish and
gathered food straight into meals, grain eaten 1 to 1 on a day without meals) and after. “Penalty only”: after, with rawGrain 1, to tell the
penalty’s own hungry days from the rest. Hungry household-days: all households of the run (total; worst household; households with any).
Pots: the share of pots cooked with 2 and with 3 sources. Raw days: household-days on which grain was eaten uncooked (before: grain eaten
straight, at no penalty). Grain at harvest: the mean grain of the living households at the end of summer, years 1 to 5. Spoiled: fresh food
lost over the run, in rations, against what was landed.
| seed | hungry household-days (worst; households) | penalty only | pots of 2 / 3 sources | raw days | grain at harvest, years 1 to 5 | fish spoiled | gathered spoiled |
| — | — | — | — | — | — | — | — |
| 3 | 5 (5; 1) -> 50 (43; 3) | 50 (45; 2) | 0.220 / 0.005 | 2,453 -> 3,790 | 171 186 206 222 268 -> 168 174 167 194 240 | 5,760 of 21,731 | 1,042 of 7,207 |
| 7 | 0 -> 4 (4; 1) | 0 | 0.203 / 0.004 | 2,056 -> 3,843 | 155 190 240 265 258 -> 153 182 215 233 215 | 4,215 of 19,368 | 615 of 4,969 |
| 11 | 2 (1; 2) -> 0 | 2 (1; 2) | 0.225 / 0.006 | 2,462 -> 3,949 | 156 171 222 277 317 -> 154 162 192 233 269 | 5,329 of 22,459 | 1,044 of 7,464 |
| 42 | 0 -> 0 | 0 | 0.182 / 0.002 | 1,523 -> 3,770 | 171 198 294 280 317 -> 166 182 255 223 250 | 7,195 of 28,372 | 1,060 of 5,829 |
medium-ref and the late saves were not run (night-run rules); the change adds no loop over history (fresh batches are at most 4 a food a
household, touched only with the store). The measuring script was not committed.Orchestrator’s decisions for Kim to overturn:
raw (eaten as it is on a day without meals); fish is not, so a household without meals or grain goes hungry beside its fish.rawGrain.rawGrain 1.25 is the starting value, to be confirmed: the penalty costs about 2,300 more rations of grain over 5 years at seed 7 (about
6 a household a year) and adds 4 hungry days at one seed of four.work and go phases; the job lapses at the end of work hours) is not looked into here.Second pass (11 Nov 2026, the orchestrator’s three steps; merged with the integration branch after VB-322, VB-237, VB-245 and others):
cookdiag script not committed). On the integration branch,
before this task: 1,044 days eaten uncooked. 914 of them were (b), the job taken but not finished by the end of work, and 106 were (b), the
job posted and never taken. At 15:00 on a missed day the best cook was idle (no job, phase none) 665 times, walking home to cook 258
times, and at other work about 100 times. With this task (before the fix) the counts were 1,738, 1,537 and 170. So it is (b): the cook job
opens at 14:00, but callCooks called the cook off work only from the work and go phases. An idle cook (waiting 2 to 4 hours since
VB-245, or out for company) looked for work only when her wait ended, often after 16:00, and the 2-hour job was cut off at 18:00. It is
not (a) nobody at home, (c) fuel or water, or (d) rank: only lone men cook at rank 1. Nor is it (e): the cause was there before this task;
the penalty only made it cost.src/sim/jobs.js callCooks): an idle best cook (no job, phase none,
not bound for an occasion) is called home to cook as well. Days eaten uncooked at seed 7, 2 years: 1,738 -> 517. The rest are mostly
cooks still walking home at 18:00 (from far fields). For a follow-up task: let a cook job under way finish after the end of work, or open
it earlier for a cook working far from home.rawGrain 1 (no
penalty). A1K is A1 with a shelf life of 1,000 days, so no fish or gathered food spoils by date; some is still lost to the cap of 4
batches. Hungry household-days: B 0 / 0 / 0 / 0 and A 0 / 1 / 0 / 0 (seeds 3 / 7 / 11 / 42; worst household 0 and 1). No household-year
is hungry on over 0.3 of its days in any run. Pots: 2 sources 0.20 to 0.23, 3 sources under 0.01. Days eaten uncooked: B 3,435 / 2,851 /
3,323 / 2,000, A 2,195 / 1,966 / 2,319 / 1,734. Grain at harvest, year 5: B 265 / 272 / 321 / 328, A 244 / 232 / 279 / 281, A1 248 / 239 /
282 / 287, A1K 258 / 248 / 309 / 299. Fish spoiled under A: 3,565 to 5,408 of 19,606 to 27,872 landed (about a fifth); gathered food
631 to 1,114 of 4,937 to 7,351.needs-review for Kim (QUESTIONS.md, “VB-119”). The work is kept as docs/patches/VB-119.patch (against 7701df6; git apply it there, without index.html: rebuild). Its cook fix (an idle cook is called at 14:00) was applied alone on the night’s branch. Over 30 years households are worse off with it (seed 3: household-years hungry over 0.3 of their days 3 to 9; grain at harvest 10 to 30% lower), 87% of the loss from spoilage and 13% from the raw-grain penalty.docs/patches/VB-119.patch and measured by the same runs; ECON.rawGrain stays 1.25, once a cook job under way may finish after work ends.needs-review, NOT to be merged as it stands: households are hungrier than
before at three seeds of four (QUESTIONS.md, “VB-119: fresh fish on dried fish”).Third pass, rebuilt on dried fish (12 Nov 2026; on claude/backlog-orchestration-t73ngj at e08e47b, VB-347 done, merged again with
69b415e, VB-333 done, before the golden file was re-recorded):
docs/patches/VB-119.patch piece by piece on the current tree (the patch did not apply). What changed from the patch:
src/sim/pot.js (sim/pot, material layer, after sim/dig): fresh food (putFresh, takeFresh, freshHeld, settle,
openFresh, FRESH_CAP), the pot (pot), and two reads for sim/kinds (cookable: spare grain or fresh food; spareFood: spare
grain, meals and fresh food). sim/stores is at the lint’s 400 lines, so the patch’s hundred lines there went to their own module, as
sim/dig did; it moves food only through the stores’ operations (record, put, takeSpare, cookLarder). household.fresh is
owned by sim/pot (src/owners.json); sim/stores gains only the reason raw (routine).household.grain (through grainOf, reserved), household.larder (dried fish), household.meals; writes
household.fresh and, through sim/stores, grain, meals and the larder. New calls: sim/hunger, sim/kinds, sim/saves to sim/pot
(all later in the load order); sim/clock reads KINDS[kind].late. No new loop over a growing collection: a household’s batches
are at most 4 a food, touched only with its store.Stores.cookLarder after the fresh batches and before grain, as the source fish
(FOODS['dried fish'] and fresh fish share it), only out of the fishing season (winter, and spring before FISH.from), and only as much
as makes fish a fifth of the pot with the fresh fish in it; short of grain, all there is. sim/drying’s intoPot (a fixed quarter) is
gone; DRY.share stays the want (a quarter of the winter’s need, so it lasts the winter at a fifth).household.rack stays the catch waiting by the rack (VB-300): it is hung within hours, so it is not made a fresh batch (see the
decisions).rawGrain 1.25 (11 Nov): a cook job under way is finished after the end of work. A kind field late (the cook’s):
at 18:00 (sim/clock, “the work day ends”) a pawn walking to such a job or working it is not released, and finishes it. The job carries
its day (j.day), so a pot finished after midnight counts for the day it was posted (hh.cookDay).FOODS gains held and the rows fish, gathered (as in the patch); dried fish is held: 'larder'. Grain eaten uncooked goes by
takeSpare with reason raw (VB-347). Older saves get an empty fresh store at load.tests/pot.js (the patch’s, on the stores of today; and a founders run where cooks at work at 18:00 go on and finish);
tests/drying.js (the pot’s dried fish: none in the fishing season, a fifth of a pot of 2 sources in winter and under the ice, none
while fresh fish makes a fifth); tests/fish.js, tests/forage.js, tests/meals.js, tests/milk.js as in the patch; invariants of
the fresh store; tools/stocks.js a line fresh (the meals’ line: filled by the cook alone, and its none is now the penalty);
tools/writes.js a hint (units in sim/pot is a local); docs/architecture/modules.md.Validation notes (12 Nov 2026): populous, small map, 30 years, seeds 3, 7, 11 and 42, ordinary weather; before = e08e47b (dried fish, VB-300;
fish and gathered food straight into meals that never spoil), after = this branch at c35d228 (before the merge with VB-333). Sampled
each day at 23:54. Hungry years: household-years hungry on over 0.3 of their days (of household-years). Hungry days: all households
(worst household; households with any). Grain at harvest: the mean grain of the living households at the end of summer. Days without
meals: household-days with fewer meals than the need at 23:54 (before: eaten as grain at no cost; after: gathered food, then grain at
1.25). Fish: rations landed (rack and food), dried, spoilt. Pots: the share with 2 and with 3 sources; meals they made and what they saved.
| seed | hungry years | hungry days (worst; households) | grain at harvest, years 5 / 10 / 15 / 20 / 25 / 30 | living, y30 | days without meals |
| — | — | — | — | — | — |
| 3 | 0 of 3,099 -> 6 of 3,086 | 30 (9; 12) -> 261 (73; 12) | 263 246 176 191 144 194 -> 247 232 147 164 129 153 | 589 -> 596 | 16,818 -> 6,875 |
| 7 | 0 of 2,901 -> 0 of 3,156 | 19 (17; 3) -> 33 (18; 4) | 274 325 262 269 319 286 -> 265 272 198 203 241 213 | 676 -> 555 | 9,397 -> 6,423 |
| 11 | 0 of 3,090 -> 5 of 3,227 | 17 (7; 6) -> 170 (78; 8) | 285 267 259 268 255 242 -> 266 243 229 202 176 171 | 638 -> 631 | 11,761 -> 5,550 |
| 42 | 0 of 2,821 -> 2 of 2,943 | 14 (9; 4) -> 40 (34; 3) | 299 329 242 281 272 272 -> 261 276 195 226 203 190 | 693 -> 668 | 6,647 -> 3,057 |
| seed | fish landed; dried; spoilt (after) | gathered; spoilt (after) | pots of 2 / 3 sources | meals from pots; saved | | — | — | — | — | — | | 3 | 299,346 -> 295,382; 34,563 -> 35,285; 120,424 | 50,227 -> 45,925; 8,296 | 0.291 / 0.003 | 443,843; 14,748 | | 7 | 469,014 -> 438,420; 51,723 -> 50,744; 180,128 | 50,441 -> 47,929; 12,034 | 0.339 / 0.003 | 436,826; 16,548 | | 11 | 385,589 -> 393,187; 43,375 -> 44,547; 167,964 | 52,001 -> 51,138; 10,664 | 0.305 / 0.003 | 459,365; 15,392 | | 42 | 540,535 -> 522,121; 55,678 -> 55,372; 199,383 | 41,544 -> 40,202; 10,985 | 0.316 / 0.001 | 486,632; 16,460 |
rawGrain 1: 1 hungry household-year, 108 hungry days (worst 26); with besides no spoilage by date (keeps 1,000 days,
the cap of 4 batches left): 5 and 151 (worst 86). One seed’s ablations are within what runs diverge by; the penalty looks the larger part
of the hungry years, the lost surplus the larger part of the grain at harvest.node tests/counters.js 6 out, the same 6 at the same values as on e08e47b (routeSearch, routeExpand, routeRefresh, oppAsk,
matchBid, lookUpJob); node tests/scaling.js 3 out as on the base (routeRefresh 1.264 -> 1.262, roundPairs 2 -> 2, takeInWeighed
1.585 -> 2, not traced). On the merged tree against 69b415e: counters 7 out, the same 7 at the same values (walkStep joins, VB-333’s);
scaling 3 out as there, two moved by this change: routeRefresh 1.272 -> 1.581 (residual +0.12 -> +0.43; cause not traced: likely cooks
walking home and working past 18:00 with VB-333’s longer harvest) and takeInWeighed 1.585 -> 2 (+0.435 -> +0.85, not traced).
npm test: 118 scripts passed, 10 targets out, the same 10 as on 69b415e.
tests/counters.json unchanged. medium-ref and the late saves not run.69b415e and this branch): at */seed only ECON (gains pot [1, 1, 0.9, 0.8], potShare
0.2, rawGrain 1.25) and households (each gains fresh = []) move, no other leaf (dumps of 69b415e and this tree compared leaf by
leaf). From year 1 every year entry moves: fish and gathered food are fresh batches, the pot makes the meals, cooks work past 18:00 and
the cook’s job carries its day, so the jobs, matching and every stream after them differ (founders 7, year 1: households 1,083 differing
leaves, pawns 2,848, agents 174, jobs 236, record 356). tests/record.js anchor: heirs 7 at 2.5 years, 55 events on its pawns (other
ones; hash re-recorded).npm test and node tests/golden.js before the last commit; tests/saves.js, plaindata.js, invariants.js, review-tools.js,
clock.js singly. npm run verify not run. The measuring scripts were not committed. No screenshot: the page is unchanged.Orchestrator’s decisions for Kim to overturn (12 Nov 2026):
sim/pot is a module of its own beside sim/stores (at the lint’s 400 lines), owner of household.fresh.household.rack stays its own store: a catch for the rack waits hours, not days (VB-300’s decision), and as a fresh batch the cook would
take the rack’s fish before it is hung.rawGrain), by a kind field late; a job only posted, or one whose cook
is not yet walking to it, still lapses at the end of work.rawGrain (the patch’s decision); QUESTIONS.md proposes to cook it.docs/patches/VB-119.patch removed.