VB-765: Strata: the heads line, the work line and the sink’s report
Status: done (2026-11-19)
Priority: 3
Size: S
Arch: town
Phase: implement
Design ref: design.md, Balance loops and targets (Strata; The balance review: The urban sink); docs/plans/VB-189.md, sections 5.8 and 7
Goal: 600 / 325 / 75 is countable, both ways, before anything is built for it, and every village’s sink is reported (Kim, 16 Nov: counted by work, all craft hours counting, heads beside).
Acceptance criteria:
tools/strata.js (starting from tools/help.js, with --help): from a run (--scenario --seed --map --years, or --load FILE), each adult’s hours of the year by kind, as tools/hours.js samples them, split as design.md, Balance loops and targets, Strata: farming (fields, hay, herds, fishing, hunting, gathering and their carrying); not farming (all craft hours, whoever the product is for; carrying to deal and dealing; service and days worked for another household’s craft); elite (the hours of an elite household’s members, 0 until VB-318’s view exists). Household work (cooking, water, firewood, grinding at the quern, building and upkeep) is printed apart and is outside the three figures (the orchestrator’s close call of 16 Nov: with it the middle figure reads 403 before anyone specialises).
The work line per 1,000 of hours worked, for the island and for each village, by decade; beside it the share of non-farm hours whose product left the household (where that cannot yet be told, the tool says so), and the heads line (households by their relation to production: elite by VB-318 when it exists, the rest by the craft’s share of their food over 3 years; today every household is a farm).
The measure, the target (600 / 325 / 75) and the residual are printed for each of the three figures, on both lines. The target is not changed and no allowance is written; the band’s width proposed by the plan (550 to 700 / 250 to 400 / 50 to 100) is printed as “proposed, not applied”.
The sink’s report for each village by decade: people, those who moved in and out, births and deaths per 1,000, M / (d - b); food received from outside its households over a person’s need, S / c; which of the two is lower.
A report entry in tests/lib/bands.js for the work line and the heads line on populous medium: reported nightly, never failing. tests/review-tools.js covers the tool’s --help and one tiny run.
Today’s numbers in the task file: populous small, seeds 7 and 42, year 30; founders small, seed 7, year 50 (expected near 1,000 / 0 / 0: fish drying and tar are a few points). The plan’s figures for comparison are a toy model’s (239 from a farm’s own crafts, 263 to 275 with makers).
Cost (rule 9): a tool, outside the simulation; nothing in a step, no new state (rule 10). If a count the tool needs is not in the record, it adds a yearly count there (rule 8), named in the PR.
Behaviour: none. node tools/same.js --base REF prints same.
Noted by VB-189, 16 November 2026.
Notes (VB-765)
Class of each job kind is a table in tools/strata.js (a test fails on a kind without one). Calls: brewing, fish drying/racking, tar, quern making, digging are craft (not farming); fell/grub, salt, slaughter, boats and carts are farming; quarry/pick, wells, mending and fetching for building are household work.
Not-farming is not ~0 today but 100 to 120 per 1,000 (brewing and fish drying), since “all craft hours” counts. The criterion’s “near 1,000 / 0 / 0” is out by that; no allowance written.
Heads: the craft’s share of food over 3 years is not measured; the tool uses the craft’s share of hours (half or more) and says so. “Product left the household” cannot be told: printed as such.
Sink: M from pawns alive at a year’s start and end in another village; S from gift entries in the 3-year ledgers whose giver is a household of another village. Populous: births exceed deaths, so M/(d-b) is infinite and S/c (2.7 to 9.3 people at years 21-30, seed 7) binds.
Bands (populous medium, nightly): work line sampled twice a day (10:00, 15:00) in runScenario, only where strata is set.
Today (every-hour samples; farming / not farming / elite per 1,000, years 1-10 and 21-30 or 41-50): populous small seed 7: 889/111/0, 878/122/0; seed 42: 897/103/0, 897/103/0; founders small seed 7 (year 50): 885/115/0, 891/109/0. Every household a farm in the heads line.