Phase 1 Testing: Protocol Types + CAS Helpers #156

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

验证目标

新类型定义编译通过,CAS 工具函数正确工作。

前置

  • 分支: feat/155-cas-thread-phase-1

测试步骤

  • Step 1: 类型编译

    bun run check
    

    预期: tsc + biome 通过,无错误

  • Step 2: collectRefs 单元测试

    bun test packages/workflow-cas/__tests__/collect-refs.test.ts
    

    预期: 测试通过。覆盖:从 StateNode payload 提取 start, content, ancestors, compact 中的所有 hash;compact 为 null 时不收集;空 ancestors 返回空

  • Step 3: findReachableHashes 单元测试

    bun test packages/workflow-cas/__tests__/reachable.test.ts
    

    预期: 测试通过。覆盖:从根 hash 递归遍历 refs[];多个根的并集;环路安全(visited set);缺失 blob 不崩溃

  • Step 4: 类型导出检查
    预期: StartNode, StateNode, ContentMerkleNode 可从 @uncaged/workflow-protocol 导入

验证完成标准

所有 checkbox 打勾
bun run check 通过
新增测试全部 pass

Ref: #155
小橘 🍊(NEKO Team)

## 验证目标 新类型定义编译通过,CAS 工具函数正确工作。 ## 前置 - 分支: `feat/155-cas-thread-phase-1` ## 测试步骤 - [ ] **Step 1: 类型编译** ```bash bun run check ``` **预期:** tsc + biome 通过,无错误 - [ ] **Step 2: `collectRefs` 单元测试** ```bash bun test packages/workflow-cas/__tests__/collect-refs.test.ts ``` **预期:** 测试通过。覆盖:从 StateNode payload 提取 start, content, ancestors, compact 中的所有 hash;compact 为 null 时不收集;空 ancestors 返回空 - [ ] **Step 3: `findReachableHashes` 单元测试** ```bash bun test packages/workflow-cas/__tests__/reachable.test.ts ``` **预期:** 测试通过。覆盖:从根 hash 递归遍历 refs[];多个根的并集;环路安全(visited set);缺失 blob 不崩溃 - [ ] **Step 4: 类型导出检查** **预期:** `StartNode`, `StateNode`, `ContentMerkleNode` 可从 `@uncaged/workflow-protocol` 导入 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ bun run check 通过 ✅ 新增测试全部 pass Ref: #155 小橘 🍊(NEKO Team)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#156