Phase 1 Testing: protocol types + moderator rewrite #491

Closed
opened 2026-05-25 04:35:51 +00:00 by xiaoju · 0 comments
Owner

验证目标

workflow-protocol 类型变更 + workflow-moderator 从 JSONata 重写为 status map lookup + mustache render。

Ref: #490

前置

cd ~/repos/workflow
git checkout feat/490-status-routing
bun install

测试步骤

  • Step 1: protocol 类型编译通过

    bun run build --filter=workflow-protocol
    

    预期: 编译成功,无错误

  • Step 2: ConditionDefinitionTransition 已删除

    grep -r "ConditionDefinition\|type Transition" packages/workflow-protocol/src/
    

    预期: 无输出(类型已删除)

  • Step 3: WorkflowPayload 无 conditions 字段,graph 为 Record<string, Record<string, Target>>

    grep -A5 "WorkflowPayload" packages/workflow-protocol/src/types.ts
    

    预期:conditions 字段,graph 类型为 Record<string, Record<string, Target>>

  • Step 4: moderator 无 jsonata 依赖

    grep jsonata packages/workflow-moderator/package.json
    

    预期: 无输出

  • Step 5: moderator 有 mustache 依赖

    grep mustache packages/workflow-moderator/package.json
    

    预期: 出现 mustache

  • Step 6: evaluate 新签名和 map lookup 逻辑

    grep -n "function evaluate" packages/workflow-moderator/src/evaluate.ts
    

    预期: 函数存在,参数不再包含 ModeratorContext(只需 lastRole + lastOutput)

  • Step 7: moderator 测试全部通过

    bun test packages/workflow-moderator/
    

    预期: 所有测试通过

  • Step 8: mustache 模板渲染测试
    验证 prompt 中 {{field}}{{nested.field}} 被正确替换

    bun test packages/workflow-moderator/ --grep mustache
    

    预期: mustache 相关测试通过

  • Step 9: WORKFLOW_SCHEMA 已更新

    grep -A10 "WORKFLOW_SCHEMA" packages/workflow-protocol/src/schemas.ts | grep -v conditions
    

    预期: schema 不含 conditions,graph 的 additionalProperties 为 object(不是 array)

  • Step 10: 全量 build 通过

    bun run build
    

    预期: 所有包编译成功

验证完成标准

所有 checkbox 打勾
jsonata 依赖已移除
mustache 依赖已添加
测试全部通过

## 验证目标 workflow-protocol 类型变更 + workflow-moderator 从 JSONata 重写为 status map lookup + mustache render。 Ref: #490 ## 前置 ```bash cd ~/repos/workflow git checkout feat/490-status-routing bun install ``` ## 测试步骤 - [ ] **Step 1: protocol 类型编译通过** ```bash bun run build --filter=workflow-protocol ``` **预期:** 编译成功,无错误 - [ ] **Step 2: `ConditionDefinition` 和 `Transition` 已删除** ```bash grep -r "ConditionDefinition\|type Transition" packages/workflow-protocol/src/ ``` **预期:** 无输出(类型已删除) - [ ] **Step 3: `WorkflowPayload` 无 conditions 字段,graph 为 Record<string, Record<string, Target>>** ```bash grep -A5 "WorkflowPayload" packages/workflow-protocol/src/types.ts ``` **预期:** 无 `conditions` 字段,`graph` 类型为 `Record<string, Record<string, Target>>` - [ ] **Step 4: moderator 无 jsonata 依赖** ```bash grep jsonata packages/workflow-moderator/package.json ``` **预期:** 无输出 - [ ] **Step 5: moderator 有 mustache 依赖** ```bash grep mustache packages/workflow-moderator/package.json ``` **预期:** 出现 mustache - [ ] **Step 6: evaluate 新签名和 map lookup 逻辑** ```bash grep -n "function evaluate" packages/workflow-moderator/src/evaluate.ts ``` **预期:** 函数存在,参数不再包含 ModeratorContext(只需 lastRole + lastOutput) - [ ] **Step 7: moderator 测试全部通过** ```bash bun test packages/workflow-moderator/ ``` **预期:** 所有测试通过 - [ ] **Step 8: mustache 模板渲染测试** 验证 prompt 中 `{{field}}` 和 `{{nested.field}}` 被正确替换 ```bash bun test packages/workflow-moderator/ --grep mustache ``` **预期:** mustache 相关测试通过 - [ ] **Step 9: WORKFLOW_SCHEMA 已更新** ```bash grep -A10 "WORKFLOW_SCHEMA" packages/workflow-protocol/src/schemas.ts | grep -v conditions ``` **预期:** schema 不含 conditions,graph 的 additionalProperties 为 object(不是 array) - [ ] **Step 10: 全量 build 通过** ```bash bun run build ``` **预期:** 所有包编译成功 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ jsonata 依赖已移除 ✅ mustache 依赖已添加 ✅ 测试全部通过
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#491