Status: done (2026-11-25) Priority: 2 Size: M Arch: plans Phase: implement Design ref: design.md section 7, Plans at four scales (The task as a plan, Progress lives in the world, A stray pile, A load in hand); docs/plans/four-scales/README.md, 3.2 (the firewood table), 3.10 step 3, section 4 Q1, Q2 and Q4 Touches: new sim/methods; new tests/methods.js Goal: The engine that reads a task’s next leg from the world exists, is fuzzed clean, and is cheap enough to carry every kind Acceptance criteria:
sim/methods (@sys; manifest after sim/kinds and sim/legs): the nine primitives (go, fetch, work, load, haul, unload, return, wait, mind); facts read from the world (where the pawn stands, what it carries, a cart or tool held, a pile at a tile, a stage done, a store’s level), none stored on the task; and next(st, goal, pawn): 1. the rule for a load in hand; 2. the stray method; 3. the first method whose when holds, read from its last step to its first, taking the last step whose precondition holds and whose effect does not; all effects hold: done; no precondition holds: blocked, with its reason. Methods are data declared by the kind’s domain (KINDS[kind].methods); next allocates nothing on its hot path.git show 4651420:docs/mocks/plans/task/micro.js (Study A, parts 2, 3 and 5), read and rebuilt in the game’s conventions, not copied.tests/methods.js, on constructed states and seeded (a short count in npm test; the 10,000 runs of Q1 at night if slower): the firewood goal of 3.2, declared in the test, under random cuts (the night, a call, a death, an illness), two goals for one cart, two owners and piles that rot: no stuck task, no false blocked, no good outside a store, a pile or a hand; the five rows of the firewood table each a check.node tools/same.js --base REF prints same; npm run verify passes.
Notes:src/sim/methods.js (compile, next, placeOf; RULE, DONE) and tests/methods.js (1,000 runs in npm test, 10,000 at night; 10,000 run here clean, about 1 s).next(st, goal, pawn, view), the readers its caller gives (the test’s micro-world now; the game’s from VB-1775, which should add sim/methods’ game view to its Touches); the engine imports nothing, holds no state, and compiles a table of kinds (compile(KINDS)) once, so the step and every blocked reason are made at load and next allocates nothing (heap growth over 0.2M and 2M asks not proportional to the asks).when is facts (data) or the kind’s function; blocked’s reason is the first step not done, its first unmet precondition (a fact’s why, else described); a fact’s pile reads at as its place.return at ‘kept’); a load off its goal, or met, is carried home first; its owner’s store gone, it is set down where the pawn stands.node tests/methods.js --time 1000000.node tools/same.js --base f62a621 prints same.