{
  "schemaVersion": "1.0",
  "title": "Delivery Graphs",
  "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": "Delivery Graphs", "variant": "heading" }
    },
    {
      "type": "text",
      "id": "subtitle",
      "props": {
        "text": "The human front door for delivery graphs (ADR 0005). An agent composes a delivery-graph JSON and compiles it \u2014 a valid compile is STAGED here as a proposal (issue #460); the agent surface ends there and hands you a proposal to review. Paste a graph below to preview + stage it yourself: SEE the rendered plan \u2014 its mermaid diagram, the human stop-points where it parks on a person, and the side effects it will perform \u2014 and fix any path-qualified validation errors inline. Then DISPATCH is your call: the Staged proposals grid below lists every staged proposal (agent- or operator-composed); review its preview and click Dispatch on the one you approve \u2014 that click IS the approval, content-addressed to the exact graph you previewed. There is no agent dispatch endpoint to replay.",
        "variant": "sub"
      }
    },
    {
      "type": "appView",
      "id": "delivery-graphs-compose",
      "props": {
        "title": "Compose \u2192 preview \u2192 stage",
        "embed": "./delivery-graphs/embed.html",
        "standalone": "./delivery-graphs/standalone.html",
        "fill": true
      }
    },
    {
      "type": "appView",
      "id": "delivery-graphs-staged",
      "props": {
        "title": "Staged proposals",
        "embed": "./delivery-graphs/staged-embed.html",
        "standalone": "./delivery-graphs/staged-standalone.html",
        "fill": true
      }
    },
    {
      "type": "appView",
      "id": "delivery-graphs-library",
      "props": {
        "title": "Library",
        "embed": "./delivery-graphs/library-embed.html",
        "standalone": "./delivery-graphs/library-standalone.html",
        "fill": true
      }
    },
    {
      "type": "dataGrid",
      "id": "delivery-graphs-inflight",
      "props": {
        "title": "In-flight delivery graphs",
        "collapsible": true,
        "defaultCollapsed": false,
        "showCount": true,
        "rowKey": "run_key",
        "refreshMs": 5000,
        "empty": "No delivery graphs in flight. Preview and Dispatch one above.",
        "data": {
          "kind": "datasource",
          "source": "app",
          "table": "delivery_graph_read_model",
          "orderBy": { "field": "updated_at", "dir": "desc" },
          "filter": [{ "field": "list_bucket", "in": ["active"] }]
        },
        "tabs": [
          { "label": "In-flight", "filter": [{ "field": "list_bucket", "in": ["active"] }] },
          { "label": "History", "filter": [{ "field": "list_bucket", "in": ["history"] }] },
          { "label": "All", "filter": [] }
        ],
        "columns": [
          { "field": "title", "template": "{{title}}", "header": "Graph", "subtitleField": "run_key", "truncate": true, "width": "18%", "link": { "kind": "page", "page": "delivery-graph-detail", "keyField": "run_key" } },
          { "field": "status", "header": "Status", "truncate": true, "width": "10%", "link": { "kind": "processExplorer", "keyField": "process_key" } },
          { "field": "process_key", "header": "Instance", "width": "8%", "truncate": true, "link": { "kind": "processExplorer", "keyField": "process_key" } },
          {
            "field": "stage",
            "header": "Pipeline",
            "kind": "pipeline",
            "width": "18%",
            "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": "12%" },
          { "field": "node_count", "header": "Nodes", "width": "5%" },
          { "field": "human_node_count", "header": "Human", "width": "5%" },
          { "field": "side_effect_count", "header": "Effects", "width": "6%" },
          { "field": "created_at", "header": "Dispatched", "width": "7%", "truncate": true, "format": "datetime" },
          { "field": "updated_at", "header": "Updated", "width": "6%", "truncate": true, "format": "datetime" }
        ],
        "detail": {
          "fields": [
            { "field": "process_definition_id", "label": "Definition" },
            { "field": "digest", "label": "Digest" },
            { "field": "phase_node_id", "label": "Parked node" }
          ]
        },
        "rowActions": [
          {
            "label": "Save to library",
            "confirm": "Save this dispatched delivery graph to the reusable library? Its stored graph is copied into the Library (source: from-dispatched) so it can be reused later.",
            "showWhenField": "title",
            "action": {
              "path": "/app/api/actions/delivery-graph/library/save",
              "body": { "name": "{{row.title}}", "digest": "{{row.digest}}" }
            }
          },
          {
            "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}}" }
            }
          }
        ]
      }
    }
  ]
}
