{
  "schemaVersion": "1.0",
  "title": "Epic Coordination",
  "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": "Epic Coordination", "variant": "heading" }
    },
    {
      "type": "text",
      "id": "subtitle",
      "props": {
        "text": "Hand an issue to the fleet to plan and implement it, then open an epic to track its review trace, wave state, merge-exclusion graph, coordination notes, and trial-merge gate results.",
        "variant": "sub"
      }
    },
    {
      "type": "actionForm",
      "id": "plan-submit",
      "props": {
        "title": "Hand an issue to the fleet",
        "submitLabel": "Plan & implement",
        "action": { "path": "/app/api/actions/start/plan-fanout", "body": "{{form}}" },
        "fields": [
          { "key": "issue", "label": "owner/repo#123 or a GitHub issue URL", "type": "text", "required": true, "requiredMessage": "An issue reference is required (owner/repo#123 or an issue URL)" },
          { "key": "baseBranch", "label": "Base branch: e.g. epic/agent-protocol to land the whole epic on an integration branch. A missing epic/* branch is auto-created off default HEAD; a non-epic/* branch must already exist.", "type": "text", "required": true, "requiredMessage": "Name the branch the PR targets (e.g. main or epic/agent-protocol)" },
          { "key": "confirmDefaultBase", "label": "Confirm landing on the default branch \u2014 required only when the base above IS the repository default (every task lands directly on it, with any merge-to-default side effect firing per task)", "type": "checkbox" },
          { "key": "allowSharedBase", "label": "Allow sharing a custom integration branch with another active epic \u2014 required only when another in-flight epic already targets this same custom base", "type": "checkbox" }
        ]
      }
    },
    {
      "type": "dataGrid",
      "id": "epic-plans",
      "props": {
        "title": "Epics",
        "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"] }]
        },
        "tabs": [
          {
            "label": "Active",
            "filter": [{ "field": "list_bucket", "in": ["active"] }]
          },
          {
            "label": "History",
            "filter": [{ "field": "list_bucket", "in": ["history"] }]
          },
          { "label": "All", "filter": [] }
        ],
        "columns": [
          { "field": "title", "template": "{{title}}", "header": "Item", "subtitleField": "plan_key", "truncate": true, "width": "38%", "link": { "kind": "page", "page": "epic-detail", "keyField": "plan_key" } },
          { "field": "epic_phase", "header": "Phase", "link": { "kind": "processExplorer", "keyField": "process_key" } },
          { "field": "delivery_label", "header": "Delivery", "truncate": true },
          { "field": "task_count", "header": "Tasks" },
          { "field": "issue_number", "header": "Issue", "linkField": "issue_url" },
          { "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 (if all slices landed, raise the integration\u2192main promotion PR first).",
            "showWhenField": "ack_open",
            "action": {
              "path": "/app/api/actions/acknowledge-epic",
              "body": { "plan_key": "{{row.plan_key}}" }
            }
          }
        ]
      }
    }
  ]
}
