{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Jev engineering: Claude làm, Jev quyết định",
    "quality_profile": "showcase",
    "views": [
      {
        "id": "happy-path",
        "label": "Một lượt loop",
        "focus": [
          "cron",
          "claude",
          "gate",
          "bash",
          "stop",
          "done"
        ],
        "note": "Triage đánh thức Claude, gate kiểm từng lệnh, stop hook quyết định đã xong chưa."
      },
      {
        "id": "guards",
        "label": "Chỗ chặn lại",
        "focus": [
          "gate",
          "stop",
          "claude"
        ],
        "note": "Gate chỉ cho lệnh an toàn qua (lệnh ra ngoài hoặc nhãn other chuyển cho người); stop hook block thì Claude làm tiếp."
      }
    ],
    "legend": {
      "mode": "hidden"
    }
  },
  "lanes": [
    {
      "id": "claude",
      "label": "Claude: làm"
    },
    {
      "id": "jev",
      "label": "Jev: quyết định",
      "variant": "exception"
    }
  ],
  "phases": [
    {
      "id": "start",
      "label": "Bắt đầu",
      "fromCol": 0,
      "toCol": 1
    },
    {
      "id": "gate-phase",
      "label": "Kiểm lệnh",
      "fromCol": 2,
      "toCol": 3,
      "variant": "emphasis"
    },
    {
      "id": "end",
      "label": "Kết thúc",
      "fromCol": 4,
      "toCol": 5,
      "variant": "dashed"
    }
  ],
  "mainPath": [
    "cron",
    "claude",
    "gate",
    "bash",
    "stop",
    "done"
  ],
  "nodes": [
    {
      "id": "cron",
      "lane": "jev",
      "col": 0,
      "type": "messagebus",
      "label": "Cron triage",
      "sublabel": "Jev gán nhãn issue",
      "width": 132
    },
    {
      "id": "claude",
      "lane": "claude",
      "col": 1,
      "type": "backend",
      "label": "Claude turn",
      "sublabel": "code, plan",
      "width": 132
    },
    {
      "id": "gate",
      "lane": "jev",
      "col": 2,
      "type": "security",
      "label": "PreToolUse",
      "sublabel": "luật cứng → Jev",
      "width": 132
    },
    {
      "id": "bash",
      "lane": "claude",
      "col": 3,
      "type": "backend",
      "label": "Bash tool",
      "sublabel": "chạy lệnh",
      "width": 132
    },
    {
      "id": "stop",
      "lane": "jev",
      "col": 4,
      "type": "security",
      "label": "Stop hook",
      "sublabel": "checks.sh + Jev",
      "width": 132
    },
    {
      "id": "done",
      "lane": "claude",
      "col": 5,
      "type": "frontend",
      "label": "Xong",
      "sublabel": "dừng loop",
      "width": 132
    }
  ],
  "edges": [
    {
      "id": "cron-claude",
      "from": "cron",
      "to": "claude",
      "label": "bug tái hiện",
      "variant": "emphasis"
    },
    {
      "id": "claude-gate",
      "from": "claude",
      "to": "gate",
      "label": "tool call"
    },
    {
      "id": "gate-bash",
      "from": "gate",
      "to": "bash",
      "label": "allow",
      "variant": "emphasis"
    },
    {
      "id": "bash-stop",
      "from": "bash",
      "to": "stop",
      "label": "hết việc, muốn dừng"
    },
    {
      "id": "stop-claude",
      "from": "stop",
      "to": "claude",
      "label": "block + lý do",
      "variant": "security",
      "role": "error"
    },
    {
      "id": "stop-done",
      "from": "stop",
      "to": "done",
      "label": "done",
      "variant": "emphasis"
    },
    {
      "id": "bash-claude",
      "from": "bash",
      "to": "claude",
      "label": "còn việc",
      "variant": "dashed",
      "role": "return"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "Chi phí theo bài",
      "items": [
        "Gate: 300 lệnh ≈ $0.0063 mỗi đêm",
        "Triage: 30 issue dưới $0.001"
      ]
    },
    {
      "dot": "rose",
      "title": "Quy tắc an toàn",
      "items": [
        "Luật cứng chạy trong code trước Jev",
        "Lệnh ra ngoài, nhãn other: luôn hỏi người"
      ]
    }
  ]
}