Status: done (2026-11-11) Priority: 2 Size: S Arch: year Phase: implement Design ref: docs/bench/hunger-night-11nov.md (the proposed fix A, with its diff); backlog/VB-249.md; design.md, Work: opportunities, plans and tasks Goal: The night’s investigation (11 Nov) found that since VB-249 plow, sow and reap wait for the household’s next review, so hoed-to-sown and ripe-to-reaped each lose up to a day, and fields lost at the frost rose from 4.7-6.6% of those sown to 6.8-9.0% on all six seeds. Fishing hides the hunger this causes; the harvests are still lost. Acceptance criteria:
reviewWhy (src/sim/plans.js) reviews a household out of turn at the first review hour of any day one of its fields is ripe, and of each day of the sowing window while one of its fields is still to hoe or sow (the report’s fieldsDue, fix A); at most one such review per household a day, beside VB-249’s other reasons. No other change to planning days, and no hourly review (the report’s variant B costs 64% more oppAsk and works no better).docs/bench/lone-households.js), and the worst household. Frost losses fall on every seed.oppAsk a living pawn-day in node tests/counters.js rises by no more than a tenth (the report measured 8.13 to 8.61), and VB-249’s gain (39.1 before it) is kept; planReview reported. tests/golden.json, tests/counters.json and the record’s anchor re-recorded, the changed entries listed.tests/plans.js: a household of cadence 3 whose field ripens the day after its review is reviewed that day at the first review hour and reaps; one whose hoed field waits in the sowing window sows the same day.
Cost: households with a field due x one review a day, in the sowing window and the harvest: at most one extra review a household on those days (about 20 days a year).
Notes:docs/bench/hunger-night-11nov.md): written. VB-249’s own third criterion asks for a review “at once when a window is about to close (sowing, the harvest before the frost)”; its closing days come too late for a field that ripens or is hoed between reviews, so this completes that criterion and moves no Decided point. Ready on that reading; for Kim to overturn.fieldsDue(st, plan, c) in src/sim/plans.js (the report’s fix A, with the sowing window’s start read too):
at the first review hour (5:00), a household plan whose farm has a field ripe, or, in the sowing window, a field in stubble or
plowed, is reviewed out of turn as 'window', under the same plan.last !== c.day guard as closing, so at most once a day and never
beside another review that day. It walks only the household’s own fields, allocates nothing, and is asked only from the review hour’s
existing loop over farmsteads. Planning days are unchanged (reviewed keeps nextReview for a review out of turn).tests/plans.js gains the case of the criterion (cadence 3, reviewed on its planning day at 18:00; the next day a field ripe, or hoed
in the sowing window: no review at 6:00, a review at 5:00 with the planning day kept, reap/sow posted, not twice that day, and the field
reaped or sown within the day; stubble in summer is not due). VB-249’s due-queue case (no review at spring day 1, 5:00) now sets the fields
growing, as with stubble in the sowing window every household is now due.Validation, populous small, 30 years, years 4 to 30, a scratch replay a day at a time (fields counted as sown once per sowing; losses
counted at 23:30 before the frost: ripe, in stooks, growing; rows as docs/bench/lone-households.js), before = 0c3c75a (the branch’s
tip, re-run: it reads above the report’s tip on seeds 3 and 11), after = this commit:
| seed | frost lost / sown, before -> after | ripe not reaped | in stooks | mean sowing day | rows > 0.3 | hungry hh-days | worst household-year |
|---|---|---|---|---|---|---|---|
| 3 | 9.20% (928/10,082) -> 6.72% (666/9,912) | 25 -> 8 | 634 -> 455 | 4.08 -> 3.95 | 0 -> 1 | 3 -> 148 | 2 days -> 17 days (1 member) |
| 7 | 7.13% (621/8,705) -> 4.64% (388/8,365) | 15 -> 1 | 414 -> 277 | 3.96 -> 3.79 | 0 -> 0 | 0 -> 0 | none -> none |
| 11 | 9.49% (978/10,304) -> 5.01% (513/10,241) | 28 -> 4 | 672 -> 333 | 4.20 -> 3.95 | 0 -> 0 | 2 -> 12 | 2 days -> 6 days |
| 42 | 5.69% (541/9,500) -> 4.75% (451/9,485) | 8 -> 3 | 355 -> 299 | 3.87 -> 3.90 | 0 -> 0 | 0 -> 0 | none -> none |
| 5 | 7.81% (744/9,531) -> 5.68% (529/9,308) | 10 -> 5 | 546 -> 395 | 4.01 -> 3.88 | 0 -> 0 | 7 -> 2 | 4 days -> 1 day |
| 13 | 8.36% (813/9,722) -> 5.74% (558/9,721) | 33 -> 3 | 527 -> 370 | 4.03 -> 3.94 | 0 -> 0 | 0 -> 3 | none -> 3 days |
Frost losses fall on every seed, into or below the base’s 4.7 to 6.6% before VB-249 (seed 3 at its edge, 6.72%). Hunger stays near zero (fishing): seed 3 reads one row and 148 hungry household-days over 27 years (its worst household-year one member, 17 days in year 26), within the spread the report found for an inert change; the other seeds read 0 rows. Households are not worse off on the measure but on seed 3’s few; the gain is the harvests no longer lost (seed 11: 465 fewer fields lost in 27 years).
node tests/counters.js, a living pawn-day): oppAsk 8.50 -> 9.01 (+6.0%, within the tenth; VB-249’s 39.1 kept at 4.3-fold),
planReview 0.2489 -> 0.2811, routeExpand 1.531 -> 1.733, routeRefresh 0.900 -> 0.9956; all other counters unchanged in value band.
Three counters out against tests/counters.json (planReview, routeExpand, routeRefresh), as the report predicted: an intended change.tests/golden.json, tests/counters.json and the anchor of tests/record.js are left to the
orchestrator after the merge. node tests/golden.js: all 12 entries move (founders and heirs, seeds 7 and 42, years 1 to 3), as a
change to when fields are worked must; tests/record.js’s anchor moves with the record
(heirs 7 at 2.5 years: 73 -> 66 events on its pawns, and its hash). npm test after the last code edit: only tests/record.js fails, on
that anchor; tests/plans.js and all other scripts pass.ECON.sowWindow (the report’s patch read only
the end; the start is day 0, so no change in behaviour). The report’s second point (the harvest’s closing days, autumn 10 and 11, too
late for a reaped crop to dry and be hauled) is left as it was: not in this task’s criteria.