Phase B Testing: Thread Root Node + workflowAsAgent 返回 root hash #42

Closed
opened 2026-05-07 13:02:29 +00:00 by xiaoju · 0 comments
Owner

验证目标

workflow 执行结束后 engine 自动生成 thread root node 存入 CAS。workflowAsAgent 返回 root hash 而非 summary string。

前置

Phase A 已合入 main。

测试步骤

  • Step 1: engine 生成 step 节点

    bun test --filter "engine"
    

    预期: 每个 role step 写入时,除了 content 节点,还生成一个 type: step 的 Merkle 节点(payload: { role, meta },children: [contentHash])。step 节点 hash 写入 jsonl。

  • Step 2: engine 生成 thread root 节点

    bun test --filter "engine"
    

    预期: workflow generator 完成后,engine 生成 type: thread 的 Merkle root 节点(payload: { workflow, threadId, result },children: 所有 step hash),存入 CAS。root hash 记录在 .data.jsonl 最后一行或 WorkflowResult 中。

  • Step 3: workflowAsAgent 返回 root hash

    bun test --filter "workflow-as-agent"
    

    预期: workflowAsAgent 返回的 content 是 thread root hash(13 字符 Crockford Base32),不再是 "completed: moderator returned END" 这种 summary 字符串。通过 cas get <root_hash> 可以读到 YAML 格式的 thread root node。

  • Step 4: Merkle DAG 可遍历

    bun test --filter "merkle-dag"
    

    预期: 从 root hash 出发,cas get root → 解析 children → cas get step → 解析 children → cas get content,完整 DAG 可遍历。集成测试验证。

  • Step 5: 全量测试通过

    bun test
    bun run build
    bun run check
    

    预期: 全部通过。

验证完成标准

所有 checkbox 打勾
WorkflowResult 或 executeThread 输出包含 rootHash
workflowAsAgent 返回 root hash
DAG 从 root 到 leaf 完整可遍历

Refs #40

## 验证目标 workflow 执行结束后 engine 自动生成 thread root node 存入 CAS。workflowAsAgent 返回 root hash 而非 summary string。 ## 前置 Phase A 已合入 main。 ## 测试步骤 - [ ] **Step 1: engine 生成 step 节点** ```bash bun test --filter "engine" ``` **预期:** 每个 role step 写入时,除了 content 节点,还生成一个 `type: step` 的 Merkle 节点(payload: `{ role, meta }`,children: `[contentHash]`)。step 节点 hash 写入 jsonl。 - [ ] **Step 2: engine 生成 thread root 节点** ```bash bun test --filter "engine" ``` **预期:** workflow generator 完成后,engine 生成 `type: thread` 的 Merkle root 节点(payload: `{ workflow, threadId, result }`,children: 所有 step hash),存入 CAS。root hash 记录在 `.data.jsonl` 最后一行或 WorkflowResult 中。 - [ ] **Step 3: workflowAsAgent 返回 root hash** ```bash bun test --filter "workflow-as-agent" ``` **预期:** `workflowAsAgent` 返回的 content 是 thread root hash(13 字符 Crockford Base32),不再是 `"completed: moderator returned END"` 这种 summary 字符串。通过 `cas get <root_hash>` 可以读到 YAML 格式的 thread root node。 - [ ] **Step 4: Merkle DAG 可遍历** ```bash bun test --filter "merkle-dag" ``` **预期:** 从 root hash 出发,`cas get root → 解析 children → cas get step → 解析 children → cas get content`,完整 DAG 可遍历。集成测试验证。 - [ ] **Step 5: 全量测试通过** ```bash bun test bun run build bun run check ``` **预期:** 全部通过。 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ WorkflowResult 或 executeThread 输出包含 rootHash ✅ workflowAsAgent 返回 root hash ✅ DAG 从 root 到 leaf 完整可遍历 Refs #40
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#42