village-builder

VB-387: Herding’s routes: the herders’ walks out of the route counters’ residual

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:

Measurement and conclusion (12 Nov 2026, agent run; nothing changed under 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).

Re-measure (16 Nov 2026, agent run; nothing changed under src/)