Status: done (2026-11-11) Priority: 2 Size: M Arch: year Phase: implement Design ref: Work: opportunities, plans and tasks (design.md, section 7); docs/review-work.md, section 2; design.md section 7 (the year) Goal: Layer 1 of how a holder chooses (design.md, section 7): the culture’s year as a template. Today’s order and targets are constants spread over the kinds and the role rankings. Put them in one table per culture, which the review reads, with today’s values, so that the order (VB-023), a head’s foresight (VB-254) and the player (VB-253) each change one row. Acceptance criteria:
VB['sim/registry'] (declared before the first seed or load; never in saved state): for each season, the routines in their order, and a target for each store (the woodpile by season, hay in winters, seed, fields per hand). Its first values are today’s (woodTarget, woodWinter, ENOUGH, fieldsWanted’s numbers), the same for every culture.kind: 'season'), made at each season’s first review from the template: its steps are the season’s routines in order; the plan’s targets (VB-248) are copied from it. The review reads steps and targets from the plan, never from the template directly, so a later change to one household’s plan touches no other.tests/golden.json unchanged. (VB-023 enforces the first order: sowing before the next hoeing.)value() allocates nothing.node tools/sim.js --household N --report plans prints a household’s plans: targets, steps, next review. Invariants: one seasonal plan per occupied household, of the current season. npm run verify’s hard checks pass, its targets reported with their residuals.
Cost: one small record per household a season.
Notes: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.Implementation notes:
src/sim/plans.js: the template is six rules of VB['sim/registry'], declared at load (owner sim/plans, ctx {culture, season, routine}):
year.order (a routine’s place in the season, -1 when it is not done then; base ROUTINES, one list of kinds per season), year.wood (by
season: woodTarget, woodWinter, woodWinter, woodTarget), year.woodSecond (woodTarget * 0.4), year.hayWinters (2, the old
ENOUGH), year.seed (seedPerField), year.perHand (FIELDS.perHand). The same for every culture (no contribution yet).templateOf compiles it per culture at the first need in a season (the season’s turn): the woodpile’s goal for all four seasons, the season’s
other targets, and its steps, sorted by year.order; 8 + 22 rule reads per culture a season, one ctx object reused. The compiled form is a
WeakMap cache keyed by the state, derived from the rules only: never saved; a loaded run compiles it again.st.plans.seasons: a Map of household id to its seasonal plan {holder, kind: 'season', year, season, made, steps}, made with the standing
plan (makePlan, and fillPlans for an older save) and again at the standing plan’s first review in each season (reviewed), when the
standing plan’s targets (wood, woodSecond, hayWinters, and the new seed and perHand) are copied from the template. Reviews within
the season no longer rewrite the targets: they read them from the plan (fieldsWorkable(st, hh, T.perHand); seedNeed reads
plan.targets.seed, ECON.seedPerField before a plan exists). Dropped with the standing plan (dropPlan).steps yet (VB-023 will).tools/sim.js --report plans (every live household) and --household N --report plans: culture, targets, reservations, next review and
cadence, last review day, the seasonal plan’s season and steps.tests/lib/invariants.js: one seasonal plan per live household, its steps existing kinds, of the current season once the standing plan has
been reviewed in it (never of a later one); the targets seed and perHand present. tests/plans.js: four new sections (the rules and
their values for cultures -1, 0, 1; seasonal plans from the start; a household’s changed target and steps stand through a review and touch
no other, the next season’s first review makes them again from the template, compiled once per culture; dropped with the plan, filled at load).Validation notes:
node tests/golden.js: matches, unchanged (not re-recorded). npm test: 92 passed; targets out: scaling.roundPairs +0.85 (as on main).npm run verify: every hard script passed except the four browser scripts, which failed for a missing node_modules in this worktree; after
npm install each passed run alone (browser-saves.js timed out once under the machine’s load and passed on the next run). Targets out:
scaling.roundPairs +0.85, history routeExpand +1.148, routeRefresh +0.426, roundPairs +7.56, heirRank +0.059, recordFold +2.13,
planReview +0.019, occasionAsked +7.60, roundRank +0.012. None is this change’s: the simulation is unchanged (golden file the same) and no
review is added; planReview and roundRank were 1.103 and 1.219 at 7205992, before the integration branch’s VB-249 and VB-250.Orchestrator’s decisions for Kim to overturn:
ROUTINES in src/sim/plans.js) are household kinds in the order the work is done (spring: manure, hoe, sow, rake,
land work, then threshing, wood, upkeep and the daily work); village and island kinds (plots, the fence’s village stretches, restoring a farm,
the cottage’s stages) are not routines of a household’s year.year.perHand replaces FIELDS.perHand only in the plan’s workable; FIELDS.oxenHands, want and expect stay constants.tests/plans.js follows. Golden still matches.