Status: done (2026-11-22)
Priority: 3
Size: M
Design ref: none (code structure). docs/architecture/target-v2.md, principle 12 and section 3.1 (Kim’s decision 27).
Goal: Custom is read through one door, and the door is in the kernel layer because every layer asks it (target-v2, principle 12 and 3.1; Kim, 9 November). Today sim/claims, sim/territory, sim/records, sim/commands, sim/opportunities and sim/lifecycle read practice arrays themselves, through Culture.DIMS and Culture.IDX. Give them the door, and leave culture as the only writer.
Acceptance criteria:
inForce(st, key, at) (a settlement or a tile), gives the option in force for a custom, from the same arrays as today. It allocates nothing; it lives in a module loaded before its readers that imports nothing social (a new sim/customs, or the part of src/culture.js that only reads).sim/claims, sim/territory, sim/records, sim/commands, sim/opportunities and sim/lifecycle ask it; outside culture and the door, no module under src/sim indexes a practice array (a lint, or tests/ownership.js, checks it).culture stays the only writer of customs, attitudes and drift (src/owners.json unchanged or tightened).tools/rules.js, or a small tools/customs.js, lists each custom key’s readers (target-v2 4.4).BACKLOG.md: behaviour unchanged, node tools/same.js --base REF prints same, tests/counters.json unchanged, npm run verify’s hard checks pass, its targets reported with their residuals.
Notes:sim/opportunities (causes, opportunities.js:71-72, reads s.practice[dim]) and sim/lifecycle (kinOpts, lifecycle.js:91, the marriage limit’s options through Culture.DIMS and Culture.IDX); practice in sim/records (records.js:291, read by heirs, hunger, farmclaims, expansion and lifecycle) allocates an object a call.inForce also returns its source and a contested state; neither exists until doctrine does (slice 8), so return the value only and leave room.Culture.advocate in sim/commands is a write through its owner and stays; the argue and rally verbs move to culture with VB-228.sim/territory and sim/claims read customs inside the meeting’s disputes; measure --report perf on small-y40 before and after.culture): the catalogue (DIMS, ARCHETYPES, PRACTICES) and the read door are one concern and go together to the kernel layer. culture is already loaded before every sim module (src/manifest.json), so the cut is between reading and writing, not a matter of load order. VB-417 waits for this task and splits what is left.sim/commands and culture; after VB-228 the customs that the verbs read are read in the verbs’ own modules, so the criterion’s sim/commands means wherever its verbs went: find the readers by grep (Culture.DIMS, Culture.IDX, .practice[), not by this list. VB-417 follows this task and VB-313.decide, now registered in sim/society, writes settlement.practice directly (st.cenv.settlements[...].practice[dim] = option), outside its owner culture; this task gives culture the write act. The customs’ verbs (decide, argue, dropCause, rally) and their guards option and causeWait are in sim/society.src/sim/customs.js (kernel, loaded before culture, imports nothing) holds DIMS, ARCHETYPES, PRACTICES, the
indexes and the door: inForce(st, key, settlement), inForceAt(st, k, settlement) (the index, for causes and the decide check) and
customOf(st, key, culture) (borderRule’s fallback). No settlement, no culture, or a short practice array reads the oldNordic option:
each reader’s old default was that option, so nothing moved. Culture re-exports the catalogue; the page is unchanged.at is a settlement id only; the tile form waits for its first reader (none reads by tile today, and a tile’s village needs
st.owner’s household-or-village rule). Culture.setPractice is the one write, used by the decide verb and the meeting’s fallback.tests/lint.js holds the door (no .practice[ or .customs[ under src/sim outside the door); node tools/customs.js lists readers.same.js same at tiny (founders, heirs; 7, 42; 2 years) and small (populous, founders; 3, 7, 11, 42; 5 years) against c648075.