{
  "schemaVersion": "1.0",
  "title": "Tasks",
  "nodes": [
    {
      "type": "nav",
      "id": "nav",
      "props": {
        "variant": "bar",
        "title": "Nano Workforce",
        "items": [
          {
            "label": "Overview",
            "page": "overview"
          },
          {
            "label": "Connect over MCP",
            "page": "mcp"
          },
          {
            "label": "Lineage",
            "page": "lineage"
          },
          {
            "label": "Convergence",
            "page": "home"
          },
          {
            "label": "Epics",
            "page": "epic"
          },
          {
            "label": "Feature",
            "page": "feature"
          },
          {
            "label": "Delivery Graphs",
            "page": "delivery-graphs"
          },
          {
            "label": "Tasks",
            "page": "tasks",
            "badge": {
              "source": "app",
              "table": "user_tasks",
              "filter": [],
              "tone": "danger",
              "refreshMs": 5000,
              "hideWhenZero": true
            }
          },
          {
            "label": "Cockpit",
            "page": "cockpit"
          },
          {
            "label": "Board",
            "page": "board"
          },
          {
            "label": "Velocity",
            "page": "velocity"
          }
        ],
        "sticky": true
      }
    },
    {
      "type": "text",
      "id": "title",
      "props": { "text": "Tasks", "variant": "heading" }
    },
    {
      "type": "text",
      "id": "subtitle",
      "props": {
        "text": "Every open native user-task escalation awaiting a human decision — feature runs, epics, PR review/merge loops, conformance reviews, and delivery-graph human/escalation gates — in one list. The \"Type\" column tells them apart; open a row to complete it via the process's own deployed form, through the nwf canonical completion door (operations/completeUserTask.ts) — recording who answered and dropping the row immediately. This list is exactly the set the nav badge counts, so a badge always maps to a visible, completable row. Rows disappear once completed (here, or out-of-band).",
        "variant": "sub"
      }
    },
    {
      "type": "dataGrid",
      "id": "user-tasks",
      "props": {
        "title": "Open tasks",
        "data": {
          "kind": "datasource",
          "source": "app",
          "table": "user_tasks",
          "filter": [],
          "orderBy": { "field": "updated_at", "dir": "desc" }
        },
        "columns": [
          { "field": "kind_label", "header": "Type" },
          {
            "field": "subject_title",
            "template": "{{subject_title}}",
            "header": "Item",
            "subtitleField": "subject_key",
            "truncate": true,
            "linkField": "subject_url"
          },
          { "field": "subject_url", "header": "Link" },
          {
            "field": "process_key",
            "header": "Process",
            "link": { "kind": "processExplorer", "keyField": "process_key" }
          },
          { "field": "updated_at", "header": "Updated", "format": "datetime" }
        ],
        "rowKey": "user_task_key",
        "detail": {
          "linkField": "subject_url",
          "fields": [
            { "field": "question", "label": "Decision context" }
          ],
          "engineForm": {
            "formKeyField": "form_key",
            "userTaskKeyField": "user_task_key",
            "completePath": "/app/api/actions/complete-user-task"
          }
        },
        "refreshMs": 5000
      }
    }
  ]
}
