Status: done (2026-11-16) Priority: 2 Size: M Arch: year Phase: implement Design ref: design.md, the household’s year (Foresight); backlog/VB-254.md Goal: A head’s foresight moves its targets about the custom’s, not above them: a head of middling skill and no bias plans as the template does, so that hungry household-days on populous small return to within a tenth of the value before VB-254 (23.75, seeds 3, 7, 11, 42, 30 years), or the residual is explained. Acceptance criteria:
project (src/sim/plans.js): the horizon replaces the template’s look-ahead where the template already looks ahead (wood’s woodWinter, hay’s winters), not adds to it: a test on a constructed state shows a head of skill 0.5 and bias 1 wants the template’s wood and hay on each season’s first day, a longer horizon wants more only where the template’s own look-ahead is shorter, and a short one less.headFields: the bias is applied before the cap at workable, or about a point where it can raise as well as cut, so that over heads with biases drawn symmetrically the mean fields wanted of a hands-limited household equals the unbiased one within 2% (a test with fix on the stream, or over the drawn distribution).T.seed > 0 (tests/lib/invariants.js), loosened to >= 0 by VB-254, is restored, or the path that makes it 0 is named beside it.newHead, startHeads), not at the next seasonal plan, or the reason it waits is written beside it.backlog/VB-254.md so that its criterion can be ticked.jobs.fit now bids as bid does, read only by views.project withdrawn and restored to VB-254’s, see the revision below): sim/plans’ project puts the head’s horizon in place of the template’s look-ahead: the
template’s targets (woodWinter, two winters of hay) are what a head that projects to the season’s end keeps (skill 0.33 to 0.67), so
it wants them as they are on any day. A head that reacts (under 0.33) wants them less what the rest of the season will burn
(ECON.woodUse) and the stall days left in it will feed, never under nothing; a far-seeing head (0.67 and up) wants the larger of the
template’s target and what it projects to burn and feed to its horizon’s end (burnAhead), so more only where the template looks less
far; with today’s ECON that projection (at most 25 loads; under a winter of stall) never passes the template’s (30 to 40 loads; two
winters), so such a head plans as the template does. The difference is kept in targets.ahead as before and taken off at the next
review. headFields takes the fields the household’s food asks before the cap (fieldsWanted(st, hh, Infinity)), times the bias,
then caps at workable. retarget: a new head’s targets made at once, at the event newHead (a succession) and in startHeads:
the season’s plan with its bias, and the fields it wants. T.seed > 0 restored in tests/lib/invariants.js: no path makes it 0 now
(the bias is at least 0.7; the target is made at the plan’s making); npm test’s continuity and verify’s invariants hold.tests/traits.js: on each season’s first day a head of skill 0.5 and no bias wants the template’s wood and hay, a
far-seeing one no more (where the template looks as far), one that reacts less by the season’s burn and stall, and back at the next
review; with a woodpile goal of 10 in winter the far-seeing head wants its 23.4, the middling 10, the reacting none; a succession
with the stream at its least gives the new head’s seed and hay at once; the fields’ mean over 101 symmetric draws (fix on the
stream) at skill 0 and 0.5 within 2% of the unbiased (the old order, cap then bias: 4.663 against 5, out). tests/lib/heads.js and
tests/head.js’s template heads are of middling skill now (wits and husbandry 0.4), since a head that reacts no longer plans by the
template. tests/trust.js waited a fixed 65 days for a weeding round, which a farm sown a day earlier had passed: it waits now for
the first day, about 65 on, a round of field work stands open (a timing of the test, not a defect).measure.js, VB-254’s script, with a line every five years: hungry household-days, head stints
out of wood and of hay, living at the end; thirds by the head’s skill that day, hungry per 1,000 household-days and wood out of
stints). All on this run’s branch before its merge of 16 Nov 01:15 (base = 2b78f07, the branch before VB-254; VB-254 = deae691, as
merged; after = cc7f7de, this task before the branch’s later commits): run side by side, four at a time, on the shared machine.| seed | hungry: base / VB-254 / after | wood out | hay out | living | after, by third (low / mid / high): hungry per 1,000; wood out of stints | VB-254, by third |
|---|---|---|---|---|---|---|
| 3 | 23 / 39 / 28 | 40 / 39 / 39 | 6 / 4 / 4 | 611 / 570 / 554 | 0.87 / 0.18 / 0; 9 of 70 / 28 of 201 / 8 of 119 | 0.50 / 0.39 / 0.08 |
| 7 | 62 / 31 / 55 | 52 / 52 / 47 | 3 / 3 / 1 | 606 / 632 / 620 | 0 / 0.32 / 0.56; 16 of 66 / 21 of 179 / 13 of 120 | 0.10 / 0 / 0.48 |
| 11 | 29 / 24 / 39 | 44 / 43 / 49 | 5 / 9 / 4 | 568 / 590 / 549 | 1.45 / 0.13 / 0.18; 10 of 53 / 34 of 196 / 15 of 132 | 0.52 / 0.21 / 0.04 |
| 42 | 12 / 6 / 25 | 48 / 58 / 50 | 4 / 3 / 2 | 671 / 660 / 668 | 0.64 / 0.22 / 0.02; 9 of 52 / 30 of 203 / 16 of 117 | 0.27 / 0.04 / 0 |
Mean hungry household-days: base 31.5, VB-254 25, after 36.75 (VB-254’s own measure, on its branch before the merge: 23.75 and
36.25). After against VB-254’s 23.75: +55%; against this branch’s base: +17%; against VB-254 as merged: +47%; not within a tenth of
either, so backlog/VB-254.md is left as it is. Mean living at the end: 614 / 613 / 598 (after is lower at three seeds of four).
The top third is hungrier less than the bottom at seeds 3, 11 and 42, not at 7 (VB-254: 3, 11, 42); wood runs out in a smaller share
of the top third’s stints than the bottom’s at all four seeds (7 to 14% against 13 to 24%).
tuning),
with a task for a measure a household cannot swing (VB-571, inbox task). No parameter runs were spent.node tests/run.js verify --verbose, after the merge): 11 out, the same 11 as at the branch’s tip (its tests/scaling.js
and tests/counters.js run on a copy of the tip): the work counters’ probe gives the tip’s values to the last digit
(counters/heirRank, roundRank, helpBid 0.2925, pastureTiles 4.863); scaling.helpBid 1.242 against the tip’s 1.230 (target
1.15; this task moves it +0.012, by the heads’ targets), the other six scaling targets as at the tip.decision). The first version left foresight two outcomes, cut or template: no head planned above the custom, the horizon was off
for the top two tiers, and the cut fell on the third that got hungrier. project is VB-254’s again (a reacting head wants the
template’s target times its bias; the others add the projected burn and stall days to their horizon’s end, through burnAhead);
tests/traits.js asserts it with numbers worked by hand on spring’s and autumn’s first days (spring: 30, 34.2, 37.8 loads; autumn:
40, 46, 65.2; hay 2, 2 + 5/21 and 2, 2 + 4/21, 2 + 16/21 winters); tests/lib/heads.js and tests/head.js are as on the branch.
Kept: the fields’ bias before the cap (criterion 2); T.seed > 0, its one possible exception named beside it (a custom taking the rule
year.seed to 0; none does); the tests/trust.js wait. retarget no longer remakes the season’s plan: it makes the targets from
this season’s template with the new head’s bias, its projection and the fields it wants, and keeps the plan’s order (the template’s,
or sp.by = 'head') and its making day to the season’s end, as a chosen target outlasts a succession (a test sets an order and kills
the head). headView: the custom’s fields and the head’s are both capped at what the hands can till; the bias is applied before the
cap, so they differ only where the bias moves the fields under it (written beside it).node tests/run.js verify --verbose): 11 out, the same 11 at the same values as at the branch’s tip
(scaling.helpBid 1.230, as at the tip); none moved by this task.