village-builder

VB-854: Verify’s small cases: the household’s rules

Status: done (2026-11-16) Priority: 1 Size: L Design ref: docs/testing.md (What runs only at night); tests/suites.js Goal: Verify takes about half a minute and holds a small constructed case of each rule the nightly-only scripts assert (Kim, 13 November) Acceptance criteria: Scripts: meals, stores, hunger, heirs, guardian, kinship, kinlimit, owners, plans, offers, exchange, occasions (second group of EXTENDED in tests/suites.js). Split from VB-409.

Noted by VB-409, 16 November 2026.

Implementation notes (VB-854)

Tests only; nothing under src/ changed. Each of the twelve scripts now runs on the small generated islands of tests/lib/probe.js (scenario, island; VB-853), and moves from EXTENDED to INTEGRATION in tests/suites.js. What took years is constructed. Two keep a night mode, heirs --extended and hunger --extended, which say so in their first lines.

A rule found red: stores failed on the run’s branch before this task (its first lines asserted grain + meals unchanged by cooking, but since VB-009 grain cooked unground gives 1 / ECON.unground a ration). The assertions now read the foods table: 4 grain cooked give 4 * FOODS.grain.worth meals, and the yearly total of cooking is -10 * (1 - worth). The rule (cooking converts at the food’s worth) is what meals asserts too.

Decision: scenes found on the 120 by 85 or default island are found again on the small island at another seed, as VB-853 did, rather than built on a tinyWorld: offers seed 42 (was 54: a son of the house whose bride speaks for herself) and, for its scene 11, seed 13, three villages, men 23 and 6 and woman 17 (was seed 61, four villages, men 32 and 8, woman 24); occasions seed 11 (was 3; at 3 and 7 the small island’s first round marries one couple, and the scene needs two).

Where each assertion went:

Validation: each script passes; heirs --extended and hunger --extended pass. CPU each, on this machine at load 15 to 19 on 4 cores (a description; wall 1.5 to 14 s under that load): meals 1.5 s, stores 4.1, hunger 3.3, heirs 2.0, guardian 0.9, kinship 2.0, kinlimit 1.1, owners 1.1, plans 3.1, offers 4.9, exchange 3.3, occasions 2.9. offers is near the line: most of it is generating the island again for each of its 20 scenes (a world cannot be cloned, it holds functions). The night loses ten scripts and two shrink (about 120 s in the 245-second measure: plans 14, offers 12, owners 10, kinlimit 10, meals 10, stores 9, guardian 9, kinship 8, exchange 6, occasions 5, and most of hunger 10 and heirs 8).

Follow-up noted: VB-872, a small island generated once per seed in tests/lib/probe.js (most of offers’ time is the island made again). npm run verify after merging the run’s branch (VB-690 in): 137/137 passed, 8 targets out (advisory), 152 s at load 18.