Status: done (2026-11-23) Priority: 3 Size: M Arch: life Phase: implement Design ref: design.md, Parity of command; docs/architecture/target-v2.md, sections 3.2 and 4.1 Goal: Implement shared work selection and explicit completion of queued commands for the existing verb, job and player queue systems. Acceptance criteria:
Notes:
sim/commands perform gives done, refused(why) or pending(ref), and issue (true or the reason) shares its one
path (refusal, then carry). A verb with a lasting act registers active(st, cmd, ref); frees replaces the queue’s verb names for “leaves the job in hand”.agent.assigned (sim/attention) numbers each taking, full or side, three numbers per pawn whatever
its history. A command begun before VB-1405 (no ref) goes on while any slot holds a job of its key; its old rule read the full slot only.appraise (sim/jobs) for the matcher (bid, canTake, with its reach rule matchBar) and the Actions list (with
takeBar: the player may still order a task that takes a held one out of reach); workCommand builds the command for both.tools/same.js --base 0178ac4 (founders, heirs, populous; seeds 7, 42; small, 3 years) differs only in agent.assigned; counters unchanged;
jobs matching 53 to 66 ms a day against 55 to 63 at the base, the same calls: within the runs’ spread. sim/agents over 700 lines: VB-1487 splits it.Today sim/opportunities builds player-facing work rows using eligibility, fit and verb checks. sim/jobs separately searches candidates and directly issues work to the matcher’s chosen pawn. Player choices enter a FIFO in sim/player. sim/commands.issue calls the registered check and run, discards the run result, and returns true or a reason. sim/player.LASTS then infers duration from mutable pawn state. Its work predicate reads the main job even though sim/agents can also claim partial and background work.
Start with src/sim/opportunities.js (work), src/sim/jobs.js (fit and the work issuers), src/sim/commands.js (issue), src/sim/agents.js (the registered work verb, hold and release), and src/sim/player.js (LASTS, queue, playerStep and unqueue). Trace the save path and the callers of issue before changing the return contract. Existing tests/commands.js, tests/opportunities.js, tests/player.js and tests/attention.js exercise the public entry points.
Keep candidate evaluation separate from selection policy. The player chooses and the matcher ranks. Share the job-level logic at the point where each already has a candidate. Building every UI row for every simulated pawn would add work to the matcher. Preserve UI-only previews for work that has yet to be posted.
Let each domain register or supply its own completion semantics. The dispatcher stays independent of job and pawn modules. Only the queue needs to retain a pending reference, and the assignment owner remains the authority on whether it is live. A completed job and an interrupted assignment both release the queue. Other participants may still be working. Preserve full-work replacement and side-work coexistence when moving the current interruption logic out of LASTS.
Limit the patch to verbs, posted jobs, assignments and queue integration. Project selection, offer or gift lifecycles, and a player-facing workflow editor are outside this task.