Status: done (2026-11-24) Priority: 2 Size: M Design ref: docs/ui2/HANDOFF.md (Kim’s direction, 24 November; Next); src/sim/player.js (the queue, playerStep, the sleep verb); src/sim/agenda.js; design.md, The player and what they see Goal: A player plans the day and the days ahead by hand, and the hours are scarce (Kim, 24 Nov). Acceptance criteria:
st.player.plan (plain data, saved, with its @state line, its owner and an invariant; absent in an older save reads as empty): {routine: [kind...] (job kinds seen to every day, in order), sleep: null | {from, until} (hours of the day, e.g. 22 and 6), tasks: [{key (a job's key), kind, site (its tile or -1)}] (in order, at most PLAN_MAX, about 24), day, done: [kind...] (the routine kinds seen to on game day day)}.Sim facade, Sim.plan(st, op, args), true or why not, the player’s as queue and setAuto are: add {key, at?} (a posted job the pawn is eligible for, whether or not it may take it this minute; no key twice), remove {i}, move {from, to}, routine {kinds} (kinds of sim/kinds only), sleep {from, until} or sleep null. And a read Sim.planView(st): the routine with, for each kind, whether it is done today and whether a job of it is open; the sleeping hours; the tasks with whether each one’s job still stands; and what the plan has the pawn on now (routine, task, sleep or null, with its kind or key).playerStep, only with automatic planning off (with it on the plan is kept and not followed), and only when the player’s queue is empty: a command queued by hand goes before the plan, as an order for now.
until, by the sleep verb. Work ordered by hand is not broken off: that is how a night is worked, at sleep’s cost (VB-1643).work verb and marked done for the day when begun. A kind with no job open yet is tried again later in the day.plan.last {key, kind, t}), as refused keeps the last refusal.
A plan-fed command goes through the queue and the verbs as any command does (source player), marked so the feeder and the page can tell it from one queued by hand.node tools/same.js --base REF, founders and solo).tests/plan.js on a small constructed state, in tests/suites.js: each op and its refusals; the routine is seen to once a day in order; the order of tasks is kept; a hand-queued command goes first; sleep by the plan’s hours; a finished task leaves; a save and a load keep the plan and go on the same. tests/player.js, tests/saves.js, tests/plaindata.js, tests/commands.js pass.sim/playerplan (owner of st.player.plan; nextOf the one read-only choice VB-1647 can call), so sim/player grows by the feeder only. The plan is written lazily: a pawn played with no plan has no plan field, so saves and hashes are unchanged.plan {from, kind, key}. A hand command queued behind a plan-fed head drops the plan’s commands at once (a task keeps its progress and stays planned; a routine kind begun stays done for the day). The feeder pre-checks each verb, so it never fills refused step after step.sleep (also for a pawn already in bed), so nothing else is fed then; with no sleeping hours the plan works on through the night.open in the view = a job of the kind posted for the household; the view also gives next (what would be fed) and followed (automatic off).clear:fN; seen only across a review, after the task had left).