Status: done (2026-11-16) Priority: 2 Size: S Design ref: Rules for cost (AGENTS.md); backlog/VB-136.md, the counters’ table Goal: Since VB-136 three work counters are out per living pawn-day on the counters’ probe: routeRefresh +237%, routeExpand +51%, routeSearch +11% (and populous small seed 7 costs about 16% more a day). VB-136 already keeps a herd on one pasture; what is left is the herder’s daily walk out and back and that the herders’ cached routes are each tested by the daily refresh. Acceptance criteria:
routeRefresh) tests since herding, how many are herders’ (home to pasture and back), and why a route that has not changed is tested at all; node tools/sim.js --scenario populous --seed 7 --map small --years 3 --report counts before VB-136 (2003881), now, and after.household.pasture), and a kept route is refreshed only when a tile on it changes cost (with VB-236, if it has landed: the route cache cleared when a tile’s cost changes), not daily.counters/routeRefresh, routeExpand and routeSearch are back within their targets on the counters’ probe, or the residual is reported with its cause; tests/counters.json is not re-recorded to hide it.node tools/same.js --base REF prints same (a route found is the same route); npm test passes; ms a day at populous small seed 7, 3 years, before and after. (nothing edited; ms a day left to the nightly bench)src/sim/routes.js or src/sim/grazing.js.src/)Criterion 1 (the cause, measured). refreshRoutes (src/sim/routes.js) is not a daily test of every route: it returns at once on a day with no
changed tile (st.routeDirty empty) and otherwise adds the cache’s size to routeRefresh and tests each route against that day’s changed
tiles (a wear stage change from fadeWear, or a felled tree). So a route that has not changed is tested only on a day when some tile
changed, which is the design (a batch test per route against the day’s changed tiles, in place of an index from tile to routes: VB-236).
--report counts, before VB-136 (2003881) -> now (the merge of claude/backlog-orchestration-t73ngj):
routeRefresh 654,311 -> 729,087 (12.66 -> 14.13 a living pawn-day, +12%); routeSearch 23,106 -> 30,268 (+31%); routeExpand 595,738 ->
772,287 (+30%); routeHit 183,811 -> 179,978. By day: days with a changed tile 124 -> 137 (+10%); the cache’s mean size on those days
5,277 -> 5,322 (+1%); its size at the end 6,291 -> 6,707 (+7%). So the rise in routeRefresh is the number of days with a changed tile,
not a larger cache; routeEvict stays 0 (cap 60,000).fadeWear changes the stage of the tiles they cross (a real change of walking cost), so the routes must be tested.route() reverses the stored one)
and, with the kept pasture, across days; none is tested daily on its own account.
Criterion 2: already so for the kept pasture: a route is tested only on a day a tile changed its cost; “not daily” holds. What would cut the
test further is VB-236’s index (the routes through a changed tile, so only those are tested, instead of every cached route against each changed
tile); it has not landed and was not built here. Left for VB-236: with it routeRefresh falls to the routes through changed tiles.
Criterion 3: not met by a change; the residual is reported: routeRefresh +294%, routeExpand +44%, routeSearch +29% on the tiny probe
(from VB-136), cause as above: herders’ new activity (more route searches while a pasture is chosen) and their wear, which makes more days
with a changed tile on a tiny, nearly quiet map. tests/counters.json is not touched.
Criterion 4: no behaviour change (nothing edited), so behaviour is unchanged. ms a day: not re-measured (no change).
Conclusion: no caching fault; the residual is the honest price of herding (a walk out and back a day by one pawn a household, and the wear it
makes) until VB-236. Status left needs-review.src/)refreshRoutes empties the whole cache on a day when any tile changed cost (routeRefresh adds the cache’s size once
per such day); it tests no route one by one. So a herder’s route (home to pasture, reversed for the way back) is searched once and stays
cached until a tile somewhere changes cost; it is not refreshed daily.--report counts (per living pawn-day): before VB-136 and at VB-136’s merge, from the 12 Nov
measurement above (routeRefresh 12.66 -> 14.13; routeSearch 0.45 -> 0.59); now: routeRefresh 2.01 (104,130), routeSearch 1.44
(74,557), routeExpand 20.07 (1,037,811), routeHit 1.86. routeRefresh fell sevenfold with VB-236; routeSearch and routeExpand rose,
since the whole cache is emptied on each dirty day and refilled by searches (VB-236’s own trade, its note in routes.js).node tests/counters.js): routeSearch 1.26 (base 0.98), routeExpand 4.97 (3.81), routeHit 3.49, routeRefresh 1.80
(1.32), routeEvict 0: all within their limits (“0 in”). The four counters out are the known heirRank, roundRank, helpBid,
pastureTiles. tests/counters.json untouched.