{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Kimi Build / Aliyun DNS｜幂等新增与冲突保护",
    "locale": "zh-CN",
    "quality_profile": "showcase",
    "legend": {
      "mode": "hidden"
    },
    "views": [
      {
        "id": "main-flow",
        "label": "内部主流程",
        "focus": [
          "request",
          "route",
          "step1",
          "step2",
          "step3",
          "step4",
          "output"
        ],
        "note": "从任务触发、路由选择到实际处理与交付。"
      },
      {
        "id": "tools-gates",
        "label": "工具与闸门",
        "focus": [
          "step1",
          "step3",
          "tool1",
          "tool2"
        ],
        "note": "查看真实脚本、外部服务以及质量或安全边界。"
      }
    ]
  },
  "lanes": [
    {
      "id": "task",
      "label": "kimix-website-publish · 任务与交付"
    },
    {
      "id": "skill",
      "label": "aliyun-dns-publishing · 内部流程"
    },
    {
      "id": "runtime",
      "label": "实际工具、脚本与质量/安全闸门"
    }
  ],
  "phases": [
    {
      "id": "intake",
      "label": "触发与路由",
      "fromCol": 0,
      "toCol": 1
    },
    {
      "id": "execution",
      "label": "内部执行",
      "fromCol": 2,
      "toCol": 4,
      "variant": "emphasis"
    },
    {
      "id": "delivery",
      "label": "验证与交付",
      "fromCol": 5,
      "toCol": 5
    }
  ],
  "mainPath": [
    "request",
    "route",
    "step1",
    "step2",
    "step3",
    "step4",
    "output"
  ],
  "nodes": [
    {
      "id": "request",
      "lane": "task",
      "col": 0,
      "type": "external",
      "label": "网站公网域名解析",
      "sublabel": "宝塔部署与域名绑定已完成",
      "width": 155
    },
    {
      "id": "route",
      "lane": "task",
      "col": 1,
      "type": "security",
      "label": "固定 build-dns Profile",
      "sublabel": "仅查询和新增权限 · 不读 CLI 凭据",
      "width": 170
    },
    {
      "id": "output",
      "lane": "task",
      "col": 5,
      "type": "frontend",
      "label": "已回读 DNS 记录",
      "sublabel": "传播状态与网站访问分别报告",
      "width": 175
    },
    {
      "id": "step1",
      "lane": "skill",
      "col": 2,
      "type": "backend",
      "label": "确认主域名与目标",
      "sublabel": "RR=www/@ · A/AAAA/CNAME · 目标不猜",
      "width": 175
    },
    {
      "id": "step2",
      "lane": "skill",
      "col": 3,
      "type": "backend",
      "label": "只读 query 预检",
      "sublabel": "查询同 RR 默认线路全部记录",
      "width": 175
    },
    {
      "id": "step3",
      "lane": "skill",
      "col": 4,
      "type": "backend",
      "label": "ensure 幂等添加",
      "sublabel": "created / already_exists / conflict",
      "width": 175
    },
    {
      "id": "step4",
      "lane": "skill",
      "col": 5,
      "type": "backend",
      "label": "回读与公网验证",
      "sublabel": "recordId/requestId → dig → HTTPS/页面",
      "width": 175
    },
    {
      "id": "tool1",
      "lane": "runtime",
      "col": 2,
      "type": "messagebus",
      "label": "scripts/aliyun-dns.mjs",
      "sublabel": "内部只调 Describe / AddDomainRecord",
      "width": 180
    },
    {
      "id": "tool2",
      "lane": "runtime",
      "col": 4,
      "type": "security",
      "label": "冲突停止门",
      "sublabel": "其他值、CNAME 冲突、disabled、回读失败",
      "width": 180
    }
  ],
  "edges": [
    {
      "id": "requestRoute",
      "from": "request",
      "to": "route"
    },
    {
      "id": "routeStep1",
      "from": "route",
      "to": "step1",
      "variant": "emphasis"
    },
    {
      "id": "step1Step2",
      "from": "step1",
      "to": "step2",
      "variant": "emphasis"
    },
    {
      "id": "step2Step3",
      "from": "step2",
      "to": "step3",
      "variant": "emphasis"
    },
    {
      "id": "step3Step4",
      "from": "step3",
      "to": "step4",
      "variant": "emphasis"
    },
    {
      "id": "step4Output",
      "from": "step4",
      "to": "output",
      "variant": "emphasis"
    },
    {
      "id": "tool1Step1",
      "from": "tool1",
      "to": "step1",
      "variant": "dashed",
      "role": "branch"
    },
    {
      "id": "tool2Step3",
      "from": "tool2",
      "to": "step3",
      "variant": "dashed",
      "role": "branch"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "实际命令 / 调用关系",
      "items": [
        "node scripts/aliyun-dns.mjs query --domain ... --rr www --type A",
        "ensure ... --value IP --ttl 600；dig @223.5.5.5 FQDN"
      ]
    },
    {
      "dot": "amber",
      "title": "内部约束 / 异常边界",
      "items": [
        "绝不 Delete/Update/停用记录或切换默认/PDS Profile",
        "API 回读不等于 DNS 已传播；超时时先 query 不盲重试"
      ]
    },
    {
      "dot": "slate",
      "title": "SKILL.md 来源定位",
      "items": [
        "aliyun-dns-publishing/SKILL.md:10-38 Profile 与最小权限",
        ":40-75 发布顺序与冲突；:77-94 生效与安全"
      ]
    }
  ]
}
