Status: done (2026-11-27)
Priority: 1
Size: L
Design ref: none (code structure). docs/architecture/target-v2.md, section 2 (principles 2 and 18) and 11.2; docs/architecture/modules.md, Adding things; backlog/VB-418.md, backlog/VB-228.md (the pattern); backlog/VB-419.md, VB-417, VB-455 (the splits it touches)
Goal: Over PRs #149 to #198 (16 to 21 November), 14 of the 19 files touched by the most tasks are hot because every feature appends a line to a list in them, not because two concerns share the file (docs/plans/VB-1406-overlap.md: the counts, the method and its limits). Splitting by size moves such a list and leaves it hot; the one split that lowered overlap, VB-418, replaced a list with a registry. Make that the rule everywhere: the module that owns a thing declares it beside the code, and a thin registry or a tool joins the declarations in a fixed order. This task writes the rule into the architecture, lands the steps that only tooling reads, and opens one task a step for the rest, in the order below. Behaviour does not change: each step shows same.
Acceptance criteria:
docs/architecture/target-v2.md gains it in section 2 (proposed as a clause of target-v2, principle 18, or a principle of its own: “what a feature adds to a shared list is declared by its owner; the list is joined at load or by a tool, in a declared order, never by load order”) and a note in 11.2 naming this task; docs/architecture/modules.md, Adding things, says for each kind of thing (a module, a state field, a test, a counter, a tunable, a migration, an event kind, a Sim name) where its one declaration goes; AGENTS.md (Finding things, Conventions) names the greps in place of the files. design.md is not changed: no Decided mechanism moves (searched for the rules file, tunables, the facade, the manifest and migrations; say so again if the search finds one).AGENTS.md, Conventions; BACKLOG.md, Refactor rules): a “Refactor: split” task first says which lists in the module every feature appends to and turns those into declarations; it splits by concern only what is left, and names the tasks of the last 50 PRs that would have touched each part (the back-test of docs/plans/VB-1406-overlap.md, section 4: heirs, relations, stores, page/cards and fields kept their tasks on the parent). The open splits VB-419, VB-417, VB-455, VB-422 and VB-431 each get a note saying what this changes for them. (Unticked: AGENTS.md, Conventions, carries it; the same sentence for BACKLOG.md, Refactor rules, is a decision note for the orchestrator, and what it changes for VB-419, VB-417, VB-455, VB-422, VB-431 and VB-1737 is in the plan, section 5, since a worker edits neither.)// @suite fast|integration|extended) and tests/run.js discovers it; tests/suites.js keeps only what is not a tier (28 tasks to 1). Shown first: no test depends on the order in tests/suites.js, or the ones that do declare it. (Not taken here: opened as VB-1933.)src/vb.js 12 tasks to 0); tests/counters.js reads the joined list as it reads VB.COUNTERS today. tests/counters.json is a recorded baseline and stays: the task proposes recording it at merge or at night, not in each task, as a question for Kim. (Not taken here: opened as VB-1934.)@sys line (// @sys sim/x [material]: ...) and src/layers.json goes (13 to 1); the bullet list of modules in docs/architecture/modules.md is generated from the @sys lines by a tool or dropped for the grep (22 to 0); NOT_STOCKS of tools/stocks.js becomes a tag on the @state line (7 of its 10 tasks). (Not taken here: opened as VB-1941.)@state line, with a marker for a cache and for a field documented outside its owner; tests/ownership.js reads the lines, and src/owners.json keeps only what no line can say (plannedOwners, the exemptions) (18 to at most 2 an owner). The ownership baseline does not rise. (Not taken here: opened as VB-1942.)tools/dependencies.js already extracts them) with a declared tie-break; build.js, tests/lib/load.js and the tools read the derived order through one function (15 to 1). The derived order equals today’s src/manifest.json exactly, or the task stops and reports the differences: the order of KINDS, of event subscribers and of rule contributions is saved state and determinism (target-v2, principle 18). (Not taken here: opened as VB-1943.)Sim facade: each module names what it gives the page, and src/sim.js joins the lists and keeps only what it composes itself (17 to between 1 and 4). The page still writes only through Sim; the width lint (VB-415) does not count a name given to the facade alone. (Not taken here: opened as VB-1944.)sim/saves runs them and loses its writes to other owners’ fields (12 to 4; its lint-allow: owner line and what it can of its exemption go). An old save loads to the same state as before (tests/saves.js). (Not taken here: opened as VB-1945.)HISTORY), its chronicle group, whether it is personal, whether it stops a skip, its icon and word on the page. sim/notable is split into the skip and the chronicle, which share only the record (16 to 8 and 6); sim/records 10 to 6. Taken with or after VB-455, not across it. tests/record.js checks a kind has its record. (Not taken here: opened as VB-1946.)VB['sim/rules']): the tables live in files by domain in the kernel layer or beside their one reader, each with its // @tunable line (VB-419’s criterion), and no shared export block (21 to at most 5 a file); VB['sim/rules'] stays as the joined view, so no reader changes. VB-419 (done 22 Nov) is the model. (Not taken here: opened as VB-1947.)src/head.html’s one <style> becomes stylesheets by area, the mural theme in its own, spliced by build.js as the page script is (14 to 6, 6 and 4); the rows of a person’s, a farm’s and a tile’s card and houseStats come from lists a feature’s page file adds to, with each row’s place declared, not left to the order of src/page.json (page/words 11 to 7). The order of rows on a card, and the three sections of the Stores tab (VB-668), stay as they are. (Not taken here: opened as VB-1948.)docs/tuning.md: proposed, not built, as a question for Kim: one entry a task, gathered by a tool, as backlog/ is (17 of its 18 tasks append to “Parameters waiting”).Waits for: where the order above binds; steps 1 to 3 may be done in this task. Each lands with npm run verify passing and node tools/same.js --base REF printing same; its PR gives, for its hot file, the tasks of #149 to #198 that would still have touched it (the back-test rerun), beside the estimate above.page/cards.js (13 to 11), sim/marriage.js and sim/fields.js are sequential work on one concern; a split would spread the same tasks over more files.
Notes / questions:docs/plans/VB-1406-overlap.md, a read-only pass; no test was run for it). Priority 1, as asked in the session that opened it.rules.js, sim.js, vb.js, saves.js, notable.js and records.js, and is least certain for the page files and tests/lib/invariants.js. Tasks a file stand in for merge conflicts, which were not measured. Most of the splits judged are three days old.tests/lib/invariants.js (24 tasks, one checkState of 1,578 lines) is the eleventh list: checks by owning module, joined (an estimate: 19 files, at most 3 tasks each). It gets its task after step 4, when the owners are read from the modules.docs/tuning.md, which Kim reads to start tuning runs; (3) recording tests/counters.json at merge or at night. Proposed answers: after slice work in flight has merged; one entry a task; at night.sim/records (was VB-455). A step that changes a registry every task writes to (1, 4, 5) lands in a quiet hour, since every branch in flight conflicts with it once.IGNORED in tools/lib/symbols.js), so that what a task declares there counts as a footprint like any function.candidate note. design.md searched again: it names src/sim/rules.js only as where the numbers of “Households short of people” live, no Decided mechanism.decision note). One task a step, VB-1933 to VB-1948, and VB-1949 for the invariants after step 4; their order and numbers in the plan, section 5. VB-1947 waits for Kim (a question); docs/tuning.md and tests/counters.json are a second question.inbox.js start VB-1406 9), for one task a step.