Status: done (2026-11-11)
Priority: 3
Size: S
Design ref: none (code structure).
Goal: put (src/sim/relations.js:35) decides whether a new tie at the cap is kept by if (worst < 0 ? !isKin : !isKin && w <= least) return; else if (worst >= 0) ..., and raiseTie tests !((p.ties.get(b) || 0) >= w). Both are right and hard to check by reading. Write them as their cases, with no change to what they do.
Acceptance criteria:
put: at the cap, the three cases are separate statements in this order: no tie that may be dropped (all are kin) and the new one is not to kin: not kept; the new one is not to kin and no stronger than the weakest that may be dropped: not kept; otherwise the weakest that may be dropped, if any, goes and the new one is kept. raiseTie tests (p.ties.get(b) || 0) < w.tests/relations.js (or tests/kinlimit.js) covers each case at the cap: all kin and a stranger arrives; all kin and kin arrives (kept, over the cap); a weaker stranger; a stronger stranger; kin against strangers.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:SPREAD = 73 (relations.js:31). (day + id) % every spreads the pawns over the 192 days as evenly as (day + id * 73) % every, and the next line of dailyTies already spreads the kin floor that way. Take it out with the next change to behaviour in sim/relations.fadeRelations copies a record’s memories instead of deleting keys, to keep the object out of V8’s dictionary mode, as decode in sim/saves orders its keys (both VB-205). A Map for r.mem would need neither; that is a change to saved state and a task of its own if wanted.put: the cap case is now three statements (all kin and a non-kin newcomer: return; non-kin no stronger than the weakest droppable: return; delete the weakest droppable if any, keep). raiseTie tests < w. Two lines of the existing body were merged to stay under the 400-line file limit of the lint.tests/relations.js: a block sets TS.cap to the held ties of a pawn with 3+ kin and covers all kin + stranger, all kin + kin (over the cap), weaker, equal and stronger stranger, kin against strangers, kin arriving over a stranger.node tests/golden.js and node tests/counters.js pass unchanged; npm test run once after the last edit.