Status: done (2026-11-11)
Priority: 2
Size: S
Arch: year
Phase: implement
Design ref: Work: opportunities, plans and tasks (design.md, section 7); docs/review-work.md, section 2 (Eligibility)
Goal: Who may take a job is decided by mayTake (src/sim/jobs.js:80), and Opportunities.forPawn reports a basis of its own. Make one function the answer to both, so that later bases (helper, debtor, hired) are added in one place and the basis can decide what the work books.
Acceptance criteria:
Eligibility.eligible(st, task, pawn) returns 'member', 'servant', 'villager', 'self' or null, and replaces mayTake; Opportunities.forPawn takes its basis from it. A task records the basis it was taken on.helper (VB-106), debtor and hired (slice 5) are not built here; the function’s shape leaves room for them (a table of bases, each a check, in a fixed order).tests/golden.json and the counters are unchanged, but for the new field if the golden state holds jobs (list it). tests/commands.js passes. npm test, node tests/golden.js.
Cost: as mayTake today, one check per pawn and task considered.
Notes:QUESTION_ARCHIVE.md, “VB-164: the household’s year”): written. Edits src/sim/jobs.js and its neighbours, so the slice’s tasks run one at a time, and not beside VB-227, VB-241 or VB-247.src/sim/eligibility.js (after sim/kinds in the manifest): a table BASES of [name, check] in a fixed order (servant, member, villager, self); eligible(st, task, pawn) returns the first that holds, or null. mayTake is gone; sim/jobs and sim/opportunities use it. Room for helper, debtor, hired: add a row in its place.work verb sets a.basis (cleared on release, finish, death); a new agent field.node tests/golden.js: only the new field moves: every entry agents (and idlers, which holds the agents) hash changes. Counters unchanged. Orchestrator re-records golden.a.basis), not on the job, as a job may have workers of different bases.