village-builder

VB-783: Sleeping away: a pawn has a bed, and sim/away holds the stays (the journeys move there)

Status: done (2026-11-17) Priority: 2 Size: M Arch: far Phase: implement Design ref: design.md, Moving to new land (Settling in steps; Sleeping away from home); docs/plans/VB-445.md, section 4; design.md, Between villages: distance and journeys (A journey; Provisions and the season) Goal: A pawn can sleep at a place that is not its home and work from it, by the mechanism that already carries a journey, and nothing else is special. Acceptance criteria:

Noted by VB-445, 16 November 2026.

Implementation (VB-783, 17 November 2026)

Impact note. New module sim/away (layer agency, loaded after sim/agents, before sim/commands) owns st.away, st.awaySeq and agent.away (cache, one writer). It reads sim/agents’ walking (walkLeg, restOnRoad, turnTo, setDown, stop, waitIndoors, standBy, placeAtHome, stayOf), sim/stores, sim/hunger (ate, rationOf), sim/exchange, sim/lying, sim/relations (opinionOf, the host’s yes) and sim/grazing; it writes the stays, the packs (through sim/stores, reason away) and the gifts on the road as the journeys did. No new coupling the other way: sim/agents tells it of a leg’s end, a rest’s end on the road, a death, a move made once a load is in and an arrival at the bed by sim/events (legEnd, legDue, stillAway, moveOn, atBed), sim/heirs of a changed household (rehoused, where it called moved), sim/births of a child to place (placeBorn); sim/commands reaches it through later. So the upward calls fall by one (20 to 19: sim/births -> sim/agents went; tests/layers-baseline.json lowered). sim/agents falls from 1,511 to 1,173 formatted lines; what is left of VB-422’s split there is the attention slots (VB-251) and the legs and awake set (VB-205, VB-473); its counted exports are 37 (the nine journey exports out, nine walking primitives and the bed in).

Every reader changed for the bed (sim/agents bed(st, a): the household’s house; a lodger’s bed; on the road, where it stands; a lodger turned for home, the house):

The one test of agent.away (a.away !== undefined) replaced: sim/hunger’s onRoad (the meal), sim/help’s copy (who carries a gift), sim/offers’ copy, sim/occasions’ phases (canGo), sim/jobs’ travelling in allot (the household’s day), and the fetcher’s travelling in haulerOf; for a journey it is the same set of pawns (agent.away is set exactly while phase is ‘journey’ or ‘road’). sim/agents’ travelling (the phases) stays for what is about the road itself (placeByDoor, sim/clock’s day end, sim/lifecycle’s death on the road, the verb check free).

Decisions (Deciding without Kim):

Validation.

Found: a pawn who dies away loses its pack (the rations vanish with the stay, as the journeys did), and what is left of a pack comes home as meals though it left as grain (a ration of grain is 1 / ECON.uncooked, so a quarter of it vanishes, and grain becomes meals with no cook): noted as a teleport, with a task of the arch physical (VB-962).