Status: done (2026-11-22)
Priority: 2
Size: M
Arch: fair
Phase: implement
Design ref: Exchange, The fair: barter between villages (10 Nov); docs/architecture/target-v2.md, sections 4.5 and 5.1 to 5.4
Goal: Kim, 10 Nov: a barter economy until coin, and the fair is the one its gathering bears. Households of different villages exchange what their places give.
Acceptance criteria:
sim/stores with a good and a reason, custody from load to load, and the residual in customary worth is booked between the two pawns who dealt.accept = floorOk && gain + allowance >= 0 for both, with needValue for gain (sim/exchange, VB-299; target-v2’s Needs.value); a keeping good counts at its worth up to 30 rations’ worth held; a hard bargain (propriety) is allowed and booked as a breach (VB-299).src/sim/rng.js), first to those they hold a balance with, then to 4 others present, on each of the 3 days; one pawn deals for its household, from its load (30 rations’ worth on the back; the cart’s 90 and the animals that walk moved to VB-1478, 22 Nov); the work grows with those present, not with their pairs (rule 2), and has a counter.tools/balance.js and --report hunger): hungry household-days, spoilt grain, the stores of the richest tenth, by household and not only on average. A small fair is an accepted result (The fair, A small fair is the right result).
Notes:medium-ref not measured: the fixtures are made at night.sim/fair (gathering is near its 700 lines): the load is pawn.load, packed from the store through sim/stores (reason fair) by the household’s first goer of 16 or more as it sets out (gatheringSetOut, emitted by sim/gathering beside the lodging and the call), and put back once it is home after the gathering. (2) What is packed: the goods whose quantum costs the household least by need against custom’s worth, while that cost is at most its worth (its margin), up to a back load less 10 (a sack’s room for what it takes: a full load could take nothing heavier). (3) A deal’s allowance is a rule of its own, dealAllowance (sim/exchange): goodwill and opinion only, the terms the gift’s allowance shares; the gift’s other terms (grain above the floor, the reserve) size a gift and would let a rich stranger accept any deal (target-v2 5.2: strangers near zero). Close call. (4) A keeping good is given up at its worth at least, as anyone takes it at its worth, and nobody proposes one keeping good for another it needs no more than what it gives: without them tar and hides went round the green between friends. Close call. (5) floorOk counts the load as the household’s food; a deal never touches the store at home. (6) Proposals: each dealer once a day, in the hour its place by id gives it (10:00 to 16:00), to its partners present and then 4 drawn at random (stream fair); the best deal for itself among one quantum against the whole quanta nearest its worth either way; a refused one is no slight (no memory). Failed for want of change: refused, but both would take it at the exact ratio of worth. (7) Animals and the cart’s 90 are VB-1478. (8) A dealer who dies on the road leaves its grain lying (sim/lying); its other goods are lost, counted.sim/away); the load a household means to exchange is this task’s, on the goers lodged at the host’s farms or coming from home each day.Needs.value is needValue in src/sim/exchange.js (VB-299), beside propriety for the hard bargain.docs/review-markets.md; QUESTIONS.md, “VB-183: the gathering, the fair and goods of place”). Its numbers were settled by Kim’s answers of 10 November (QUESTION_ARCHIVE.md, “VB-183”; design.md, sections 8, 9 and 11).medium-ref.swap (VB-690), and it is freed from the gathering (Kim): any two pawns may swap who are in one place, each with its load in its custody, and each carries its own away. The gathering is where strangers have loads together; a visit does the same for two. A swap is never agreed at a distance, though the ask travels at once: a pawn does not judge goods it has not seen. This presence check is part of the basis from the start; the trading trip as a pawn’s own act (a load taken to a named household between gatherings) waits for the visit, VB-289 and VB-292. The fifth criterion’s ‘its allowance does not bind it’ is VB-690’s rule for every played pawn. Waits for VB-690.