Skip to content

Data graph

Every workspace is a graph under its account's root. Rows live in boxes, a container edge says who owns what, and a handful of typed edges link rows across boxes. This page is generated from models.jac where it lists fields, so it cannot drift from the code.

The shape of a workspace

Containment. Every row hangs under a box, and every box under the root. These are plain ++> edges from parent to child.

flowchart LR
    root(("root"))
    root --> projects["Projects"] --> project["Project"] --> task["Task"]
    root --> members["Members"] --> member["Member"]
    root --> roles["Roles"] --> role["Role"] --> resp["Responsibility"]
    root --> steps["WorkflowSteps<br/><small>name, template_key</small>"] --> step["WorkflowStep"]
    root --> logs["Logs"] --> day["LogDay"] --> entry["LogEntry"]
    root --> filtersets["FilterSets<br/><small>board, board_set</small>"] --> filterset["FilterSet"]
    root --> runs["AgentRuns<br/><small>enabled</small>"] --> run["AgentRun"]
    root --> repo["Repo"]
    root --> conn["GithubConnection"]

    classDef box stroke-dasharray:4 3
    class projects,members,roles,steps,logs,filtersets,runs box

Typed edges. Five edges declared in models.jac link rows across boxes.

flowchart LR
    task["Task"] -- "AssignedTo" --> member["Member"]
    entry["LogEntry"] -- "By" --> member
    member -- "OnProject" --> project["Project"]
    member -- "HasRole" --> role["Role"]
    project -- "HasRepo" --> repo["Repo"]
Layout Meaning
root ++> Projects ++> Project ++> Task A task's project is its container. Every task has exactly one project, and moving a task to another project re-homes it.
root ++> Members ++> Member The roster. Members are archived (active = false), never deleted.
root ++> Roles ++> Role Org-level roles; a member holds one through a HasRole edge.
Role ++> Responsibility An AI responsibility the role carries (an AI_RESPONSIBILITIES key, such as code review), run when a task enters one of the role's steps.
root ++> AgentRuns ++> AgentRun One run of a responsibility on a task: its status and result, what the task sheet shows. The box also carries the workspace's AI switch, off until someone turns it on.
root ++> WorkflowSteps ++> WorkflowStep The flow line. The box also carries the flow line's display name and the template that seeded it.
root ++> Logs ++> LogDay ++> LogEntry The activity log task events write, one LogDay per date.
root ++> FilterSets ++> FilterSet Named sets of filters. The box also carries the board's own filters, so the board opens on them in any browser.
root ++> Repo, root ++> GithubConnection Repos and the GitHub App installation hang off the root directly.

Design rules

Boxes, made on first write

One box per kind sits under the root. Writers get or create it through a helper (projects_box(root), members_box, roles_box, steps_box, logs_box, filter_sets_box, agent_runs_box); reads look it up and return nothing when it is absent, so a read never writes. Two overlapping first writes can leave two boxes of one kind, so the cross-kind readers (projects_of, members_of, roles_of, steps_of, filter_sets_of, the task readers) merge every box while writers always take the first.

The working set is a query, the totals are tallies

The task readers push their predicates into the store's query, so a request loads only the rows it returns or counts over: open_tasks, done_since and working_tasks (the board's open plus recently Done rows), created_since for a chart's window, done_before for the "+N older" history, and the GitHub lookups by repo and number. All-time totals are kept on write instead of counted: Project.task_total, done_total and seeded_done_total (tasks created already Done, history rather than throughput), and Projects.categories. ensure_tallies fills them once for a project that has none yet (tallies_at empty) and every counting walker calls it first. A write made in a request is not visible to a pushed query later in the same request, only to the next one, so a walker that writes and then looks the same row up keeps it in a local instead.

Containment is ownership

owned(holder, target) climbs container edges, at most three hops (task, project, box; log entry, day, box; or responsibility, role, box), and compares each parent with the caller's root. Typed edges never lead to a container, so they cannot make a foreign row look owned.

Some references are stored as jid strings on purpose:

