Status: done (2026-11-09) Priority: 1 Size: S Arch: kin-help Phase: implement Design ref: Exchange, goodwill and obligations (The gift: What the player sees, Agreed 8 Nov); VB-182’s plan. Goal: The player sees who owes whom and why: the pawn panel lists a pawn’s largest balances and, for a holder, how much it would give each counterpart and what that is made of. Acceptance criteria:
showRelations, src/page/words.js:189), a list of up to 5 balances by size, from Sim.goodwillOf: “Owes Erik Larsson 34 rations” or “Is owed 12 rations by Anna Persdotter”, rounded to whole rations (no reason or year: a balance is one number, Kim 8 Nov). A row focuses its pawn on click, as the relations rows do. No list when the pawn has no balance of a ration or more.Sim.explainAllowance(st, giver, receiver) (a read-only wrapper of explain(allowance)) on hover: each part’s label and value (“Grain above the floor +120 · Own reserve −40 · Goodwill 0, from slice 4”).Sim API and writes nothing to st (the lint enforces it).tests/smoke.js in jsdom, or tests/browser.js): after a run with gifts (populous 7, tiny map), a pawn with a balance shows its rows and a holder’s row shows its allowance.apiKeys.Sim changes (the two new Sim functions),
re-recorded and listed in the PR; npm run verify passes; index.html rebuilt.
Notes:Sim.explainAllowance takes the counterpart pawn as the receiver, toward its household
(the design: “how much it would give that pawn”), while assessGift takes the receiving household’s holder. They differ only once
slice 4 switches goodwill’s term on (GOODWILL.acts), and only when the counterpart is not its household’s holder; who the receiver is
is a question for slice 4’s plan.sim/relations (balance, goodwillSince, goodwillOf); VB-217 left the Sim
API alone so that its golden change was the booking only, and this task adds Sim.goodwillOf and Sim.explainAllowance.explain checks each part against its range, so a failing range shows here first; report it rather than widen a range in the page.sim/exchange: explainAllowance(st, giver, receiver) (pawn ids) returns Rules.explain(st, 'allowance', ctx) with its own context
{giver, receiver, from, to}: from the household the giver holds, to the receiver’s household; null unless the giver holds a
household and the receiver lives in another, not dissolved. It reads only. Sim exports it and goodwillOf (src/sim.js).src/page/words.js: showRelations adds “Owes and is owed” under “Knows best”, from goodwillRows(id): up to 5 balances of a ration
or more, largest first, rounded (“Owes X 34 rations”, “Is owed 12 rations by X”, “1 ration” singular); a row is a data-pawn button,
so the existing click handler focuses its pawn. On a holder’s panel a row whose pawn lives in another household adds “would give up to N
rations”, with the parts as its title: each label and its rounded value, signed (“Grain above the floor +91 · Goodwill (acts from
slice 4) 0 · Own reserve −91”), in the registry’s order and with the labels the contributions declare. src/head.html: the note is
right-aligned and the second heading spaced.goodwillOf (at most 32 balances) and at most 5 explanations.tests/smoke.js (verify): after the populous 7 tiny map is generated it skips a year, selects through the settlers list a holder with
a balance toward another household, and checks the rows (count, wording) and each “would give” row’s three parts on hover; a pawn with
no balance shows no list. It finds Mats Jönsson (pawn 5), “Is owed 47 rations by Karin Matsdotter” (his daughter, in another
household), would give up to 0 rations. The mock Graphics gained rect, which booths drawn after a year on the tiny map call.apiKeys.Sim changed (bf8cf0f76d85b0e8 to a773355c8b1c7127, the two new Sim functions); every state entry is
unchanged. node tests/counters.js unchanged.npm test (78 scripts) and npm run verify (91 scripts) pass.