{
  "schemaVersion": "1.0",
  "title": "Feature Run",
  "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": "Single-issue feature run", "variant": "heading" }
    },
    {
      "type": "text",
      "id": "subtitle",
      "props": {
        "text": "Hand one issue to a single implementation agent — it raises exactly one PR. Optionally converge (review rounds) and auto-merge as follow-on steps. The missing middle between Epics (many PRs) and PR convergence (an already-open PR).",
        "variant": "sub"
      }
    },
    {
      "type": "actionForm",
      "id": "feature-submit",
      "props": {
        "title": "Implement one issue",
        "submitLabel": "Implement & raise PR",
        "action": { "path": "/app/api/actions/start/feature", "body": "{{form}}", "successLabel": "Feature run dispatched \u2014 track it in the runs below. (A run already live for this issue is re-used, not double-started; if nothing is dispatched you\u2019ll see an error here, never a silent success.)" },
        "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: the branch the PR targets, e.g. main. 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": "customInstructions", "label": "Custom instructions (optional) \u2014 extra steering appended to the implementation agent's prompt, e.g. \u201cprefer Deno; keep the diff small; add integration tests\u201d", "type": "text" },
          { "key": "converge", "label": "Converge \u2014 hand the raised PR to the review-convergence loop", "type": "checkbox" },
          { "key": "autoMerge", "label": "Auto-merge \u2014 after convergence, drive the merge-loop (only applies when Converge is on)", "type": "checkbox" },
          { "key": "confirmDefaultBase", "label": "Confirm landing on the default branch \u2014 required only when the base above IS the repository default", "type": "checkbox" },
          { "key": "allowSharedBase", "label": "Allow sharing a custom integration branch with another active epic", "type": "checkbox" }
        ]
      }
    },
    {
      "type": "dataGrid",
      "id": "feature-runs",
      "props": {
        "title": "Feature runs",
        "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"] }]
        },
        "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": "feature_key", "truncate": true, "width": "30%", "linkField": "issue_url" },
          {
            "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",
            "badgeField": "attention",
            "notInPathField": "stage_skipped",
            "locus": { "field": "process_key", "link": { "kind": "processExplorer", "keyField": "process_key" } }
          },
          { "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": "base_branch", "label": "Base branch" },
            { "field": "outcome", "label": "Outcome" },
            { "field": "delivery_label", "label": "Delivery" }
          ]
        }
      }
    }
  ]
}
