wirk_write
Apply batched item and link changes atomically with revision checks to avoid conflicts. Propose context changes when needed; retry uncertain results with request_id.
Instructions
Change items and links in one atomic batch. Put the revision you read (rN) of each existing item you change or link from in expect; one left out is refused as basis_changed. Context changes apply when you may make them; otherwise they are refused with requires_review: propose them (mode propose, with a reason). After an uncertain result, resend the identical body with the request_id it names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| expect | No | {"<ID>": <revision you read>}, e.g. {"5c1e7a90": 3}. | |
| format | No | ||
| reason | No | Why: required to propose and to archive; to complete wirk, the evidence (tests, link, file path or upload ID). | |
| operations | Yes | 1-32 of: {op:item.create, ref?, data:{title, body?, work?:{owner_id?, due_at?, criteria?:[{text}]}, context?:{level, state?, steward_id?, open?}, fields?}, allow_duplicate_of?} · {op:item.edit, id, patch:{title?, body?, work?, fields?}} · {op:link.create, data:{type, from, to}}, type related_to, contributes_to, requires, cites or relies_on, from/to may be $ref of a new item; a cites quotation must match the cited text exactly, or quotation_mismatch · {op:link.remove, id} · {op:item.archive, id} · {op:item.restore, id}. work makes an item work, context makes it context (level organization or initiative); fields maps a field to an option, null clears. | |
| request_id | No | Optional; generated and named in the receipt. After an uncertain result, resend with that ID. | |
| workspace_id | No |