RFC-20 Phase 1: Variable CRUD #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User Story
作为用户,我能用 CLI 创建一个 variable 绑定到 CAS node,查看、更新(schema 校验)、删除它。
测试步骤
准备:创建测试用 CAS 节点
CRUD 验证
Step 1: create
预期: 输出 JSON
{ "type": "<variable-schema-hash>", "value": { "id": "<ULID>", "scope": "uwf/thread/", "value": "<HASH_A>", "schema": "<SCHEMA_HASH>", ... } }Step 2: get
预期: 输出与 create 一致的 JSON 信封,字段值相同
Step 3: update(schema 一致)
预期: 输出更新后的 variable,value 变为 HASH_B,updated 时间戳更新,schema 不变
Step 4: update(schema 不一致)
预期: 输出 error JSON
{ "type": "<error-schema-hash>", "value": { "message": "schema mismatch", ... } },exit code 非零Step 5: delete
预期: 输出被删除的 variable JSON
Step 6: get 已删除
预期: error JSON,variable not found
Scope 校验
/结尾输出格式
{ type, value }信封验证以上每一步的输出都是合法 JSON,顶层只有 type 和 value 两个 key,type 是 13 字符 CAS hash
验证完成标准
✅ 所有 checkbox 打勾
✅
bun test通过✅
bun run check无 lint 错误Ref: #20, #19