Phase 1 Testing: Protocol + CAS 层 — parentState / childThread 字段 (#194) #195

Closed
opened 2026-05-12 01:33:02 +00:00 by xiaoju · 0 comments
Owner

验证目标

StartNodePayloadStateNodePayload 支持新字段,序列化/反序列化正确,GC 可达性正确。

测试步骤

  • Step 1: 类型定义
    StartNodePayload 新增 parentState: string | null
    StateNodePayload 新增 childThread: string | null

    cd ~/repos/workflow && grep "parentState" packages/workflow-protocol/src/cas-types.ts
    grep "childThread" packages/workflow-protocol/src/cas-types.ts
    

    预期: 两个字段都存在且类型为 string | null

  • Step 2: putStartNode 支持 parentStateHash

    bun test packages/workflow-cas
    

    预期: 新增测试用例:putStartNode 带 parentStateHash 时 refs 包含该 hash,不带时 refs 只有 promptHash

  • Step 3: putStateNode 支持 childThreadHash

    bun test packages/workflow-cas
    

    预期: 新增测试用例:state node 带 childThread 时 refs 包含该 hash 且 payload.childThread 正确

  • Step 4: 解析兼容旧节点

    bun test packages/workflow-cas
    

    预期: 旧格式节点(无 parentState/childThread)解析成功,字段值为 null

  • Step 5: GC 可达性

    bun test packages/workflow-execute --filter "gc"
    

    预期: 通过 refs 引用的 parentState/childThread hash 不被 GC 回收

  • Step 6: 全量测试

    cd ~/repos/workflow && bun run build && bun test
    

    预期: 全量通过,无回归

验证完成标准

所有 checkbox 打勾
build 通过
全量测试通过

Ref: #194

## 验证目标 `StartNodePayload` 和 `StateNodePayload` 支持新字段,序列化/反序列化正确,GC 可达性正确。 ## 测试步骤 - [ ] **Step 1: 类型定义** `StartNodePayload` 新增 `parentState: string | null` `StateNodePayload` 新增 `childThread: string | null` ```bash cd ~/repos/workflow && grep "parentState" packages/workflow-protocol/src/cas-types.ts grep "childThread" packages/workflow-protocol/src/cas-types.ts ``` **预期:** 两个字段都存在且类型为 `string | null` - [ ] **Step 2: putStartNode 支持 parentStateHash** ```bash bun test packages/workflow-cas ``` **预期:** 新增测试用例:putStartNode 带 parentStateHash 时 refs 包含该 hash,不带时 refs 只有 promptHash - [ ] **Step 3: putStateNode 支持 childThreadHash** ```bash bun test packages/workflow-cas ``` **预期:** 新增测试用例:state node 带 childThread 时 refs 包含该 hash 且 payload.childThread 正确 - [ ] **Step 4: 解析兼容旧节点** ```bash bun test packages/workflow-cas ``` **预期:** 旧格式节点(无 parentState/childThread)解析成功,字段值为 null - [ ] **Step 5: GC 可达性** ```bash bun test packages/workflow-execute --filter "gc" ``` **预期:** 通过 refs 引用的 parentState/childThread hash 不被 GC 回收 - [ ] **Step 6: 全量测试** ```bash cd ~/repos/workflow && bun run build && bun test ``` **预期:** 全量通过,无回归 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ build 通过 ✅ 全量测试通过 Ref: #194
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#195