Field Why not an edge
Task.step_id Empty on tasks older than flow lines and on tasks whose step was deleted. The board falls back to status.
Task.project_id, assignee_ids The container project and the AssignedTo targets, kept in step with the edges at every write so a list row needs no hop. The edges stay the truth: owned climbs the container edge, ArchiveMember finds tasks through AssignedTo.
Task.checklist The card's own {id, text, done} items, written only by the checklist walkers.
FilterSets.board_set The saved set the board's filters came from, a hint for the menu. DeleteFilterSet clears it.
WorkflowStep.transitions A list of {to, label, carries}. Cycles are allowed, so a step can point back upstream. Deleting a step strips its id from every other step's list.
Task.reviewer_id, reviewer_name A snapshot of who was asked to review.
Task.gh_parent_repo, gh_parent_number GitHub sub-issue family. An edge would cost a traversal per row in every list.
LogEntry.task_id, member_name, project_name The log is history: names are snapshotted when the entry is written.
AgentRun.task_id, responsibility_id Like a log entry, a run outlives a deleted task or responsibility, and a task's runs are one pushed query on task_id.
Responsibility.on_steps The steps of the role it runs on, by jid; empty means all of them. A deleted step's id simply never matches.

Ids

Every node has a jid, the string the API uses as id, task_id, project_id and so on. View objects carry it as id. A walker that reports a raw node (a Project or a LogEntry) serialises every field plus the runtime's _jac_id. resolve(id) turns a jid back into a node and returns None, never an exception, for an empty, malformed, unknown or foreign id.

Not in the graph

Two collections live in the runtime's shared docs store instead, because a webhook arrives with no tenant attached:

Collection Key Holds
gh_installations installation id root_jid (the workspace that last connected it), bound_at, webhook_seen_at
gh_deliveries GitHub delivery id One queued webhook delivery, its outcome and applied_at. Applied rows are purged after about a week.

See GitHub sync.

Nodes

Project

Field Type Default Description
name str required
description str ""
active bool True
created_at str "" When it was made (SaveProject stamps it); the board and the flow line open on the earliest. Empty on a project from before the stamp, which sorts first, by name.
task_total int 0 All-time tallies kept on every task write, so no count loads the history. seeded_done_total is the Done tasks created already Done (history, not throughput). An empty tallies_at means never set: ensure_tallies fills them from one full load and stamps it.
done_total int 0
seeded_done_total int 0
tallies_at str ""
week_added dict[str, int] {} The Overview's history, kept on the same writes: tasks added and moved to Done per week, keyed by the week's Monday (history_days). An empty history_at means not counted yet; ensure_history fills it.
week_finished dict[str, int] {}
history_at str ""
keys_at str "" When its tasks' sort keys (Task.keep_keys) were last filled; empty means never, and ensure_keys fills them from one full load.

Task

Field Type Default Description
title str required
category str required
priority str required
step_id str "" The board column this task sits in, as a WorkflowStep jid. Empty on every task written before flow lines existed, and on any task whose step was deleted; the board falls back to status for those, so this is additive and old rows keep working.
status str "Backlog" Legacy column AND the semantic signal the rest of the app reads ("Done" is terminal, "Blocked" needs attention). A move keeps it in step with the step's kind, so insights, GitHub sync and the assistant never have to learn about steps.
due_date str ""
notes str ""
issue_link str ""
pr_link str ""
reviewer_id str ""
reviewer_name str ""
review_due str ""
created_at str ""
updated_at str ""
sort_order float 0.0
tags list[str] [] Free labels beside the single category; GitHub issue labels land here at import. Additive with a default, so old rows keep working.
estimate float 0.0 Effort estimate in the org's own unit (points or hours). 0 means unestimated; additive with a default, so old rows read as such.
gh_repo str "" GitHub identity. issue_link/pr_link stay the human URLs anyone can paste by hand; these are the machine key the API syncs against. gh_issue_number == 0 means "not linked to a real issue".
gh_issue_number int 0
gh_issue_state str ""
gh_synced_at str ""
gh_updated_at str "" GitHub's updated_at of the newest issue item applied here, kept monotonic so an older event can never roll a newer one back. The linked PR is a different object with its own clock, hence two.
pr_updated_at str ""
gh_parent_repo str "" GitHub sub-issue family, stamped by the sync. A parent carries its summary counts; a child carries its parent's identity. Fields, not edges: an edge would cost a traversal per row in every list.
gh_parent_number int 0
gh_sub_total int 0
gh_sub_done int 0
pr_number int 0
pr_state str ""
gh_assignees list[str] [] GitHub's own assignees on the issue, refreshed by every issue event. The card's assignees are the roster's and stay the workspace's to set; these say what GitHub thinks.
gh_labels list[str] [] GitHub's labels on the issue and on the linked PR, refreshed by the sync. A label trigger fires on one newly added to either.
pr_labels list[str] []
pr_review_state str "" The linked PR's review conversation: "requested" from a review request, then the verdict a review submits. Its own clock, because the PR's updated_at does not move when someone reviews it.
pr_review_at str ""
done_at str "" When the task last entered Done, "" while it is open. Written only by set_status; rows from before it read updated_at (done_day).
checklist list[dict[str, any]] [] The card's own breakdown: {"id", "text", "done"} in display order. Written only by the checklist walkers, never by UpdateTask.
start_date str "" When work on the task starts; the roadmap draws it to the due date.
ai_state str "" "queued" or "running" while an AI run is open on the task, else "". Kept by the run's write points through settle_ai, so a row shows it.
ai_queued_at str "" The stamp of the request that last queued a run here (settle_ai).
ai_outcome str "" The last settled review, for the row's chip: "changes", "reviewed", "failed" or "" (kept by note_ai_outcome where a run settles).
ai_comments int 0
ai_blocking int 0
project_id str "" The container project's jid and the assignees' jids, kept in step with the edges at every write point so a list row needs no hop. The edges stay the truth: owned climbs the container edge.
assignee_ids list[str] []
row_key str "" The tasks table's sort keys, so the store can order and page the history: the jid (the tiebreak), title and category as sort_text, priority as urgency, the due date with undated last (keep_keys).
title_key str ""
category_key str ""
priority_rank int 1
due_key str ""
Method Description
keep_keys() Called wherever title, category, priority or due date is written.
set_status() Every status write goes through here, so done_at stays true to the move into Done (kept while the task stays Done, cleared when it leaves) and the project's Done tallies move with it.
to_view() One task's view, hopping its own edges (the structural truth). Fine for a single task; a list reads the link fields through hydrate_rows.
row_with() The list row given names the caller already has. The row's field list lives here once; view_with adds the sheet's fields on top of it.
view_with() The full view: the row plus notes, the checklist and the GitHub-only fields. vars() of an obj is exactly its declared fields.

