{
  "schema_version": 3,
  "diagram_type": "lifecycle",
  "meta": {
    "title": "Issue 狀態 label 生命週期",
    "locale": "zh-TW",
    "quality_profile": "standard",
    "output": "docs/workflow/diagrams/04-issue-labels.html"
  },
  "mainPath": ["needs_triage", "ready_for_agent", "in_progress", "completed"],
  "states": [
    { "id": "needs_triage", "type": "start", "label": "needs-triage", "sublabel": "issue-create.mjs 建立", "tag": "待討論", "step": "01" },
    { "id": "ready_for_agent", "type": "active", "label": "ready-for-agent", "sublabel": "/issue-queue 釐清完成", "tag": "可開工", "step": "02" },
    { "id": "in_progress", "type": "active", "label": "in-progress", "sublabel": "/issue-run 認領並建 worktree", "tag": "處理中", "step": "03" },
    { "id": "completed", "type": "success", "label": "completed", "sublabel": "close-issue.mjs 結案", "tag": "已關閉", "step": "04" },
    { "id": "ready_for_human", "type": "waiting", "label": "ready-for-human", "sublabel": "人工實作", "tag": "可開工" },
    { "id": "needs_info", "type": "waiting", "label": "needs-info", "sublabel": "等補資訊", "tag": "待討論" },
    { "id": "wontfix", "type": "neutral", "label": "wontfix", "sublabel": "/issue-queue 判定不處理", "tag": "已關閉" }
  ],
  "transitions": [
    { "id": "t1", "from": "needs_triage", "to": "ready_for_agent", "label": "/issue-queue" },
    { "id": "t2", "from": "ready_for_agent", "to": "in_progress", "label": "/issue-run n" },
    { "id": "t3", "from": "in_progress", "to": "completed", "label": "結案 → push → 結案", "variant": "emphasis" },
    { "id": "t4", "from": "needs_triage", "to": "ready_for_human", "label": "/issue-queue" },
    { "id": "t5", "from": "needs_triage", "to": "needs_info", "label": "/issue-queue" },
    { "id": "t6", "from": "needs_triage", "to": "wontfix", "label": "/issue-queue" },
    { "id": "t7", "from": "needs_info", "to": "ready_for_agent", "label": "補完後重跑" },
    { "id": "t8", "from": "needs_info", "to": "ready_for_human", "label": "補完後重跑" },
    { "id": "t9", "from": "needs_info", "to": "wontfix", "label": "補完後重跑" },
    { "id": "t10", "from": "ready_for_human", "to": "in_progress", "label": "開工 n" }
  ],
  "cards": [
    { "dot": "cyan", "title": "看板就是 label", "items": ["GitLab「Development」board 的欄位即狀態 label", "狀態 label 互斥，只能透過 issue-state.mjs --set 改", "待討論＝needs-triage／needs-info；可開工＝ready-for-*；處理中＝in-progress；完成＝completed／wontfix"] },
    { "dot": "amber", "title": "沒有審查中", "items": ["Issue 層級不開 MR，in-progress 直接結案", "只有整合分支要進 develop 時才開 MR"] }
  ]
}
