Status: done (2026-11-18) Priority: 1 Size: M Design ref: none (code structure). backlog/VB-228.md (the same for verbs); backlog/VB-359.md, backlog/VB-328.md (the kinds placed outside sim/kinds while it was full) Goal: sim/kinds is 781 formatted lines, the fifth longest module. Most job kinds’ records are declared in it; sim/dig and sim/grazing declare theirs as KIND and sim/building the cottage’s stages as KINDS, registered in sim/kinds in a line each, two of the three because sim/kinds stood at the old cap of 400 lines. Decide the rule (proposed: a domain module declares its kinds beside the rules they call, and sim/kinds keeps the registry, the shared rules and the asking order, as VB-228 does for verbs), then move the kinds, a domain at a time, each move checked with tools/same.js. Acceptance criteria:
docs/architecture/modules.md (Adding things: a new job kind) and AGENTS.md, and every kind follows it.node tools/same.js --base REF prints same for each.sim/kinds is under 700 lines and leaves tests/lint-baseline.json.sim/kinds exports no more names than before (VB-420’s criterion), and the width baselines of the modules whose callbacks became private fall.
Notes / questions:sim/kinds alone (8, 4, 5 and 3 functions that their own modules never call): the kinds’ records would join the rules they name.sim/kinds by concern), which asked for the same move from the lint’s side and is closed; renamed to name sim/kinds, so the lint finds it as the module’s split task. The rule proposed here is the general one: a domain declares what it contributes (its kinds, as its rules, goods and, with VB-228, verbs), and the central module keeps the registry and the order (ASK). Measured on this day by a grep of src/: 8 of sim/fields’ 28 exports, 5 of sim/meadows’ 23 and 5 of sim/byre’s 16 are read by sim/kinds alone; they stop being exports when the records move, so the width baselines of those modules fall with this task (node tests/lint.js --update). If the field kinds take sim/fields over 700 lines, they go to a module of their own beside it and the PR says so; VB-434 and VB-435 wait for this task and are judged again after it.sim/stores’ ale has a module of its own by then, the brew kind goes there. VB-434 and VB-435 wait for this task and VB-454.docs/review-blocks.md): the kinds’ records change with VB-472 (the worked hook is called at a reckoning with hours; field, pace and the rows become the page’s): moving the records is independent, but do one before the other is begun, not across it.docs/agents/worker.md).docs/plans/VB-418.md): Kim asked that each choice be motivated from principles and responsibilities; section 5 does so from target-v2’s principles 1 to 3 (a kind’s record is a domain’s rule; one writer per field; a module calls its own layer and below). Kim approved, with one change: the helpers several domains share go where they belong, size ignored, not to a module of their own.05ad44e. One commit a home, each with npm test, the lint and node tools/same.js --base 05ad44e (same: founders and heirs, seeds 7 and 42, tiny, 2 years):
rowAngle, firstRow, onField to sim/fields; onProject, landProject to sim/projects; workStake to sim/claims; spareDays, spareUrgency to sim/hunger;sim/byre: fodder, milk, slaughter, salt, byreWork; sim/meadows: meadow, rake, mow, hay, meadowWork; sim/expansion: fell, grub, plotWork; sim/farmclaims: restore, claimWork; sim/drying: fish; sim/building: mend, repair (as UPKEEP);sim/fieldwork (271 lines, material layer, after sim/fields): the ten field kinds and sowWhy; new sim/chores (185 lines, material layer, after sim/carts): wood, water, cook, brew, gather, with fuelFree and cookWanted.rowAngle, firstRow, onField) went to sim/fields, not sim/layout as the plan first said: sim/layout places things at seeding, and the rows are how a field tile is worked. A close call.KINDS is kept exactly, by one line a kind in sim/kinds: st.plans.due (saved state) holds an index into the windowed kinds in that order, and the fetch kinds and the roles’ ranks follow it. Found while moving; the rule (a new kind is added at the end) is in modules.md.mend and repair are a second table of sim/building (UPKEEP), since its KINDS is joined before the green’s and the work day’s and they stood after.same: (1) a common field’s ends of haul, clear and break are sim/commons’ (common(K), which wraps the three records), so sim/fieldwork in the material layer does not call a social module; (2) hunt takes spareUrgency in sim/deer (the patch in sim/kinds is gone); (3) hay’s cart part (...Carts.HAY) joins in sim/kinds, since sim/carts imports sim/meadows; (4) Projects. and Drying. prefixes dropped where a record now sits in that module.sim/kinds 859 to 150 lines (the lint’s count 781 to 149; it left tests/lint-baseline.json), its exports 8 to 3 (KINDS, ASK, isOpen), its imports 27 modules to 19, none of them for a callback (35 names were imported for the records alone). The one rule with two shapes (29 kinds in the registry, 20 with their domain) has one. Exports that became private: finishMeadow, hayDay, meadowJobs, mowDone, hayIn (sim/meadows, counted width 16 to 10: it left tests/width-baseline.json), workClaim, claimJobs (sim/farmclaims). No new upward call (tests/layers-baseline.json unchanged at 13).sim/fields 767 to 783 lines and its counted exports 23 to 38. Three are the rows; twelve are the transitions the kinds call (hoed, sown, reaped, …), which the lint left out while their only reader was the registry and counts now that the reader is sim/fieldwork. Nothing more is exported than before; the measure sees what it did not. It falls only if the field kinds live in sim/fields itself, which the note of 15 November ruled out by length: owed to VB-434 (noted there). sim/byre’s five callbacks stay exported because tests call them. sim/claims went over its width baseline (17 to 18, workStake): VB-1176 opened, as the lint asks. sim/byre is 606 lines, sim/expansion 561, sim/building 526.npm run verify 192/192, 9 targets out, as at 05ad44e (192/192, 9 out). node tools/same.js --base 05ad44e --scenario founders,populous --seeds 7 --map small --years 4: same. No behaviour changed, so no numbers before and after.wood, gather, cook; written in modules.md). Close calls: the rows to sim/fields; sim/chores as one module and not five homes. No teleport found.