Status: done (2026-11-11)
Priority: 3
Size: S
Design ref: none (code structure). AGENTS.md, Conventions (write through the module in src/owners.json).
Goal: tools/writes.js places a write’s receiver from its declaration, a loop, or the name’s convention (hh, p); a write it cannot place goes to an unresolved list and is not checked against src/owners.json. tests/tools.js:57 allows up to 20, and there are 19, so a new write through a name the scan cannot follow passes unseen.
Acceptance criteria:
tests/ownership.js fails on an unresolved write that is not in its baseline, naming the file and line and saying how to place it (a declaration from the state, a conventional name, or a hint in tools/writes.js); --update only removes entries, as for the other baselines. The allowance of 20 in tests/tools.js goes.ramHerd.rams (herds.js:202), g.path (agents.js:28) and the two row(...).claims (claims.js:135) are writes of state and are placed.tests/ownershiprules.js holds the case found on 10 November: function f(st, home) { home.grain = 0; } in a module that does not own household.grain fails the check.tests/golden.json unchanged; npm test passes.
Notes:household.grain were put into sim/herds in turn: caught through a conventional name, a declaration from st.households, a helper’s return, Object.assign, a computed key, a forEach callback and a compound assignment; missed only through a parameter named home.tools/writes.js, write-scopes.js, owner-policy.js, tests/ownership.js and tests/ownershiprules.js, one second a run, one field left in its baseline.Implementation notes (night run):
tests/ownership.js gained auditUnresolved and tests/unresolved-baseline.json (mod how text: count; now empty, since all 19 are placed); --update only removes entries. The allowance of 20 left tests/tools.js.tools/writes.js HINTS: s/family/live/households/people/r as local scratch (records, heirs, expansion, lifecycle, claims), ramHerd as herd, g as agent (agents), u as union (lifecycle), h as household|village (saves). claims.js:135 binds const r = row(...) (behaviour unchanged). Ownership baseline unchanged (7 writes).tests/ownershiprules.js: function f(st, home) { home.grain = 0; } in sim/herds reaches the unresolved list and fails with file and line, as an unplaced write (the scan cannot tell home).
Validation: ownership, ownershiprules, tools, golden pass; npm test run once.Orchestrator’s decisions for Kim to overturn:
row(...).claims writes are tallies of a local report, so they are placed local, not as state; the task called them state writes.