{
  "schemaVersion": "1.0",
  "title": "Overview",
  "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": "Overview", "variant": "heading" }
    },
    {
      "type": "text",
      "id": "subtitle",
      "props": {
        "text": "Everything currently in flight across the four dispatch surfaces \u2014 PR convergences, Epics, Feature runs, and Delivery Graphs. Each section lists only its active items, remembers whether you collapsed it, and shows a live count in its header. Follow any row to its detail page.",
        "variant": "sub"
      }
    },
    {
      "type": "button",
      "id": "agent-instructions",
      "props": {
        "label": "\ud83e\udd16 Agent Instructions",
        "variant": "ghost",
        "modal": {
          "title": "Point your agent at Nano Workforce",
          "description": "Copy this prompt and paste it into your coding agent (Copilot, Claude, etc.). It connects the agent to this instance's MCP server \u2014 the workforce's operations become native tools (including the live operator guide as `getAgentInstructions`, or its addressable companion `getAgentGuide(section?)` \u2014 preferred over the ~43KB blob to avoid tool-result overrun), so it can drive and debug your workforce; agents with no MCP client fall back to fetching the operator skill. Note: `/app/mcp` is served on the same HTTP surface as the rest of the app \u2014 reachable on loopback by default, and from a remote instance (merlin, an ngrok tunnel) only when the app is bound wide (`network.bind`) or fronted by a reverse proxy, per the MCP runbook.",
          "copyLabel": "Copy prompt",
          "copyText": "Add this running Nano Workforce instance as an MCP server, then help me drive and debug my workforce \u2014 a durable orchestration app that drives pull requests to review convergence against an automated reviewer, merges them, and can take a whole issue and plan \u2192 implement \u2192 converge it across a fleet of coding agents.\n\nRegister ONE MCP server entry per instance (streamable-HTTP transport, URL {{appBase}}app/mcp). Naming the instance makes targeting the wrong one structurally impossible \u2014 its tools are namespaced under that name:\n\n    copilot mcp add --transport http workforce-local {{appBase}}app/mcp\n\nGive each instance its own entry (e.g. `workforce-merlin` for a LAN/remote node). In config form (~/.copilot/mcp-config.json or repo-scoped .mcp.json):\n\n    {\n      \"mcpServers\": {\n        \"workforce-local\": {\n          \"type\": \"http\",\n          \"url\": \"{{appBase}}app/mcp\",\n          \"tools\": [\"*\"]\n        }\n      }\n    }\n\nIf this instance is secured with a shared secret (NANO_PR_WEBHOOK_SECRET), pass it on the MCP connection \u2014 reads AND mutations both require it (including the framework-owned mutating urban_debug_* tools \u2014 set_variables, retry_job, resolve_incident, cancel_instance \u2014 which authorize against this same x-hook-secret on a remote-exposed instance):\n\n    copilot mcp add --transport http workforce-local {{appBase}}app/mcp \\\n      --header \"x-hook-secret: $NANO_PR_WEBHOOK_SECRET\"\n\nIn config form, add a `headers` entry alongside `url` on that server (per the MCP runbook) \u2014 the config path has no header flag, so omitting this yields 401s:\n\n    \"headers\": { \"x-hook-secret\": \"$NANO_PR_WEBHOOK_SECRET\" }\n\nA Basic-Auth-fronted instance (behind a reverse proxy) additionally needs `Authorization: Basic \u2026` on the connection.\n\nMCP servers register at host startup \u2014 add the entry, THEN start a new session so its tools load. The `workforce-*` tools then appear (the full set of operations projected from this instance's OpenAPI contract, including the live operator guide itself as the `getAgentInstructions` read tool \u2014 or its addressable companion `getAgentGuide(section?)`, which the MCP runbook recommends over the ~43KB blob to avoid tool-result overrun \u2014 plus the `urban_debug_*` family for inspecting a wedged instance's process instances, wait states, and incidents).\n\nThe instance's operations are now native tools. Ask, naming the instance: \"Using workforce-local, show what's in flight and any open escalations.\" It should call the status tool, not curl. Operator-only doors (the delivery-graph stage/dispatch/dismiss lifecycle \u2014 the human click IS the approval) are deliberately not tools.\n\nNo MCP client? The curl path is unchanged \u2014 fetch and follow the live guide (the response is JSON with a `skill` markdown field), adding `-H \"x-hook-secret: <secret>\"` if this instance is secured:\n\n    curl -sS {{appBase}}app/api/agent/skill\n\nThat skill bootstraps you to this instance's live operator guide at {{appBase}}app/api/agent (the same guide MCP exposes as `getAgentInstructions`, or section-addressably as `getAgentGuide`). If you find a bug or a stuck process, the guide explains how to raise an issue or a PR against nanobpm/nano-workforce."
        }
      }
    },
    {
      "type": "dataGrid",
      "id": "overview-prs",
      "props": {
        "title": "Active PR convergences",
        "collapsible": true,
        "defaultCollapsed": false,
        "showCount": true,
        "rowKey": "pr_key",
        "refreshMs": 5000,
        "data": {
          "kind": "datasource",
          "source": "app",
          "table": "pull_requests_read_model",
          "orderBy": { "field": "updated_at", "dir": "desc" },
          "filter": [{ "field": "list_bucket", "in": ["active"] }]
        },
        "columns": [
          { "field": "title", "template": "{{title}}", "header": "Item", "subtitleField": "pr_key", "truncate": true, "width": "36%", "link": { "kind": "page", "page": "home", "keyField": "pr_key" } },
          { "field": "status", "header": "Status", "link": { "kind": "processExplorer", "keyField": "process_key" } },
          { "field": "incident_message", "header": "Incident", "truncate": true, "badge": { "tone": "danger", "label": "1" } },
          { "field": "current_round", "template": "{{current_round}} · {{active_worker}}", "header": "Round · Agent" },
          { "field": "updated_at", "header": "Updated", "width": "9rem", "format": "datetime" }
        ],
        "rowActions": [
          {
            "label": "Dismiss",
            "confirm": "Dismiss this finished PR? It acknowledges the terminal pull request and files it under History.",
            "showWhenField": "ack_open",
            "action": {
              "path": "/app/api/actions/acknowledge-pr",
              "body": { "pr_key": "{{row.pr_key}}" }
            }
          }
        ]
      }
    },
    {
      "type": "dataGrid",
      "id": "overview-epics",
      "props": {
        "title": "Active Epics",
        "collapsible": true,
        "defaultCollapsed": false,
        "showCount": true,
        "rowKey": "plan_key",
        "refreshMs": 5000,
        "data": {
          "kind": "datasource",
          "source": "app",
          "table": "plan_read_model",
          "orderBy": { "field": "updated_at", "dir": "desc" },
          "filter": [{ "field": "list_bucket", "in": ["active"] }]
        },
        "columns": [
          { "field": "title", "template": "{{title}}", "header": "Item", "subtitleField": "plan_key", "truncate": true, "width": "36%", "link": { "kind": "page", "page": "epic-detail", "keyField": "plan_key" } },
          { "field": "status", "header": "Status", "link": { "kind": "processExplorer", "keyField": "process_key" } },
          { "field": "delivery_label", "header": "Landing" },
          { "field": "wave_label", "header": "Wave" },
          { "field": "updated_at", "header": "Updated", "width": "9rem", "format": "datetime" }
        ],
        "rowActions": [
          {
            "label": "Dismiss",
            "confirm": "Dismiss this resolved epic? Its slices have all reached a terminal state \u2014 it acknowledges the epic and files it under History.",
            "showWhenField": "ack_open",
            "action": {
              "path": "/app/api/actions/acknowledge-epic",
              "body": { "plan_key": "{{row.plan_key}}" }
            }
          }
        ]
      }
    },
    {
      "type": "dataGrid",
      "id": "overview-features",
      "props": {
        "title": "Active Features",
        "collapsible": true,
        "defaultCollapsed": false,
        "showCount": true,
        "rowKey": "feature_key",
        "refreshMs": 5000,
        "data": {
          "kind": "datasource",
          "source": "app",
          "table": "feature_read_model",
          "orderBy": { "field": "updated_at", "dir": "desc" },
          "filter": [{ "field": "list_bucket", "in": ["active"] }]
        },
        "columns": [
          { "field": "title", "template": "{{title}}", "header": "Item", "subtitleField": "feature_key", "truncate": true, "width": "36%", "link": { "kind": "page", "page": "feature", "keyField": "feature_key" } },
          { "field": "status", "header": "Status", "link": { "kind": "processExplorer", "keyField": "process_key" } },
          { "field": "delivery_label", "header": "Delivery" },
          { "field": "updated_at", "header": "Updated", "width": "9rem", "format": "datetime" }
        ],
        "rowActions": [
          {
            "label": "Dismiss",
            "confirm": "Tick off this finished run? It acknowledges the run as done and files it under History.",
            "showWhenField": "ack_open",
            "action": {
              "path": "/app/api/actions/acknowledge-done",
              "body": { "feature_key": "{{row.feature_key}}" }
            }
          }
        ],
        "detail": {
          "fields": [
            { "field": "outcome", "label": "Outcome" }
          ]
        }
      }
    },
    {
      "type": "dataGrid",
      "id": "overview-delivery-graphs",
      "props": {
        "title": "Active Delivery Graphs",
        "collapsible": true,
        "defaultCollapsed": false,
        "showCount": true,
        "rowKey": "run_key",
        "refreshMs": 5000,
        "data": {
          "kind": "datasource",
          "source": "app",
          "table": "delivery_graph_read_model",
          "orderBy": { "field": "updated_at", "dir": "desc" },
          "filter": [{ "field": "list_bucket", "in": ["active"] }]
        },
        "columns": [
          { "field": "title", "template": "{{title}}", "header": "Item", "subtitleField": "run_key", "truncate": true, "width": "30%", "link": { "kind": "page", "page": "delivery-graph-detail", "keyField": "run_key" } },
          { "field": "status", "header": "Status", "link": { "kind": "processExplorer", "keyField": "process_key" } },
          {
            "field": "stage",
            "header": "Pipeline",
            "kind": "pipeline",
            "stages": [
              { "key": "Requested", "label": "Requested" },
              { "key": "Implementing", "label": "Implementing" },
              { "key": "PR open", "label": "PR open" },
              { "key": "Converging", "label": "Converging" },
              { "key": "Merging", "label": "Merging" },
              { "key": "Done", "label": "Done" }
            ],
            "activeField": "stage",
            "stateField": "stage_state",
            "locus": { "field": "process_key", "link": { "kind": "processExplorer", "keyField": "process_key" } }
          },
          { "field": "park_label", "header": "Parked", "truncate": true, "width": "28%" },
          { "field": "updated_at", "header": "Updated", "width": "9rem", "format": "datetime" }
        ],
        "detail": {
          "fields": [
            { "field": "process_definition_id", "label": "Definition" },
            { "field": "digest", "label": "Digest" },
            { "field": "node_count", "label": "Nodes" },
            { "field": "human_node_count", "label": "Human nodes" },
            { "field": "side_effect_count", "label": "Side effects" }
          ]
        },
        "rowActions": [
          {
            "label": "Dismiss",
            "confirm": "Dismiss this finished delivery graph? It acknowledges the terminal run and files it under History.",
            "showWhenField": "ack_open",
            "action": {
              "path": "/app/api/actions/acknowledge-delivery-graph",
              "body": { "run_key": "{{row.run_key}}" }
            }
          }
        ]
      }
    }
  ]
}
