Command reference
oko defects assign
Gives one defect an owner or priority, or dispatches a selected product backlog to an executor in one locked register write. `oko work queue` reads the same owner field; the Desktop defect list uses the same native action. No selection silently takes another executor's work.
Invocation#
oko defects assign <id> [--owner SESSION] [--priority high|medium|low] [--json] | oko defects assign --product P --owner SESSION [--unowned] [--surface TEXT] [--take] [--priority-from-rank] [--json]Inputs and options#
- For one id, at least one of --owner and --priority. For a product, --product and --owner are required; --unowned limits the selection to nobody's defects, --surface compares the recorded surface exactly, and --take explicitly transfers holders that are not observed stopped (incompatible with --unowned). A stopped holder can be transferred only when the executor inventory observes no process. --priority-from-rank uses work queue evidence: delivery-blocking or release-unblocking work is high, ruled or class work is medium, and remaining ranked work is low.
- Example: `oko defects assign --product oko --unowned --owner <executor> --json` assigns the unowned open Oko backlog; `oko defects assign --product oko --surface 'CLI' --owner <executor> --take --priority-from-rank` names the transfers and priorities.
Output and state effect#
- One lock and one write contain every accepted assignment. Each changed defect retains an `assigned` lifecycle event and a note naming the previous holder, the new holder and the supervisor's product dispatch. Human output counts assignments per product and names every refused id and cause; JSON returns `{assigned, refused: [{id, cause}], counts: {product: count}}`. CLI, native API and Oko Desktop → Defects → Assign product backlog read the same report. The supervisor backlog uses this action with --unowned.
Refusals and safe exits#
- A missing product or owner, a stray id beside a product selector, incompatible --unowned and --take, or an unknown flag is refused by name. Without --take, a holder not observed stopped remains untouched and is listed with its id; unreadable holder, broker or process state refuses with its cause rather than guessing. Fixed or withdrawn items are not assigned. A ruled-out repair names the ruling, and a missing work rank names the item when rank priority was requested. If the register changed after selection, the affected id is refused rather than overwritten. No matching item names the selection; when every item is refused, CLI exits unsuccessfully with every cause.