Status: done (2026-11-11)
Priority: 3
Size: S
Design ref: none (code structure). AGENTS.md, Conventions (Food moves through src/sim/stores.js operations).
Goal: type(holder) (src/sim/stores.js:18) names a holder by the fields it has: farmstead makes a household, center a village, and everything else a pawn. put on an agent or a farmstead object is therefore accepted and writes a stake field onto it. The module that guards food movements should refuse what it does not know.
Acceptance criteria:
type(holder) returns 'pawn' only for a pawn, by a field every pawn has and no other holder does ('stake' in holder, or the like, with pawns given stake: 0 where they are made if they are not already), and throws stores: not a holder for anything else. Households and villages are told as today.tests/stores.js holds that put, take and move throw for an agent record, a farmstead and {}, and leave them unchanged.put, take and set work the holder’s kind out once a call, not three times (pass it on).BACKLOG.md: behaviour unchanged, tests/golden.json and tests/counters.json unchanged, npm run verify’s hard checks pass, its targets reported with their residuals.
Notes:fb35e75, Stores.put(st, agent, 'grain', 3, 'gift') on an agent record {id, x, y} is accepted and leaves it with stake: 3; the same on a farmstead {id, tile, household}.small-y40) to 580 (medium-ref) store calls a game day.kind on each holder is a state field and needs its owner and invariant.Implementation notes (night run, 11 Nov):
type(holder) tells a pawn by 'given' in holder (every person on record has it, made in records.js person; households, villages, farmsteads,
agent records and herd heads do not), so no stake: 0 was added to pawns (that would change saved state). Anything else throws stores: not a holder.
Checked against tonight’s users (catch, gathering, goods registry, plan.dirty crossed): all pass households, villages or pawns.put and take call type once and pass the kind to field, record, set and crossed. What fell: two type calls per put/take
(three before) and one in test in crossed.tests/stores.js asserts put, take and move (both sides) throw for an agent record, a farmstead and {} and leave them unchanged.Validation: npm test 97 scripts passed (1 target out, scaling.roundPairs +0.85, as on the base); node tests/golden.js matches;
node tests/counters.js 0 out. npm run verify not run (size S, no page change; the night rules ask for npm test).
Orchestrator’s decisions for Kim to overturn: pawns told by given rather than a new stake: 0 field.