{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "多張 Issue 批次交付",
    "locale": "zh-TW",
    "quality_profile": "standard",
    "output": "docs/workflow/diagrams/06-batch.html"
  },
  "lanes": [
    { "id": "operator", "label": "Operator（人）" },
    { "id": "claude", "label": "Claude Code" },
    { "id": "local", "label": "本機 worktree" }
  ],
  "mainPath": ["run", "perissue", "merge", "regress", "integ", "push", "close"],
  "nodes": [
    { "id": "run", "lane": "claude", "col": 0, "type": "backend", "label": "/issue-run n m …", "sublabel": "batch-dispatch --prepare 逐張 READY／STOP" },
    { "id": "perissue", "lane": "claude", "col": 1, "type": "backend", "label": "逐張實作", "sublabel": "各自的 Issue worktree，只跑本單測試" },
    { "id": "merge", "lane": "claude", "col": 2, "type": "backend", "label": "batch-merge.mjs", "sublabel": "merge／verify／drift" },
    { "id": "close", "lane": "claude", "col": 5, "type": "backend", "label": "batch-merge.mjs close", "sublabel": "逐張結案、刪 worktree" },
    { "id": "batch", "lane": "local", "col": 1, "type": "database", "label": "批次 worktree", "sublabel": "feature-ron-batch-<key>" },
    { "id": "regress", "lane": "local", "col": 3, "type": "security", "label": "統一回歸", "sublabel": "queue-regression.mjs FIFO 排隊", "tag": "只跑一次" },
    { "id": "integ", "lane": "local", "col": 4, "type": "database", "label": "整合分支", "sublabel": "merge-into-integration.sh" },
    { "id": "push", "lane": "operator", "col": 5, "type": "external", "label": "! git push", "sublabel": "主 checkout", "tag": "PUSH_REQUIRED" }
  ],
  "edges": [
    { "id": "b1", "from": "run", "to": "perissue", "variant": "emphasis" },
    { "id": "b2", "from": "run", "to": "batch", "label": "建批次 worktree", "variant": "dashed", "role": "branch" },
    { "id": "b3", "from": "perissue", "to": "merge", "label": "各張候選 commit", "variant": "emphasis" },
    { "id": "b4", "from": "merge", "to": "batch", "label": "合入批次分支", "variant": "default", "role": "branch" },
    { "id": "b5", "from": "merge", "to": "regress", "variant": "emphasis" },
    { "id": "b6", "from": "regress", "to": "perissue", "label": "失敗則回該張修正", "variant": "security", "role": "error" },
    { "id": "b7", "from": "regress", "to": "integ", "label": "通過", "variant": "emphasis" },
    { "id": "b8", "from": "integ", "to": "push", "label": "PUSH_REQUIRED", "variant": "security" },
    { "id": "b9", "from": "push", "to": "close", "label": "推送後", "variant": "emphasis" }
  ],
  "cards": [
    { "dot": "cyan", "title": "與單張的差別", "items": ["候選先合進批次分支，回歸只跑一次，通過才合入整合分支", "推送後逐張結案，而不是一張一張合入"] },
    { "dot": "amber", "title": "排隊", "items": ["回歸與合入視為同一臨界區，queue-regression.mjs FIFO 預約", "不要自己寫等待迴圈；只改工具或文件的分支可插隊"] }
  ]
}
