更新文档

This commit is contained in:
strepsiades
2026-03-25 10:32:50 +08:00
parent 67370657db
commit 4b81b83fd8
5 changed files with 208 additions and 29 deletions
+8 -8
View File
@@ -3,7 +3,7 @@
## 1. 分层职责(pipeline + strategy + datasource + domain
### pipeline(编排层)
- 入口:`pipeline/full_sync_pipeline.py`
- 入口:`sync_state_machine/pipeline/full_sync_pipeline.py`
- 负责组装并驱动整条流程:加载持久化、执行 bind/create/update、调用 datasource 同步、持久化结果。
- reset 语义:
- 加载阶段仅恢复持久化状态(不做状态重置);
@@ -24,8 +24,8 @@
- 非僵尸节点统一进入 `S00`,再进入本轮 bind/create/update 判定。
### strategy(决策组织层)
- 外部入口:`sync_system/strategy.py`
- 具体实现下沉:`sync_system/strategy_ops/`
- 外部入口:`sync_state_machine/sync_system/strategy.py`
- 具体实现下沉:`sync_state_machine/sync_system/strategy_ops/`
- `bind_ops.py`: `run_bind()` + `phase_core_state()/phase_dependency_check()/phase_auto_binding()`
- `create_ops.py`: `run_create()`
- `update_ops.py`: `run_update()`
@@ -34,19 +34,19 @@
- strategy 负责收集上下文并调用状态机事件函数,不直接硬编码状态值。
### datasource(执行与回写层)
- 入口:`datasource/datasource.py`
- 入口:`sync_state_machine/datasource/datasource.py`
- 执行 handlercreate/update/delete),并结合 `E40` 将执行结果落地到节点状态。
### domain(业务适配层)
- 目录:`domain/*`
- 目录:`sync_state_machine/domain/*`
- 负责业务字段映射、handler 细节与 schema 约束,不承担状态迁移判定。
## 2. 运行时契约(Runtime Contract
### 真源
- 状态机配置真源:`config/node_state_machine.yaml`
- 事件执行入口:`engine/events.py`
- 状态落地入口:`engine/state_apply.py`
- 状态机配置真源:`sync_state_machine/config/node_state_machine.yaml`
- 事件执行入口:`sync_state_machine/engine/events.py`
- 状态落地入口:`sync_state_machine/engine/state_apply.py`
### 执行规则
1. 业务层构造 `context`