Status: done (2026-11-25)
Priority: 3
Size: M
Arch: debt
Phase: implement
Design ref: Claims, ownership and territory, One scope model for overlays, stores and trees (Agreed, 30 Oct); Households and other bodies (Bodies: Open, measured 11 Nov); Commands, time steps and views (Store views, Family tree: Decided); docs/architecture/target-v2.md, section 4.4 (Membership)
Goal: The overlay, the store views and the family tree must each work for any level of entity (pawn, family, household, village, culture), and slice 5’s bodies (a village with an alderman, a household that owes) need one way to say who belongs where. Build the membership graph once, and the scopes on it. Waits for Kim’s answer on bodies (QUESTIONS.md, VB-184, question 7): if the graph is adopted as Membership’s truth, this task makes it so; if each kind keeps its own domain, it builds the same graph as a derived view for the scopes only, and the second criterion falls.
Acceptance criteria (Kim, 2026-10-30: the scope model is adopted as the plan for the overlay, store views and family trees; rewritten by VB-184, 11 Nov 2026):
{from: pawn or body, to: body, role, since, until}): residence, service, holder, spouse, a household’s village, a village’s culture, the alderman (VB-314), and a pawn’s family (the line of a farm, or descent from a founder); a pawn may hold several edges of one kind over time and several kinds at once (the multi-membership test below). Ended edges stay, outside the index of live edges that every step reads (rule 1).sim/records and sim/membership, or a module that takes their membership part over) writes the edges, and derives pawn.household, household.members, pawn.servant and the role cache from them as caches it alone writes, checked against the edges in a test; behaviour unchanged (node tools/same.js --base REF prints same).{ level, ids, dim } with dim one of owns, claims, uses, works, is kin of (owns and uses read VB-311’s rights where it is done). inScope(st, scope) returns the pawns, households, tiles or stores it covers.docs/review-architecture.md, section 2, point 6): the review’s multi-membership test (docs/architecture/stress-tests.md, section 4) has a pawn in several memberships at once: a household in one village, work for an employer or a guild in another, land elsewhere. Keep the graph’s links as typed edges a pawn may have several of, not a chain pawn → household → village → culture, so a later employer, guild or parish is a new kind of edge, not a redesign.docs/slices.md, section 3.5; the slices Decided by Kim): moved to slice 5, arch debt (from claims). blocked until the slice’s plan (VB-184) confirms, rewrites or closes it.Notes (VB-043, 25 Nov):
sim/graph (kernel, before sim/records) holds st.edges (saved) and the live index st.graph (derived); each writer writes its edge beside its cache; check derives the caches from the edges alone and runs in the invariants, so every test’s states are checked. Scopes are sim/scopes (derived layer).migrate).left on an ended edge says the member gave it up; without it (a death, a dissolution) the record keeps it: that is how the dead keep their last household and service, and the living kept on a dissolved household’s record.uses reads st.owner, as owns, until VB-311.sim/heirs refreshRoles; check compares it with the role the edges settle (holder, holder’s spouse, service). Its move to Membership is VB-372’s.tools/same.js --added edges prints same (the option is new: a key the work adds).check 0.7 ms, a move 0.008 ms; the edges add about 0.19 MB to an 11.3 MB save. Year 12 was not reached in the time (0.5 to 0.8 s a day).