Status: done (2026-11-19) Priority: 3 Size: S Arch: animals Phase: implement Design ref: design.md, Goods and the farming year (Yield over time; Soil); docs/review-yields.md (section 4); docs/review-yields.md (section 4.2) Goal: The ratio of stock to arable matters above the soil’s cap, and a field in courses does not lose tilth for wanting less dung (Kim, 16 Nov). Acceptance criteria:
TILTH.surplus 2 in src/sim/rules.js: the most loads of manure a field takes in a year beyond what its soil asks (Kim, 16 Nov; an estimate, no source).manureWanted (src/sim/fields.js): as today, the heap goes first to the farm’s poorest field not yet sown, until its soil is at SOIL.cap. Once no field of the farm wants dung for its soil and the heap still holds a load, the job is posted for a field in the same stages the manure job takes today (not yet sown), the one with the least tilth (tilthOf, VB-717) first, for as many loads as it may still take this year. Those loads raise tilth only (manureDone already adds TILTH.perLoad a load; the soil stays at its cap; a fresh field above the cap takes surplus loads too and its soil is not lowered).fd.surplus, fd.surplusYear, or one pair; plain data, @state, owner sim/fields), read as 0 when the year is not this one; nothing resets it at the year’s turn. Invariant: 0 ≤ the count ≤ TILTH.surplus, the year ≤ this year.manure job (1 hour a load, the cart’s rates), posted by the head on the plan’s day as the others are; no new verb. A decision for the task, written in its file: whether surplus loads are as urgent as the loads to the cap (today the heap is carted before the hoe) or come after hoeing and sowing. Start with after: dung to spare must not make a household sow late. If the measure below shows no later sowing either way, keep the simpler.tests/suites.js: a farm of 3 unsown fields at the cap with tilth 0.02, 0.05 and 0 and 5 loads on the heap spreads 2 on the third, 2 on the first and 1 on the second; with 10 loads it spreads 6 and 4 stay on the heap; a field below the cap is served first; a sown field takes none; next spring each may take 2 again.TILTH.surplus tried in at most five short runs (1, 2 and 4 at the least; seeds and map named; what each gave in the task file). 2 stays unless a run shows a defect; a shortfall goes to docs/tuning.md as a row.manureWanted already walks one farm’s fields (a handful, capped by the farm’s labour) when the job is posted in spring days 1 to 6; this adds one tilthOf a field on that walk, only when the heap still holds a load and no field wants soil: at most about 700 exp a spring day at medium-ref, six days a year. No new loop, no cache; the counter of VB-717 shows it. Measured on a late save, counters reported.node tests/run.js verify --verbose before and after, a line for each target moved; tests/counters.js --update only for an intended change, said in the PR.design.md is not edited (Goods and the farming year, Yield over time, already says this); the @state line, docs/architecture/ownership.md and tools/stocks.js (the manure heap’s line: what is carted beyond the cap) kept current.Noted by VB-160, 16 November 2026.
U.manureSurplus 0.5, a flag on the job); the loads to the cap keep U.manure 1.7.manureWanted now takes st first and returns a third element (surplus or not); fd.surplus/fd.surplusYear absent read as 0, so no migration.TILTH.surplus runs (1, 2, 4), the cost counters on a late save and the verify targets are not measured here (shared machine); owed to VB-662.