Expand description
Task block: files a Kanban task for an agent, or for the backlog (the Drone real-world jobs spec §4.2).
Block config (node.data):
titlerequired. The graph’s words; each{{...}}value is quoted data (§6.2).bodyoptional, the task’s text, quoted the same way.targetoptional, the agent’s id; empty is the backlog. Written in the graph, never a{{reference}}: a value from outside must not pick who gets the work (§6.2).dedupeoptional, “one task per incident”: a second run with the same key adds a line to the open task instead of filing another. The key may be built from a reference (it only finds a task; it names no one). It is kept per node and target: another node, or the same node with another target, with the same text has its own task.
Output: { "filed": bool, "task": <number>, "work_id": "<id>" }; filed is false when the
run added a line to an open task with the same key.
A task this block files carries the drone’s tag (created_by_uid, drone:<id>), which is what
the note mode below finds it by.
Note mode: with note_task in the config the block adds a line to a task instead of filing one.
note_taskthe task’s number (12or#12), which may be a{{reference}}: it only finds a task, and the block adds to a task this drone filed and to no other (a task filed by another drone, an agent or a person is refused, whatever number is given).noterequired, the line’s text; each{{...}}value is quoted data (§6.2).
Output: { "updated": true, "task": <number>, "work_id": "<id>" }; any refusal fails the block.
Structs§
Constants§
- FILED_
BY 🔒 - Who the task’s history says filed it.
- KEY_
PREFIX 🔒 - The key line that opens a deduplicated task’s text.
- OPEN_
STATES 🔒 - The states in which a task is still open for the dedupe: it is not done, failed or cancelled.
- TASK_
KIND 🔒 - The tasks’
kind; the dedupe looks only at these.
Statics§
- DEDUPE_
LOCK 🔒 - Held from looking for an open task with the key to filing one, so two runs with the same key at once can’t both find none. Never held across an await.
Functions§
- add_
note 🔒 - Add the note to the task, which must be one this drone filed. Every refusal is an error, so a graph that tries to write on another’s task fails at that block instead of carrying on.
- compose 🔒
- The task the node describes. Pure, so the quoting and the rules are testable without a server.
- compose_
note 🔒 - The note the node describes. Pure, so the number and the quoting are testable without a server.
- file_
or_ 🔒repeat - File the task, or add a line to the open one with the same key. Synchronous end to end, so the lock covers the lookup and the insert and is never held across an await.
- find_
open 🔒 - The open task that carries
key, if there is one. - hash_
key 🔒 - A short stable hash of the key with the drone, the node and the target, so the stored line carries no text from outside and another drone, another node or another target doesn’t share the task (node ids are only unique inside one graph).
- is_note 🔒
- Whether the node adds a note instead of filing a task: it has a
note_taskwith something in it (the editor leaves an empty one behind when the field is cleared). - line_
for_ 🔒repeat - The line a repeat adds to the open task.
- owner_
tag 🔒 - The tag a task carries when the drone
drone_idfiled it. A scope outside a saved drone has none. - run