Flow lines¶
Design the organization's steps and the transitions between
them. The board's step groups are these steps. Read
Flow lines first for kinds, fallbacks
and handoffs. Source: services/flowlines/flowlines.jac.
The flow line¶
GetFlowLineMeta¶
Read-only: a GET must not write, so a workspace with no box yet reports the defaults without creating one.
Body field: none.
Reports {"name": "...", "template_key": "..."}; with no flow line yet,
{"name": "Flow line", "template_key": ""}. An empty template_key means the
steps were drawn from scratch. GetWorkspace carries
the same two values as flow_name and template_key.
RenameFlowLine¶
| Body field | Type | Default |
|---|---|---|
name |
str |
"" |
Reports {"name": "<name after the write>"}. A blank name changes nothing
but still reports the current name (and creates the box if there was none).
GetFlowLine¶
The org's steps, each carrying how much work sits on it; project_id
narrows the count. Computed here so the placement rule (step first, then
the legacy status fallback) has one implementation for board and view.
The count is over the working set (done_days, as on the board), so
only that is loaded. with_counts=False skips the walk: the board
counts the rows it already holds, so its 60 s poll need not pay for it.
| Body field | Type | Default |
|---|---|---|
project_id |
str |
"" |
with_counts |
bool |
True |
done_days |
int |
7 |
Reports one list of StepView in sort_order, each with
task_count filled in (tasks placed by the board's fallback rules count too)
and task_titles, the first two titles in the step's panel order (what a node
shows at the flow line page's closest zoom). With no flow line, [].
- The count is over the board's working set: open tasks plus Done tasks that
reached Done in the last
done_days(default 7), so the done step counts recent Done the way the board's Done group shows it, not the whole history. The titles come from the same set, so they are the first two rowsListStepTaskswould page for that step. project_idcounts only that project's tasks. A foreign id still lists the steps, with every count at 0 and no titles.with_counts: falseskips the task walk (the board's poll uses it): every count is 0 and everytask_titlesempty.
ListStepTasks¶
One page of the work sitting on one step, for the panel the flow line
view opens. Placement reuses GetFlowLine's rule over the same working
set (done_days) so list and count never disagree; the walk touches
node fields only and the page alone is hydrated. total is the whole
step, so the header can keep counting.
| Body field | Type | Default |
|---|---|---|
step_id |
str |
"" |
project_id |
str |
"" |
done_days |
int |
7 |
page |
int |
1 |
page_size |
int |
0 |
The flow line page's step panel: the tasks sitting on one step.
Reports one TaskPage ordered by sort_order:
page_size defaults to 50 and is capped at 500, and older is always 0. The
rows come from the same working set GetFlowLine counts (done_days), so
the panel and the node's count agree. An unknown or foreign step_id or
project_id reports an empty page.
ApplyTemplate¶
Seed the org's flow line from one template, atomically. Idempotent by refusal: with any step already present the existing flow line is reported instead, so a double-click cannot overlay two flow lines.
| Body field | Type | Default |
|---|---|---|
template_key |
str |
"" |
Seeds an empty flow line from a template in one call. The templates today are
simple (shown as Simple) and jaseci (shown as Software team); see
Templates.
Reports one list of StepView:
| Situation | Reported | Written |
|---|---|---|
| Steps already exist | The existing steps | Nothing |
Unknown template_key |
[] |
The empty box only |
| Success | The new steps, with transitions | Steps at sort_order 1024, 2048, ... with their entry rules; transitions with labels, carries and triggers; template_key; the template's roles, if it has any (existing names kept) |
Existing tasks are not touched; tasks with no step start landing on the new steps through the status fallback.
Steps¶
SaveStep¶
Empty step_id creates; otherwise updates the addressed one. Update is partial on purpose (empty means keep): the inspector edits one field at a time and must not blank the others.
| Body field | Type | Default | Description |
|---|---|---|---|
step_id |
str |
"" |
|
name |
str |
"" |
|
kind |
str |
"" |
|
color |
str |
"" |
|
owner |
str |
"" |
Empty means "keep", like every field here; a space clears it. |
blurb |
str |
"" |
|
x |
float |
0.0 |
|
y |
float |
0.0 |
An empty step_id creates a step at the end of the flow line; otherwise it is
a partial update where empty fields keep their value.
Reports one StepView.
No-op when creating with a blank name, or step_id is set but unknown or
foreign.
| Field | On create | On update |
|---|---|---|
name |
Required | Empty keeps |
kind |
Invalid or empty becomes active |
Invalid or empty keeps. A real change re-maps the status of every task on the step. |
color |
Empty uses the kind's default colour | Empty keeps |
owner, blurb |
Stored trimmed | Empty keeps |
x, y |
Canvas position; outside 0..20000 becomes 0 | Ignored: use MoveStep |
MoveStep¶
Persist the designer position after a drag, fired on mouse-up.
| Body field | Type | Default | Description |
|---|---|---|---|
step_id |
str |
"" |
from find_step |
x |
float |
0.0 |
|
y |
float |
0.0 |
Reports the moved StepView. Coordinates outside
0..20000 (or not finite) become 0.
SetStepRules¶
The step's entry rules, both sent every time: a task lands here only
with a due date (needs_due_date) and a linked PR (needs_pr). Tasks
already sitting here stay; the rules gate the next move in.
| Body field | Type | Default | Description |
|---|---|---|---|
step_id |
str |
"" |
from find_step |
needs_due_date |
bool |
False |
|
needs_pr |
bool |
False |
Reports the updated StepView. Both rules are sent
every time. They gate every move onto the step: MoveTask and UpdateTask
leave the task where it is and report its view with refused set (for
example "Ready needs a due date"), CreateTask creates nothing, and a
GitHub trigger leaves the task and logs Stayed on <step> · <reason>. Tasks
already on the step stay.
DeleteStep¶
Removes the step and every transition into it (its own go with it); any task on it falls back to its status. Refuses to remove the LAST start or done step: an org with no way in or out has a board work cannot leave.
| Body field | Type | Default | Description |
|---|---|---|---|
step_id |
str |
"" |
from find_step |
Reports one dict:
{ "ok": false, "error": "last_of_kind", "message": "This is the only done step. Give another step that kind first, then delete this one." }
The guard applies to the last start and the last done step. On success,
tasks on the step keep their status and lose their step_id (so they fall back
to the first step of that kind), and every transition into the step is removed.
DeleteFlowLine¶
Removes every step and transition so the flow line can be designed again. Walks the caller's own root (no jid input, nothing to owned()-check). Tasks fall back to their status as after DeleteStep; name and roles stay; the template marker is cleared so a scratch redo does not report it.
Body field: none.
Wipes every step so the flow line can be designed again.
Reports {"ok": true, "deleted": <number of steps>}.
Side effects clears step_id on every task that was on a removed step
(statuses stay), deletes the steps and resets template_key. The flow line's
name and the roles stay.
Transitions¶
LinkTransition¶
Draw a transition from_id -> to_id, both ends owned-checked. Loops and branches are legal; a self-loop is refused and a duplicate reports success.
| Body field | Type | Default | Description |
|---|---|---|---|
from_id |
str |
"" |
|
to_id |
str |
"" |
|
label |
str |
"" |
What has to be true to cross. Optional. |
carries |
str |
"" |
"issue" or "pr" (CARRY_KINDS); anything else is stored as untagged. |
trigger |
str |
"" |
What moves a task across on its own (TRANSITION_TRIGGERS), and the arrow's GitHub label (what a "label" trigger waits for). |
github_label |
str |
"" |
Draws the transition from_id to to_id, or redraws an existing one.
Reports {"ok": true, "linked": true, "duplicate": <bool>}, or
{"ok": false, "error": "not_found"} when either end is not an owned step, or
{"ok": false, "error": "self_link", "message": "A step cannot flow into itself."}.
- A new target is appended to the source step's
transitions. - An existing target (
duplicate: true) is updated in place, and here an empty label or carries keeps the old value. carriesother thanissueorpris stored as empty.triggeris one ofTRANSITION_TRIGGERS(label,pr_merged,changes_requested) or empty.github_labelis the arrow's GitHub label (at most 50 characters) whatever the trigger: alabeltrigger waits for it, and a repo with label sync writes it when a task crosses the arrow.
LabelTransition¶
Set or clear what has to be true to cross an existing transition, and what it carries and what moves a task across on its own. Unlike LinkTransition, empty here means CLEAR, the only way to take the wording, the trigger or the GitHub label off an arrow without deleting it. The editor saves every field together, so all are always sent.
| Body field | Type | Default | Description |
|---|---|---|---|
from_id |
str |
"" |
|
to_id |
str |
"" |
|
label |
str |
"" |
|
carries |
str |
"" |
|
trigger |
str |
"" |
|
github_label |
str |
"" |
|
keep_label |
bool |
False |
Leave the GitHub label on once the task moves past this arrow's step. |
Sets or clears the label, the carries tag, the trigger and the GitHub label
on an existing transition. Unlike LinkTransition, empty clears.
keep_label leaves the GitHub label on once the task moves past the step the
arrow leads into (the Software team template keeps validated).
Reports {"ok": true, "label": "...", "carries": "...", "trigger": "...",
"github_label": "...", "keep_label": <bool>}, or {"ok": false, "error": "not_found"} when either
end is foreign or there is no such transition, or {"ok": false, "error":
"match_required", ...} for a label trigger with no github_label.
A trigger moves a task across the arrow without a person, from the step the arrow leaves, when the GitHub sync or a webhook drain sees the fact:
| Trigger | Fires when |
|---|---|
label |
github_label is newly added to the task's issue or its linked PR (case-insensitive) |
pr_merged |
The linked PR merges |
changes_requested |
A review on the linked PR requests changes (webhook deliveries only) |
The move lands the task at the end of the target step's column, hands it to
the step's owner as a drag would, and logs Moved to <step> · <why>. A merge
that no pr_merged arrow takes still lands on the done step for a repo with
auto-done on.
UnlinkTransition¶
| Body field | Type | Default |
|---|---|---|
from_id |
str |
"" |
to_id |
str |
"" |
Reports {"ok": true, "unlinked": true} whether or not the transition
existed (idempotent), or {"ok": false, "error": "not_found"} when either end
is not an owned step.
Lookup base¶
The base the jid-addressed walkers above extend: it resolves the id, checks ownership and only then visits. It is not an HTTP endpoint.
find_step¶
Lookup base: resolve the jid once, verify org parentage, then visit. MoveStep and DeleteStep subclass this; walkers needing Root entry repeat the resolve + isinstance + owned triple. Resolution is NOT authorization.
| Field | Type | Default |
|---|---|---|
step_id |
str |
"" |