village-builder

VB-182: Plan: kin help, booked as goodwill (slice 1)

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:

Plan (2026-11-08)

Run interactively (started by Kim from the app): the questions are in QUESTIONS.md (“VB-182”) and asked in the session.

Survey.

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:

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).

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.