Status: done (2026-11-11) Priority: 2 Size: S Arch: life Phase: implement Design ref: Inheritance, expansion and other bodies (Marriage as a negotiation: The player’s doors); The player and what they see (Marriage; The round’s acts). Goal: As the one to marry, the player may wish for a match, carried to the round as its other wishes are (VB-212). A wish narrows what the round does for the played pawn and never takes it past a rule. The other side answers the match as it would any offer. Acceptance criteria:
st.player.wishes.match: null (as the pawn would), false (not this year), or a pawn id (that partner). Set by Sim.wish(st, 'match', value), kept until changed, and cleared when the played pawn or the wished partner marries or dies. An older save’s player loads with match: null. Invariants added.false, the played pawn is left out of the round’s men or women, and so is not counted by kinPressure. With a pawn id, at the start of the man’s village’s round and before the matcher’s loop, the pair becomes an offer (VB-293), but only if the round’s rules allow it. Both are alive, single, of marrying age (MARRIAGE.menFrom, womenFrom), fed (HUNGER.marryBelow), not retired and not in an open offer. Their kin degree passes kinOk under the man’s village’s custom. homeFor gives a home, and that home affords the match (affords, the means to marry). The pair’s score, with the noise at its mean (MARRIAGE.noise / 2), is at least MARRIAGE.minScore. No draw is made from st.rng.society for it. The played pawn’s own answer is yes, since the wish is its yes. The other answers follow VB-293. If the wish fails a rule, the played pawn enters the matcher as usual.Sim.opportunities says, for the wished partner, the rule that bars the match now if one does (as roundBox does for the other wishes). The pawn panel offers the wish under “At the moving round”: “not this year”, “as I would”, or a partner. The partners listed are the unmarried pawns of the other sex, of age, whom the pawn knows best by tie, at most 8, each with the rule that bars it if one does.tests/wishes.js): false keeps the played pawn unmarried through a round that would have married it; a wished partner who passes the rules becomes an offer at the round and is married at the close; a wished sister, a partner with no home, and one 30 years older make no offer, and the played pawn enters the matcher as usual; with no player and with no wish, the golden file is unchanged. A browser test sets the wish from the panel.src/page/play.js, as VB-273 does: one at a time.Implementation notes (11 Nov 2026):
marriageRound into a new module src/sim/matching.js (after sim/heirs in the manifest; no state, no owner): kinOk,
matchScore (the matcher’s score, with the noise a fraction of its amplitude), matchRules(st) (place, homeFor, affords, with their caches) and
matchBar(st, a, b) (the first rule that bars a match, or {man, woman, home}). The round and Sim.opportunities read the same rules. A new module was
needed: heirs.js stands at its 400-line limit. The round’s own lines changed little: the context block is now matchRules(st), the loop’s score is one call
to matchScore, and a wished pair comes first in the loop with no scan and no draw (the goAhead draw is skipped for it too); the played pawn’s own
answer is set yes (the man or woman key only; a played head’s answer for a member stays open, so an offer waits).st.player.wishes.match; Sim.wish(st, 'match', v) takes null, false or a living pawn of the other sex; clearMatchWish (sim/commands, the owner)
is called by wed and killPawn. Older saves load with match: null (saves.js). Invariant in tests/lib/invariants.js (null, false or a living pawn
of the other sex, the played pawn living).Sim.opportunities: for a played single adult, {verb: 'match', when: 'round'} items: one with target: null (the pawn may wish), then up to 8 partners by
tie (relationsOf), the wished one added if not among them, each with why from matchBar. The Actions sheet shows “A match”: As it would, Not this year, partners.matchBar a round (one pair; kinDegree is bounded); the panel’s items run matchBar for at most 9 pairs on a rebuild, sharing one matchRules
(a lazy roundHeirs), only for a played single adult.docs/img/vb274-wish.png (the Actions sheet, “A match”).Validation notes:
node tests/wishes.js (new section 9: a wished pair the round would not marry by itself is married at the round; the same wished by the woman; false
keeps a pawn who would have married unmarried and out of kinPush; a sister, a pair with no home, a partner 30 years older make no offer and the played
pawn is matched as the unwished run does; the wish is cleared by the partner’s death; saved and loaded, older save null), node tests/browser.js (the wish
set from the panel), node tests/golden.js (unchanged, no re-record), npm test. Not run: npm run verify, the long runs.Orchestrator’s decisions for Kim to overturn:
Sim.wish’s only shape check; every other rule is the round’s, shown as the panel’s reason.