Member

Roles are HasRole edges to Role nodes, never names on the member.

Field Type Default Description
first_name str ""
last_name str ""
email str ""
github_username str ""
tags list[str] []
color str "" A manager-picked avatar colour (a step colour key). Empty falls back to the hue hashed from the name, so existing members keep the colour they already show.
active bool True
Method Description
full_name() The display name; the log and every view show this.

Role

An org-level role definition, seeded by ApplyTemplate and editable on the Roles tab. A member holds it through a HasRole edge, so a rename or delete reaches members on its own; a step's owner still holds the NAME.

Field Type Default
name str required
blurb str ""
color str ""
sort_order float 0.0

Responsibility

An AI responsibility a role carries (an AI_RESPONSIBILITIES key), run when a task enters one of the role's steps. on_steps narrows it to some of those steps by jid ([] means all of them); "" for model means the byllm default.

Field Type Default
key str required
enabled bool True
on_steps list[str] []
instructions str ""
mode str "comment"
model str ""
created_at str ""
updated_at str ""

WorkflowSteps

The steps' box is also the flow line's own record: its display name and which template seeded it ("" means drawn from scratch). The Roles tab keys on the template: one with a roles list brings fixed roles.

Field Type Default Description
name str "Flow line"
template_key str ""
arrows_at str "" When ensure_arrows (services/util.jac) moved this flow line's arrows to the "github_label" key; "" means not yet.

WorkflowStep

One step of the org's flow line: a named column with a semantic kind behind the user's label. The kind, not the name, is what the app keys behaviour on, so renaming never breaks anything. Position is the designer's canvas placement in px, persisted because it is drawn by hand.

