village-builder

VB-381: Measures of width in place of the cap on length

Status: blocked Waits for: VB-380 Priority: 3 Size: S Arch: yardstick Phase: implement Design ref: none (code structure). docs/typescript-plan.md (P9); the survey in backlog/VB-055.md. Goal: The lint holds a module’s exports to 15 and a function’s formatted length to 60 lines, each with a baseline that only falls (tests/width-baseline.json, updated with node tests/lint.js --update, a ratchet as the lint’s), and no cap on a module’s length. A function is a declaration, expression or arrow with a block body; a one-line arrow is not counted. Counted from the source (export declarations and the names of export { ... }). Today’s numbers, from the code on 12 November, to be recounted by the task (exports are counted on the loaded namespaces, constants included; functions on the formatted copy described in VB-380): 62 modules export, median 9, 18 over 15: sim 106 (the facade), sim/rules 56, sim/records 52, sim/agents 34, sim/relations 32, sim/stores 32, sim/herds 30, sim/fields 22, culture 20, sim/lifecycle 19, sim/layout, sim/claims, sim/plans 18 each, sim/hunger, sim/meadows, sim/heirs, sim/commands 17 each, sim/farmclaims 16. Functions over 60 formatted lines: 26 in src/sim, src/gen and the root modules (generate 486, gen/geology.lay 186, sim/scenarios.makeState 186, sim/lifecycle.marriageRound 159, sim/saves.encode 134, sim/scenarios.seedHeirs 134, sim/layout.layVillage 133, gen.bakeChunk 126, sim/heirs.heirRanking 116, …). heirRanking (116 formatted lines) is among them; movingRound, which Kim also named, is exported by sim/lifecycle but did not appear among the longest functions in the survey’s count (it is probably a short wrapper over roundPhase; not checked), and the task says what it measures. Acceptance criteria: