Status: done (2026-11-10)
Priority: 2
Size: M
Arch: year
Phase: implement
Design ref: Work: opportunities, plans and tasks (design.md, section 7); docs/review-work.md, sections 1.2 and 5 (task 2)
Goal: Several choices and targets a household makes are hidden in the rules that post jobs (docs/review-work.md, section 1.2). Move them into the plan record, each read where it is read today, so a culture, a head’s foresight or the player can later change them in one place.
Acceptance criteria:
sim/plans at each review with today’s values: the woodpile’s goal by season (woodGoal, src/sim/kinds.js), hay for ENOUGH winters (hayWanted, src/sim/meadows.js), the fields wanted (fieldsWanted, fieldsWorkable, src/sim/fields.js). wood.available, the meadow work and the land step read the plan’s targets, not the constants.startProject and startMeadow are called by the plan’s review (once a day at WORK[0], as now), and the tile comes from one function per kind (chooseTile, chooseMeadow) behind a seam that takes a tile given in the plan in its place. No verb gives one yet (VB-253).herd.cull stays where it is, filled at the autumn count; the plan records that the count was held this year. Nothing reads it yet.sim/stores keeps a count per holder, good and plan (reserve, release, reserved, each with a reason, as its other operations); seedReserve (src/sim/hunger.js) becomes the plan’s reservation of seed for its unsown fields and its project, and its readers (cookWanted, floorOf, src/sim/help.js, src/sim/farmclaims.js, src/sim/lifecycle.js) read the reserved count. An invariant: a holder’s reservations of a good never exceed its stock of it, and no reservation names a plan that is gone.@state lines for the new fields; tests/golden.json unchanged; counters unchanged. npm run verify’s hard checks pass, its targets reported with their residuals.QUESTION_ARCHIVE.md, “VB-164: the household’s year”): written. Edits src/sim/jobs.js and its neighbours, so the slice’s tasks run one at a time, and not beside VB-227, VB-241 or VB-247.tests/golden.json and tests/counters.json stay unchanged and win over the exact shape; where a stored seed
count would lag, the computed read stays behind reserved.
sim/plans now reads sim/stores (reserve), sim/hunger (seedNeed), sim/fields (fieldsWanted, fieldsWorkable,
startProject) and sim/meadows (startMeadow), all earlier modules; sim/kinds (wood) and sim/meadows (hayWanted) read the
household’s plan as data (st.plans.households); sim/stores writes plan.reserved and plan.reasons. sim/kinds, sim/help,
sim/farmclaims, sim/settle and sim/lifecycle read Stores.reserved(st, hh, 'grain') instead of Hunger.seedReserve. New state:
plan.targets {wood[4], woodSecond, hayWinters, fields, workable}, plan.tiles {field, meadow}, plan.counted, plan.reserved,
plan.reasons (@state lines in src/sim/plans.js and src/sim/stores.js; owners in src/owners.json; tools/writes.js knows a
plan as an entity). Saves without them get them at load (Plans.fillPlans). No new loop and no new counter; the review writes five
numbers and one count per household, the fields’ targets once a day.sim/plans (template: the woodpile’s goal by season from ECON.woodTarget/woodWinter, the
second hand’s level, HAY_WINTERS = 2), written at each review; the fields wanted and workable at the day’s first work review, the one
that takes the land step (fieldsWanted now takes workable, so it walks the members once). wood.available, wood’s urgency, hayWanted
and the land step read the plan.Plans.landStep, called from the review at WORK[0] as before; startProject(st, f, hh, built, wanted, given) and
startMeadow(st, f, hh, built, given) take the plan’s target and a tile the plan names (plan.tiles, -1 for none) in place of
chooseTile/chooseMeadow. A named tile skips the choice and the contest and is not checked: VB-253’s verb must check it before it
sets plan.tiles. After the step the plan reserves again, so a project begun holds its seed.plan.counted = year on the count day for a household with herds; herd.cull is unchanged.Stores.reserve, release, reserved, reasons in Stores.RESERVE (seed only). One count per plan and good, kept on the
plan (on the household it would enter the golden hash of households; plans are outside it), so a reservation goes with its plan. The
standing plan reserves the seed of its unsown fields and project (Hunger.seedNeed, today’s computation, now allocation-free) at each
review. Not met as written, two points: (1) a stored count lags: measured with a probe, 43 of 175,306 reads in populous seed 7 (3 years)
differed from the computed value (a cook finishing in the hour a field was sown; sharing and the meal at midnight after evening
changes), which would change the golden file. So a reservation whose reason follows its plan’s needs (seed) is counted at read by
the rule sim/hunger gives (Stores.follow), and the stored count is the review’s (tests/plans.js checks they agree right after a
review). (2) “Reservations never exceed stock” does not hold for seed: a household short of grain reserves the fields’ whole need
(0.6% of household-days, populous seed 7, 2 years, 87 of 14,275); capping it would change the means to marry and the deals’ floor.
The invariant added checks that reservations live on a live plan with a known reason and a count >= 0; the stock part waits for
the plans that reserve against each other (VB-252). Sim.seedReserve stays (the page and the golden API hash) and reads reserved.woodGoal (kinds.js) and ENOUGH (meadows.js) are gone, their numbers now only in the plan’s template; startProject
and startMeadow are no longer called from sim/jobs (nor imported there); seedReserve is no longer read by any simulation module
(seven call sites in six modules now read Stores.reserved); E.woodTarget * 0.4 is read only by the template.npm test passes (1 new script, tests/plans.js); node tests/golden.js: golden state matches; node tests/counters.js:
0 counters out, tests/counters.json unchanged. npm run verify (fixtures remade at the base, FORMAT 3, all four loaded): 104 scripts
passed; 6 targets out, none moved by this change (counters unchanged): scaling.routeRefresh +0.1147, scaling.roundPairs +0.85 (as at
the base), history.routeExpand +0.4405, history.routeRefresh +0.5579, history.roundPairs +2.128, history.recordFold +1.511.