一个聚合一份 .md:上半部 ``mermaid 状态图,下半部状态说明卡(契约权威源)。**每条迁移边: ` 后第一个词必须是事件名**(check.sh 在 mermaid fence 内提取,双向校验:不得出现墙外事件)。
# CatalogItem 状态档
## 状态图
stateDiagram-v2
[*] --> Active : CatalogItemCreated 创建上架
Active --> Inactive : CatalogItemDeactivated 停用
Inactive --> Active : CatalogItemReactivated 重新启用
Active --> Active : CatalogItemDeactivationRejected 重复停用被拒
Inactive --> Inactive : CatalogItemReactivationRejected 重复启用被拒
```
| 状态 | 含义 | 允许操作 |
|---|---|---|
| Active | 可被申请引用 | 停用 |
| Inactive | 不可被新申请引用,存量不受影响 | 启用 |
| from | 事件 | to | 守卫 | 动作 |
|---|---|---|---|---|
| [*] | CatalogItemCreated | Active | 字段齐全 | 建档 |
| Active | CatalogItemDeactivated | Inactive | - | 记停用时间 |
| Active | CatalogItemDeactivationRejected | Active | 已停用 | 履历, ITSMD_4012 |
| Inactive | CatalogItemReactivationRejected | Inactive | 已启用 | 履历, ITSMD_4013 |
```
不是自建状态机——是 Warm-Flow 生命周期图的投影:status 枚举值与关键阶段节点固定(系统托管契约),审批段客户可调但不改变本图。状态图部分示例:
stateDiagram-v2
[*] --> Draft : IncidentCreated 提交报修
Draft --> Assigned : IncidentAssigned 派单(可能经审批段)
Assigned --> InProgress : AssignmentAccepted 接单
InProgress --> Resolved : IncidentResolved 处理完成
Resolved --> Closed : IncidentClosed 回访关单
Closed --> [*]
note right of Assigned
status 枚举与阶段节点为固定契约
实际迁移由 Warm-Flow task complete 驱动
flowCode = incident
end note
说明卡同变体 A(状态定义表的"状态"列 = status 枚举值,加注 Warm-Flow 节点映射)。
[*] --> 初始态 : XxxCreated;仅当存在明确的审批前草稿业务态时才引入 Draft<命令>Rejected 画自环边,上墙+有自己的时序档+迁移表一行(守卫=被拒原因、动作含错误码)+一个测试拒绝用例note right of ci);挂复合状态成员的限定 id(note right of ci.Draft)渲染报 No such shape: undefined,check.sh 已 lint(2026-10-07 实测踩坑)