Status: done (2026-11-18) Priority: 1 Size: M Arch: crops Phase: implement Design ref: Goods and the farming year, Crops and rotations (design.md, section 8) Goal: Parity of command for crops, and what the player sees of them. The player chooses freely: the other heads’ short choice is for cost (Kim, 11 Nov). Acceptance criteria:
src/sim/commands.js: set a field’s rotation (any rotation of the rules the household has seed for, not only the village’s usual one) and sow one field out of turn for a year; each checks the seed, the window and that the field is free, and returns why not; only the holder may issue them. The holder’s own rule goes through the same verbs with source: 'pawn'; tests/commands.js holds.st only; screenshots by tools/shot.js in the PR.node tools/same.js --base REF prints same). npm run verify (it touches src/page/).
Cost: none in a run without a player.
Notes / questions:QUESTION_ARCHIVE.md, VB-345): its numbers are design.md’s starting values, Agreed.fieldsFrost, src/sim/fields.js), which a player would try after three lost harvests (VB-1115), but there is no verb for it.src/sim/scenarios.js:576), so the verb needs a way to come by rye seed (Crops and rotations, Seed); say in the notes how the player’s farm gets it.b0d998d). Impact: sim/fields gains the checks and acts of two verbs and a view
(rotationChoice, rotationWhy, takeRotation, turnWhy, outOfTurn, fieldView; holdRotation is gone), sim/commands the verbs
rotation and sowOutOfTurn (both in HEAD_VERBS, so Sim.head reaches them), sim/plans issues rotation with source pawn where it
called holdRotation; the page reads Sim.fieldView (page/tileinfo, page/words) and draws by fieldLook (page/settlement,
page/fieldart). No new coupling: commands reaches fields as it reaches plans, by later. Two state fields, both sim/fields’:
farmstead.fields[].turn (true while a field bears a crop out of turn) and farmstead.rotationBy (the household whose head chose the
rotation to keep); invariants in tests/lib/invariants.js, rotationBy in src/owners.json and tools/stocks.js (not a stock).
src/sim/fields.js is now 766 lines and 23 counted exports: VB-434 (open) splits it.rotation: only the head (heads), a farm of its own, a known rotation, a field’s seed of every crop of it (in store or
standing, as VB-350’s hasSeed), and no field under a crop it has not (the “free field”). It has no window: a rotation is a plan, and
each course keeps its own window. sowOutOfTurn: the field free (in stubble or hoed), the crop’s sowing window open today, a field’s
seed of it in the store. The window is read strictly: the choice is made when the crop can be sown, not ahead. A close call: surfaced.
fallow is a choice too (a year’s rest: no seed, no window), and a field’s own course puts it back to its turn.rotation({hold: true}) marks farmstead.rotationBy, and the rule (rotationChoice)
then leaves that farm alone, the fall-back included: short of seed, the field waits unsown, as the design’s row has it where no
rotation serves. rotation({rotation: null}) gives the choosing back. The page always passes hold; the rule never does, so the verb
does the same for any source. A field out of turn is likewise left out of the rule’s fall-back (shortOf).nextStep clears turn; on barley every year it goes back to barley).tests/sowing.js (new, in npm test): each refusal with its reason and nothing changed, a rotation the village does not
hold, kept across reviews and given back, the rule issuing the verb once with source pawn, a field out of turn through its year,
a year’s rest, back to its turn, the played head through Sim.head, the view; checkState after each. tests/rotations.js and
tests/commands.js hold unchanged. node tools/same.js --base b0d998d: same (founders and heirs, seeds 7 and 42, tiny, 2 years; and
founders and populous, seed 7, small, 3 years). Those runs sow barley alone, so the rule’s path through the verb was also compared with
rye: tools/sim.js --rye, heirs and founders, seed 7, tiny, 4 years, base against work: the saves are byte for byte the same.
npm run verify passes; counters unchanged (node tests/counters.js: 2 out, as before the change).
node tests/smoke.js and node tests/browser-gathering.js pass. node tests/browser.js fails on two camera checks (“opening the People
sheet moved the camera”, “Show on map did not bring the camera to the project’s tile”) on the base commit as well: not this task’s,
noted as a task (VB-1145).tools/shot.js as it stands,
which cannot play a pawn or open a card: by a throwaway script on its hook. The scene is staged: two households were given rye and
peas in their stores for the picture; the played head’s choices then went through Sim.head and the card’s own button, and the year
was run. The card’s buttons have no browser check yet (VB-1146).