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:
sim/away (a new module; src/owners.json, the manifest, docs/architecture/modules.md) owns st.away[], the open stays, each {id, pawn, why, bed, roof, food, from, to}, and agent.away, its index (a cache with one writer); the journeys’ code leaves sim/agents for it (VB-422 planned that split: say in its file what is left of it). st.journeys and st.journeySeq go: a save with them loads as stays (src/sim/saves.js, tests/saves.js), and invariants cover the new fields (tests/lib/invariants.js: one stay a pawn, a stay’s pawn alive, agent.away and st.away agree).src/sim/commands.js): lodge (walk to a tile and stay, with a why and a pack) and comeHome. The pack is taken as a journey’s provisions are, a ration for each day planned, at most AWAY.pack (12), from the household’s food above its seed; a household with nothing to spare sends nobody, and the verb says why.agent.away (it replaces sim/hunger’s onRoad and sim/help’s copy); what is left of the pack returns to the household’s store when it is home (the store kind ‘journey’ becomes ‘away’; tools/stocks.js gains the pack’s line).AWAY.walk (4 hours there and back) is the tunable a caller reads to choose between walking daily and lodging.lodge), roof ‘house’: what VB-289’s visit and a late carrier need. Nothing sends a guest yet.node tools/same.js --base REF prints same, or the differences are listed with their cause; tests/journeys.js passes unchanged but for names.tests/tiny.js): a pawn lodges two hours from home with a pack of 3 rations, works there two days, is absent from its household’s meals, walks home on the third with nothing left; a household at its seed sends nobody; a save in the middle plays as the unbroken run.awayMeals in VB.COUNTERS; node tests/counters.js before and after.Noted by VB-445, 16 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):
sim/agents goHome: walks to the bed (the walk home, and the day’s end: sim/clock’s 18:00 entry issues goHome).sim/agents placeAtHome, placeByDoor (dawn): by the door of the bed (bedSpot).sim/jobs score and fit (a job’s reach, the distance term): from the bed.homeSpot for an indoor task (start) and a load brought to the door (ended): both are
at the house whoever does them; idleAbout’s stroll (a lodger never idles about); sim/occasions’ hours to a feast (a lodger goes to none).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):
lodge is refused unless the household’s grain above its seed covers every day planned (at
most AWAY.pack), ‘has no food to spare for the pack’. Reason: a half pack sends the worker home midway and wastes the walk; the design
says a household with nothing to spare sends nobody (note decision).walk is the route’s hours from the house to the bed when it set
out (its estimate), kept on the stay.HEALTH.riskBelow (50), where the death roll begins to weigh it; gone hungry is a meal from the pack that fell short.moved), not at its meal: to another village its stay becomes the journey,
with what is left of its pack. The meal check covers a change it missed.AWAY is a tunable of src/sim/rules.js (pack 12, walk 4); nothing reads AWAY.walk yet (VB-784 and VB-781 will).sim/agents, reached through primitives that write the agent’s
owned fields; sim/agents reaches sim/away only through sim/events (the module order forbids a later lookup).Validation.
node tools/same.js --base cf5ea11 (founders and heirs, seeds 7 and 42, tiny, 2 years): differs only by names, checked leaf by leaf
with --keep: journeys is away (each stay gains bed: null, roof: 'none'), journeySeq is awaySeq, the travellers’ agents gain
away (the stay’s id), and the households’ ledger entries of kind journey are away. Everything else is the same.node tools/same.js --base cf5ea11 --scenario populous --seeds 7 --map small --years 1: 61 journeys in the year, 5 open at its end;
the same differences of names only, nothing else.npm run verify 178 of 178 (tests/setdown.js calls moved from sim/away now), npm test 61 of
61, node tests/smoke.js exit 0. The page is unchanged (a lodger’s line in the pawn panel only: ‘Walking to where it sleeps away’,
‘Away from home’), so no screenshot.tests/journeys.js passes with names only changed (st.journeys to st.away, the ledger kind). tests/legs.js, tests/fetch.js,
tests/help.js, tests/commons.js, tests/exchange.js, tests/grain.js, tests/commands.js likewise.tests/away.js (new, on a tiny state): a pawn lodges 2.0 hours from home at 16:00 with a pack of 3 rations (4 grain taken, uncooked),
sleeps at its bed, works the task its stay names on days 1 and 2, is out of its household’s meal (the meals taken are the others’
rations), eats a ration a day (2 awayMeals over the two days), turns home at the third meal with nothing left and walks home on the
third morning, its stay over; a household at its seed sends nobody (‘has no food to spare for the pack’); a guest sleeps at the host’s
house (roof ‘house’, a pack of AWAY.pack for 20 days asked), turns home by comeHome and brings what is left of its pack back into its
household’s meals; a save made at noon of the first day loads into a world of its own and plays on as the unbroken run.tests/saves.js: a save with st.journeys (an open journey, provisions of kind ‘journey’) loads as a stay with its index and plays on as
the save made today. tests/lib/invariants.js: one stay a pawn, its pawn alive, agent.away and st.away agree, a lodger’s bed, roof
and host.node tests/counters.js, two villages, 30 days, 889 living pawn-days): every counter the same before and after; awayMeals
0 (no journey and no lodger in the probe). Cost: a meal a day for each stay, over st.away (tens), and dayAway only when a stay is
open; no loop over pawns added (the household’s meal skips a member by its index).same.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).