village-builder

VB-221: The player’s gift from the pawn panel, with the floor’s warning

Status: done (2026-11-10) Priority: 2 Size: S Arch: life Phase: implement Design ref: Exchange, goodwill and obligations (The gift: The player’s gift, Decided 3 Nov and Agreed 8 Nov); The player and what they see (What the player sees); docs/architecture/target-v2.md, section 4.7 (offers in Exchange, the player’s fourth door); VB-182’s plan. Goal: The player’s fourth door: while it plays a holder, the pawn panel lets it give grain to any household, by the verb give with source player, as any pawn’s gift goes. Its pawn’s allowance does not bind it; below the floor it is warned, by name, who goes hungry. Acceptance criteria:

Implementation (10 Nov 2026).

Not built: who else than the holder may give for a household (the kind’s rule; today the holder only). The warning names the whole household where the feed order is “equal”, as the rule says: everyone is served last together.

Numbers: no behaviour of the simulation changes for a run without a player’s gift (node tests/golden.js: the state hashes match; the one changed entry is apiKeys / Sim, for the two new exports).

Validation (10 Nov 2026): npm test (86 scripts), node tests/golden.js, and tests/smoke.js, tests/browser.js and tests/browser-mobile.js run one by one pass; the two browser tests now play and stop through the Debug panel and find the played pawn’s buttons in the Actions sheet. tests/exchange.js has the simulation side: no warning down to the floor; 20 rations below it, the warning’s names are the feed order’s last group; asking writes nothing; the player’s gift below the floor settles. By hand, once, in real Chromium on populous tiny seed 7 (a script not kept): a gift of 5 is queued and settles, the receiver 5 richer; the draft survives the card’s refresh; giving all above the seed shows the warning, Cancel queues nothing and “Give all the same” gives it; a household of another village picked on the map is listed under “Chosen on the map”; no console errors. Not checked: the sheet on a phone beyond the mobile test’s fit and switch, and a gift to a household without a holder.