Status: done (2026-11-26) Priority: 2 Size: M Arch: plans Phase: implement Design ref: design.md section 7, Plans at four scales (Bodies and horizons, The plan record, Authors, How a step becomes work); Reasons shown; docs/plans/four-scales/README.md, 3.4 and 3.10 step 4 Touches: sim/plans (makePlan, planOf, seedPlans, reviewed, dropPlan, holdProject, headView); sim/seasonal (seasonal, begin, reviewTargets, dropSeason); sim/projects (stepOf, projectsOf, openOf); sim/jobs (post); sim/reasons (reasonOf, reasonLine); sim/saves; tests/plans.js; new tests/planrecord.js Goal: Every body’s plan is one record of steps, and every task can say which step it serves, up the chain Acceptance criteria:
Plan and PlanStep; owner sim/plans; plain data, saved, @state; an invariant that every step’s why resolves and every who is within the planner’s authority): one for every live household and village, and for a pawn once it holds a step; the order of steps is saved behaviour; a season or year step carries left (lo, mid, hi: the hours still to do by the planner’s estimate), which the labour budget (VB-1778) sets against the levies. (Done but the season steps’ left: a year step carries it; a season step’s hours by the head’s estimate are VB-1826. The invariant is in tests/lib/invariants.js.)author: 'custom'); the code that read the old parts reads the steps; the old parts go; FORMAT raised (sim/saves): a save of an older build is refused, as docs/architecture/modules.md (Saves) says; no migration is written.Sim.why(st, task) gives the chain of steps upward and Sim.plans(st, body) the record, both through the actor view; the card’s reason (Reasons shown) reads the chain.node tools/same.js --base REF differs only in the plan record’s leaves (listed) and the gate is not run; each change of behaviour is named, and then the gate applies. (same.js against 92753cf1, founders and heirs, seeds 7 and 42, tiny, 2 years: 7.2 million leaves read back through the old parts the same; the leaves that differ are the record’s: plan.body, year, season, ahead, reviewed, st.plans.pawns, stepSeq, a project step’s id, why, who, author, state, and a task’s step on jobs, agents, workDue and lying. No change of behaviour; the card’s reason line gains the chain’s top, “in the season’s plan”.)docs/plans/four-scales/README.md, 3.10), by one command: npm run verify green (a test that asserted the old behaviour updated on purpose, never skipped or quarantined, and named in the PR), and node tools/gate.js --base <the last recorded result> passing (VB-1774): no settlement extinct by hunger or collapsed (VB-1774’s bound), no more tasks held over 48 hours than the base, the stocks’ unexplained no larger. (Not run, by criterion 5: no change of behaviour; npm run verify green, tests/reasons.js updated on purpose for the card’s new line.)node tests/counters.js, --update with the entries listed); the result kept (--out) as the next task’s base. (No gate output: no behaviour change, so hunger before and after are the same runs; counters: planSteps updated, 0.0168 to 0.4526 a pawn-day. The next task’s base stays the last recorded result.)
Notes:left (VB-1826).