Status: done (2026-10-29, cb7b024)
Priority: 1
Size: S
Design ref: none (test infrastructure for refactoring)
Goal: The refactor tasks (VB-016 onwards) must leave behaviour exactly as it is. World generation and the simulation are deterministic, so record a fingerprint of their output that npm test checks.
Acceptance criteria:
tests/golden.js hashes, for seeds 7 and 42: the generated world (every typed array and number on w); and for each scenario (founders, heirs, default settings) the state after Sim.seed and after each of three calls to Sim.advance(st, Sim.YEAR).Map and Set as entries in insertion order; typed arrays as plain arrays; numbers as toPrecision(12); functions skipped; st.w skipped (the world is hashed on its own); a shared or cyclic reference written as a back-reference to the path where the object was first seen.st gets its own hash, so a failure names what changed (e.g. founders/42/year2: households, events).node tests/calibrate.js natural 2 50, and the sorted key lists of Sim, ArchGen and Culture (to catch renames).tests/golden.json; node tests/golden.js --update rewrites the file. Only Node built-ins (crypto). Runs in under 15 s. Added to npm test.ECON value locally (not committed) makes it fail and names the changed keys; the committed suite passes.
Notes / questions: