%%{init: {"theme": "base", "themeVariables": {"background": "transparent", "primaryColor": "#f2ede3", "primaryTextColor": "#253047", "primaryBorderColor": "#64748b", "lineColor": "#6b7280", "secondaryColor": "#e6edf5", "tertiaryColor": "#f7f4ed", "fontFamily": "Inter, PingFang SC, sans-serif"}, "flowchart": {"curve": "basis", "nodeSpacing": 32, "rankSpacing": 45}}}%%
flowchart TB
  subgraph R1[" "]
    direction LR
    A["Git Diff<br/>新增、修改、删除、重命名"] --> B["影响证据<br/>目录 · 依赖 · 业务风险 · 历史失败"]
    B --> C["检查清单 Manifest<br/>选择什么、跳过什么、为什么"]
    C --> D{"影响面完整、可信<br/>且足够小？"}
  end
  subgraph R2[" "]
    direction LR
    E["目标检查<br/>相关测试 + 永久门禁"] --> G["统一 Required Gate"]
    F["扩大检查<br/>模块全量 / 平台矩阵 / 完整套件"] --> G
    G --> H{"检查通过<br/>且跳过均有合法原因？"}
    H -->|"是"| I["进入下一阶段"]
    H -->|"否"| J["阻断并显示失败证据"]
  end
  D -->|"是"| E
  D -->|"否 / 删除 / 公共契约 / 选择器改动"| F

  style R1 fill:transparent,stroke:transparent
  style R2 fill:transparent,stroke:transparent

  classDef input fill:#f7f4ed,stroke:#8b7355,color:#1f2937,stroke-width:1.5px;
  classDef analysis fill:#e6edf5,stroke:#486581,color:#1f2937,stroke-width:1.5px;
  classDef gate fill:#f4edcf,stroke:#8a6d1f,color:#2f291a,stroke-width:1.5px;
  classDef pass fill:#e6f0e7,stroke:#4b7352,color:#1f2937,stroke-width:1.5px;
  classDef fail fill:#f9e8e5,stroke:#a14f45,color:#35231f,stroke-width:1.5px;
  class A input;
  class B,C,E,F analysis;
  class D,G,H gate;
  class I pass;
  class J fail;
