Status: done (2026-11-08)
Priority: 1
Size: S
Arch: kin-help
Phase: plan
Design ref: Goods, production and animals (Help in hunger); Exchange, goodwill and obligations; docs/roadmap.md, section 3.1; docs/architecture/target-v2.md, sections 4.1 (rules), 4.3 (Stores), 4.4 (Relations: goodwill and allowance), 4.5 (Exchange) and 5.1; Kim’s decisions 2, 4, 5 and 14 (target-v2, section 8).
Goal: The walking skeleton: help in hunger (sim/help) re-expressed through the target’s pieces with behaviour nearly unchanged, so the rules registry, stores, goodwill and Exchange each get their first real consumer. A gift moves food through sim/stores (VB-174), books the customary residual as goodwill between the two acting pawns, and is accepted or refused by need and allowance; the pawn panel shows who owes whom and why. Design it concretely and write slice 1’s tasks.
Acceptance criteria:
QUESTIONS.md, each with a proposed answer: goodwill’s unit (customary rations) and how it decays; the culture’s curve coupling goodwill to opinion, starting from what a gift does to the tie today; the floor (seed and some days of food); the contributions to allowance and their ranges; what the pawn panel shows.design.md v0.4 (Exchange, goodwill and obligations: the gift), for Kim’s approval.ownership arch), which its implement tasks build on. Runs beside slice 2 (life), which touches other files.death.hazard take its causes from its contributions; allowance’s explain should follow the same rule.player, VB-169). The page side would follow in slice 2’s arch once the gift lands. Kim decided on 3 November that the player may go below the floor, with a warning that names who goes hungry.QUESTION_ARCHIVE.md, “VB-182”): rations, a 4-year half-life, a cap of 32; gratitude, then an old debt sours; booked and shown only in slice 1, the curves and allowance’s goodwill term switched on at the head of slice 4; the floor at seed and 20 days, the rest of the buffer as allowance’s reserve; slack, reserve and goodwill (0 until slice 4); the store books nothing, half passes at a handover; balances on the panel, and allowance on a holder’s.Run interactively (started by Kim from the app): the questions are in QUESTIONS.md (“VB-182”) and asked in the session.
Survey.
src/sim/help.js (68 lines). Each day shareFood (help.js:43, called at src/sim/clock.js:55) takes every
household whose grain above its seed reserve covers fewer than 3 days of its need, and asks for 12 days’ food: first its kin
households, closest first (kinHouseholds, help.js:15: those of members’ parents and children, then siblings), each giving what
lies above its seed reserve and its holder’s buffer (surplus, help.js:9; pawn.buffer is 20 to 60 days, drawn at birth,
src/sim/records.js:54); then the village store, which gives the rest. gift (help.js:29) moves the grain, writes the two holders’
gift events, and raises their ties (familiarity) by 0.5 each way (help.js:39); opinion does not change. At the moving round,
fillStores (help.js:59, from src/sim/lifecycle.js:128) moves a quarter of each household’s surplus to the village store.sim/stores (src/sim/stores.js) as the one writer of food: put, take and move with a good and a reason, each
writing a ledger entry on each side (gift entries name the other side by farm or village name, not by household id); help already
calls them. VB-204 (ready) folds the routine kinds into yearly totals and keeps gifts as entries, so a gift’s entry can carry its deal.sim/relations as the one writer of ties and memories: strengthenTie (relations.js:17), opinionOf (standing plus
timed memories, read in closed form, relations.js:84), the seasonal fadeRelations (relations.js:114, from
lifecycle.js:276) and forget at a death (lifecycle.js:32). Goodwill and its coupling to opinion go here.src/sim/registry.js) has one rule, death.hazard (src/sim/deaths.js:6); value allocates nothing, so the
allowance’s context must be a reused object.src/sim/commands.js:20) have no verb that moves goods; the meeting’s verbs show an actor that is a body
({settlement}), which the village store’s gift can follow.sim/heirs: transfer (heirs.js:156, a handover at retirement or death) and succession (heirs.js:287, a
widow’s), where a share of goodwill would pass.showRelations (src/page/words.js:189), from Sim.relationsOf and Sim.reasonsOf.What goodwill needs. A signed balance per pair that has dealt, with the time it was last booked and when it opened; sparse (only pairs
that dealt), capped per pawn, decaying in closed form (no daily pass), pruned at the seasonal pass that already walks the living. Measured
(fixtures at 4ee11e9, stale): 33 to 75 gifts between holders a year at populous small, seed 7 (350 to 420 living), 112 pairs in 8
years, at most 9 counterparts a pawn; one year from small-y40, 163 gifts among 129 pairs (729 living), at most 5; from medium-y60,
486 among 364 pairs (2,531 living), at most 6. A gift is about 22 rations. The scratch scripts are not kept; the numbers are in
QUESTIONS.md.
Approach. A design pass, no code: Kim answered seven questions in the session, approved the design text, then the task list and two
points on the player’s gift (questions 8 and 9, archived with the rest). Help keeps its own rules (whom it asks, in what order, for how
much); Exchange’s gift decides whether a gift goes ahead (the floor, the allowance) and settles it; sim/relations keeps goodwill and
declares allowance. Behaviour is kept first (VB-216), then the booking is added as state that nothing reads but the panel (VB-217,
VB-218); goodwill acts only from slice 4 (VB-220).
Rejected:
surplus in the last bits, so the golden file would move.
Help proposes today’s size and Exchange checks it within 1e-9 (VB-216’s note).st.contacts): reading one pawn’s balances, for the cap and the panel, would need an
index beside it, a cache with its own invariant. Mirrored per-pawn maps, like pawn.ties, with one writer, read directly.Tasks written.
| Task | Size | What | Golden | Cost line |
|---|---|---|---|---|
| VB-216 | M | the gift through sim/exchange and the verb give; the floor; allowance with slack and reserve |
unchanged | under 0.05 ms a game day |
| VB-217 | M | pawn.goodwill in sim/relations: booking, decay, cap, pruning, handovers; the goodwill term at 0 |
the booking only | under 0.01 ms; under 50 KB of JSON (restated 8 Nov: under 0.5% of the late save; VB-217’s Flag) |
| VB-218 | S | the panel: balances, a holder’s allowance with its parts | unchanged | 0 ms (page) |
| VB-219 | S | wrap-up: the probe of the balances, the cost, design against code; the arch closed | unchanged | measures the line |
| VB-220 | S | slice 4 (fair): goodwill acts: the curves and the term |
re-recorded | measured on opinionOf, which talk reads |
| VB-221 | S | slice 2 (life): the player’s gift from the panel, the floor’s warning |
unchanged | 0 ms (page) |
Slice 1’s line: under 0.1 ms a game day at the late reference, against the 200 ms of the systems built so far (roadmap, section 5.2).
Implementation notes (8 Nov 2026).
design.md section 9 gains The gift (Kim’s answers as Agreed; the gift as Exchange’s mechanism and its acceptance as Proposed); the
Help in hunger row of section 8 is no longer under revision; a version row. docs/roadmap.md section 3.1 gains the update of
8 November. VB-039’s first question is marked superseded (it was taken over by question 2); VB-106 and VB-183 have notes on what
this plan leaves them.Validation. npm test after each commit (76 scripts pass); npm run verify before the last: 89 scripts passed in 201 s. The
plan changes no code: golden file and counters unchanged.