Status: done (2026-11-16)
Priority: 2
Size: M
Arch: year
Phase: implement
Design ref: Work: opportunities, plans and tasks (design.md, section 7); docs/review-work.md; design.md section 7 (projects)
Goal: Layer 3 of how a holder chooses: a head whose year is secured turns to something more, and which thing depends on who it is. An ambitious head takes land; a generous one builds for its heir.
Decided (Kim, 10 November; QUESTION_ARCHIVE.md, “VB-255: the barn as a project”): the barn and the base weights, as in the criteria.
Acceptance criteria:
fieldsWanted, up to what the hands can work; a claim on land (a stake, by the rules of the stakes as built); a farm or cottage for the heir (the heir an adult at home with no holding; the steps of a plot and a cottage as built); a barn: a second store building on the farm’s block, one per farm, built by the steps of a plot’s cottage for 40 timber and its hours, drawn on the map beside the house (src/page/, so npm run verify); a farm with a barn loses half as much grain to spoilage (ECON.storeLoss, src/sim/hunger.js) and half as much barn hay (src/sim/byre.js). @state for the farm’s barn, an invariant, and a test of both halvings.1 + ambition for the field and the claim, 1 + generosity for the heir’s farm, 1 for the barn; one draw from the stream plans (new in SYSTEMS). Made at most once a year per holder, and when a project ends. One project per holder at a time.log, personEvent, with kind, pawn and place; tests/record.js).medium-ref fixture in this checkout and the machine shared, so its time is left to the nightly bench; the counter aimMenu counts each menu, and the menu is computed only for a head with a surplus and no project (tests/aims.js); verify’s hard checks pass) Cost measured at medium-ref: the menu is computed only for a holder with a surplus and no project. npm run verify’s hard checks pass, its targets reported with their residuals.
Cost: holders with a surplus × 1 a year × at most 4 options.
Notes:QUESTION_ARCHIVE.md, “VB-164: the household’s year”): written. Edits src/sim/jobs.js and its neighbours, so the slice’s tasks run one at a time, and not beside VB-227, VB-241 or VB-247.sim/aims (agency layer, after sim/heirs), the head’s layer 3; it hears
sim/plans’ new event planReviewed (emitted at the end of a household’s review) and stepDone, reads the plan’s targets, the
stores, Traits.of (ambition, generosity), heirRanking, pickField, pickMeadow, findSite, and acts only through verbs: the
existing project (field, meadow) and two new ones in sim/commands, barn and heirFarm. New state: plan.aim (sim/aims),
farmstead.barn (sim/building), household.workHours (sim/agents); the stream plans (sim/rng, made at the load of an older save);
the record’s kinds projectTaken, projectDone (kept for good, in the chronicle’s land group). Rules: BUILD.barn {timber 40, hours
30/60/30 as the cottage’s stages, loss 0.5}. AIMS {years 1.5 (MARRIAGE.means), idle 1/3, base 1, heirs 2} in sim/aims.
surplusOf): at the first review on or after the autumn count (HERD.countDay) each year, and at the first review after
a head’s project ends: the plan’s fields, the season’s woodpile goal and (with herds) the hay for its winters met; food (grain, sheaves,
meals, larder) less the grain reserved at least 1.5 years of the household’s need; and its hands idle over a third of the last season’s
work hours. The idle share reads household.workHours [season, hours, last], which sim/agents adds to as each task’s work is
reckoned (settle, one addition a hand), against hands × 12 work hours × 12 days.menu, computed, never stored; only for a head with a surplus, no project and no hold on projects): a field while it has its
fields and fewer than its hands can work (targets.workable) and pickField finds a tile; a claim, a new hay meadow staked by the
stakes as built (pickMeadow, the meadow project); the heir’s farm: a plot of the household with the plot’s and cottage’s steps as
built (sim/expansion’s plot, held by the household: plot.by, plot.village; allotted to the heir it was cleared for, or to nobody);
a barn: three steps at the house (barnbase, barnwalls waiting for its 40 loads of timber felled in the village’s wood, as a cart’s
or a boat’s, barnroof), one a farm, drawn behind the storehouse (src/page/settlement.js). A barn multiplies the day’s grain loss
(spoilGrain) and barn hay loss (spoilHay) by BUILD.barn.loss.choose): weights base × lean (field and claim 1 + ambition, the heir’s farm 1 + generosity and base 2 with two or more
ranked heirs, the barn 1); one draw from plans. The project is the household’s project plan (VB-123); the head’s is watched at
each review: food under the measure starts shortSince, and a season of it drops the plan (Plans.drop, reservations released, its
stakes dropped) with a notable projectDropped of the head; an impossible step is dropped by sim/plans as before.projectTaken and projectDone, personEvent of the head and log with the household’s place.sim/kinds’ landProject posted a household’s open project step as its own task; a plot’s first
step has places, not a place, so the heir’s plot made a task on no tile (NaN), whose walk stalled the legs’ due-queue (a crash in
unleg at seed 11, year 5). It now leaves a plot to plotWork, as every plot (test in tests/aims.js). The barn’s stages finish for
the task’s owner, not the household of the hand that ends it.sim/agents’ settle), not by the matcher, since the matcher hands out tasks and does not know how long they are worked; hands are
14 to 59 and not retired, as sim/drying counts them; (5) the barn stands on the house’s tile (the farm’s block), drawn behind the
storehouse; (6) the heir’s plot does not count against the village’s two plots at a time; (7) the yearly look is at the first review on or
after the count day, through the year’s end.tests/aims.js (new, verify’s integration tier, beside tests/traits.js): a barn halves the day’s grain and barn hay lost; the idle share from household.workHours,
across the season’s turn; a surplus and its menu, the weights by ambition, the draw at its least, its most and past the first weight;
the review takes the barn, tells it of the head and household, and takes no second; its three stages built (by a neighbour’s hand), the
barn stands and its finish is told; a field taken, the food gone, kept under a season and dropped after one with its reservations and
stake; no project without idle hands; the heir’s farm’s weight and the household’s plot, its tasks on tiles. Invariants: plan.aim,
household.workHours, farmstead.barn. tests/counters.json gains aimMenu (0 in the tiny probe; nothing else re-recorded).| seed | hungry (worst) before -> after | living | growth a year | stores, year 30 | top tenth’s land | new farms (for an heir) |
|---|---|---|---|---|---|---|
| 3 | 25 (17) -> 51 (18) | 602 -> 562 | 1.99% -> 1.76% | 3.70 -> 4.52 | 0.175 -> 0.168 | 59 -> 56 (7) |
| 7 | 38 (15) -> 32 (12) | 631 -> 667 | 1.98% -> 2.17% | 3.46 -> 4.11 | 0.182 -> 0.153 | 51 -> 49 (2) |
| 11 | 19 (3) -> 39 (11) | 578 -> 553 | 1.95% -> 1.80% | 3.52 -> 3.92 | 0.188 -> 0.178 | 64 -> 60 (4) |
| 42 | 13 (5) -> 7 (3) | 641 -> 679 | 2.07% -> 2.26% | 3.50 -> 4.52 | 0.188 -> 0.169 | 41 -> 53 (5) |
Mean hungry household-days 23.75 -> 32.25, a description: one household’s bad stretch is 15 to 30 days (VB-571), and the rise is at two
seeds, the fall at two. Mean living at the end 613 -> 615; growth stays near 2% a year at every seed (target 1%). Stores at the year’s
end are higher at every seed (the barns’ halving: 65 to 93 barns built a run), and land is a little less concentrated.
Projects taken / finished (dropped) by kind: seed 3 field 54/54, claim (meadow) 202/202, heir’s farm 11/7 (2), barn 87/81 (2); seed 7
65/64, 234/234, 3/2, 95/93; seed 11 50/50, 147/146, 7/4, 68/65 (3); seed 42 51/51, 220/219, 7/5 (1), 79/75. Heads who ever had a
surplus, by skill thirds (low / mid / high): 0.46 / 0.54 / 0.30 (3), 0.40 / 0.56 / 0.43 (7), 0.37 / 0.33 / 0.27 (11), 0.38 / 0.44 /
0.25 (42): the top third reaches a surplus less often, not more, since a far-seeing head’s targets (VB-254’s projection) are higher and
so less often all met at the autumn count (inbox tuning). Land projects (field and claim) taken per 100 head-years by ambition thirds
(low / mid / high): 8.5 / 9.5 / 7.5 (3), 9.1 / 10.1 / 10.9 (7), 5.8 / 6.3 / 8.1 (11), 7.9 / 5.0 / 11.7 (42). The lean 1 + ambition moves
the share of land among a surplus head’s options only from about 0.70 to 0.79, so a seed’s draws can reverse it (inbox tuning).
Idle share by season (seeds 3, 7 and 11, 10 years; spring / summer / autumn / winter): 0.42 / 0.48 / 0.32 / 0.69, 0.43 / 0.47 /
0.34 / 0.71 and 0.45 / 0.49 / 0.35 / 0.71; households idle over a third: 0.66 / 0.74 / 0.31 / 0.90, 0.73 / 0.69 / 0.41 / 0.90 and 0.71
/ 0.75 / 0.42 / 0.92. Walking counts as idle.
No parameter runs were spent; one version measured.
node tests/run.js verify --verbose, after merging the run’s branch at 4a54ae1): 8 out, as at the branch’s tip
(counters/heirRank, roundRank; scaling.roundPairs, roundWalk, heirRank, takeInWeighed, frontTile, roundRank); none
moved by this task (scaling.helpBid 1.077 as at the tip; before that merge it read 1.321 against the older tip’s 1.077, which the
merge’s later work brought back); aimMenu new, 0 in the probes. node tests/smoke.js fails its four clock
lines at the branch’s tip as here (the clock under a loaded machine); node tests/browser.js passes. Screenshot: docs/img/vb-255-barn.jpg
(populous small seed 7, year 3: farms with a second barn behind the storehouse).npm test passes; npm run verify fails one script, tests/traits.js (“nursling 9 is not
her child born within the term”, a nursing invariant), which fails the same at the branch’s tip without this task.sim/expansion handToVillage, by the verb plotToVillage and the event projectHanded, which
sim/plans hears to move the record and sim/aims to free the head): its tiles, work and timber stay where they lie, and the village
allots it by its custom (to the heir still, where the heir can take it). Decision (inbox): to the village, not to the next child, so
that nothing built is lost and the household’s project slot is not kept on a plot its head may not have the surplus for. Invariant:
no household’s plot stands cleared with nobody to go to, and the index below holds only households’ plots. Tests: the heir dies
before the clearing ends, dies once it is cleared (at the roof), marries onto another farm, and the plot given up.
Not mended here, and older than this task: a village’s own plot with nobody to have it stands open for ever (follow-up VB-646).sim/plans leftWood; a test). Tiles are not released, since a dropped plot now passes to the village with them. A
boat’s timber at its shore still vanishes when its plan is dropped: a teleport, noted with VB-645 (arch physical).targets.ahead): decision (inbox), replacing the earlier one.st.plans.projects.heirPlots (written with the record by sim/plans; made at the
load of an older save), so livePlots reads it instead of walking the village’s farms (counter plotWalk, an entry each); findSite
is no longer called by the verb’s check (startPlot finds the site), and the menu’s call is counted under aimMenu.post (sim/jobs) refuses a task on no tile and enqueue (sim/agents) a leg due at no step, so a NaN fails where it is made;
builtTiles (sim/fields) and the holdings report (sim/claims) read the households’ plots; a plot’s number is one past the highest of
the village’s plots built and under way. tests/aims.js stays in verify’s tier (the notes said fast: corrected).| seed | hungry (worst) before -> after | living | growth a year | stores, year 15 | top tenth’s land |
|---|---|---|---|---|---|
| 3 | 45 (42) -> 18 (14) | 456 -> 449 | 2.12% -> 2.01% | 3.94 -> 5.19 | 0.170 -> 0.151 |
| 7 | 38 (27) -> 16 (12) | 445 -> 449 | 1.61% -> 1.67% | 3.28 -> 4.03 | 0.182 -> 0.149 |
| 11 | 35 (21) -> 0 (0) | 442 -> 436 | 2.09% -> 2.00% | 4.28 -> 4.98 | 0.196 -> 0.177 |
| 42 | 5 (3) -> 32 (22) | 492 -> 474 | 2.35% -> 2.10% | 3.66 -> 4.81 | 0.179 -> 0.170 |
Mean hungry household-days 30.75 -> 16.5, a description (one household’s stretch swings it). Projects taken / finished (dropped): seed 3 field 49/49, claim 152/152, heir’s farm 9/7, barn 66/58 (2); seed 7 34/33, 120/120, 4/3, 56/55; seed 11 40/40, 109/109, 6/3, 46/46; seed 42 32/31, 127/127, 9/5, 68/62 (3); an heir’s farm taken and not finished passed to its village or was under way at the end. Heads who ever had a surplus, skill thirds (low / mid / high, heads): 0.33 / 0.51 / 0.73 (6 / 132 / 11), 0.13 / 0.52 / 0.44 (8 / 130 / 9), 0.56 / 0.42 / 0.20 (9 / 137 / 10), 0.43 / 0.51 / 0.80 (7 / 153 / 5): now higher in the top third than the bottom at three seeds of four (before the revision, at none). Land projects per 100 head-years, ambition thirds low / high: 7.6 / 18.5, 19.0 / 7.9, 16.5 / 9.8, 6.7 / 22.3. Idle share by season (spring / summer / autumn / winter): 0.41-0.47 / 0.48-0.51 / 0.32-0.36 / 0.68-0.73.
node tests/run.js verify --verbose): 8 out, as at the tip
(counters/heirRank, roundRank; scaling.roundPairs, roundWalk, heirRank, takeInWeighed, frontTile, roundRank); new and
in: aimMenu, plotWalk (0 in the probes). npm run verify passes, 117 of 117. node tests/smoke.js fails its four clock lines at the
tip as here; node tests/browser.js passes. The screenshot docs/img/vb-255-barn.jpg is retaken closer: the farm in the middle and the
one at the top right have the second barn behind the storehouse.medium-ref is owed in VB-662; the ambition bar and seed 42’s hungry days are VB-663, items 2 and 3.