Status: done (2026-11-25)
Priority: 3
Size: M
Arch: debt
Phase: implement
Design ref: Exchange, Loans, obligations and cases (Grain loans; Interest and due; Overdue and default); Customs and culture, Slice 5’s practices (“Loans of grain are repaid”); docs/architecture/target-v2.md, sections 4.1 (a loan is one command), 4.5 (Exchange) and trace 7.2
Goal: Kim, 10 Nov: grain loans are slice 5’s. Help in hunger gives; a household still short after help has nowhere to turn. Let it borrow from a household with grain to spare, owing it back at the harvest with a quarter more, so lean years move grain to the hungry and debts to those with full stores.
Acceptance criteria:
src/sim/help.js; VB-308) and a household is still short of reaching the next harvest with its floor, its holder asks to borrow, once a season: from the households of its own village in order of grain to spare (most first, then by id), then from its holder’s trade partners met at a gathering (VB-302, once done).loan of offer, not a verb lend; tests/loans.js) (a verb lend in src/sim/commands.js, covered by tests/commands.js) that moves the grain through sim/stores with the reason loan and creates the obligation, or does nothing and says why.src/culture.js, read where the loan is made. The loan is due when the borrower’s next harvest is threshed (the end of autumn); it is paid then from grain above the floor, in part if it must; unpaid, it is overdue and due again at the next harvest; unpaid after the second, defaulted (VB-315 hears it).log, personEvent; tests/record.js).tools/balance.js, --report hunger): loans a year, grain lent, repaid, defaulted; hungry household-days and the worst household’s hungry share, by household and not only on average; the stores of the richest tenth. The counters re-recorded (node tests/counters.js --update), their entries listed.
Cost: a short household asks once a season and looks over its village’s households (about 30 at most), so at medium-ref a few hundred comparisons a season; the dues are in VB-310’s queue. Measured on small-y40.
Order: after VB-310. VB-315 (cases) follows.
Notes:QUESTIONS.md, VB-184, question 3). Settlers borrowing their provisions (the cities review, phase 2) is left out of slice 5.loan (VB-690: the borrower wants grain now and gives a promise), not a verb lend; and nothing teleports: the third criterion’s ‘moves the grain through sim/stores’ reads as the grain set aside in the lender’s store as the borrower’s and fetched (VB-461), and the repayment is carried back when due. Waits for VB-461 and VB-690.sim/loans (new, agency layer): the basis loan (Kim, 16 Nov), the verb repay, the obligation kind loan
(contributed through the new Obligations.kind, which replaces the KINDS export: width stays 15). Decisions: a loan is asked only by a
household help went round for (asked this season, or below HELP.askBelow days), else the well-off borrowed too; the village store is
asked after the village’s households, before trade partners; trade partners are the holder’s goodwill counterparts in another village
within a day’s walk by land (no partner record exists); the practice is a custom (DIMS of src/sim/customs.js, voted and drifting as
slice 5’s practices are, design.md), read by the borrower’s village; the repayment is set aside at the debtor’s house and fetched by
the creditor (a store’s hauled to the green), and lies for the creditor when none can fetch. Left: a store’s repayment hauled and not
finished returns to the debtor (journeys unfetched); the Debtors’ politics pull is not built (not a criterion).