VB-1561: A hay target met early is kept to the winter
Status: done (2026-11-23)
Priority: 2
Size: S
Design ref: design.md section 7 (the head’s targets); src/sim/meadows.js hayWanted; tests/head.js (the raised hay target)
Goal: With standing duties (VB-1553) the haymaking is done days sooner: the target is met with meadows unmown, their mowing is called off (sim/meadows hayWanted), and the stack falls to 2.67 winters of 3 by the start of winter (tests/head.js; 4.48 before, by the overshoot of meadows mown together). A target met early should still be met at the winter.
Acceptance criteria:
On the scene of tests/head.js (a cow and five ewes, four meadows, seed 3) with the hay target raised to 3 winters, the household holds 3 winters or more of hay at the start of winter, and the assertion VB-1553 relaxed (2.5) is 3 again.
The rule is named in the design row it belongs to (the hay target: what is wanted reckons with what the stack loses before winter, or the late window tops it up) and the head, played or not, passes the same check; no hay is made that nothing would eat (the balance review’s 3,893). (Built and checked: one rule for played and unplayed heads, none wanted with no animals. The design line is left to the orchestrator: a sub-agent does not edit design.md; text in the inbox decision note.)
tests/meadows.js and npm run verify pass; hay at the start of winter before and after, populous small, seeds 7 and 11, 2 years.
Noted by VB-1553, 23 November 2026.
Notes (VB-1561):
Chose “what is wanted reckons with what the stack loses” over a late top-up: one rule in hayWanted, no new window or state. Wanted = target + (stall days left before winter, doy 32-35 and spring’s before doy 5, at the herds’ daily hay) + (days to winter x dayLoss of a stack at the target, halved by a barn). hayLostToWinter exported for the test.
tests/head.js: raised target 2.67 -> 4.38 winters at winter’s start (3.70 wanted at its most, the overshoot under a meadow, 1.43); the bound is 3 at the start of winter again, with an upper bound of wanted + one meadow. The template’s 2.67 unchanged.
Populous small, hay at winter / need (winters), year 1 and 2: seed 7 1.15, 1.19 before and after (unchanged); seed 11 1.11 and 1.32 before, 1.11 and 1.32 after (4409 -> 4431 hay in year 2). Populous farms are short of meadow, so the rule rarely binds there.