feat: 条件表达式树 + 步骤模板 + 状态机回退语义 (#36, #35, #34) #37

Merged
shaotao merged 1 commit from feat/condition-tree into main 2026-06-12 23:12:39 +08:00
Owner

改动清单

#36 条件表达式 DSL 化

  • 新增 bixiweave/condition.py:树形条件节点(ComparisonNode / LogicalNode / ConstantNode)
  • _execute_judge 支持 dict 格式组合条件(and / or / not
  • 向后兼容旧版字符串运算符表达式和纯字段名格式
  • 31 个新测试

#35 步骤模板复用

  • 新增 bixiweave/templates/:5 个内置模板(llm_call, mcp_call, retry, validate_then_route, branch_on_field
  • Pipeline.__init__ 自动注册模板 + call 扩展(不再需要显式 "use": ["call"]
  • 修复 _run_sub_pipeline 缺少 await 的 bug(warnings 中发现的)
  • 8 个新测试

#34 状态机回退

  • terminal: true 显式声明(与隐式推导区分,隐式 terminal 仍立即终止)
  • 显式 terminal + 有 transition → 不 break,继续在事件循环中等待(可回退)
  • transition 支持 rollback: true → 执行前触发 TransactionContext.rollback()
  • DSLValidator 校验 terminal 字段必须为布尔值
  • 10 个新测试

208 passed, 0 regression(唯一失败的是 DeepSeek API key 环境变量导致的已有测试问题)

## 改动清单 ### #36 条件表达式 DSL 化 - 新增 `bixiweave/condition.py`:树形条件节点(ComparisonNode / LogicalNode / ConstantNode) - `_execute_judge` 支持 dict 格式组合条件(`and` / `or` / `not`) - 向后兼容旧版字符串运算符表达式和纯字段名格式 - 31 个新测试 ### #35 步骤模板复用 - 新增 `bixiweave/templates/`:5 个内置模板(`llm_call`, `mcp_call`, `retry`, `validate_then_route`, `branch_on_field`) - `Pipeline.__init__` 自动注册模板 + `call` 扩展(不再需要显式 `"use": ["call"]`) - 修复 `_run_sub_pipeline` 缺少 `await` 的 bug(warnings 中发现的) - 8 个新测试 ### #34 状态机回退 - `terminal: true` 显式声明(与隐式推导区分,隐式 terminal 仍立即终止) - 显式 terminal + 有 transition → 不 break,继续在事件循环中等待(可回退) - transition 支持 `rollback: true` → 执行前触发 `TransactionContext.rollback()` - DSLValidator 校验 `terminal` 字段必须为布尔值 - 10 个新测试 **208 passed, 0 regression**(唯一失败的是 DeepSeek API key 环境变量导致的已有测试问题)
#36 条件表达式 DSL 化
- 新增 bixiweave/condition.py: 树形条件节点(Comparison/Logical/Constant)
- _execute_judge 支持 dict 格式组合条件(and/or/not)
- 向后兼容旧版字符串和纯字段名格式
- 31 个新测试

#35 步骤模板复用
- 新增 bixiweave/templates/: 5 个内置模板(llm_call/mcp_call/retry/validate_then_route/branch_on_field)
- Pipeline.__init__ 自动注册模板 + call 扩展
- 修复 _run_sub_pipeline 缺少 await 的 bug
- 8 个新测试

#34 状态机回退
- terminal: true 显式声明(与隐式推导区分)
- 显式 termination + 有 transition → 不 break,继续接收事件
- transition 支持 rollback: true → 触发 TransactionContext.rollback()
- DSLValidator 校验 terminal 字段类型
- 10 个新测试

合计: 208 passed, 0 regression
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bixiu/bixiweave!37
No description provided.