flowchart LR

  subgraph BOOT["Bootstrap / Reset"]
    S00["S00<br/>进入 bind 前的唯一起点<br/>binding_status: UNCHECKED<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S15(["S15<br/>节点被清理删除（zombie cleanup）"]) 
    S16(["S16<br/>持久化加载输入态：本轮 E01 的输入节点集合（可包含上轮遗留与已稳定节点）"]) 
    S17(["S17<br/>加载异常隔离态：持久化枚举非法，保留错误供人工处理，不进入自动流程"]) 
  end

  subgraph BIND["Binding"]
    S01["S01<br/>绑定正常（待后续 update 检查）<br/>binding_status: NORMAL<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S02["S02<br/>孤儿节点（可能进入 create / auto_bind / delete）<br/>binding_status: MISSING<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S03["S03<br/>数据损坏/缺失（阻断态，需人工）<br/>binding_status: ABNORMAL<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S04["S04<br/>不可自动处理（阻断态，需人工）<br/>binding_status: WARNING<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S05["S05<br/>依赖项不满足/ID解析失败（阻断态）<br/>binding_status: DEPENDENCY_ERROR<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S13["S13<br/>对侧创建进行中（本侧等待提交）<br/>binding_status: PEER_CREATING<br/>action: NONE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
  end

  subgraph CREATE["Create"]
    S06(["S06<br/>待执行 CREATE（执行入口）<br/>binding_status: NORMAL<br/>action: CREATE<br/>status: PENDING<br/>data_id_exist: false<br/>"]) 
    S10C["S10C<br/>CREATE 异步执行中<br/>binding_status: NORMAL<br/>action: CREATE<br/>status: IN_PROGRESS<br/>data_id_exist: false<br/>"]
    S11C["S11C<br/>CREATE 执行成功<br/>binding_status: NORMAL<br/>action: CREATE<br/>status: SUCCESS<br/>data_id_exist: true<br/>"]
    S12C["S12C<br/>CREATE 执行失败<br/>binding_status: NORMAL<br/>action: CREATE<br/>status: FAILED<br/>data_id_exist: false | true<br/>"]
  end

  subgraph UPDATE["Update"]
    S07["S07<br/>准备更新<br/>binding_status: NORMAL<br/>action: UPDATE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S08["S08<br/>更新前置失败（缺 data_id / 依赖ID未解析等）<br/>binding_status: NORMAL<br/>action: UPDATE<br/>status: PRECONDITION_FAILED<br/>data_id_exist: false | true<br/>"]
    S10U["S10U<br/>UPDATE 异步执行中<br/>binding_status: NORMAL<br/>action: UPDATE<br/>status: IN_PROGRESS<br/>data_id_exist: true<br/>"]
    S11U["S11U<br/>UPDATE 执行成功<br/>binding_status: NORMAL<br/>action: UPDATE<br/>status: SUCCESS<br/>data_id_exist: true<br/>"]
    S12U["S12U<br/>UPDATE 执行失败<br/>binding_status: NORMAL<br/>action: UPDATE<br/>status: FAILED<br/>data_id_exist: false | true<br/>"]
    S14["S14<br/>更新被跳过（执行时降级为 NONE）<br/>binding_status: NORMAL<br/>action: NONE<br/>status: SKIPPED<br/>data_id_exist: true<br/>"]
  end

  subgraph DELETE["Delete"]
    S09["S09<br/>待执行 DELETE（执行入口）<br/>binding_status: NORMAL<br/>action: DELETE<br/>status: PENDING<br/>data_id_exist: true<br/>"]
    S10D["S10D<br/>DELETE 异步执行中<br/>binding_status: NORMAL<br/>action: DELETE<br/>status: IN_PROGRESS<br/>data_id_exist: true<br/>"]
    S11D["S11D<br/>DELETE 执行成功（随后删除节点）<br/>binding_status: NORMAL<br/>action: DELETE<br/>status: SUCCESS<br/>data_id_exist: true<br/>"]
    S12D["S12D<br/>DELETE 执行失败<br/>binding_status: NORMAL<br/>action: DELETE<br/>status: FAILED<br/>data_id_exist: false | true<br/>"]
  end

  S00 -- "E10a 核心绑定判定" --> S01
  S00 -- "E10e 核心绑定判定" --> S02
  S00 -- "E10c 核心绑定判定, E10d 核心绑定判定" --> S03
  S00 -- "E10b 核心绑定判定" --> S04
  S01 -- "E30c 更新准备" --> S07
  S01 -- "E30a 更新准备, E30b 更新准备" --> S08
  S02 -- "E16c 自动绑定（1:1）" --> S01
  S02 -- "E15b 依赖检查" --> S03
  S02 -- "E15a 依赖检查, E16a 自动绑定, E16b 自动绑定, E16d 自动绑定, E16e 自动绑定, E16h 自动绑定（N:0）" --> S04
  S02 -- "E15c 依赖检查, E16f 自动绑定, E21a 创建依赖解析失败" --> S05
  S02 -- "E22a 孤儿自删准备" --> S09
  S02 -- "E16g 自动绑定（N:0）" --> S13
  S06 -- "E40C_STARTa CREATE 执行入口" --> S10C
  S07 -- "E40U_STARTa UPDATE 执行入口" --> S10U
  S09 -- "E40D_STARTa DELETE 执行入口" --> S10D
  S10C -- "E40Ca CREATE 执行结果回写" --> S11C
  S10C -- "E40Cb CREATE 执行结果回写" --> S12C
  S10D -- "E40Da DELETE 执行结果回写" --> S11D
  S10D -- "E40Db DELETE 执行结果回写" --> S12D
  S10U -- "E40Ua UPDATE 执行结果回写" --> S11U
  S10U -- "E40Ub UPDATE 执行结果回写" --> S12U
  S10U -- "E40Uc UPDATE 执行结果回写" --> S14
  S11C -- "E41a 创建成功后归并到 update …" --> S01
  S13 -- "E20a 创建准备阶段2" --> S01
  S16 -- "E01b 初始化：删CREATE僵尸；其余…" --> S00
  S16 -- "E01a 初始化：删CREATE僵尸；其余…" --> S15
  S13 -. "副作用: E16识别需创建后，对侧spawn S06" .-> S06