Status: done (2026-11-10)
Priority: 2
Size: S
Design ref: Inheritance, expansion and other bodies (Leaving home); Customs and culture (the meetings). docs/architecture/target-v2.md, section 3.3. Kim, 10 Nov 2026 (code review).
Goal: movingRound (src/sim/lifecycle.js) handles every village in one six-minute step, and to stay near the 60 ms limit it keeps a dependency-tracked cache of heir rankings that is invalidated by reading the event record. Kim decided on 10 November that each village holds its own meeting and its own round, on the same days as today, a village a step: the game is about locally supported community, and a village’s step is small enough to rank heirs afresh. Survey what the split touches and write the implement tasks.
Acceptance criteria:
meetingStage and movingRound read and write across villages today, with file and function: the matcher’s pool (unmarried men and women of the whole map, the same-village bonus, the settlement tie), places, homes, handed, means and putOff, kinPressure, the handovers and retirements (lifecycle.js:256-264), countDemand, the land meeting, and changedSince. For each: whether it is a village’s own, or reaches another village and how.design.md (Leaving home; Customs and culture) as rows Decided, 10 Nov: (1) all villages meet on autumn day 10 and move on day 11, as today, each village in its own six-minute step, in the order of village id; (2) a village’s round matches its own unmarried men, and a woman of any village may be chosen, by today’s score; a woman taken in an earlier village’s round is no longer free; (3) a lone farm (a one-farm village) is a village here. Say what the order of villages changes against today (which man asks first), and whether the order should turn from year to year so that no village is always first.heirRanking is called afresh, roundHeirs, the parameters nested, ownFirstSet, watch and family, and changedSince go, or the survey says what must stay and why. Each task names its steps as entries of VB-241’s calendar, and that a save between two villages’ steps goes on (tests/saves.js).medium-ref and small-y40; the longest step expected, against 60 ms. VB-201 (steps within 60 ms) brought in line: its lines for the meetings and the round are rewritten or closed by these tasks.st.offers (VB-293), so a woman held by one in an earlier village’s round is not free in a later one; whichever of VB-242’s round task and VB-293 lands second moves the offer into the village’s round.fb35e75 on the published fixtures, three rounds each, the heir cache as it is against a fresh ranking at every ask with every household counted as changed after each change: the final state is identical. medium-ref (1,026 living, 227 households): 58, 69 and 42 ms a round with 604 rankings, against 78, 86 and 68 ms with 4,008. small-y40 (695 living, 173 households): 53, 43 and 24 ms with 486, against 87, 91 and 109 ms with 5,098. The cache saves 20 to 60 ms once a year, and the round is over 60 ms with it.heirs.js:20-147, lifecycle.js:149-264): heirRanking has seven parameters, four for the cache; a household’s memo is trusted while hh.members is the same array of the same length (it leans on how moveTo replaces one array and appends to the other); watch records which rankings depend on which pawns and spouses; changedSince finds what changed by reading the event record since a mark, so a change that writes no entry, or one that names no household, leaves a stale ranking with nothing to show it.QUESTIONS.md, “VB-242”, question 1). Its proposal: start at village year mod count, deterministic, with no new random stream. No other task depends on it.roundHeirs, watch, family and changedSince go; nested and ownFirstSet stay, for the reasons under “What stays”, below.AGENTS.md, Working rules).QUESTIONS.md, “VB-242”, question 2). Kim’s three decisions name the matching and the steps, not these phases. Proposed: they stay island-wide, on fixed steps after the villages’ steps, as VB-201 spread them. VB-277 proceeds on the proposal and nothing waits.Survey (10 Nov 2026, at fd74348): what the meetings and the round read and write across villages. “Own” means the work reads and writes only its village’s people, households and farms.
The moving round. roundPhase, src/sim/lifecycle.js:140-153, called by stepEnds (src/sim/clock.js:105) on four steps from noon of autumn day 11. Phase 0 is marriageRound (lifecycle.js:154-288).
| What | Where | Today | Village a step |
|---|---|---|---|
| The village store | fillStores, src/sim/help.js:74-81, at the round’s start |
Every household gives its surplus to its own village’s store | Own: each household gives to its own village, in its village’s step |
| The pool | marriageRound, lifecycle.js:157-165 |
Ages refreshed, the widowed found and the pool built from every living pawn of the island; men from 20, women from 18, single, not retired, fed | The village’s own men; the women of every village (decision 2). Reaches every village’s women; a woman married in an earlier step is no longer single, and one held by an offer (VB-293) is taken |
| The order of asking | lifecycle.js:176 |
Every man of the island in one list: those with a place first, then the oldest | Village by village in id order, and within a village as today (see The order of villages) |
| The score | lifecycle.js:245-249 |
-|gap - 3| × 0.3 (0.15 widowed) + 2 for the same village, else 2 × the lesser of the two settlements’ ties to their culture’s centre; + noise up to 1.5, drawn from st.rng.society for each pair |
Unchanged. It reads the other village’s tie (written by the meetings, updateTies, the day before) and its settlement id: a read, nothing written. The draws reorder with the men |
places |
place, lifecycle.js:168-175 |
Per pawn: the household it holds or is first heir to, from roundHeirs; dropped by changedSince |
Reaches other villages: a woman’s place ranks her household’s heirs, in any village; and under land residence a placeless man’s candidates are the women with a place anywhere (housed, :239). Memo for the step, cleared after each marriage or handover |
homes |
lifecycle.js:168 |
Each living pawn’s household at the round’s start, so that changedSince can find the household a pawn left |
Goes with changedSince |
handed |
handsOnWell, lifecycle.js:183-191; swept by village at :262-265 |
Per household: whether its farm would be handed on well (a grown heir, else a landless adult of its village in st.demand). After each marriage, every memo of a village the marriage touched is dropped |
Reaches another village: a couple’s home may be the woman’s farm. Memo for the step, cleared after each marriage; the sweep goes |
means |
affords, lifecycle.js:205-213 |
Per home household: food above seed for 1.5 years of its members and one more | Reaches another village for the same reason. Memo for the step |
putOff |
lifecycle.js:214, logged :267-270 |
Couples put off for want of means, counted and logged by the man’s village | Own |
| The marriage | issue(... 'marry' ...), :255; wed, :122-134 |
The pair moves to the home; a spouse who held a farm hands it on (handOn, src/sim/heirs.js:323-348), to its heir, else to a landless adult of that farm’s village (st.demand), else it stands empty |
Reaches another village: the woman’s household and farm, and a farm handed on in her village. VB-293 makes this call an offer |
changedSince |
lifecycle.js:215-231, called at :259 and :283 |
Reads every event of the record since a mark, to find the pawns and households a command changed (moves, transfers, extinctions, a third party’s claim), and drops their rankings, homes, means and places. A change that writes no event, or names no household, would leave a stale ranking | Goes: a step ranks afresh |
kinPressure |
lifecycle.js:90-119, called at :271 |
Clears kinPush on every pawn ever (st.pawns, Rules for cost, 1); sets the plenty pull on the couples married this round; the scarcity push on every unmatched adult who has no allowed partner in the island but would under the next looser limit: a pass over pairs (each unmatched against the free pawns of the other sex); logs per settlement |
The village’s own people, against the free of the other sex in every village; the reset walks the living once (at the first step) and the dead’s push is cleared at death |
| The handovers and retirements | lifecycle.js:273-285 |
After all marriages, every live household: the first heir takes over when the custom is “when the heir marries” and the heir is married and at home, or “at 60” and the holder is 60 | The village’s own farms, plus the homes in other villages that its marriages chose (else a woman’s farm whose heir married in a later village’s step would wait a year). One function, which VB-293 also needs at an offer’s close |
| Roles | refreshRoles, :156 and :286 |
Every living pawn, twice | Every living pawn at each step’s end (0.3 ms); not a village’s own, but cheap |
countDemand |
phase 1, lifecycle.js:143; src/sim/heirs.js:391-395 |
Every living pawn: who wants out, ranked by roundHeirs’ fresh view |
Island-wide, after every village’s step (question 2): st.demand feeds claims on farms in villages within CLAIMS.farmReach (src/sim/farmclaims.js:64-80), plots (own village, src/sim/expansion.js:90-100), settlement (a crowded village’s party to another village’s land or new land, src/sim/settle.js:205) and service (within SERVICE.reach, src/sim/service.js:86-110) |
| Claims, plots, settlement, service, what is owed, prestige | phases 1 to 3, lifecycle.js:142-151 |
Island-wide | Unchanged, on fixed steps at 18:00, 18:06 and 18:12: settlement founds villages, which would move steps counted from the number of villages |
The meetings. meetingStage, lifecycle.js:51-80, called by stepEnds (clock.js:104) on four steps from noon of autumn day 10 (VB-206).
| What | Where | Today | Village a step |
|---|---|---|---|
| Stage 0: roles, prestige, interests | refreshRoles, src/sim/heirs.js:349-363; refreshPrestige and refreshInterests, src/sim/society.js:73-133 |
Every living pawn; interests walk every pawn ever (society.js:85, clearing the dead’s) and rank the heirs of each pawn’s household against ownFirstOf(st), a ranking of every household |
Interests are the village’s own living (each household ranked once); the dead’s cleared at death. Roles and prestige stay island-wide at the first step (0.3 ms) |
| Stage 1: ties | updateTies, society.js:52-72 |
Each settlement’s tie to its culture’s centre: a path search between the two greens, and the kin of its people who live in the centre | Own, reading the centre: the kin count reads where its people’s near kin live |
| Stage 2: entrepreneurs | Culture.entrepreneurs, src/culture.js:232-258 |
Every living adult, drawing from st.rng.culture in st.living order; the cause is weighted by the pawn’s own settlement’s lastSupport |
Own: the village’s living adults (and the living of no settlement at the first step). The draws reorder |
| Stage 2: the meeting | Culture.meeting, culture.js:269-286 |
Each settlement: its members’ voice-weighted support, its practice changed through the decide verb |
Own |
| Stage 2: the culture’s year | Culture.cultureYear, culture.js:288-320 |
Each culture: every settlement’s support, size and tie; may change every settlement’s practice, and split a settlement off | Not a village’s own: after every village’s step (18:00) |
| Stage 2: the meeting log | lifecycle.js:61-79 |
One block of lines at the head of st.meetingLog, or “changed nothing” |
Each village’s lines at its step; the culture’s lines and “changed nothing” (read from the log’s first entry’s year) at 18:00 |
| Stage 3: the land meeting | landMeeting, src/sim/territory.js:179-187 |
Outland settled and claimed between villages (borders, pressure on a neighbour), then each village’s wood | Not a village’s own: after the cultures (18:06), unchanged |
What a lone farm is: every farmstead has a village (settlementIdOf, src/sim/records.js:176-180), and a lone farm is a village of one farm (design.md, Every farm in a village), so it holds its own step like any other. At medium-ref 4 of 26 villages hold one household, at small-y40 1 of 25.
The order of villages (decision 1). Today the round asks every unmarried man of the island in one list, those with a place (holders and first heirs) first, then the oldest. By villages, every man of village 0 asks before any man of village 1: a young landless man of village 0 asks before an old holder of village 25. A woman of a later village may be chosen by an earlier village’s man before her own village’s men ask; a woman of an earlier village is chosen by a later village’s man only if no man of her own village took her. Lower ids are the older and larger villages (the first third of ids held 154 of the 333 men who asked, below).
Measured with a static matcher (scratch, not committed) on 38 states: populous small at seeds 1 to 6, years 5, 10, 15, 20, 25 and 30, plus small-y40 and medium-ref. Homes, places and means are as at the start, nobody is married as it goes, and each pair’s noise is a hash of the pair and the year, so the three orders see the same men, scores and draws. Of 486 unmarried men, 333 would ask (best score at least minScore, the go-ahead draw passed). “Lost” means the woman he scores best was taken before his turn.
| Order | Men asking, by third of village ids | Lost their best | Married | Lost to a man of another village |
|---|---|---|---|---|
| Today | 154 / 126 / 53 | 38% / 43% / 49% | 36% / 41% / 45% | 51 / 47 / 26 |
| Village id | 154 / 126 / 53 | 21% / 48% / 53% | 44% / 36% / 40% | 26 / 55 / 28 |
| Turned (start at year mod villages) | 154 / 126 / 53 | 44% / 34% / 43% | 34% / 40% / 57% | 62 / 36 / 21 |
In id order the first third’s men lose their best-scored woman about half as often (21% against 38%) and marry more often (44% against 36%); the middle and last thirds lose more. The losses move to the villages that ask later. Married in all: 131 today, 133 by village id, 134 turned. Being first measurably favours a village, so VB-280 proposes turning the start by the year. The study’s shares are not the game’s, since no marriage changes the next choice; VB-277’s real runs report the same measures.
What stays of the heir cache (decision 2). roundHeirs (heirs.js:103-147), watch, family (heirs.js:32-36, 60-62), changedSince, homes and the sweep of handed go: VB-277 removes the round’s use, and VB-279 the rest. Two of the four parameters the task named stay:
nested is not a cache. It is the direct-heirs-only ranking that ownFirstOf (heirs.js:93-100) needs for the rule “an heir to their own parents’ farm” (heirs.js:73-89).ownFirstSet has no dependencies to track: a pass that ranks many households while nothing changes computes the island’s first direct heirs once (countDemand, firstHeirs, placeIfMarried, refreshInterests). tests/lib/heir-rankings.js (VB-224) checks the candidate-lines shortcut against it. On cost it is neutral. Ranking every household of medium-ref without it took 2.6 to 4.3 ms (574 rankings), against 5.5 to 19 ms with it (422 rankings, the set included). At small-y40 it took 16 to 23 ms (1,109) against 12 to 27 (338).Cost (Rules for cost, 9). Measured with a prototype of the village step (scratch, not committed). It is marriageRound for one village’s men, with a memo of heirRanking(st, hh) cleared after every marriage or handover, and handovers for the village’s farms and the homes its marriages chose; it leaves out kin pressure and the village store. It ran on each fixture advanced to 11.9 h of the round’s day, three runs each, while other agents ran on the machine, so single times are noisy.
medium-ref |
small-y40 |
|
|---|---|---|
| Living at the round, households, villages | 1,018; 211; 26 (4 of one household) | 636; 168; 25 (1 of one household) |
| Households a village: median, most | 8; 20 | 6; 15 |
| Living a village: median, most (at the fixture) | 24; 111 | 22; 69 |
| Today’s marriage phase, one step | 27, 31, 39 ms; 521 rankings; 1,455 pairs; 13 marriages | 18, 23, 64 ms; 396 rankings; 485 pairs; 7 marriages |
| A village a step: the longest step | 16.3, 15.2, 30.3 ms | 23.5, 6.7, 19.1 ms |
| Rankings a step: most, mean | 229; 72 | 188; 69 |
| The round’s rankings, the window’s total time | 1,884; 73 to 132 ms | 1,722; 34 to 77 ms |
| Pairs scored, marriages, handovers | 1,313; 12; 2 | 186; 8; 0 |
The longest village step is expected at 15 to 30 ms against the 60 ms target. Most of a step is fixed: building the pool from the living, ages, the widowed, and roles. The rankings come next, 229 at most. The round costs more in all (about 3.6 times the rankings), but it is spread over 26 steps once a year: a few ms a game day over the year’s mean. The meetings’ village steps are expected under 15 ms: the largest village holds 11% of the living, and the island-wide stages took 33, 52, 16 and 13 ms at medium-ref and 45, 15, 10 and 17 ms at small-y40 (cold, one call each, stages 0 to 3).
VB-201 brought in line: its criterion left “the village order within the marriages” until that phase alone nears 60 ms; Kim’s decision of 10 November makes it VB-277, and VB-201’s notes say so. Its spread of phases 1 to 3 stays. The bench’s lines “Moving round, its call” and “Meetings, its call” (tools/bench.js, through tools/perf.js’s wrap of roundPhase and meetingStage) keep their meaning, the longest step, because both stay the entry points of each step. VB-206’s stages become a village’s (VB-278).
Plan (10 Nov 2026). Tasks:
| Task | Size | Waits for | Against VB-293 |
|---|---|---|---|
| VB-277: the round a village a step | M | VB-241, VB-293 | After. VB-293 is ready and on slice 2’s path, and this task waits for VB-241 anyway. The offer sits at the marry call inside the matcher’s loop, which moves into the village’s step unchanged. VB-293 also extracts the handover rule this task needs. |
| VB-278: the meetings a village a step | M | VB-241 | Independent: marriage does not touch the meetings. One at a time with VB-277 (both edit sim/clock.js and sim/lifecycle.js). |
| VB-279: Refactor: the heir cache’s end | S | VB-277 | After, through VB-277. Behaviour unchanged. |
| VB-280: the order turns by the year | S | VB-277, Kim | After, through VB-277. Waits for Kim’s answer; nothing depends on it. |
Each names its steps as one entry of VB-241’s calendar for its day, whose run reads the step of the day, and checks that a save between two villages’ steps goes on (tests/spread.js, tests/saves.js).
Brought in line: VB-293 (its notes: the order against VB-277, and that a woman held by an offer is not free to a later village’s men), VB-274 (until VB-277 lands, “the man’s village’s round” is the island’s round), VB-275 (pairs scored after VB-277), VB-201 (its notes), design.md (below) and docs/roadmap.md (section 3.2’s marriage tasks, and section 5.4’s debt “the moving round spread over days”).
Design (10 Nov 2026), design.md. Leaving home gains the row “A village’s round”, Decided, 10 Nov: Kim’s three decisions, what the order changes, and the two proposals (the island-wide phases after it; the turn, VB-280). Customs and culture, Meetings, culture and splits, gains “A village’s meeting”, Decided, 10 Nov. Marriage as a negotiation, The offer: a pair held by an open offer is not free to a later village’s men the same day.
Validation (10 Nov 2026): no game code changed, so index.html and the golden file are unchanged. npm test passes (88 scripts), with two scaling targets out that nothing here touches, as on main (scaling.routeRefresh +0.11, scaling.roundPairs +0.85). tests/backlog.js passes with the four new tasks. The prototypes and the static study were scratch scripts run against the fixtures and saves, not committed.