Status: done (2026-10-29, 938bf05)
Priority: 1
Size: M
Design ref: none (code structure)
Goal: Adding or splitting a source file today means editing build.py, the markers in src/body.html, tests/smoke.js (it evals the page’s scripts by index and renames const ArchGen, const Culture, const Sim) and the require/global set-up at the top of every test. Put the module list in one place and give modules one way to register and find each other.
Acceptance criteria:
src/manifest.json lists the JS modules in load order: vb.js, gen.js, culture.js, sim.js.src/vb.js creates the namespace (var VB = globalThis.VB = globalThis.VB || {};) and documents the convention in at most 6 comment lines: src/<path>.js registers as VB['<path>'] (e.g. src/sim/hex.js is VB['sim/hex']) with VB['sim/hex'] = (() => { ...; return { ... }; })();, and reads what it needs at the top of its IIFE, e.g. const { bfs } = VB['sim/hex'];. A module reads only modules listed before it. Grepping a key finds the module and every user.gen.js, culture.js and sim.js also register as VB['gen'], VB['culture'] and VB['sim'] (the same objects; the ArchGen, Culture and Sim globals stay). sim.js reads gen and culture from VB instead of its typeof/require fallbacks.build.py inlines each manifest file as its own <script>, in order, at one <!--__MODULES__--> marker in src/body.html, which replaces the three marker scripts. The page script stays last.python3 build.py --check exits non-zero with a one-line message if index.html differs from a fresh build, without writing it; npm test runs it first.src/load.js (Node only) creates VB, requires every manifest file in order and returns VB. tests/regress.js, tests/heirs.js, tests/calibrate.js and tests/golden.js load through it, with no direct require('../src/…') and no hand-set globals.tests/smoke.js evals every inline <script> of index.html in document order, rewriting any top-level const Name = to var Name = generically; it names no modules and assumes no script count.npm test passes; tests/golden.json unchanged.
Notes / questions: