{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "北大法宝｜法律检索、版本与引用核验",
    "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": "pkulaw · 任务与交付"
    },
    {
      "id": "skill",
      "label": "pkulaw · 内部流程"
    },
    {
      "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": "按决策树选 MCP 工具",
      "sublabel": "精准取条 / 语义 / 关键词 / 核验",
      "width": 170
    },
    {
      "id": "output",
      "lane": "task",
      "col": 5,
      "type": "frontend",
      "label": "可追溯法律检索辅助",
      "sublabel": "A/B 可信级别与复核提示",
      "width": 175
    },
    {
      "id": "step1",
      "lane": "skill",
      "col": 2,
      "type": "backend",
      "label": "检索并取准原文",
      "sublabel": "search → get_law_article / document",
      "width": 175
    },
    {
      "id": "step2",
      "lane": "skill",
      "col": 3,
      "type": "backend",
      "label": "核查适用与版本",
      "sublabel": "正文、要件、时效、新版、冲突",
      "width": 175
    },
    {
      "id": "step3",
      "lane": "skill",
      "col": 4,
      "type": "backend",
      "label": "读取三层返回",
      "sublabel": "content · structuredContent · _meta",
      "width": 175
    },
    {
      "id": "step4",
      "lane": "skill",
      "col": 5,
      "type": "backend",
      "label": "按纪律输出",
      "sublabel": "法名条号、时效版本、原文链接",
      "width": 175
    },
    {
      "id": "tool1",
      "lane": "runtime",
      "col": 2,
      "type": "messagebus",
      "label": "PKULaw 官方 MCP",
      "sublabel": "gid 原样传递，不从 URL 构造",
      "width": 180
    },
    {
      "id": "tool2",
      "lane": "runtime",
      "col": 4,
      "type": "security",
      "label": "定稿核验与错误门",
      "sublabel": "verify citations · 网关错误不绕过",
      "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": [
        "复杂任务：取法条 → 要件核查 → 3-5 类案 → 定稿核验",
        "返回：content 指导 + structured 字段 + evidence/limits"
      ]
    },
    {
      "dot": "amber",
      "title": "内部约束 / 异常边界",
      "items": [
        "空结果是有效结果，不等于不存在；不得编造法条案号",
        "900805 立即停止调用；submit_feedback 必须用户同意"
      ]
    },
    {
      "dot": "slate",
      "title": "SKILL.md 来源定位",
      "items": [
        "pkulaw/SKILL.md:50-114 工具与决策树",
        ":232-280 结果、核查与输出；:295-326 异常边界"
      ]
    }
  ]
}
