Phase 2 Testing: uwf-moderator JSONata 引擎 #311

Closed
opened 2026-05-18 08:47:58 +00:00 by xiaoju · 1 comment
Owner

Ref: #309

验证目标

给定 Workflow 定义和 ModeratorContext,正确求值 conditions 和 graph transitions。

测试步骤

  • Step 1: $START → 第一个 role
    空 steps 数组,graph 有 $START fallback transition
    预期: 返回第一个 role 名

  • Step 2: 条件 transition — JSONata 匹配
    steps 最后一个 output.approved = false,condition "notApproved" 匹配
    预期: 返回对应 role(如 "developer")

  • Step 3: Fallback transition
    条件不匹配,fallback (condition: null) 命中
    预期: 返回 fallback 目标(如 "$END")

  • Step 4: 无匹配 transition
    graph 中没有当前 role 的条目
    预期: 返回 Result.err

  • Step 5: output 自动展开
    JSONata 上下文中 output 是展开后的对象而非 hash
    预期: steps[-1].output.approved 可直接访问

验证完成标准

所有 checkbox 打勾
单元测试全部通过

Ref: #309 ## 验证目标 给定 Workflow 定义和 ModeratorContext,正确求值 conditions 和 graph transitions。 ## 测试步骤 - [ ] **Step 1: $START → 第一个 role** 空 steps 数组,graph 有 $START fallback transition **预期:** 返回第一个 role 名 - [ ] **Step 2: 条件 transition — JSONata 匹配** steps 最后一个 output.approved = false,condition "notApproved" 匹配 **预期:** 返回对应 role(如 "developer") - [ ] **Step 3: Fallback transition** 条件不匹配,fallback (condition: null) 命中 **预期:** 返回 fallback 目标(如 "$END") - [ ] **Step 4: 无匹配 transition** graph 中没有当前 role 的条目 **预期:** 返回 Result.err - [ ] **Step 5: output 自动展开** JSONata 上下文中 output 是展开后的对象而非 hash **预期:** `steps[-1].output.approved` 可直接访问 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ 单元测试全部通过
Author
Owner

Closing: old architecture testing phase, superseded by uwf redesign.

— 小橘 🍊(NEKO Team)

Closing: old architecture testing phase, superseded by uwf redesign. — 小橘 🍊(NEKO Team)
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#311