Field Type Default Description
name str required
kind str "active"
color str ""
owner str "" A ROLE, not a person: "domain expert", "model", "whoever raised it".
blurb str "" One line of what happens here, in the org's own words. Shown on the card in the Lane view, where it takes the kind row's place.
x float 0.0
y float 0.0
sort_order float 0.0
transitions list[dict[str, str]] [] Outgoing transitions in draw order, one per target step: {"to": step jid, "label": what has to be true to cross, "carries": "issue" | "pr" | "", "trigger": a TRANSITION_TRIGGERS value, "github_label": the arrow's GitHub label (a "label" trigger waits for it; crossing the arrow writes it for a label_sync repo), "keep_label": "yes" to leave it on after the task moves on}.
needs_due_date bool False Entry rules: no task lands here, by hand or by a trigger, without a due date or a linked PR.
needs_pr bool False
created_at str ""
updated_at str ""
Method Description
refusal() Why a task with this due date and PR link may not land here, or "" when it may.

Logs

LogDay

One day of the log under the Logs box; its entries hang off it. Its tallies (entries, and entries per person named on them) are kept on write by note_entry / forget_entry once tallied; fill_day sets them for a day written before they existed, so no count ever loads the entries.

Field Type Default
date str required
entry_total int -1
member_counts dict[str, int] {}
tallied bool False

LogEntry

Field Type Default Description
date str required
activity str required
at str ""
task_id str ""
task_title str ""
category str ""
repo str ""
issue_link str ""
pr_link str ""
status str ""
notes str ""
member_name str ""
tags str ""
project_name str ""
sort_key str "" entry_key(): the stamp as digits, then the jid. Unique, so a page of a day is an ORDER BY plus OFFSET/LIMIT in the store.
item_count int 0 The issues an import line stands for ("Imported 12 issues from org/repo", one per day, repo and status); 0 on every other entry.

FilterSet

A named set of filters for one page, stored like FilterSets.board.

Field Type Default
name str required
page str "board"
filters dict[str, str] {}
created_at str ""
updated_at str ""

AgentRun

One run of a responsibility on a task, what the task sheet shows. It names the task and the responsibility by jid, like a log entry; run_key (see agent_run_key) is unique per task, responsibility and PR head commit.

Field Type Default Description
task_id str required
responsibility_id str required
key str required
run_key str required
step_id str "" The step the task landed on when the run was queued: a review that requests changes sends the task back only if it is still there.
status str "queued" An AGENT_RUN_STATUSES value.
pr_repo str ""
pr_number int 0
head_sha str ""
verdict str "" "comment" or "request_changes", once the review is written.
comments int 0
blocking int 0
summary str ""
review_url str ""
error str "" Why a run failed or was skipped, in words a person can act on.
model str ""
tokens_in int 0
tokens_out int 0
cost_usd float 0.0
attempts int 0 The runner's bookkeeping: tries so far, when the claim on a running run lapses (a pod that died mid-review), and when a queued run is due (a retry waits out its backoff).
lease_until str ""
next_try_at str ""
job_id str ""
queued_at str ""
started_at str ""
finished_at str ""

Repo

Field Type Default Description
full_name str required
auto_sync bool False Auto-file new issues onto the entry step on every GitHub sync. The cursor is the newest updated_at seen, so each sync asks GitHub only for what changed since; empty means backfill.
issue_cursor str ""
auto_done bool False Merged PR moves the linked card to the done step on sync.
auto_close bool False The reverse direction: a card landing on Done closes its issue, and one leaving Done reopens it.
label_sync bool False A move across an arrow with a GitHub label adds that label to the issue or its PR, and leaving the step takes the ones not kept off.

GithubConnection

The org's GitHub App installation, singleton per root. It stores an installation id, NOT a credential: tokens are minted on demand in ghutil. pending_state is the one-shot CSRF nonce for an install round trip; without it a forged callback could bind someone else's installation here.

Field Type Default
installation_id int 0
account_login str ""
account_avatar str ""
status str "ok"
connected_at str ""
last_sync_at str ""
pending_state str ""
pending_at str ""

Projects

Boxes, one of each per root, made on first write by the *_box helpers. Every project, member, role and step hangs off its box, never off the root. The projects' box also lists every category a task carries, kept exact on write (note_category / forget_category), so no list scans for them.

Field Type Default
categories list[str] []

Members

Roles

FilterSets

The board's filters as the account left them (board, only the keys set away from their default in constants.BOARD_FILTERS), the saved set they came from, and when they were last written ("" means never).

Field Type Default
board dict[str, str] {}
board_set str ""
board_at str ""

AgentRuns

The runs' box is also the workspace's AI switch: off until someone turns it on, and nothing is queued while it is off.

Field Type Default Description
enabled bool False
enabled_at str ""
day_counts dict[str, int] {} Runs queued on the current UTC day ("2026-10-14" -> n), for AGENT_LIMITS' daily_runs; a new day replaces the old count.

Typed edges

Edge From To Source
HasRepo Project Repo models.jac:668
AssignedTo Task Member models.jac:669
By LogEntry Member models.jac:670
OnProject Member Project models.jac:671
HasRole Member Role models.jac:672

Each edge carries no fields. A task's project and a row's box are plain container edges, not typed ones.